mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
certs
This commit is contained in:
1
config/certs/.gitignore
vendored
1
config/certs/.gitignore
vendored
@@ -0,0 +1 @@
|
||||
*
|
||||
|
||||
@@ -90,7 +90,7 @@ def prepare_tile_gen(c):
|
||||
|
||||
|
||||
def upload_http_host_config(c):
|
||||
domain_direct = dotenv_values(f'{CONFIG_DIR}/.env').get('DOMAIN_DIRECT1', '').strip()
|
||||
domain_direct = dotenv_values(f'{CONFIG_DIR}/.env').get('DOMAIN_DIRECT', '').strip()
|
||||
domain_cf = dotenv_values(f'{CONFIG_DIR}/.env').get('DOMAIN_CF', '').strip()
|
||||
skip_planet = (
|
||||
dotenv_values(f'{CONFIG_DIR}/.env').get('SKIP_PLANET', '').lower().strip() == 'true'
|
||||
@@ -99,6 +99,13 @@ def upload_http_host_config(c):
|
||||
if not (domain_direct or domain_cf):
|
||||
sys.exit('Please specify DOMAIN_DIRECT or DOMAIN_CF in config/.env')
|
||||
|
||||
if domain_cf:
|
||||
if (
|
||||
not (CONFIG_DIR / 'certs' / 'cf.key').exists()
|
||||
or not (CONFIG_DIR / 'certs' / 'cf.cert').exists()
|
||||
):
|
||||
sys.exit('When using DOMAIN_CF, please place cf.key and cf.cert in config/certs')
|
||||
|
||||
host_config = {
|
||||
'domain_direct': domain_direct,
|
||||
'domain_cf': domain_cf,
|
||||
@@ -106,6 +113,7 @@ def upload_http_host_config(c):
|
||||
}
|
||||
|
||||
host_config_str = json.dumps(host_config, indent=2, ensure_ascii=False)
|
||||
print(host_config_str)
|
||||
put_str(c, '/data/ofm/config/http_host.json', host_config_str)
|
||||
|
||||
|
||||
@@ -246,6 +254,7 @@ def debug(hostname, user, port):
|
||||
c = get_connection(hostname, user, port)
|
||||
|
||||
upload_http_host_config(c)
|
||||
|
||||
upload_https_host_files(c)
|
||||
run_http_host_sync(c)
|
||||
|
||||
|
||||
@@ -10,10 +10,7 @@ import requests
|
||||
from http_host_lib import DEFAULT_ASSETS_DIR, DEFAULT_RUNS_DIR, MNT_DIR
|
||||
from http_host_lib.download_assets import (
|
||||
download_and_extract_asset_tar_gz,
|
||||
download_fonts,
|
||||
download_natural_earth,
|
||||
download_sprites,
|
||||
download_styles,
|
||||
)
|
||||
from http_host_lib.download_tileset import download_and_extract_tileset
|
||||
from http_host_lib.mount import clean_up_mounts, create_fstab
|
||||
|
||||
@@ -9,8 +9,8 @@ server {
|
||||
listen [::]:443 ssl;
|
||||
http2 on;
|
||||
|
||||
ssl_certificate /data/nginx/certs/openfreemap.org.cert;
|
||||
ssl_certificate_key /data/nginx/certs/openfreemap.org.key;
|
||||
ssl_certificate /data/nginx/certs/cf.cert;
|
||||
ssl_certificate_key /data/nginx/certs/cf.key;
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
|
||||
ssl_session_tickets off;
|
||||
|
||||
Reference in New Issue
Block a user