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.
This fixes the `431 Request Header Fields Too Large` error
By default, the read-buffer-size is 8192, up from fiber's default of 4096.
Fixes#674Fixes#636
Supersedes #637
Supersedes #663
* Basic setup to serve HTTPS
* Correctly handle the case of missing TLS configs
* Documenting TLS
* Refactor TLS configuration setup
* Add TLS Encryption section again to README
* Extending TOC in README
* Moving TLS settings to subsection of web settings
* Adding tests for config/web
* Add test for handling TLS
* Rename some variables as suggested
* Corrected error formatting
* Update test module import
* Polishing the readme file
* Error handling for TLSConfig()
---------
Co-authored-by: TwiN <twin@linux.com>
* Add a new Pushover provider (#129)
- Adds new provider named Pushover with corresponding tests
- Adds Pushover as a provider to the configuration and adjusts test accordingly
- Adds Pushover to alerting_test.go, provider.go and type.go
- Updates the readme with configuration details
* Correct import order
* Fix some missing pushover references
* Apply suggestions from code review
* Rename application-key to application-token for Pushover
---------
Co-authored-by: TwiN <twin@linux.com>
BREAKING CHANGE: `services` has been replaced by `endpoints` in v3.3.0, but backward compatibility has been retained until now. v5.0.0, however, will no longer support `services`, so make sure to update your configuration to use `endpoints` instead.
See #374 for more information
Closes#308
Work remaining:
- Add the documentation on the README.md
- Test it with an actual Ntfy instance (I've only used https://ntfy.sh/docs/examples/#gatus as a reference; I haven't actually tested it yet)
* recreated all changes for setting thresholds on Uptime Badges
* Suggestion accepted: Update core/ui/ui.go
Co-authored-by: TwiN <twin@linux.com>
* Suggestion accepted: Update core/ui/ui.go
Co-authored-by: TwiN <twin@linux.com>
* implemented final suggestions by Twin
* Update controller/handler/badge.go
* Update README.md
* test: added the suggestons to set the UiConfig at another line
Co-authored-by: TwiN <twin@linux.com>
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>