skip_letsencrypt implemented

This commit is contained in:
Zsolt Ero
2024-10-23 23:22:00 +02:00
parent e800123093
commit 2084f24469
2 changed files with 33 additions and 28 deletions

View File

@@ -17,6 +17,7 @@ def write_nginx_config():
domain_le = config.ofm_config['domain_le']
domain_ledns = config.ofm_config['domain_ledns']
skip_letsencrypt = config.ofm_config['skip_letsencrypt']
# remove old configs and certs
for file in Path('/data/nginx/sites').glob('ofm_*.conf'):
@@ -58,6 +59,7 @@ def write_nginx_config():
subprocess.run(['nginx', '-t'], check=True)
subprocess.run(['systemctl', 'reload', 'nginx'], check=True)
if not skip_letsencrypt:
subprocess.run(
[
'certbot',

View File

@@ -22,6 +22,9 @@ PLANETILER_BIN = f'{TILE_GEN_DIR}/planetiler'
HTTP_HOST_BIN = f'{OFM_DIR}/http_host/bin'
# Handling multiple .env files is supported
# or example ENV=test would use .env.test
ENV = os.getenv('ENV')
if ENV:
env_file_name = f'.env.{ENV}'