Add data management, randomized HTML drip and public README
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3671019e60
commit
f5d8ca7484
46 files changed
+1601
-172
No files matched your search
@@ -0,0 +1,44 @@
|
||||
# Personal deployment: Unraid
|
||||
|
||||
This folder is Tom's own setup. It is kept as an example; the main [README](../../README.md)
|
||||
describes a generic installation.
|
||||
|
||||
Every push to `main` (except docs and `.md` files) runs `.gitea/workflows/deploy.yml` on the
|
||||
act_runner on Unraid: it builds the image, pushes it to
|
||||
`gitea.anticarnist.de/tom/flypaper` (`:latest` and `:<short-sha>`), deploys
|
||||
`deploy/unraid/compose.yaml` and waits for `/health`. A manual run is possible from the Actions
|
||||
tab (`workflow_dispatch`).
|
||||
|
||||
## Secrets
|
||||
|
||||
Gitea → repo → Settings → Actions → Secrets:
|
||||
|
||||
| Secret | Purpose |
|
||||
|---|---|
|
||||
| `REGISTRY_USER` | Registry username |
|
||||
| `REGISTRY_TOKEN` | Gitea access token with `package:write` (not the password) |
|
||||
| `FLYPAPER_ADMIN_PASSWORD` | Dashboard login password |
|
||||
|
||||
## Data
|
||||
|
||||
`/mnt/user/appdata/flypaper` on Unraid, mounted as `/data`:
|
||||
|
||||
- `flypaper.db`: trap events and the settings saved in the dashboard
|
||||
- `keys/`: Data Protection keys, so logins survive a restart
|
||||
- `geoip/`: DB-IP databases, downloaded on first start and refreshed monthly
|
||||
|
||||
The container runs as UID 1654. The workflow creates the folder and sets its owner on every
|
||||
deploy.
|
||||
|
||||
## Access
|
||||
|
||||
- Dashboard: `http://192.168.1.14:44307` (LAN only, login with `FLYPAPER_ADMIN_PASSWORD`)
|
||||
- Trap: NPM forwards to `flypaper:8080` over `proxynet`. Every Host header other than the
|
||||
dashboard host lands in the trap, as do the trap paths on known hosts.
|
||||
- `/health` answers only to private addresses; from public addresses it is a trap like any
|
||||
other path.
|
||||
|
||||
## Rollback
|
||||
|
||||
Pin the image in `compose.yaml` to a previous `:<short-sha>` and push, or deploy that tag
|
||||
manually on Unraid.
|
||||
@@ -0,0 +1,48 @@
|
||||
# Tom's production stack on Unraid -- a personal deployment, not needed to run
|
||||
# Flypaper elsewhere (see the README for a generic setup). Deployed as is by
|
||||
# .gitea/workflows/deploy.yml, not pasted into the Compose Manager.
|
||||
#
|
||||
# NPM reaches the trap as flypaper:8080 over the external network proxynet (default
|
||||
# site for unknown hosts, trap paths on the real domains). The dashboard is reached
|
||||
# from the LAN on the host port: http://192.168.1.14:44307.
|
||||
#
|
||||
# `restart: always`, not `unless-stopped`: Unraid stops every container explicitly
|
||||
# when Docker or the array goes down, and `unless-stopped` treats that as a manual
|
||||
# stop -- the trap would stay down after a reboot.
|
||||
|
||||
name: flypaper
|
||||
|
||||
services:
|
||||
flypaper:
|
||||
image: gitea.anticarnist.de/tom/flypaper:latest
|
||||
container_name: flypaper
|
||||
restart: always
|
||||
ports:
|
||||
- "44307:8080"
|
||||
environment:
|
||||
TZ: Europe/Berlin
|
||||
# The dashboard host. Every other Host header lands in the trap.
|
||||
Flypaper__Http__KnownHosts__0: 192.168.1.14
|
||||
# Subnet of proxynet: only NPM may set X-Forwarded-For / X-Real-IP.
|
||||
Flypaper__Http__TrustedProxies__0: 172.19.0.0/16
|
||||
# From the repository secret, never in the repo.
|
||||
Flypaper__Admin__Password: ${FLYPAPER_ADMIN_PASSWORD:?FLYPAPER_ADMIN_PASSWORD is not set}
|
||||
volumes:
|
||||
# SQLite database and Data Protection keys. Owned by the image's app user
|
||||
# (UID 1654); the deploy workflow creates the folder and sets the owner.
|
||||
- /mnt/user/appdata/flypaper:/data
|
||||
networks:
|
||||
- proxynet
|
||||
healthcheck:
|
||||
# The image has neither curl nor wget; bash's /dev/tcp does the request.
|
||||
# /health from loopback is exempt from the trap.
|
||||
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/8080 && printf 'GET /health HTTP/1.0\\r\\nHost: localhost\\r\\n\\r\\n' >&3 && head -n 1 <&3 | grep -q ' 200 '"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
start_period: 10s
|
||||
retries: 3
|
||||
|
||||
networks:
|
||||
proxynet:
|
||||
# Created once on Unraid and shared with NPM.
|
||||
external: true
|
||||
Reference in new issue
Block a user