feat: playground static site with cursor webhook deploy

Scaffold nginx + deploy-hook stack for playground.schwenk.online,
Gitea cursor workflow, directory-based public/ content, and boka
bootstrap via git clone.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Frank Schwenk
2026-07-05 16:07:24 +02:00
commit 8cdde429f5
21 changed files with 1173 additions and 0 deletions
+92
View File
@@ -0,0 +1,92 @@
# playground
Experimentier-Site auf [playground.schwenk.online](https://playground.schwenk.online): statisches HTML, Inhalte per `@cursor` in Gitea-Issues, Auto-Deploy per Push-Webhook.
## Wie es funktioniert
1. Issue in Gitea öffnen, z. B. *„Onepager: Thema XY“*
2. Kommentar: `@cursor recherchiere zu Thema XY und generiere einen Onepager als plain HTML`
3. Gitea Action ([cursor-gitea-agent](https://gitea.schwenk.online/froxxxy/cursor-gitea-agent)) committet nach `public/<slug>/` auf `main`
4. Push-Webhook triggert `git pull` im Container-Stack → nginx liefert die Seite aus
Content-Konventionen: siehe [SOUL.md](SOUL.md).
## Repo-Layout
```
public/ # Webroot
nginx/ # nginx-Konfiguration
hooks/ # Webhook-Skripte + hooks.json.template
deploy-hook/ # Dockerfile für Webhook-Container (git pull)
compose.yml # nginx + deploy-hook auf Traefik-Netz
```
Auf boka ist `/home/frank/playground.schwenk.online` ein **Git-Clone** dieses Repos.
## Gitea (einmalig)
1. **`cursor`-Bot** als Collaborator zum Repo hinzufügen
2. **Repo-Secrets** (Namen ohne `GITEA_`-Prefix):
- `CURSOR_API_KEY` — Cursor API key
- `CURSOR_BOT_TOKEN` — Gitea API token des `cursor`-Users
3. **Push-Webhook** (Repo → Einstellungen → Webhooks):
- URL: `https://playground.schwenk.online/hooks/deploy`
- Content type: `application/json`
- Event: **Push**
- Secret: gleicher Wert wie `WEBHOOK_SECRET` in `.env` auf boka
## boka Bootstrap (einmalig)
**Automatisch** (von Arch-Dev-Rechner):
```bash
./scripts/bootstrap-boka.sh
```
Erzeugt `.env` mit zufälligem `WEBHOOK_SECRET` (Wert in der Ausgabe — für Gitea-Webhook eintragen).
**Manuell:**
ssh frank-schwenk.de
# App-Verzeichnis (Compose + Config)
git clone ssh://git@gitea.schwenk.online:2222/froxxxy/playground.git \
/home/frank/playground.schwenk.online
cd /home/frank/playground.schwenk.online
cp .env.example .env
# WEBHOOK_SECRET, DEPLOY_GIT_TOKEN, HOST_UID/HOST_GID eintragen
docker compose up -d --build
```
(Manueller Pfad endet oben bei `docker compose up -d --build`.)
**Deploy-Token:** In Gitea einen read-only Token anlegen (oder dedizierten Deploy-User), nur für `git pull` im Container.
DNS: `playground.schwenk.online` → boka (A-Record).
## Lokaler Smoke-Test (optional)
Ohne Traefik — nur prüfen ob nginx die leere `public/` ausliefert:
```bash
docker run --rm -p 8080:80 \
-v "$(pwd)/public:/usr/share/nginx/html:ro" \
-v "$(pwd)/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro" \
-v "$(pwd)/nginx/security-headers.conf:/etc/nginx/conf.d/security-headers.conf:ro" \
nginx
# curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/ → 404 (kein index.html, erwartet)
```
## Manuelles Deploy (Fallback)
```bash
ssh frank-schwenk.de
cd /home/frank/playground.schwenk.online
git pull
docker compose up -d
```
## Beispiel-URL nach erstem Onepager
`https://playground.schwenk.online/thema-xy/` — wenn Cursor `public/thema-xy/index.html` angelegt hat.