Add a project Dockerfile to allow deploying the application in a docker
container. Add a `run.sh` script to start the application in the container.
Add Makefile commands to build the docker image based on the Dockerfile.
Fix possible nil reference error in the `db` package.
Add the `git-chglog` tool to handle auto-generating the project changelog
based on the commit history. Add a custom configuration and file template.
Update the Makefile to include a command to generate the changelog.
Update the Gitlab CI/CD process to include a build stage that uses
`goreleaser` to build and package the application. The output of the build
is stored as an artifact for 1 day.
Add the `goreleaser` tool to the repository to handle building and
publishing the application. Add a simple configuration file to build the
application for all major OS versions.
Update the Makefile to include commands to build release and snapshot
versions of the tool.
Add a placeholder CHANGELOG file to be included in the package files.
Add a check when connecting to the sqlite3 database to ensure that the file
exists before connecting. If the file does not exist, the connection fails.
Add support for configuring CLI parameters in the application using a new
`cfg` package. The `cfg` package exports an `AppSettings` struct that
contains the settings the application was run with.
Update the application to use the new CLI parameters to set the db to open
and the port to use for the metrics server.
Add support for setting the app version during build. The app includes a
`-version` flag to print the stored version data.
Export the number of banned IPs stored in the fail2ban database as well
as the number of bad IPs.
Update the queries used to collect data to better handle cases where the
database table for bad/banned IPs is empty. The new query always lists all
jails, even when the count is zero.
Update exported metrics to spit the number of bad IPs per jail using metric
value labels. This includes a change to the database code to use a
different query that groups the count by the `jail` column.
Add dependencies on `sqlite` to allow connecting to the fail2ban database.
Add a new `db` module to handle all the database connections and data
queries used to generate metrics.
Export a new metric for the total number of bad IPs stored in the fail2ban
database.
Add dependency on the prometheus library to start exporting metrics. Add
a new `up` metric that always returns `1` to ensure the exporter is
working as expected.