From 07660986cf638c08bd431eac5868f83ba730df15 Mon Sep 17 00:00:00 2001
From: Arthur Le Bars <arthur.le-bars@sb-roscoff.fr>
Date: Mon, 12 Apr 2021 10:19:08 +0200
Subject: [PATCH] authelia config path made optional in config.yml

---
 gga_init.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gga_init.py b/gga_init.py
index 67be6ed..16332f9 100755
--- a/gga_init.py
+++ b/gga_init.py
@@ -202,7 +202,7 @@ def make_traefik_compose_files(config, main_dir):
                 traefik_compose_file.truncate(0)
                 traefik_compose_file.write(traefik_compose_output)
 
-        if config["authelia_config_path"]:
+        if authelia_config_path in config.keys():
             if not config["authelia_config_path"] == "" or not config["authelia_config_path"] == "/path/to/authelia/config":
                 if os.path.isfile(os.path.abspath(config["authelia_config_path"])):
                     try:
@@ -217,8 +217,10 @@ def make_traefik_compose_files(config, main_dir):
                     #     authelia_config_file.truncate(0)
                     #     authelia_config_file.write(authelia_config_output)
                 else:
-                    logging.critical("Cannot find authelia configuration template path (%s)" % config["authelia_config_path"])
+                    logging.critical("Cannot find authelia configuration path (%s)" % config["authelia_config_path"])
                     sys.exit()
+            else:
+                logging.critical("Invalid authelia configuration path (%s)" % config["authelia_config_path"])
 
         # Path to the authelia users in the repo
         authelia_users_path = script_dir + "/templates/authelia_users_template.yml"
-- 
GitLab