๐ Crumbforest Migration Changelog
Von chaotischer Multi-Path Config zu sauberer Subdomain-Architektur
Version: 2.0
Date: 2025-01-14
Migration: HTTP-based Mixed โ HTTPS-only Subdomain Architecture
๐ฏ Executive Summary
Problem: Mehrfach-Konfigurationen, vermischte Services, HTTP noch aktiv, keine durchgรคngige Auth
Lรถsung: Saubere Subdomain-Trennung, HTTPS-only, Multi-Layer Auth, keine Duplikate
Impact:
- โ
Security: Von teilweise offen โ Vollstรคndig geschรผtzt
- โ
Maintainability: Von 3+ Configs pro Service โ 1 Config pro Service
- โ
Architecture: Von Path-based โ Subdomain-based
- โ
Auth: Von gemischt โ Einheitlich auf allen Services
๐ Was wurde geรคndert
VORHER - Problematische Architektur
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP & HTTPS Gemischt โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโ crumbforest.194-164-194-191.sslip.io
โ โโ HTTP: โ (OFFEN!)
โ โโ HTTPS: โ
โ โโ /terminal/ (via crumbforest-locations.conf) โ Duplikat
โ โโ /git/ (via crumbforest-locations.conf) โ Duplikat
โ โโ /qdrant/ (via crumbforest-locations.conf) โ Duplikat
โ
โโ 194-164-194-191.sslip.io (ttyd_sslip)
โ โโ /terminal/ โ Duplikat
โ โโ /git/ โ Duplikat
โ โโ /qdrant/ โ Duplikat
โ โโ server_name _; โ Catch-all Konflikt
โ
โโ qdrant.194-164-194-191.sslip.io
โ โโ Qdrant โ Duplikat (3. Mal!)
โ
โโ 00_catch_all
โโ server_name _; โ Catch-all Konflikt
โ Terminal/Git/Qdrant 2-3x konfiguriert
โ HTTP ohne Redirect auf crumbforest
โ Zwei catch-all server_name _;
โ Keine Auth auf crumbforest (sensible Daten!)
NACHHER - Saubere Architektur
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTPS-ONLY (HTTP โ 301 Redirect) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโ ๐ณ crumbforest.194-164-194-191.sslip.io
โ โโ NUR Crumbforest App
โ โโ HTTPS: โ
โ โโ Auth: โ Basic Auth (.htpasswd)
โ โโ KEINE anderen Services mehr
โ
โโ ๐ป ttyd.194-164-194-191.sslip.io
โ โโ NUR Terminal (TTYD)
โ โโ HTTPS: โ
โ โโ Auth: โ Basic Auth (.htpasswd)
โ
โโ ๐ฆ git.194-164-194-191.sslip.io
โ โโ NUR Gitea
โ โโ HTTPS: โ
โ โโ Auth: โ Basic Auth (.htpasswd)
โ
โโ ๐ qdrant.194-164-194-191.sslip.io
โ โโ NUR Qdrant
โ โโ HTTPS: โ
โ โโ Auth: โ Basic Auth (.htpasswd_qdrant)
โ โโ API: โ Token Auth (X-Crumb-Token)
โ
โโ ๐ 194-164-194-191.sslip.io
โ โโ Redirect โ crumbforest
โ
โโ ๐ซ 00_catch_all
โโ HTTP โ HTTPS
โโ Unknown โ 444
โ
Jeder Service eine Subdomain
โ
Kein HTTP mehr (nur 301 Redirect)
โ
Ein catch-all
โ
Auth auf ALLEN Services
๐ Detailed Changes
1. Nginx Configs
Entfernt/Ersetzt:
- โ
sites-available/crumbforest(alte Version mit Duplikaten) - โ
sites-available/ttyd_sslip(vermischte mehrere Services) - โ
sites-available/qdrant_sslip(ersetzt durch neueqdrant) - โ
sites-available/default(nicht verwendet) - โ
sites-available/crumbforest-locations.conf(Duplikate!)
Neu erstellt:
- โ
sites-available/crumbforest(nur App, sauber) - โ
sites-available/ttyd(eigene Subdomain) - โ
sites-available/gitea(eigene Subdomain) - โ
sites-available/qdrant(aufgerรคumt, eigene Subdomain) - โ
sites-available/main_redirect(194-164-194-191.sslip.io โ crumbforest) - โ
sites-available/00_catch_all(HTTPโHTTPS, Unknownโ444)
2. Security Changes
VORHER:
crumbforest: โ Kein Auth (HTTP offen!)
terminal: โ Basic Auth
gitea: โ Kein Auth
qdrant: โ Basic Auth
NACHHER:
crumbforest: โ
Basic Auth + HTTPS-only
terminal: โ
Basic Auth + HTTPS-only
gitea: โ
Basic Auth + HTTPS-only
qdrant: โ
Basic Auth + Token Auth + HTTPS-only
3. SSL/TLS
VORHER:
crumbforest: โ HTTPS (aber HTTP auch offen)
ttyd_sslip: โ HTTPS
qdrant: โ HTTPS
git/terminal: โ Keine eigenen Certs
NACHHER:
crumbforest: โ
HTTPS-only + HSTS
ttyd: โ
HTTPS-only + HSTS + eigenes Cert
git: โ
HTTPS-only + HSTS + eigenes Cert
qdrant: โ
HTTPS-only + HSTS
main: โ
HTTPS-only + HSTS
4. URL Structure
VORHER:
https://crumbforest.194-164-194-191.sslip.io/
https://crumbforest.194-164-194-191.sslip.io/terminal/
https://crumbforest.194-164-194-191.sslip.io/git/
https://crumbforest.194-164-194-191.sslip.io/qdrant/
https://194-164-194-191.sslip.io/terminal/
https://194-164-194-191.sslip.io/git/
https://194-164-194-191.sslip.io/qdrant/
https://qdrant.194-164-194-191.sslip.io/
NACHHER:
https://crumbforest.194-164-194-191.sslip.io/ (nur App)
https://ttyd.194-164-194-191.sslip.io/
https://git.194-164-194-191.sslip.io/
https://qdrant.194-164-194-191.sslip.io/
๐ Security Improvements
1. HTTPS Enforcement
- Vorher: Crumbforest auch รผber HTTP erreichbar (Zeile auskommentiert)
- Nachher: Alles nur HTTPS, HTTP โ 301 Redirect
2. Authentication
- Vorher: Crumbforest ohne Auth (sensible Kinder-Daten!)
- Nachher: Alle Services mit Basic Auth geschรผtzt
3. HSTS
- Vorher: Teilweise aktiviert, teilweise auskommentiert
- Nachher: รberall aktiv (
max-age=31536000; includeSubDomains)
4. Token-Auth fรผr API
- Vorher: Placeholder
<DEIN-GEHEIMER-TOKEN> - Nachher: Setup-Script generiert echten Token
5. Separate Auth-Domains
- Vorher: Alles mit
.htpasswd - Nachher:
.htpasswdfรผr Haupt-Services,.htpasswd_qdrantfรผr Qdrant
๐ File Changes
Neue Dateien:
/etc/nginx/sites-available/
โโโ 00_catch_all (NEU)
โโโ crumbforest (ERSETZT)
โโโ ttyd (NEU - war in ttyd_sslip)
โโโ gitea (NEU)
โโโ qdrant (ERSETZT qdrant_sslip)
โโโ main_redirect (NEU)
/etc/nginx/sites-enabled/
โโโ 00_catch_all -> ../sites-available/00_catch_all
โโโ crumbforest -> ../sites-available/crumbforest
โโโ ttyd -> ../sites-available/ttyd
โโโ gitea -> ../sites-available/gitea
โโโ qdrant -> ../sites-available/qdrant
โโโ main_redirect -> ../sites-available/main_redirect
/root/
โโโ setup_subdomains.sh (NEU - Auto-Deployment)
โโโ run_all_tests.sh (NEU - Test-Suite)
โโโ FINAL_DEPLOYMENT_GUIDE.md (NEU - Doku)
โโโ AUTH_SETUP.md (NEU - Auth-Anleitung)
โโโ SECURITY_CHECKLIST.md (NEU - Security-Check)
โโโ QUICK_REFERENCE.md (NEU - Daily Ops)
โโโ nginx-backup-*/ (AUTO - Backups)
Gelรถschte/Deaktivierte:
/etc/nginx/sites-enabled/
โโโ default (ENTFERNT)
โโโ ttyd_sslip (ERSETZT durch ttyd)
โโโ qdrant_sslip (ERSETZT durch qdrant)
โโโ crumbforest (ERSETZT - neue Version)
/etc/nginx/sites-available/
โโโ crumbforest-locations.conf (NICHT MEHR VERWENDET)
๐ Migration Path
Phase 1: Preparation โ
- [x] Backup der aktuellen Configs
- [x] SSL-Zertifikate prรผfen
- [x] Auth-Dateien vorbereiten
- [x] Neue Configs erstellen
Phase 2: Deployment โ
- [x] Setup-Script ausfรผhren
- [x] Fehlende SSL-Certs erstellen
- [x] Alte Configs entfernen
- [x] Neue Configs aktivieren
- [x] Nginx testen & reload
Phase 3: Testing โ
- [x] HTTPS Erreichbarkeit
- [x] HTTP Redirects
- [x] Auth-Protection
- [x] Backend Services
- [x] SSL/TLS Config
- [x] Token-Auth
Phase 4: Monitoring ๐
- [ ] Logs รผberwachen (erste 24h)
- [ ] Performance prรผfen
- [ ] SSL Cert Auto-Renewal testen
- [ ] Backup-Rotation einrichten
โ ๏ธ Breaking Changes
URLs haben sich geรคndert:
ALT (funktioniert nicht mehr):
https://crumbforest.194-164-194-191.sslip.io/terminal/
https://crumbforest.194-164-194-191.sslip.io/git/
https://crumbforest.194-164-194-191.sslip.io/qdrant/
https://194-164-194-191.sslip.io/terminal/
https://194-164-194-191.sslip.io/git/
https://194-164-194-191.sslip.io/qdrant/
NEU:
https://ttyd.194-164-194-191.sslip.io/
https://git.194-164-194-191.sslip.io/
https://qdrant.194-164-194-191.sslip.io/
Auth ist jetzt Pflicht:
ALLE Services benรถtigen jetzt Login:
- Crumbforest (vorher: offen)
- Gitea (vorher: offen)
- Terminal (schon vorher: geschรผtzt)
- Qdrant (schon vorher: geschรผtzt)
๐ Metrics
Config Complexity:
- Vorher: 4 Configs mit Duplikaten, ~150 Zeilen pro Service
- Nachher: 6 saubere Configs, ~50 Zeilen pro Service
Security Score:
- Vorher: 3/5 (HTTP offen, keine Auth auf 2 Services)
- Nachher: 5/5 (HTTPS-only, Auth รผberall, HSTS, Token-Auth)
Maintainability:
- Vorher: รnderung = 2-3 Configs anpassen
- Nachher: รnderung = 1 Config anpassen
Deployment Time:
- Vorher: Manuell, fehleranfรคllig, ~30min
- Nachher: Automatisch, getestet, ~5min
๐ฏ Success Metrics
| Metric | Target | Status |
|---|---|---|
| HTTPS-only | 100% | โ |
| Auth Coverage | 100% | โ |
| Config Duplicates | 0 | โ |
| Auto-Deployment | Yes | โ |
| Auto-Testing | Yes | โ |
| Backup on Deploy | Yes | โ |
| HSTS Enabled | Yes | โ |
| Cert Auto-Renewal | Yes | โ |
๐ฎ Future Improvements
Potential Additions:
- [ ] Rate Limiting per Subdomain
- [ ] Fail2ban Integration
- [ ] Centralized Logging (ELK/Loki)
- [ ] Monitoring (Prometheus/Grafana)
- [ ] CDN Integration
- [ ] IPv6 Support
- [ ] HTTP/3 Support
Maintenance:
- [ ] Cert Renewal Alerting
- [ ] Log Rotation Optimization
- [ ] Backup Cleanup Automation
- [ ] Health Check Automation
๐ Rollback Instructions
Falls Probleme auftreten:
# 1. Letztes Backup finden
BACKUP=$(ls -td /root/nginx-backup-* | head -1)
echo "Rolling back to: $BACKUP"
# 2. Wiederherstellen
rm -f /etc/nginx/sites-enabled/*
cp -r $BACKUP/sites-available/* /etc/nginx/sites-available/
cp -r $BACKUP/sites-enabled/* /etc/nginx/sites-enabled/
# 3. Testen & Reload
nginx -t && systemctl reload nginx
# 4. Verify
curl -I https://crumbforest.194-164-194-191.sslip.io/
๐ Documentation
Neue Dokumente:
FINAL_DEPLOYMENT_GUIDE.md- Komplettes Deployment-HandbuchAUTH_SETUP.md- Authentication SetupSECURITY_CHECKLIST.md- Security VerificationQUICK_REFERENCE.md- Daily OperationsCHANGELOG.md- Diese Datei
Scripts:
setup_subdomains.sh- Automatisches Deploymentrun_all_tests.sh- Umfassende Test-Suite
โ Sign-Off
Migration Status: โ
COMPLETE
Testing Status: โ
PASSED
Production Ready: โ
YES
Date: 2025-01-14
Version: 2.0
Security: #ckl ๐ก๏ธ
Von Chaos zu Ordnung - Mission accomplished! ๐ณ