- matrix: drop cryptohelper LoginAs so device.json creds aren't
invalidated on every restart by Init's re-login
- matrix: thread ctx through PostThreadedReply; bot dispatcher derives
per-command ctx from app lifecycle so SIGTERM cancels in-flight work
- matrix: isTokenValid verifies /whoami user_id matches configured one
- matrix: loadDevice distinguishes missing file from corrupt parse;
refuse to silently overwrite a corrupt device.json
- matrix: Start checks Syncer type assertion and returns error
- arr: parseLookup skips empty-title items and extracts existing id
- bot: skip Add when Result.Exists; reply "already in library"
Multi-stage alpine Dockerfile builds with -tags goolm so libolm isn't
needed at runtime. Annotated config.example.yaml documents every field
and shows ${ENV_VAR} usage for secrets. README is rewritten for the Go
bot — Python-era web-portal docs are gone.
Wire Matrix messages to the *arr clients. Dispatcher parses
"<prefix><cmd> <query>", routes movie/tv/music to Radarr/Sonarr/Lidarr,
adds the top hit, and replies in a thread. Unconfigured services reply
with a clear message instead of failing.
Adds internal/arr with a shared HTTP layer and per-service clients that
look up candidates and POST the chosen one back with monitored=true and
search-on-add enabled. Lidarr requires metadata_profile_id, now part of
ArrConfig and validated when lidarr is set.
Adapted from Pete: password login + device persistence, cryptohelper
with cross-signing bootstrap, sync loop with auto-join on invite, and
PostThreadedReply for command responses. Messages outside allowed_rooms
are dropped.
Pivot from FastAPI web portal to a Matrix command bot (modeled on Pete).
Users will issue !movie / !tv / !music commands in allowlisted rooms; the
bot performs a top-hit search against Radarr/Sonarr/Lidarr and adds it.
This commit is session 1 of a multi-session rewrite (see SESSION_PLAN.md):
- Delete app/, requirements.txt, old Dockerfile, .env.example
- Add go.mod (mautrix-go + yaml.v3)
- Add internal/config: YAML loader with ${ENV} expansion, validates
matrix creds, allowed_rooms, and per-service *arr config
- Reset .gitignore / .dockerignore for the Go layout
If the env var is unset, a random key is generated at startup. This
removes a manual setup step. The README and .env.example are updated
to reflect that the variable is now optional (but recommended in
production for session persistence across restarts).
https://claude.ai/code/session_018iMt5qm4j9bk8wzytLC3E6