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)
|
variables = utils.load_variables(args.variables)
|
||||||
configurator.load_variables(variables)
|
configurator.load_variables(variables)
|
||||||
config = configurator.get_config()
|
config = configurator.get_config()
|
||||||
#print(config)
|
|
||||||
|
|
||||||
# Remove old config
|
# TODO : find a proper way to remove old sites
|
||||||
# TODO : remove unnecessary files after rendering
|
env_list = glob.glob(args.output + "/**/*.env", recursive=True)
|
||||||
# for filename in os.listdir(args.output):
|
for env in env_list :
|
||||||
# file_path = os.path.join(args.output, filename)
|
os.remove(env)
|
||||||
# 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)
|
|
||||||
|
|
||||||
# Generate the files from templates and config
|
# Generate the files from templates and config
|
||||||
templator = Templator(config, args.templates, args.output, args.target)
|
templator = Templator(config, args.templates, args.output, args.target)
|
||||||
|
|||||||
@ -534,7 +534,7 @@
|
|||||||
"env": "EMAIL_LETS_ENCRYPT",
|
"env": "EMAIL_LETS_ENCRYPT",
|
||||||
"id": "email-lets-encrypt",
|
"id": "email-lets-encrypt",
|
||||||
"label": "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"
|
"type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -633,7 +633,7 @@
|
|||||||
"env": "SELF_SIGNED_SSL_STATE",
|
"env": "SELF_SIGNED_SSL_STATE",
|
||||||
"id": "self-signed-ssl-state",
|
"id": "self-signed-ssl-state",
|
||||||
"label": "State of the self-signed certificate",
|
"label": "State of the self-signed certificate",
|
||||||
"regex": "^[A-Za-z\\-]+$",
|
"regex": "^[A-Za-z\\- ]+$",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -642,7 +642,7 @@
|
|||||||
"env": "SELF_SIGNED_SSL_CITY",
|
"env": "SELF_SIGNED_SSL_CITY",
|
||||||
"id": "self-signed-ssl-city",
|
"id": "self-signed-ssl-city",
|
||||||
"label": "City of the self-signed certificate",
|
"label": "City of the self-signed certificate",
|
||||||
"regex": "^[A-Za-z\\-]+$",
|
"regex": "^[A-Za-z\\- ]+$",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -651,7 +651,7 @@
|
|||||||
"env": "SELF_SIGNED_SSL_OU",
|
"env": "SELF_SIGNED_SSL_OU",
|
||||||
"id": "self-signed-ssl-ou",
|
"id": "self-signed-ssl-ou",
|
||||||
"label": "Organizational Unit of the self-signed certificate",
|
"label": "Organizational Unit of the self-signed certificate",
|
||||||
"regex": "^[A-Za-z\\-]+$$",
|
"regex": "^[A-Za-z\\-]+$",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -660,7 +660,7 @@
|
|||||||
"env": "SELF_SIGNED_SSL_ORG",
|
"env": "SELF_SIGNED_SSL_ORG",
|
||||||
"id": "self-signed-ssl-org",
|
"id": "self-signed-ssl-org",
|
||||||
"label": "Organization name of the self-signed certificate",
|
"label": "Organization name of the self-signed certificate",
|
||||||
"regex": "^[A-Za-z\\- ]+$$",
|
"regex": "^[A-Za-z\\- ]+$",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -974,7 +974,7 @@
|
|||||||
"env": "REMOTE_PHP",
|
"env": "REMOTE_PHP",
|
||||||
"id": "remote-php",
|
"id": "remote-php",
|
||||||
"label": "Remote php",
|
"label": "Remote php",
|
||||||
"regex": "^[a-z\-0-9_\.]*$",
|
"regex": "^[a-z\\-0-9_\\.]*$",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -983,7 +983,7 @@
|
|||||||
"env": "REMOTE_PHP_PATH",
|
"env": "REMOTE_PHP_PATH",
|
||||||
"id": "remote-php-path",
|
"id": "remote-php-path",
|
||||||
"label": "Remote php path",
|
"label": "Remote php path",
|
||||||
"regex": "^\/[a-zA-Z\-0-9_\.\/]*$",
|
"regex": "^\\/[a-zA-Z\\-0-9_\\.\\/]*$",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -992,7 +992,7 @@
|
|||||||
"env": "LOCAL_PHP",
|
"env": "LOCAL_PHP",
|
||||||
"id": "local-php",
|
"id": "local-php",
|
||||||
"label": "local php",
|
"label": "local php",
|
||||||
"regex": "^\/[a-zA-Z\-0-9_\.\/]*$",
|
"regex": "^\\/[a-zA-Z\\-0-9_\\.\\/]*$",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1001,7 +1001,7 @@
|
|||||||
"env": "LOCAL_PHP_PATH",
|
"env": "LOCAL_PHP_PATH",
|
||||||
"id": "local-php-path",
|
"id": "local-php-path",
|
||||||
"label": "Local php path",
|
"label": "Local php path",
|
||||||
"regex": "^\/[a-zA-Z\-0-9_\.\/]*$",
|
"regex": "^\\/[a-zA-Z\\-0-9_\\.\\/]*$",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -58,7 +58,9 @@ class Config :
|
|||||||
for filename in glob.iglob("/etc/nginx/**/site.env") :
|
for filename in glob.iglob("/etc/nginx/**/site.env") :
|
||||||
env = self.__env_to_dict(filename)
|
env = self.__env_to_dict(filename)
|
||||||
services.append(env)
|
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
|
return services
|
||||||
|
|
||||||
def check_variables(self, variables) :
|
def check_variables(self, variables) :
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
{% if param["type"] != "multiple" and param["context"] == "multisite" %}
|
{% if param["type"] != "multiple" and param["context"] == "multisite" %}
|
||||||
<div class="row mb-3" id="form-new-{{ param["id"] }}">
|
<div class="row mb-3" id="form-new-{{ param["id"] }}">
|
||||||
{% set default = {"value": param["default"]} %}
|
{% 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"]]}) %}
|
{% set x = default.update({"value": config["CONFIG"].get_config()[param["env"]]}) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ form_service_gen("form-new-" + param["id"], param["label"], param["type"], default["value"], param["env"])|safe }}
|
{{ form_service_gen("form-new-" + param["id"], param["label"], param["type"], default["value"], param["env"])|safe }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user