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

File diff suppressed because it is too large Load Diff

View File

@@ -29,7 +29,8 @@ server {
error_log /data/ofm/http_host/logs_nginx/le-error.log; 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; root /data/nginx/acme-challenges;
try_files $uri =404; try_files $uri =404;
} }

View File

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

View File

@@ -1,13 +1,12 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import datetime
import json import json
from datetime import datetime, timezone
import click import click
import requests import requests
from dotenv import dotenv_values from dotenv import dotenv_values
from loadbalancer_lib import OFM_CONFIG_DIR from loadbalancer_lib import OFM_CONFIG_DIR
from loadbalancer_lib.cloudflare import get_zone_id, set_records_round_robin from loadbalancer_lib.cloudflare import get_zone_id, set_records_round_robin
from loadbalancer_lib.curl import pycurl_get, pycurl_status
from loadbalancer_lib.telegram_ import telegram_send_message from loadbalancer_lib.telegram_ import telegram_send_message
@@ -27,7 +26,7 @@ def check():
Runs load-balancing check (triggered by cron every minute) Runs load-balancing check (triggered by cron every minute)
""" """
print(f'starting loadbalancer check at: {datetime.datetime.now(tz=datetime.timezone.utc)}') print(f'starting loadbalancer check at: {datetime.now(timezone.utc)}')
check_or_fix(fix=False) check_or_fix(fix=False)
@@ -37,7 +36,7 @@ def fix():
Fixes records based on check results Fixes records based on check results
""" """
print(f'starting loadbalancer fix at: {datetime.datetime.now(tz=datetime.timezone.utc)}') print(f'starting loadbalancer fix at: {datetime.now(timezone.utc)}')
check_or_fix(fix=True) check_or_fix(fix=True)
@@ -102,7 +101,7 @@ def run_area(c, area):
for host_ip in c['http_host_list']: for host_ip in c['http_host_list']:
try: try:
check_host(c['domain_ledns'], host_ip, area, target_version) # check_host(c['domain_ledns'], host_ip, area, target_version)
results[host_ip] = True results[host_ip] = True
except Exception as e: except Exception as e:
results[host_ip] = False results[host_ip] = False
@@ -111,8 +110,6 @@ def run_area(c, area):
return results return results
def get_target_version(area): def get_target_version(area):
url = f'https://assets.openfreemap.com/versions/deployed_{area}.txt' url = f'https://assets.openfreemap.com/versions/deployed_{area}.txt'
response = requests.get(url) response = requests.get(url)

View File

@@ -1,2 +1 @@
These are self contained Python scripts, they can be run outside of this project's environment. These are self contained Python scripts, they can be run outside of this project's environment.

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from datetime import UTC, datetime from datetime import datetime, timezone
import click import click
from tile_gen_lib.btrfs import make_btrfs from tile_gen_lib.btrfs import make_btrfs
@@ -8,7 +8,7 @@ from tile_gen_lib.rclone import make_indexes_for_bucket, upload_area
from tile_gen_lib.set_version import check_and_set_version from tile_gen_lib.set_version import check_and_set_version
now = datetime.now(tz=UTC) now = datetime.now(timezone.utc)
@click.group() @click.group()

View File

@@ -4,14 +4,14 @@ import subprocess
from datetime import datetime, timezone from datetime import datetime, timezone
from pathlib import Path from pathlib import Path
from tile_gen_lib.config import config
from tile_gen_lib.btrfs import cleanup_folder from tile_gen_lib.btrfs import cleanup_folder
from tile_gen_lib.config import config
def run_planetiler(area: str) -> Path: def run_planetiler(area: str) -> Path:
assert area in config.areas assert area in config.areas
date = datetime.now(tz=timezone.utc).strftime('%Y%m%d_%H%M%S') date = datetime.now(timezone.utc).strftime('%Y%m%d_%H%M%S')
area_dir = config.runs_dir / area area_dir = config.runs_dir / area

View File

@@ -5,9 +5,7 @@ import { defineConfig } from 'astro/config'
export default defineConfig({ export default defineConfig({
vite: { vite: {
css: { css: {
transformer: "lightningcss", transformer: 'lightningcss',
}, },
}, },
}) })

2003
website/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,3 @@
## Self-hosting ## Self-hosting
You can also download our processed full planet Btrfs images if you want to self-host yourself. Details can be found on [GitHub](https://github.com/hyperknot/openfreemap). You can also download our processed full planet Btrfs images if you want to self-host yourself. Details can be found on [GitHub](https://github.com/hyperknot/openfreemap).

View File

@@ -1,5 +1,5 @@
@import "reset.css"; @import 'reset.css';
@import "global.css"; @import 'global.css';
/* */ /* */
@import "map.css"; @import 'map.css';
@import "donate.css"; @import 'donate.css';

View File

@@ -31,8 +31,6 @@
} }
} }
/* noUI slider customizations */ /* noUI slider customizations */
.noUi-connects { .noUi-connects {

View File

@@ -24,7 +24,8 @@ h6 {
margin-top: 3em; margin-top: 3em;
margin-bottom: 0.5em; margin-bottom: 0.5em;
line-height: 1.2; line-height: 1.2;
font-family: Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif; font-family: Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro,
sans-serif;
font-weight: bold; font-weight: bold;
} }
@@ -123,4 +124,3 @@ hr {
background-color: #dea31d; background-color: #dea31d;
} }
} }

View File

@@ -25,7 +25,11 @@
} }
.mapbg-attrib { .mapbg-attrib {
font: 12px / 20px Helvetica Neue, Arial, Helvetica, sans-serif; font:
12px / 20px Helvetica Neue,
Arial,
Helvetica,
sans-serif;
background-color: hsla(0, 0%, 100%, 0.5); background-color: hsla(0, 0%, 100%, 0.5);
padding: 0 5px; padding: 0 5px;
bottom: 0; bottom: 0;