trails/openspec/changes/self-hosting-guide/proposal.md
Ullrich Schäfer 5dd4968626 docs+openspec: prior-art research (Organic Maps, Endurain, wanderer) and 15 proposals
Add docs/inspirations.md as the durable record of the 2026-07-05/06
prior-art research — per-project learnings with source paths, canonical
credit lines, and the changes each spawned — and extend the
acknowledgment lists in philosophy.md/architecture.md (Organic Maps,
Endurain, wanderer).

New OpenSpec changes (proposal/design/specs/tasks each):
- Organic Maps: elevation-profile-hardening, gpx-parser-robustness,
  hiking-time-estimate, poi-index, hiking-foot-profile
- Endurain: account-export, activity-duplicate-review,
  fit-parsing-hardening, activity-locations, self-hosting-guide,
  activity-privacy-controls
- wanderer: federation-hardening, link-share-tokens
- credits-page (user-visible acknowledgments)

Updated in-flight changes with wanderer prior-art sections:
route-federation, route-discovery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 07:23:00 +02:00

2.6 KiB

Why

trails.cool's identity is "federated, self-hostable" — but the repo only documents the flagship deployment (SOPS-encrypted secrets, two-host topology, full monitoring stack). A third party wanting to run an instance has no entry point: no minimal compose file, no environment-variable reference, no backup or upgrade guidance. Endurain (reviewed 2026-07-06) shows the bar for a self-hosted fitness app: three compose variants, a ~45-variable documented env table, reverse-proxy recipes, and Docker-secrets support. Federation is only real if other people can actually stand up instances.

What Changes

  • New docs/self-hosting.md: prerequisites, quick start, the environment-variable reference table (every variable with default / required / description), reverse-proxy guidance (Caddy example), upgrade procedure (image tags + drizzle migrations), backup & restore (Postgres dump + media store + what not to back up), and scaling notes.
  • New minimal operator compose at infrastructure/examples/docker-compose.selfhost.yml: journal + planner + PostgreSQL/PostGIS + BRouter, plain .env file (no SOPS), single host, no monitoring stack — with an accompanying .env.example documenting the minimal variable set.
  • A secrets variant documented inline (Docker file-based secrets for DB password and app keys), following Endurain's pattern.
  • BYO provider credentials documented: how a self-hosted instance registers its own Wahoo (and later Garmin/COROS) developer app and configures redirect URIs — the connected-services features are per-instance, not flagship-only.
  • CI smoke check: the example compose must boot and pass health checks so it can't rot (extends the existing journal image smoke-test approach).
  • Not in scope: Kubernetes/Helm, managed-DB recipes, automated backup tooling, and multi-instance federation operations guides (allowlists/moderation — future).

Capabilities

New Capabilities

  • self-hosting: The supported third-party deployment surface — minimal compose, documented env contract, upgrade/backup procedures, and the CI guarantee that the example deployment boots.

Modified Capabilities

Impact

  • docs/self-hosting.md (new), linked from README and docs/architecture.md.
  • infrastructure/examples/docker-compose.selfhost.yml + .env.example (new).
  • .github/workflows: compose smoke job (boot, wait healthy, hit health endpoints, planner loads).
  • Possible small app fixes surfaced by the exercise (env defaults that assume flagship values) — folded in as found.