No description
- JavaScript 50.3%
- PHP 27.1%
- CSS 17.6%
- HTML 5%
| .forgejo/workflows | ||
| app/www | ||
| notes | ||
| web/www | ||
| .gitignore | ||
| README.md | ||
timedb-php
Schlanke PHP-+-Supabase-App, ausgeliefert als drei vHosts
(timedb-api/app/web.bamsenet.de) aus /home/timedb/{app,web}/www auf bnet006.
Das Frontend (web/www) spricht mit Supabase über einen serverseitigen PHP-Proxy
(web/www/php/supabase.php), damit der API-Key nie im Browser landet.
Aufbau
| Pfad | Was es ist |
|---|---|
web/www/ |
Haupt-App - HTML/CSS/JS + der Supabase-PHP-Proxy |
app/www/ |
vHost timedb-app |
api/www/ |
vHost timedb-api |
.forgejo/workflows/ |
CI/CD-Pipelines |
ops/ (nur Server) |
deploy.sh - das In-Place-Deploy-Skript |
Infrastruktur
Es gibt keinen Build-Schritt - reines PHP/JS/CSS. Der Clou ist das Deploy-Modell.
Git-in-Place: Das Repo ist direkt im Live-Docroot ausgecheckt (/home/timedb
auf bnet006). Die Produktionsdateien sind der Working-Tree, ein Deploy ist also nur
git reset --hard origin/main - kein Artefakt, kein Kopieren.
CI/CD (Forgejo Actions):
ci.yaml- lintet jeden Push/PR:php -l+ ESMnode --check.deploy.yaml- bei Push aufmainwird automatisch deployt.
Push auf main
│
▼
┌──────────────────────────┐ SSH (Forced-Command-Key)
│ Runner (Container auf │ ──────────────────────────────► timedb@bnet006
│ bnet006, CPU/RAM-limitiert)│ führt ops/deploy.sh aus
│ • php -l / node --check │ │
│ • stößt Deploy an │ ▼
└──────────────────────────┘ git reset --hard origin/main
(Live-Docroot aktualisiert)
Warum so gebaut (Sicherheit):
- Der Runner ist ein ressourcenlimitierter Container, damit CI nie ungesandboxt auf der geteilten Produktionsmaschine läuft und die anderen Dienste (Supabase, KillBill, ...) nicht ausbremsen kann.
- Das Deploy nutzt einen Forced-Command-SSH-Key (
DEPLOY_SSH_KEY, ein Forgejo-Secret), der genau eine Sache kann -ops/deploy.shalstimedbausführen. Kein weiterer Zugriff auf die Maschine. - Keine Secrets auf der Platte; der Deploy-Key liegt in Forgejo und wird nur in den Deploy-Job injiziert.
Entwicklung
Klonen, bearbeiten, committen, auf main pushen - CI lintet und die Änderung wird
automatisch deployt. Fertig.
git clone ssh://forgejo@git.b-net.cloud/Apps/timedb-php.git