Commit Graph

135 Commits

Author SHA1 Message Date
Hector
f6e328a0aa feat: correctly handle shutdown signals
Add a new method to the application startup to listen for OS shutdown
signals and handle them appropriately. A shutdown signal will cause the
app to exit immediately.
Use correct syntax for the `ENTRYPOINT` field in the Dockerfile to ensure
that OS signals get passed down to the running application.
2022-02-20 08:17:06 +00:00
Hector
aedef536dd Merge branch 'update-changelog' into 'main'
Update changelog

See merge request hectorjsmith/fail2ban-prometheus-exporter!62
2022-02-19 17:10:25 +00:00
Hector
97ea58d86a docs: update changelog 2022-02-19 17:06:48 +00:00
Hector
ab80610a3a Merge branch 'rewrite-application-cli-parameters' into 'main'
Rewrite application cli parameters

See merge request hectorjsmith/fail2ban-prometheus-exporter!61
2022-02-19 17:01:50 +00:00
Hector
6e575aa0fd feat: rewrite cli flags and environment variables
Replace existing CLI flags to make them more consistent and follow a more
standard format.
Remove CLI flags and environment variables that are no longer relevant.
Add short `-v` option for version flag.
Update README with new documentation.

BREAKING CHANGE: Replace `--socket` flag with `--collector.f2b.socket`.
BREAKING CHANGE: Merge `--port` flag and `--web.listen-address` into a single flag.
BREAKING CHANGE: Remove `--collector.textfile` flag, its value is now derived from `--collector.textfile.directory`.
BREAKING CHANGE: Remove `F2B_COLLECTOR_TEXT` and `F2B_WEB_PORT` environment variables.
2022-02-19 17:01:49 +00:00
Hector
7515698ec8 Merge branch 'simplify-docker-image-for-exporter' into 'main'
Simplify docker image for exporter

See merge request hectorjsmith/fail2ban-prometheus-exporter!60
2022-02-19 14:58:51 +00:00
Hector
0f0efe58af feat: remove startup script from docker image
Update the docker image to remove the `run.sh` script and instead run the
exporter directly. This keeps the docker image as simple as possible.
Update README file with extra info on how to collect textfile metrics in
a docker container.

BREAKING CHANGE: Using the textfile collector in docker now requires setting environment variables.
2022-02-19 14:10:36 +00:00
Hector
e01d4cfe12 Merge branch 'update-exporter-logging-on-startup' into 'main'
Update exporter logging on startup

See merge request hectorjsmith/fail2ban-prometheus-exporter!59
2022-02-19 11:25:58 +00:00
Hector
e2902b8cc2 feat: improve logging on startup
Update the exporter logging on startup to include the exporter version,
the path to the fail2ban socket, and whether basic-auth is enabled or not.
Fix code printing error messages on invalid CLI parameters to correct line
breaks and correctly print the "usage" information.
2022-02-19 11:21:58 +00:00
Hector
ec10999814 Merge branch 'add-default-value-for-fail2ban-socket' into 'main'
Add default value for fail2ban socket

See merge request hectorjsmith/fail2ban-prometheus-exporter!58
2022-02-18 22:15:32 +00:00
Hector
1f27dace2d feat: add default value for fail2ban socket path
Update the CLI param parser to include a default value for the fail2ban
socket file path. This is the default location fail2ban creates the socket
file on an ubuntu-based system.
2022-02-18 22:15:32 +00:00
Hector
8452caf4c5 Merge branch 'update-changelog' into 'main'
Update changelog

See merge request hectorjsmith/fail2ban-prometheus-exporter!57
2022-02-18 21:52:01 +00:00
Hector
4bf63a6ed6 docs: update changelog
Update the CHANGELOG file with recent unreleased changes.
2022-02-18 21:49:20 +00:00
Hector
9f0327b028 Merge branch '19-update-creation-of-docker-image-labels' into 'main'
Resolve "Update creation of docker image labels"

Closes #19

See merge request hectorjsmith/fail2ban-prometheus-exporter!56
2022-02-12 17:31:01 +00:00
Hector
05f236902a ci: update creation of tags (#19)
Update creation of docker tags to only tag actual releases with the
`:latest` tag. Builds on the main branch are now tagged with a `:nightly`
tag.
2022-02-12 17:31:01 +00:00
Hector
191dda3b9f Merge branch '18-dash-missing-in-docker-run-sh-line-4-version' into 'main'
Resolve "Dash missing in /docker/run.sh line 4 "-version""

Closes #18

See merge request hectorjsmith/fail2ban-prometheus-exporter!55
2022-01-31 22:51:13 +00:00
Hector
93da909b0a fix: use correct flag in dockerfile (#18)
Update the Dockerfile entrypoint script to use the correct version flag
syntax. The flag now requires two dashes instead of one. The syntax for
the texfile collector has also change, and the script was updated
accordingly.
Fix incorrect order of variable assignment when parsing CLI flags.
2022-01-31 22:51:13 +00:00
Hector
98d376ac60 Merge branch '17-configure-exporter-using-environment-variables' into 'main'
Resolve "Configure exporter using environment variables"

Closes #17

See merge request hectorjsmith/fail2ban-prometheus-exporter!54
2022-01-30 21:32:48 +00:00
Hector
b7e317edbc feat: configure tool using environment variables (#17)
Replace CLI parsing functionality with the `kingpin` library to better
support configuring the tool with environment variables.
Add new environment variables to configure the tool.

BREAKING CHANGE: CLI params now require two dashes instead of one (e.g. `--socket`)
2022-01-30 21:32:48 +00:00
Hector
d92f7f79b6 Merge branch '16-add-basic-auth' into 'main'
Resolve "Add basic auth"

Closes #16

See merge request hectorjsmith/fail2ban-prometheus-exporter!53
2022-01-14 21:36:49 +00:00
Hector
6f76a03118 feat: add support for basic auth (#16)
Add new CLI parameters to enable protecting the API endpoints with basic
auth authentication.
Wrap the server endpoints in a new auth middleware that protects it using
the provided basic auth credentials (if set).
Store the provided basic auth credentials as hashed values to prevent them
from being accidentally leaked.
Add unit tests to ensure the new functionality works as expected.
2022-01-14 21:36:49 +00:00
Hector
013e8f30c9 Merge branch '15-update-sample-grafana-dashboard' into 'main'
Update sample grafana dashboard

Closes #15

See merge request hectorjsmith/fail2ban-prometheus-exporter!52
2021-12-23 11:42:10 +00:00
Hector
ae08a798b6 refactor: update grafana dashboard (#15)
Update the sample Grafana dashboard to use a variable for the data
source. All panels have been updated to use the new variable. This makes
it easier to import the dashboard and have it work with different data
sources.
2021-12-23 11:39:15 +00:00
Hector
cf71dc7449 Merge branch 'release/0.5.0' into 'main'
Release/0.5.0

See merge request hectorjsmith/fail2ban-prometheus-exporter!51
2021-12-21 21:25:00 +00:00
Hector
e0531694dd docs: update changelog for release 2021-12-21 21:16:38 +00:00
Hector
c2bc99afc2 Merge branch 'remove-deprecated-database-metric-collector' into 'main'
Remove deprecated database metric collector

See merge request hectorjsmith/fail2ban-prometheus-exporter!50
2021-12-21 17:46:46 +00:00
Hector
497e2ff692 remove: references to db collector
Remove final references to the deprecated database metric collector.
Remove counter for db connection errors.

BREAKING CHANGE: Remove `-db` CLI flag.
2021-12-21 17:42:42 +00:00
Hector
157e065369 Merge branch '15-add-sample-grafana-dashboard' into 'main'
Resolve "Add sample grafana dashboard"

Closes #15

See merge request hectorjsmith/fail2ban-prometheus-exporter!49
2021-12-21 17:29:00 +00:00
Hector
b397a51cf8 feat: sample grafana dashboard (#15)
Add a sample Grafana dashboard to display all the metrics collected by
this tool.
Update the README file to mention Grafana dashboard.
2021-12-21 17:29:00 +00:00
Hector
4be463a7c8 Merge branch 'python2' into 'main'
fix: support python2 fail2ban

Closes #14

See merge request hectorjsmith/fail2ban-prometheus-exporter!48
2021-12-18 06:58:40 +00:00
Private Creator
7932ccbe23 fix: support python2 fail2ban
Python2 pickles use different class names for some types. Specifically,
builtins.str is __builtin__.str.
2021-12-18 06:58:40 +00:00
Hector
6bbdd7a0a6 Merge branch 'main' into 'main'
feat: Add listen address parameter

See merge request hectorjsmith/fail2ban-prometheus-exporter!47
2021-12-18 06:45:37 +00:00
Private Creator
c208c8e97d feat: add listen address parameter
Add new -web.listen-address command line parameter, so that the
listening interface can be limited. This follows a similar style as
the official prometheus-node-exporter project.
Update project README with the new parameter.
2021-12-18 06:45:37 +00:00
Hector
f18bd78d4e Merge branch 'release/0.4.0' into 'main'
Release/0.4.0

See merge request hectorjsmith/fail2ban-prometheus-exporter!46
2021-10-18 18:44:46 +00:00
Hector
61a8a58754 docs: update changelog for release 2021-10-18 19:33:59 +01:00
Hector
4f2d8d9079 refactor: update imports in exporter.go
Remove unnecessary name from the textfile import.
Remove the sqlite3 dependency which is no longer required.
2021-10-18 19:32:08 +01:00
Hector
f2cd6ebb7b Merge branch 'refactor-project-makefile' into 'main'
Refactor project makefile

See merge request hectorjsmith/fail2ban-prometheus-exporter!45
2021-10-17 17:39:03 +00:00
Hector
695447a4c2 refactor: update project makefile
Rename steps in the project makefile to follow a more consistent naming
scheme.
Add new gitlab CI step to check for unused dependencies.
2021-10-17 17:39:02 +00:00
Hector
5363cad4ce Merge branch 'update-changelog' into 'main'
Update changelog

See merge request hectorjsmith/fail2ban-prometheus-exporter!44
2021-10-16 21:04:20 +00:00
Hector
1a660ab046 docs: update project changelog 2021-10-16 22:01:09 +01:00
Hector
4c122609b8 Merge branch 'remove-fail2ban-database-based-metrics' into 'main'
Remove fail2ban database based metrics

See merge request hectorjsmith/fail2ban-prometheus-exporter!43
2021-10-15 18:02:26 +00:00
Hector
b268f8654c remove: database-based metrics
Remove all database-based metrics from the metrics endpoint.
Remove all code related to pulling metrics from the fail2ban database.
Remove all configuration variables related to the fail2ban database.
The CLI parameter for the database path was not removed to avoid breaking
compatibility.
Update docker entrypoint to remove references to the fail2ban database.
Remove all references to the old database metrics from the README.
2021-10-15 18:02:26 +00:00
Hector
025347b7ca Merge branch 'add-metrics-on-basic-jail-configuration' into 'main'
Add metrics on basic jail configuration

See merge request hectorjsmith/fail2ban-prometheus-exporter!42
2021-10-14 20:52:25 +00:00
Hector
56730c8774 feat: add new jail config metrics
Add new metrics around basic jail configuration. The new metrics expose the
max retries, ban time, and find time for each jail.
Update project README with the new metrics.
2021-10-14 20:52:25 +00:00
Hector
bb5c15de1b Merge branch 'refactor-metric-collector-file-structure' into 'main'
Refactor metric collector file structure

See merge request hectorjsmith/fail2ban-prometheus-exporter!41
2021-10-13 20:40:10 +00:00
Hector
60e6365e1f refactor: create new collector folder
Create a new `collector` folder to store the code for the different
collectors. Move the existing f2b and textfile collectors to this folder.
Minor refactors to the f2b collector to better match the code style of the
newer textfile collector.
2021-10-13 21:33:49 +01:00
Hector
7cdaf1ebd1 Merge branch 'update-readme-with-missing-version-metric' into 'main'
Update readme with missing version metric

See merge request hectorjsmith/fail2ban-prometheus-exporter!40
2021-10-13 16:35:25 +00:00
Hector
9ccad42342 docs: add details on version metric to readme
Update the README file to include info on the new version metrics.
2021-10-13 17:21:33 +01:00
Hector
3591582b61 Merge branch 'remove-windows-support' into 'main'
Remove windows support

See merge request hectorjsmith/fail2ban-prometheus-exporter!39
2021-10-13 06:57:59 +00:00
Hector
0b6a941b38 remove: windows builds
Update the goreleaser config to remove windows builds. It doesn't make
sense to build binaries for windows because fail2ban does not provide any
binary for windows. If windows support is required, docker can be used.
2021-10-13 07:53:27 +01:00