koopa-admin-log/2026/2026-07-09--bonfire-ground-zero.md

57 lines
1.9 KiB
Markdown

# Bonfire ground zero + FOSS posts + gitbot (2026-07-09)
## Stack
| Item | Value |
|------|--------|
| Path | `/home/hernani/koopa-bonfire/` |
| Containers | `koopa-bonfire`, `koopa-bonfire-db` |
| Port | **9021** → Caddy `bonfire.hacktivism.ch` |
| Image | `bonfirenetworks/bonfire:1.0.5-social-amd64` |
| Env | secrets **64** chars; `DB_MIGRATE_INDEXES_CONCURRENTLY=false` |
Ground zero: wiped volume + dir, clean migrate (import_me `20200828094944` applied, ~109 migrations, identity tables present).
## Accounts
| Login | Role |
|-------|------|
| `foss` / `foss@bonfire.hacktivism.ch` | FOSS posts |
| character `gitbot` | same account (multi-profile) |
Passwords: `/home/hernani/koopa-bonfire/users.env` (mode 600).
Public: https://bonfire.hacktivism.ch/
## FOSS posts (as @foss)
Topics: NGI0 dossiers, SM dossier, Castopod pilot, git.ngi-0.eu, four freedoms — linking **https://dossiers.ngi-0.eu/** and **https://git.ngi-0.eu/**.
## Commit mirror bot
- Script: `~/koopa-bonfire/bin/gitbot-mirror.py`
- State: `~/koopa-bonfire/gitbot-state.json` (seen SHAs)
- Loop: every **300s**, pidfile `~/koopa-bonfire/gitbot.pid`, log `~/koopa-bonfire/gitbot.log`
- Source: Forgejo API `https://git.ngi-0.eu/api/v1/repos/search` + `…/commits`
```bash
# status
ps -p "$(cat ~/koopa-bonfire/gitbot.pid)" -o pid,cmd
tail -20 ~/koopa-bonfire/gitbot.log
# one-shot
python3 ~/koopa-bonfire/bin/gitbot-mirror.py
# restart loop
kill "$(cat ~/koopa-bonfire/gitbot.pid)"; \
nohup python3 ~/koopa-bonfire/bin/gitbot-mirror.py --loop >>~/koopa-bonfire/gitbot.log 2>&1 & \
echo $! >~/koopa-bonfire/gitbot.pid
```
Note: occasional `URI.parse/1` errors on some commit messages (special chars / URLs); bot skips and retries later.
## Lessons
- First boot needs **≥64-byte** `SECRET_KEY_BASE`.
- Migrations: **`DB_MIGRATE_INDEXES_CONCURRENTLY=false`** on empty DB (avoids concurrent index in txn).
- Partial DB → wipe volume and ground zero rather than patch half-migrated state.