pull v1.2.8 fixes when applicable
This commit is contained in:
parent
8bb6676f58
commit
a1b9010d9e
13
gen/main.py
13
gen/main.py
|
@ -49,16 +49,11 @@ if __name__ == "__main__" :
|
|||
variables = utils.load_variables(args.variables)
|
||||
configurator.load_variables(variables)
|
||||
config = configurator.get_config()
|
||||
#print(config)
|
||||
|
||||
# Remove old config
|
||||
# TODO : remove unnecessary files after rendering
|
||||
# for filename in os.listdir(args.output):
|
||||
# file_path = os.path.join(args.output, filename)
|
||||
# if os.path.isfile(file_path) or os.path.islink(file_path):
|
||||
# os.unlink(file_path)
|
||||
# elif os.path.isdir(file_path):
|
||||
# shutil.rmtree(file_path)
|
||||
# TODO : find a proper way to remove old sites
|
||||
env_list = glob.glob(args.output + "/**/*.env", recursive=True)
|
||||
for env in env_list :
|
||||
os.remove(env)
|
||||
|
||||
# Generate the files from templates and config
|
||||
templator = Templator(config, args.templates, args.output, args.target)
|
||||
|
|
|
@ -534,7 +534,7 @@
|
|||
"env": "EMAIL_LETS_ENCRYPT",
|
||||
"id": "email-lets-encrypt",
|
||||
"label": "Email lets encrypt",
|
||||
"regex": "^([a-z0-9\-\.]+@[a-z\-0-9\.]+|.{0})$",
|
||||
"regex": "^([a-z0-9\\-\\.]+@[a-z\\-0-9\\.]+|.{0})$",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
|
@ -633,7 +633,7 @@
|
|||
"env": "SELF_SIGNED_SSL_STATE",
|
||||
"id": "self-signed-ssl-state",
|
||||
"label": "State of the self-signed certificate",
|
||||
"regex": "^[A-Za-z\\-]+$",
|
||||
"regex": "^[A-Za-z\\- ]+$",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
|
@ -642,7 +642,7 @@
|
|||
"env": "SELF_SIGNED_SSL_CITY",
|
||||
"id": "self-signed-ssl-city",
|
||||
"label": "City of the self-signed certificate",
|
||||
"regex": "^[A-Za-z\\-]+$",
|
||||
"regex": "^[A-Za-z\\- ]+$",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
|
@ -651,7 +651,7 @@
|
|||
"env": "SELF_SIGNED_SSL_OU",
|
||||
"id": "self-signed-ssl-ou",
|
||||
"label": "Organizational Unit of the self-signed certificate",
|
||||
"regex": "^[A-Za-z\\-]+$$",
|
||||
"regex": "^[A-Za-z\\-]+$",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
|
@ -660,7 +660,7 @@
|
|||
"env": "SELF_SIGNED_SSL_ORG",
|
||||
"id": "self-signed-ssl-org",
|
||||
"label": "Organization name of the self-signed certificate",
|
||||
"regex": "^[A-Za-z\\- ]+$$",
|
||||
"regex": "^[A-Za-z\\- ]+$",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
|
@ -974,7 +974,7 @@
|
|||
"env": "REMOTE_PHP",
|
||||
"id": "remote-php",
|
||||
"label": "Remote php",
|
||||
"regex": "^[a-z\-0-9_\.]*$",
|
||||
"regex": "^[a-z\\-0-9_\\.]*$",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
|
@ -983,7 +983,7 @@
|
|||
"env": "REMOTE_PHP_PATH",
|
||||
"id": "remote-php-path",
|
||||
"label": "Remote php path",
|
||||
"regex": "^\/[a-zA-Z\-0-9_\.\/]*$",
|
||||
"regex": "^\\/[a-zA-Z\\-0-9_\\.\\/]*$",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
|
@ -992,7 +992,7 @@
|
|||
"env": "LOCAL_PHP",
|
||||
"id": "local-php",
|
||||
"label": "local php",
|
||||
"regex": "^\/[a-zA-Z\-0-9_\.\/]*$",
|
||||
"regex": "^\\/[a-zA-Z\\-0-9_\\.\\/]*$",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
|
@ -1001,7 +1001,7 @@
|
|||
"env": "LOCAL_PHP_PATH",
|
||||
"id": "local-php-path",
|
||||
"label": "Local php path",
|
||||
"regex": "^\/[a-zA-Z\-0-9_\.\/]*$",
|
||||
"regex": "^\\/[a-zA-Z\\-0-9_\\.\\/]*$",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -58,7 +58,9 @@ class Config :
|
|||
for filename in glob.iglob("/etc/nginx/**/site.env") :
|
||||
env = self.__env_to_dict(filename)
|
||||
services.append(env)
|
||||
services.append(self.__env_to_dict("/etc/nginx/site.env"))
|
||||
no_multisite = self.__env_to_dict("/etc/nginx/site.env")
|
||||
if len(no_multisite) > 0 :
|
||||
services.append(no_multisite)
|
||||
return services
|
||||
|
||||
def check_variables(self, variables) :
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{% if param["type"] != "multiple" and param["context"] == "multisite" %}
|
||||
<div class="row mb-3" id="form-new-{{ param["id"] }}">
|
||||
{% set default = {"value": param["default"]} %}
|
||||
{% if param["env"] in config["CONFIG"].get_config() %}
|
||||
{% if param["env"] in config["CONFIG"].get_config() and param["env"] != "SERVER_NAME" %}
|
||||
{% set x = default.update({"value": config["CONFIG"].get_config()[param["env"]]}) %}
|
||||
{% endif %}
|
||||
{{ form_service_gen("form-new-" + param["id"], param["label"], param["type"], default["value"], param["env"])|safe }}
|
||||
|
@ -58,4 +58,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue