server: zone-labels API (Fastify + SQLite) — Phase A
New server/ service classifying zones as free_2h/3h/4h street vs pay_immediate lots. Public reads; writes require the admin bearer token (timing-safe compare). @fastify/rate-limit (120/min global, 20/min writes), manual IP denylist + auto-block on repeated auth failures. SQLite via better-sqlite3. Dockerfile + compose (loopback-only, mem/cpu capped) + nginx block + README. 9 tests pass. Deployed live at https://bigbrainparking.mowden.top (behind nginx + certbot). Not an npm workspace — kept out of the app/CI install to avoid the native dep. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2434879804
commit
c14081d85f
14 changed files with 2306 additions and 0 deletions
25
server/deploy/bigbrainparking.mowden.top.conf
Normal file
25
server/deploy/bigbrainparking.mowden.top.conf
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# nginx reverse proxy for the zone-labels API.
|
||||
# Install: sudo cp this file to /etc/nginx/sites-available/bigbrainparking.mowden.top
|
||||
# sudo ln -s ../sites-available/bigbrainparking.mowden.top /etc/nginx/sites-enabled/
|
||||
# sudo nginx -t && sudo systemctl reload nginx
|
||||
# TLS: sudo certbot --nginx -d bigbrainparking.mowden.top
|
||||
# (certbot rewrites this file to add the :443 server block + HTTP->HTTPS redirect.)
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name bigbrainparking.mowden.top;
|
||||
|
||||
# Small API; cap request bodies.
|
||||
client_max_body_size 32k;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8097;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue