From a315cdbf7405a72da1a390a525692c8b8dd9874e Mon Sep 17 00:00:00 2001 From: Robin Portigliatti Date: Wed, 16 Oct 2024 18:51:48 +0200 Subject: [PATCH] Adding the possibility to put conf file inside the directory /etc/ldap2pg --- docs/config.md | 1 + internal/config/file.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/config.md b/docs/config.md index 4801415d..7b235003 100644 --- a/docs/config.md +++ b/docs/config.md @@ -18,6 +18,7 @@ ldap2pg searches for configuration file in the following order : 1. `ldap2pg.yml` in current working directory. 2. `~/.config/ldap2pg.yml`. 3. `/etc/ldap2pg.yml`. +4. `/etc/ldap2pg/ldap2pg.yml`. If `LDAP2PG_CONFIG` or `--config` is set, ldap2pg skips searching the standard file locations. diff --git a/internal/config/file.go b/internal/config/file.go index 303ac383..e82e201c 100644 --- a/internal/config/file.go +++ b/internal/config/file.go @@ -41,6 +41,8 @@ func FindConfigFile(userValue string) string { path.Join(home, "/.config/ldap2pg.yaml"), "/etc/ldap2pg.yml", "/etc/ldap2pg.yaml", + "/etc/ldap2pg/ldap2pg.yml", + "/etc/ldap2pg/ldap2pg.yaml", } return FindFile(userValue, candidates) }