- HTML 43.9%
- Python 42.9%
- Shell 13.2%
|
|
||
|---|---|---|
| config | ||
| gemini | ||
| templates | ||
| www | ||
| .env.example | ||
| .gitignore | ||
| app.py | ||
| provision.sh | ||
| README.md | ||
| setup.sh | ||
debster — Gemini Capsule Registration System
Self-service subdomain registration for [naam].gemini.debster.nl.
How it works
- User visits
https://debster.nl/claim→ fills in subdomain, email, SSH key - Verification email sent via Postmark (or logged if token is
PLACEHOLDER) - User clicks verify link → capsule is automatically provisioned:
- Linux user created (
/usr/sbin/nologinshell,gemini-usersgroup) - SSH key installed → SFTP-only access
- Directory
/var/gemini/[subdomain].gemini.debster.nl/created - Welcome
index.gmiwritten - Self-signed TLS cert generated (10 years)
- Molly Brown VirtualHost appended + service restarted
- Linux user created (
Upload files
scp myfile.gmi alice@debster.nl:/
Stack
- Python 3 + Flask
- SQLite (
/opt/debster/debster.db) - Molly Brown (Gemini server)
- Nginx (HTTP → Flask proxy for
/claim,/check-subdomain,/verify/*) - Postmark (email)
Config
Copy .env.example to .env and set values:
POSTMARK_TOKEN=your-token-here
SECRET_KEY=random-64-char-hex
When POSTMARK_TOKEN=PLACEHOLDER, emails are logged to /var/log/debster-emails.log instead.
Deployment
systemctl enable --now debster-app
Service file: /etc/systemd/system/debster-app.service
Anti-abuse
- Max 1 verified capsule per email address
- Max 1 verified capsule per IP address
- Verification link expires after 24 hours
- Subdomain blacklist (admin, www, mail, …)
- Format:
a-z0-9-, 3–32 chars, no leading/trailing dash
Real-time availability check
The claim form calls /check-subdomain?name=xxx (debounced, 400 ms) while the
user types. Blacklisted names are rejected client-side instantly, without a
server round-trip. The submit button stays disabled until the subdomain is
confirmed available.
Forgejo — Push Status
Repo niet aangemaakt — de API-token heeft onvoldoende rechten.
Fout: token does not have at least one of required scope(s): [write:user]
De git repo is klaar in /opt/debster/ (commit 79eee54). Zodra een token met
de juiste scope beschikbaar is:
# 1. Maak repo aan via Forgejo web UI, of met een token met write:repository scope:
curl -X POST \
-H "Authorization: token <NIEUW_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name":"debster","description":"Gemini capsule registration system","private":false}' \
http://forgejo.internalcorp/api/v1/user/repos
# 2. Push (token al geconfigureerd in remote URL)
cd /opt/debster
git remote set-url origin "http://claude:<NIEUW_TOKEN>@forgejo.internalcorp/claude/debster.git"
git push -u origin main
Benodigde token-scope in Forgejo:
Settings → Applications → Generate token → vink aan: Repository (Read & Write)