diff options
Diffstat (limited to 'www/gatus/patches/patch-config_config_go')
| -rw-r--r-- | www/gatus/patches/patch-config_config_go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/www/gatus/patches/patch-config_config_go b/www/gatus/patches/patch-config_config_go new file mode 100644 index 0000000..eaf7ad5 --- /dev/null +++ b/www/gatus/patches/patch-config_config_go @@ -0,0 +1,33 @@ +Gatus has hardcoded paths where it expects to find a config file. +This patch changes them to a more sensible values and also fixes a bug which prevents +using different hardcoded values. Of course the latter fix could be upstreamed, but +I just haven't found a way to explaining this yet. Seems rather weird. 'Oh, I changed +a bunch of values in your code and it broke'. Still, I believe that this is a genuine bug +since the code misuses the variables. + - la ninpre +Index: config/config.go +--- config/config.go.orig ++++ config/config.go +@@ -28,11 +28,11 @@ import ( + const ( + // DefaultConfigurationFilePath is the default path that will be used to search for the configuration file + // if a custom path isn't configured through the GATUS_CONFIG_PATH environment variable +- DefaultConfigurationFilePath = "config/config.yaml" ++ DefaultConfigurationFilePath = "${SYSCONFDIR}/gatus" + + // DefaultFallbackConfigurationFilePath is the default fallback path that will be used to search for the + // configuration file if DefaultConfigurationFilePath didn't work +- DefaultFallbackConfigurationFilePath = "config/config.yml" ++ DefaultFallbackConfigurationFilePath = "${SYSCONFDIR}/gatus" + ) + + var ( +@@ -155,7 +155,7 @@ func LoadConfiguration(configPath string) (*Config, er + } + var config *Config + if fileInfo.IsDir() { +- err := walkConfigDir(configPath, func(path string, d fs.DirEntry, err error) error { ++ err := walkConfigDir(usedConfigPath, func(path string, d fs.DirEntry, err error) error { + if err != nil { + log.Printf("[config][LoadConfiguration] Error walking path=%s: %s", path, err) + return err |
