mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
domain_le -> domain_direct
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
SSH_PASSWD=
|
SSH_PASSWD=
|
||||||
|
|
||||||
# Domain, using Let's Encrypt certificates
|
# Domain, using Let's Encrypt certificates
|
||||||
DOMAIN_LE=
|
DOMAIN_DIRECT=
|
||||||
|
|
||||||
# Let's Encrypt account email
|
# Let's Encrypt account email
|
||||||
LE_EMAIL=
|
LE_EMAIL=
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ git clone https://github.com/hyperknot/openfreemap
|
|||||||
|
|
||||||
In the config folder, copy `.env.sample` to `.env` and set the values.
|
In the config folder, copy `.env.sample` to `.env` and set the values.
|
||||||
|
|
||||||
`DOMAIN_LE` - Your subdomain \
|
`DOMAIN_DIRECT` - Your subdomain \
|
||||||
`LE_EMAIL` - Your email for Let's Encrypt
|
`LE_EMAIL` - Your email for Let's Encrypt
|
||||||
|
|
||||||
Set `SKIP_PLANET=true` first.
|
Set `SKIP_PLANET=true` first.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ def write_nginx_config():
|
|||||||
|
|
||||||
curl_text_mix = ''
|
curl_text_mix = ''
|
||||||
|
|
||||||
domain_le = config.ofm_config['domain_le']
|
domain_direct = config.ofm_config['domain_direct']
|
||||||
domain_roundrobin = config.ofm_config['domain_roundrobin']
|
domain_roundrobin = config.ofm_config['domain_roundrobin']
|
||||||
skip_letsencrypt = config.ofm_config['skip_letsencrypt']
|
skip_letsencrypt = config.ofm_config['skip_letsencrypt']
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ def write_nginx_config():
|
|||||||
)
|
)
|
||||||
|
|
||||||
# processing Let's Encrypt config
|
# processing Let's Encrypt config
|
||||||
if domain_le:
|
if domain_direct:
|
||||||
le_cert = config.certs_dir / 'ofm_le.cert'
|
le_cert = config.certs_dir / 'ofm_le.cert'
|
||||||
le_key = config.certs_dir / 'ofm_le.key'
|
le_key = config.certs_dir / 'ofm_le.key'
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ def write_nginx_config():
|
|||||||
curl_text_mix += create_nginx_conf(
|
curl_text_mix += create_nginx_conf(
|
||||||
template_path=config.nginx_confs / 'le.conf',
|
template_path=config.nginx_confs / 'le.conf',
|
||||||
local='ofm_le',
|
local='ofm_le',
|
||||||
domain=domain_le,
|
domain=domain_direct,
|
||||||
)
|
)
|
||||||
|
|
||||||
subprocess.run(['nginx', '-t'], check=True)
|
subprocess.run(['nginx', '-t'], check=True)
|
||||||
@@ -75,7 +75,7 @@ def write_nginx_config():
|
|||||||
'--deploy-hook',
|
'--deploy-hook',
|
||||||
'nginx -t && service nginx reload',
|
'nginx -t && service nginx reload',
|
||||||
'-d',
|
'-d',
|
||||||
domain_le,
|
domain_direct,
|
||||||
],
|
],
|
||||||
check=True,
|
check=True,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ def set_version(area, version):
|
|||||||
def check_all_hosts(area, version) -> bool:
|
def check_all_hosts(area, version) -> bool:
|
||||||
oc = config.ofm_config
|
oc = config.ofm_config
|
||||||
|
|
||||||
domain = oc['domain_roundrobin'] or oc['domain_le']
|
domain = oc['domain_roundrobin'] or oc['domain_direct']
|
||||||
print(f'Using domain: {domain}')
|
print(f'Using domain: {domain}')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -200,22 +200,22 @@ def setup_roundrobin_writer(c):
|
|||||||
|
|
||||||
|
|
||||||
def upload_config_json(c):
|
def upload_config_json(c):
|
||||||
domain_le = dotenv_val('DOMAIN_LE').lower()
|
domain_direct = dotenv_val('DOMAIN_DIRECT').lower()
|
||||||
domain_roundrobin = dotenv_val('DOMAIN_ROUNDROBIN').lower()
|
domain_roundrobin = dotenv_val('DOMAIN_ROUNDROBIN').lower()
|
||||||
skip_planet = dotenv_val('SKIP_PLANET').lower() == 'true'
|
skip_planet = dotenv_val('SKIP_PLANET').lower() == 'true'
|
||||||
skip_letsencrypt = dotenv_val('SKIP_LETSENCRYPT').lower() == 'true'
|
skip_letsencrypt = dotenv_val('SKIP_LETSENCRYPT').lower() == 'true'
|
||||||
le_email = dotenv_val('LE_EMAIL').lower()
|
le_email = dotenv_val('LE_EMAIL').lower()
|
||||||
|
|
||||||
if not (domain_le or domain_roundrobin):
|
if not (domain_direct or domain_roundrobin):
|
||||||
sys.exit('Please specify DOMAIN_LE or DOMAIN_ROUNDROBIN in config/.env')
|
sys.exit('Please specify DOMAIN_DIRECT or DOMAIN_ROUNDROBIN in config/.env')
|
||||||
|
|
||||||
if domain_le and not le_email and not skip_letsencrypt:
|
if domain_direct and not le_email and not skip_letsencrypt:
|
||||||
sys.exit('Please add your email to LE_EMAIL when using DOMAIN_LE')
|
sys.exit('Please add your email to LE_EMAIL when using DOMAIN_DIRECT')
|
||||||
|
|
||||||
http_host_list = [h.strip() for h in dotenv_val('HTTP_HOST_LIST').split(',') if h.strip()]
|
http_host_list = [h.strip() for h in dotenv_val('HTTP_HOST_LIST').split(',') if h.strip()]
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'domain_le': domain_le,
|
'domain_direct': domain_direct,
|
||||||
'domain_roundrobin': domain_roundrobin,
|
'domain_roundrobin': domain_roundrobin,
|
||||||
'le_email': le_email,
|
'le_email': le_email,
|
||||||
'skip_planet': skip_planet,
|
'skip_planet': skip_planet,
|
||||||
|
|||||||
Reference in New Issue
Block a user