Author: Michael Krelin <hacker@klever.net>
make config adjustable via env variable CGIT_CONFIG Signed-off-by: Michael Krelin <hacker@klever.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
cgit.c | 4 +++-
diff --git a/cgit.c b/cgit.c index d9a03c2773e88ca0a65eadc97183e0197e0524ba..1281bfa94294088438e7aa62417578b1d1012be2 100644 --- a/cgit.c +++ b/cgit.c @@ -222,6 +222,7 @@ int main(int argc, const char **argv) { struct cacheitem item; + const char *cgit_config_env = getenv("CGIT_CONFIG"); htmlfd = STDOUT_FILENO; item.st.st_mtime = time(NULL); @@ -229,7 +230,8 @@ cgit_repolist.length = 0; cgit_repolist.count = 0; cgit_repolist.repos = NULL; - cgit_read_config(CGIT_CONFIG, cgit_global_config_cb); + cgit_read_config(cgit_config_env ? cgit_config_env : CGIT_CONFIG, + cgit_global_config_cb); cgit_repo = NULL; if (getenv("SCRIPT_NAME")) cgit_script_name = xstrdup(getenv("SCRIPT_NAME"));