Fix TTYD base path and App config

This commit is contained in:
2025-12-25 16:37:39 +01:00
parent f66aa8c6b3
commit 971996cec7
2 changed files with 57 additions and 4 deletions

View File

@@ -60,14 +60,67 @@ location /api/docs {
# Terminal (TTYD)
location /terminal/ {
proxy_pass http://127.0.0.1:7681;
# Basic-Auth (Uncomment if /etc/nginx/.htpasswd exists)
# auth_basic "Crumbforest Terminal";
# auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://127.0.0.1:7681/; # Trailing slash is important for TTYD base path
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 86400; # Long timeout for terminal sessions
proxy_send_timeout 86400;
}
# Gitea / Git
location /git/ {
proxy_pass http://127.0.0.1:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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;
client_max_body_size 512M; # Allow large pushes
}
# Qdrant Dashboard & API
location = /qdrant { return 301 /qdrant/; }
location /qdrant/ {
proxy_pass http://127.0.0.1:6333/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Prefix /qdrant;
proxy_read_timeout 300;
# Body decompression for sub_filter
proxy_set_header Accept-Encoding "";
# Rewrites for Dashboard Assets (SPA)
sub_filter_once off;
sub_filter '="/dashboard/' '="/qdrant/dashboard/';
sub_filter "='/dashboard/" "'=/qdrant/dashboard/";
sub_filter '="/dashboard' '="/qdrant/dashboard';
sub_filter "='/dashboard" "'=/qdrant/dashboard";
# OpenAPI & Telemetry
sub_filter '="/openapi.json' '="/qdrant/openapi.json';
sub_filter "='/openapi.json" "'=/qdrant/openapi.json";
sub_filter '="/telemetry' '="/qdrant/telemetry';
sub_filter "='/telemetry" "'=/qdrant/telemetry";
}
# Qdrant Fallbacks (if dashboard requests root assets)
location = /openapi.json { proxy_pass http://127.0.0.1:6333/openapi.json; }
location /telemetry { proxy_pass http://127.0.0.1:6333/telemetry; }
location = /dashboard { return 301 /qdrant/dashboard/; }
location /dashboard/ { proxy_pass http://127.0.0.1:6333/dashboard/; }
# Health check (internal monitoring)
location /health {
proxy_pass http://crumbforest_backend;
@@ -87,5 +140,5 @@ server_tokens off;
access_log /var/log/nginx/crumbforest.access.log;
error_log /var/log/nginx/crumbforest.error.log;
# File upload size limit (adjust if needed)
client_max_body_size 10M;
# File upload size limit
client_max_body_size 512M; # Increased for Git

View File

@@ -90,7 +90,7 @@ WorkingDirectory=$HOME_DIR
# -W: writable (client can write to pty) - default true
# -p 7681: port
# bash: the command to run
ExecStart=/usr/local/bin/ttyd -p 7681 -u 1000 -g 1000 -W bash
ExecStart=/usr/local/bin/ttyd -p 7681 -b /terminal -u 1000 -g 1000 -W bash
Restart=always
RestartSec=3