lint, fix Python 3.10 bug

This commit is contained in:
Zsolt Ero
2024-09-11 23:50:15 +02:00
parent 69bc529dd6
commit 15bb347a61
19 changed files with 2340 additions and 827 deletions

View File

@@ -200,7 +200,7 @@ def create_version_location(
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;
add_header x-ofm-debug 'specific JSON {area} {version}';
}}
@@ -218,7 +218,7 @@ def create_version_location(
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;
add_header x-ofm-debug 'specific PBF {area} {version}';
}}
"""
@@ -252,7 +252,7 @@ def create_latest_locations(*, local: str, domain: str) -> str:
# latest
location_str += f"""
# latest JSON {area}
location = /{area} {{ # no trailing slash
alias {tilejson_path}; # no trailing slash
@@ -262,7 +262,7 @@ def create_latest_locations(*, local: str, domain: str) -> str:
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;
add_header x-ofm-debug 'latest JSON {area}';
}}
"""
@@ -270,40 +270,40 @@ def create_latest_locations(*, local: str, domain: str) -> str:
# wildcard
# identical to create_version_location
location_str += f"""
# wildcard JSON {area}
location ~ ^/{area}/([^/]+)$ {{
# regex location is unreliable with alias, only root is reliable
location ~ ^/{area}/([^/]+)$ {{
# regex location is unreliable with alias, only root is reliable
root {run_dir}; # no trailing slash
try_files /tilejson-{local}.json =404;
expires 1w;
default_type application/json;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;
add_header x-ofm-debug 'wildcard JSON {area}';
}}
# wildcard PBF {area}
location ~ ^/{area}/([^/]+)/(.+)$ {{
# regex location is unreliable with alias, only root is reliable
root {mnt_dir}/tiles/; # trailing slash
try_files /$2 @empty_tile;
add_header Content-Encoding gzip;
expires 10y;
types {{
application/vnd.mapbox-vector-tile pbf;
}}
add_header 'Access-Control-Allow-Origin' '*' always;
add_header Cache-Control public;
add_header x-ofm-debug 'wildcard PBF {area}';
}}
"""

View File

@@ -29,7 +29,8 @@ server {
error_log /data/ofm/http_host/logs_nginx/le-error.log;
location ^~ /.well-known/acme-challenge/ { # trailing slash
location ^~ /.well-known/acme-challenge/ {
# trailing slash
root /data/nginx/acme-challenges;
try_files $uri =404;
}

View File

@@ -18,7 +18,7 @@ def full_sync(force=False):
print('---')
print('running full_sync')
print(datetime.now(tz=timezone.utc))
print(datetime.now(timezone.utc))
assert_linux()
assert_sudo()