From 2becae11e18c0e213d790c62c4e1fb71b25ddd56 Mon Sep 17 00:00:00 2001 From: Zsolt Ero Date: Wed, 15 Oct 2025 16:22:53 +0200 Subject: [PATCH] work --- docs/self_hosting.md | 2 +- http-host.py | 8 ++++---- modules/http_host/http_host_lib/nginx_config_gen.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/self_hosting.md b/docs/self_hosting.md index d1771c4..98ee7f1 100644 --- a/docs/self_hosting.md +++ b/docs/self_hosting.md @@ -82,7 +82,7 @@ Run the actual deploy command and wait a few minutes If everything is OK, you'll have some curl lines printed. Run the first one locally and make sure it's showing HTTP/2 200. For example this is an OK response. ```locally to test them. -curl -sI https://test.openfreemap.org/monaco | sort +curl -sI https://test.openfreemap.org/monaco HTTP/2 200 access-control-allow-origin: * diff --git a/http-host.py b/http-host.py index 14f6462..df9a306 100755 --- a/http-host.py +++ b/http-host.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import click -import json5 from ssh_lib.cli_helpers import common_options, get_connection from ssh_lib.config import config @@ -33,7 +32,8 @@ def init_static(hostname, user, port, noninteractive): @cli.command() @common_options -def init_autoupdate(hostname, user, port, noninteractive): +@click.option('--sync', is_flag=True, help='Run manual sync after init') +def init_autoupdate(hostname, user, port, noninteractive, sync): if not noninteractive and not click.confirm(f'Run script on {hostname}?'): return @@ -44,8 +44,8 @@ def init_autoupdate(hostname, user, port, noninteractive): prepare_shared(c) prepare_http_host(c) - # for the monaco run, wait for the sync to complete - if json5.loads(config.local_config_jsonc.read_text()).get('skip_planet'): + # if --sync, run manual sync + if sync: run_http_host_sync(c) put(c, config.local_modules_dir / 'http_host' / 'cron.d' / 'ofm_http_host', '/etc/cron.d/') diff --git a/modules/http_host/http_host_lib/nginx_config_gen.py b/modules/http_host/http_host_lib/nginx_config_gen.py index 44aec21..f21a0bf 100644 --- a/modules/http_host/http_host_lib/nginx_config_gen.py +++ b/modules/http_host/http_host_lib/nginx_config_gen.py @@ -87,7 +87,7 @@ def dynamic_blocks(domain_data: dict) -> tuple[str, str]: # f'/{area}/{version}/9999/9999/9999.pbf', # empty_tile test ]: # curl_help_text += f'curl -H "Host: __DOMAIN_SLUG__" -I http://localhost{path}\n' - curl_help_text += f'curl -sI https://__DOMAIN__{path} | sort\n' + curl_help_text += f'curl -sI https://__DOMAIN__{path}\n' nginx_conf_text += create_latest_locations(domain_data=domain_data) @@ -98,7 +98,7 @@ def dynamic_blocks(domain_data: dict) -> tuple[str, str]: # f'/{help_area}/latest/9999/9999/9999.pbf', # empty_tile test ]: # curl_help_text += f'curl -H "Host: __DOMAIN_SLUG__" -I http://localhost{path}\n' - curl_help_text += f'curl -sI https://__DOMAIN__{path} | sort\n' + curl_help_text += f'curl -sI https://__DOMAIN__{path}\n' nginx_conf_text += '\n' + (config.nginx_templates / 'static_blocks.conf').read_text() return nginx_conf_text, curl_help_text