Skip to content

Self-host on k3s with mycelium OAuth2 (proof-of-tap) as sole entry #11

Description

@midineutron

Containerize Crate and run it on k3s, with mycelium as the sole front door via OAuth2 proof-of-tap. Crate becomes a registered OAuth client.

Auth model

  • Tag scan -> mycelium OAUTH2 mapping -> https://<host>/auth/callback?code= -> crate-auth exchanges at /oauth/token (client_secret) -> validates JWT vs cached JWKS -> mints 30-day self-signed HMAC session cookie.
  • No session -> decoy HTTP 502 page; silently listens for konami -> mints same self-signed session (personal backdoor, accepted).
  • Traefik forwardAuth checks only the HMAC cookie; gating is network-only (offline PWA cache intentional).

Storage

  • Synology NAS over NFS -> NFS-backed PV; nginx serves /manifest.json, /audio, /artwork read-only.

Infra

  • k3s + Traefik forwardAuth + cert-manager (Let's Encrypt). Hostname templated. Images -> public ghcr, built/pushed by GH Actions. mycelium already on-cluster.

Out of scope

  • mycelium code changes; AWS tooling + terraform left intact (parallel path).

Acceptance criteria

  • 1. docker build works; npm run build runs inside; nginx serves dist/ on start
  • 2. No valid session -> decoy 502 page (no shell/media leaked)
  • 3. Decoy konami -> hidden endpoint -> self-signed session -> full app
  • 4. OAUTH2 tag scan -> callback -> token exchange -> JWT vs JWKS -> session -> app loads
  • 5. With either session, manifest/audio/artwork return 200; audio plays (range requests)
  • 6. Bad/expired/absent credential -> decoy 502; JWT vs JWKS; session via HMAC
  • 7. Catalog served from NFS PV, not baked into image
  • 8. TLS via cert-manager at Traefik for the host
  • 9. GH Actions builds + pushes both images to ghcr on push
  • 10. README documents build, ghcr, manifests, NAS/NFS layout, client + tag registration

Tier: swarm:med

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions