Add Python FastAPI service, cheap hotels page, and Tailwind theme refactor
Deploy with Docker Compose / deploy (push) Successful in 1m29s
Deploy with Docker Compose / deploy (push) Successful in 1m29s
- Replace searxng and open-webui with a FastAPI `python/` service proxied at /py/ (Travelodge hotel search, rate-limited in nginx) - Add CheapHotels view and CreateToggle component - Move design tokens into Tailwind @theme in styles.css and migrate components/views to utility classes; CVLayout re-points tokens for light theme - Update README, CLAUDE.md, and .gitignore accordingly Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dphx7LL5JC8dAFYU7MMpoA
This commit is contained in:
@@ -16,6 +16,7 @@ http {
|
||||
limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;
|
||||
limit_req_zone $binary_remote_addr zone=api:10m rate=30r/s;
|
||||
limit_req_zone $binary_remote_addr zone=upload:10m rate=5r/m;
|
||||
limit_req_zone $binary_remote_addr zone=hotel_search:10m rate=3r/m;
|
||||
|
||||
log_format compact
|
||||
'$remote_addr "$request" $status rt=$request_time';
|
||||
@@ -51,7 +52,7 @@ http {
|
||||
set $upstream_gitea http://$GITEA_HOST:$GITEA_PORT;
|
||||
set $upstream_hasura http://$HASURA_HOST:$HASURA_PORT;
|
||||
set $upstream_quartz http://$QUARTZ_HOST:$QUARTZ_PORT;
|
||||
set $upstream_searxng http://$SEARXNG_HOST:$SEARXNG_PORT;
|
||||
set $upstream_python http://$PYTHON_HOST:$PYTHON_PORT;
|
||||
|
||||
location /uploads/ {
|
||||
alias /uploads/;
|
||||
@@ -176,6 +177,35 @@ http {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /py {
|
||||
return 301 /py/;
|
||||
}
|
||||
|
||||
location = /py/hotels/search {
|
||||
# Public, minutes-long upstream call with a single search slot: keep it to a few per minute per IP
|
||||
limit_req zone=hotel_search burst=2 nodelay;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
rewrite ^/py/(.*)$ /$1 break;
|
||||
proxy_pass $upstream_python;
|
||||
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;
|
||||
}
|
||||
|
||||
location /py/ {
|
||||
limit_req zone=api burst=20 nodelay;
|
||||
# Hotel search blocks for up to a few minutes while it calls Travelodge and TfL
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
rewrite ^/py/(.*)$ /$1 break;
|
||||
proxy_pass $upstream_python;
|
||||
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;
|
||||
}
|
||||
|
||||
location = /internal/auth/admin-validate {
|
||||
internal;
|
||||
@@ -190,21 +220,6 @@ http {
|
||||
return 302 /admin/login?redirect=$request_uri;
|
||||
}
|
||||
|
||||
location /searxng {
|
||||
return 301 /searxng/;
|
||||
}
|
||||
|
||||
location /searxng/ {
|
||||
auth_request /internal/auth/admin-validate;
|
||||
error_page 401 403 = @auth_denied;
|
||||
rewrite ^/searxng/(.*)$ /$1 break;
|
||||
proxy_pass $upstream_searxng;
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
@@ -219,7 +234,7 @@ http {
|
||||
set $upstream_gitea http://$GITEA_HOST:$GITEA_PORT;
|
||||
set $upstream_hasura http://$HASURA_HOST:$HASURA_PORT;
|
||||
set $upstream_quartz http://$QUARTZ_HOST:$QUARTZ_PORT;
|
||||
set $upstream_searxng http://$SEARXNG_HOST:$SEARXNG_PORT;
|
||||
set $upstream_python http://$PYTHON_HOST:$PYTHON_PORT;
|
||||
|
||||
location /uploads/ {
|
||||
alias /uploads/;
|
||||
@@ -344,6 +359,35 @@ http {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /py {
|
||||
return 301 /py/;
|
||||
}
|
||||
|
||||
location = /py/hotels/search {
|
||||
# Public, minutes-long upstream call with a single search slot: keep it to a few per minute per IP
|
||||
limit_req zone=hotel_search burst=2 nodelay;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
rewrite ^/py/(.*)$ /$1 break;
|
||||
proxy_pass $upstream_python;
|
||||
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;
|
||||
}
|
||||
|
||||
location /py/ {
|
||||
limit_req zone=api burst=20 nodelay;
|
||||
# Hotel search blocks for up to a few minutes while it calls Travelodge and TfL
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
rewrite ^/py/(.*)$ /$1 break;
|
||||
proxy_pass $upstream_python;
|
||||
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;
|
||||
}
|
||||
|
||||
location = /internal/auth/admin-validate {
|
||||
internal;
|
||||
@@ -358,21 +402,6 @@ http {
|
||||
return 302 /admin/login?redirect=$request_uri;
|
||||
}
|
||||
|
||||
location /searxng {
|
||||
return 301 /searxng/;
|
||||
}
|
||||
|
||||
location /searxng/ {
|
||||
auth_request /internal/auth/admin-validate;
|
||||
error_page 401 403 = @auth_denied;
|
||||
rewrite ^/searxng/(.*)$ /$1 break;
|
||||
proxy_pass $upstream_searxng;
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user