gatus/config
James Durand 926d20d000 feat: Added support for Docker secrets
This adds the ability to use [Docker
secrets](https://docs.docker.com/compose/use-secrets/) in configuration
files. In Docker this is done by creating a secret resource, adding that
secret to the container when you're starting it, and specifying an
environment variable that has the `_FILE` suffix. The environment
variable should point to the file which contains the secret
(`/run/secrets/<secret-name>`).

Typically Docker images are setup so that they will try and find any
environment variables that end in `_FILE` and set new environment
variables with the same name minus the `_FILE` suffix in the running
process. This is beneficial since environment variables that are set by
the user when creating the container are visible to anyone who is able
to run `docker container inspect <container>` on the host. For secrets
this could be really damaging and leak sensitive information. Instead it
is recommended to use Docker secrets.

Because Gatus uses the `scratch` base image I wasn't able to just use a
Bash script to convert the secret file path into a normal environment
variable like many other images do. Instead I opted to just modify the
configuration logic so that it checks the environment variable name and
changes its behavior based on that. This seems to work well enough.

As far as error handling, I opted _not_ to crash the service when it's
unable to read the secret file and instead just pretend its a normal
environment variable and return an empty string. This follows the
conventions of the rest of the configuration handling and leaves the
error reporting to the configuration validation.

I've also updated the readme to mention this feature with a link to an
example.
2024-04-12 20:44:00 -05:00
..
connectivity feat(connectivity): Allow internet connection validation prior to endpoint execution (#461) 2023-05-02 22:41:22 -04:00
endpoints feat(api): Migrate from gorilla/mux to fiber 2023-07-11 22:46:49 -04:00
maintenance fix(alerting): Unable to set maintenance interval to all day (#475) 2023-05-17 18:45:18 -04:00
remote chore: Bump module version to v5 2022-12-06 01:41:18 -05:00
ui chore: Bump module version to v5 2022-12-06 01:41:18 -05:00
web fix(web): Allow configuration of read-buffer-size (#675) 2024-02-07 18:54:30 -05:00
config_test.go feat: Added support for Docker secrets 2024-04-12 20:44:00 -05:00
config.go feat: Added support for Docker secrets 2024-04-12 20:44:00 -05:00