Deployment: Installationsskript und Variante Nginx Proxy Manager
- deploy/install.sh: Installation/Update in einem Schritt (--proxy-ip oder --caddy), ufw-Regel nur für die Proxy-IP, Funktionsprüfung am Ende - it-connect.service: Bind-Adresse, Port und vertrauenswürdige Proxy-IP aus .env, Start nach network-online.target - .env.example und SETUP.md 7.0 ergänzt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ad0fa6ff8a
commit
af63841249
4 files changed
+181
-5
No files matched your search
@@ -5,7 +5,8 @@
|
||||
|
||||
[Unit]
|
||||
Description=it-connect (FastAPI)
|
||||
After=network.target
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
@@ -13,11 +14,13 @@ User=itconnect
|
||||
Group=itconnect
|
||||
WorkingDirectory=/opt/it-connect/backend
|
||||
EnvironmentFile=/opt/it-connect/.env
|
||||
# Nur lokal lauschen: von außen ist die App ausschließlich über Caddy (HTTPS) erreichbar.
|
||||
# uvicorn übernimmt die Client-IP aus X-Forwarded-For nur von 127.0.0.1 (Caddy).
|
||||
# Adresse, Port und Proxy-IP kommen aus der .env:
|
||||
# Caddy auf demselben Server: IT_CONNECT_BIND_HOST=127.0.0.1, IT_CONNECT_PROXY_IPS=127.0.0.1
|
||||
# Externer Proxy (z. B. NPM): IT_CONNECT_BIND_HOST=<eigene LAN-IP>, IT_CONNECT_PROXY_IPS=<Proxy-IP>
|
||||
# uvicorn übernimmt die Client-IP aus X-Forwarded-For nur von IT_CONNECT_PROXY_IPS.
|
||||
ExecStart=/opt/it-connect/.venv/bin/uvicorn app.main:app \
|
||||
--host 127.0.0.1 --port 8000 \
|
||||
--proxy-headers --forwarded-allow-ips 127.0.0.1 \
|
||||
--host ${IT_CONNECT_BIND_HOST} --port ${IT_CONNECT_PORT} \
|
||||
--proxy-headers --forwarded-allow-ips ${IT_CONNECT_PROXY_IPS} \
|
||||
--no-server-header
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
|
||||
Reference in new issue
Block a user