diff --git a/autoconf/AutoConf.py b/autoconf/AutoConf.py index e362ec5..31efca2 100644 --- a/autoconf/AutoConf.py +++ b/autoconf/AutoConf.py @@ -29,6 +29,10 @@ class AutoConf : env = instance.attrs["Config"]["Env"] for entry in env : self.__env[entry.split("=")[0]] = entry.replace(entry.split("=")[0] + "=", "", 1) + blacklist = ["NGINX_VERSION", "NJS_VERSION", "PATH", "PKG_RELEASE"] + for entry in blacklist : + if entry in self.__env : + del self.__env[entry] if not "SERVER_NAME" in self.__env or self.__env["SERVER_NAME"] == "" : self.__env["SERVER_NAME"] = [] else : diff --git a/entrypoint/jobs.sh b/entrypoint/jobs.sh index f110a70..e787a01 100644 --- a/entrypoint/jobs.sh +++ b/entrypoint/jobs.sh @@ -58,7 +58,7 @@ if [ "$files" != "" ] ; then if [ "$EMAIL_LETS_ENCRYPT" = "" ] ; then EMAIL_LETS_ENCRYPT="contact@${FIRST_SERVER}" fi - certbot_outpout=$(/opt/scripts/certbot-new.sh "$(echo -n $SERVER_NAME | sed 's/ /,/g')" "$EMAIL_LETS_ENCRYPT" 2>&1) + certbot_output=$(/opt/scripts/certbot-new.sh "$(echo -n $SERVER_NAME | sed 's/ /,/g')" "$EMAIL_LETS_ENCRYPT" 2>&1) if [ $? -eq 0 ] ; then echo "[*] Certbot new successfully executed for domain(s) $(echo -n $SERVER_NAME | sed 's/ /,/g')" else diff --git a/gen/Configurator.py b/gen/Configurator.py index 3ca4732..db3e1d7 100644 --- a/gen/Configurator.py +++ b/gen/Configurator.py @@ -21,10 +21,11 @@ class Configurator : def load_variables(self, vars, multisite_only=False) : for var, value in vars.items() : - if self.__check_var(var, value) : + check, reason = self.__check_var(var, value) + if check : self.__variables[var] = value else : - print("Ignoring " + var + "=" + value) + print("Ignoring " + var + "=" + value + " (" + reason + ")") def get_config(self) : config = {} @@ -45,4 +46,10 @@ class Configurator : real_var = "_".join(var.split("_")[:-1]) else : real_var = "_".join(var.split("_")[:-1][1:]) - return real_var != "" and re.search(self.__settings[real_var]["regex"], value) and (not multisite_only or self.__settings[real_var]["context"] == "multisite") + if real_var == "" : + return False, "doesn't exist" + elif not re.search(self.__settings[real_var]["regex"], value) : + return False, "doesn't match regex : " + self.__settings[real_var]["regex"] + elif multisite_only and self.__settings[real_var]["context"] != "multisite" : + return False, "not at multisite context" + return True, ""