Source: polls Navidrome getNowPlaying every 10 s as a non-admin lotus-nowplaying user, direct to 10.10.10.28:4533. Navidrome is the scrobbling master and Dropped Needle passes the listener through (log confirmed user=jared via player="droppedneedle [DroppedNeedleApp]"), so entries carry SSO usernames. The droppedneedle service user is ignored.
Auth: Matrix OpenID token → Synapse /_matrix/federation/v1/openid/userinfo (verified to answer locally), cached about 10 min.
Matrix → SSO username: the server-only users.json override first (Jeff, Ben and Cole have no email on their SSO link), then the admin API: email <u>@lotusguild.org, or the legacy plain-username external ID. Authelia opaque UUIDs are explicitly ignored.
Opt-in: off by default, stored in /var/lib/lotus-now-playing/state.json, written atomically.
API:
GET/PUT /v1/me
GET /v1/users?ids= (up to 50; only opted-in, matched, playing users)
GET /v1/cover/<id>: no auth, but only for covers an opted-in user is playing right now
Never logs titles, artists or tokens. Request logging is off because paths carry user IDs.
Tests
18 unit tests: python3 -m unittest now-playing/test_lotus_now_playing.py.
Local HTTP smoke test (fake Navidrome/Synapse):
401 without a token;
empty until opt-in;
400 on a bad PUT;
cover 404 until shared and for anyone not sharing;
CORS headers present.
ruff is clean and now runs on now-playing/ in CI.
Not done yet (needs approval)
Create the Navidrome user lotus-nowplaying (non-admin; navidrome user create) and /etc/lotus-now-playing/env. My attempt was blocked by the permission check.
Write /etc/lotus-now-playing/users.json, run now-playing/install.sh, add the NPM /now-playing/ location (Advanced config plus 49.conf).
Backend for LotusGuild/cinny#491 (Discord/Spotify-style "Listening to"). The client side is in the cinny PR.
## What it does
`now-playing/lotus_now_playing.py`: stdlib Python, `lotus-now-playing.service`, LXC 151 `:8072`, NPM `/now-playing/`.
- **Source:** polls Navidrome `getNowPlaying` every 10 s as a non-admin `lotus-nowplaying` user, direct to `10.10.10.28:4533`. Navidrome is the scrobbling master and Dropped Needle passes the listener through (log confirmed `user=jared` via `player="droppedneedle [DroppedNeedleApp]"`), so entries carry SSO usernames. The `droppedneedle` service user is ignored.
- **Auth:** Matrix OpenID token → Synapse `/_matrix/federation/v1/openid/userinfo` (verified to answer locally), cached about 10 min.
- **Matrix → SSO username:** the server-only `users.json` override first (Jeff, Ben and Cole have no email on their SSO link), then the admin API: email `<u>@lotusguild.org`, or the legacy plain-username external ID. Authelia opaque UUIDs are explicitly ignored.
- **Opt-in:** off by default, stored in `/var/lib/lotus-now-playing/state.json`, written atomically.
- **API:**
- `GET`/`PUT /v1/me`
- `GET /v1/users?ids=` (up to 50; only opted-in, matched, playing users)
- `GET /v1/cover/<id>`: no auth, but only for covers an opted-in user is playing right now
- Never logs titles, artists or tokens. Request logging is off because paths carry user IDs.
## Tests
- 18 unit tests: `python3 -m unittest now-playing/test_lotus_now_playing.py`.
- Local HTTP smoke test (fake Navidrome/Synapse):
- 401 without a token;
- empty until opt-in;
- 400 on a bad PUT;
- cover 404 until shared and for anyone not sharing;
- CORS headers present.
- ruff is clean and now runs on `now-playing/` in CI.
## Not done yet (needs approval)
1. Create the Navidrome user `lotus-nowplaying` (non-admin; `navidrome user create`) and `/etc/lotus-now-playing/env`. My attempt was blocked by the permission check.
2. Write `/etc/lotus-now-playing/users.json`, run `now-playing/install.sh`, add the NPM `/now-playing/` location (Advanced config plus `49.conf`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
New lotus-now-playing service (LXC 151, :8072, NPM /now-playing/):
- polls Navidrome getNowPlaying every 10 s as a non-admin service user;
Navidrome is the scrobbling master and Dropped Needle passes the real
listener through, so entries are keyed by SSO username
- authenticates Lotus Chat with Matrix OpenID tokens (Synapse
/_matrix/federation/v1/openid/userinfo, cached)
- maps Matrix users to SSO usernames: server-only override file, then the
Synapse admin API (email <name>@lotusguild.org or the legacy
plain-username external ID; Authelia opaque UUIDs are ignored)
- opt-in per user (off by default), stored in /var/lib/lotus-now-playing
- GET/PUT /v1/me, GET /v1/users?ids= (opted-in, matched, playing only),
GET /v1/cover/<id> (no auth, but only covers being played by an
opted-in user right now)
- never logs titles, artists or tokens
Also: systemd unit, install.sh, unit tests, ruff on now-playing/ in CI,
README section + port row, the outdated NPM note (routes now live in
proxy host 49's Advanced config), and cinny/config.json nowPlaying.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
jared
merged commit 3a0a4e15a8 into main2026-11-16 23:51:08 -05:00
jared
deleted branch now-playing-service2026-11-16 23:51:08 -05:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Backend for LotusGuild/cinny#491 (Discord/Spotify-style "Listening to"). The client side is in the cinny PR.
What it does
now-playing/lotus_now_playing.py: stdlib Python,lotus-now-playing.service, LXC 151:8072, NPM/now-playing/.getNowPlayingevery 10 s as a non-adminlotus-nowplayinguser, direct to10.10.10.28:4533. Navidrome is the scrobbling master and Dropped Needle passes the listener through (log confirmeduser=jaredviaplayer="droppedneedle [DroppedNeedleApp]"), so entries carry SSO usernames. Thedroppedneedleservice user is ignored./_matrix/federation/v1/openid/userinfo(verified to answer locally), cached about 10 min.users.jsonoverride first (Jeff, Ben and Cole have no email on their SSO link), then the admin API: email<u>@lotusguild.org, or the legacy plain-username external ID. Authelia opaque UUIDs are explicitly ignored./var/lib/lotus-now-playing/state.json, written atomically.GET/PUT /v1/meGET /v1/users?ids=(up to 50; only opted-in, matched, playing users)GET /v1/cover/<id>: no auth, but only for covers an opted-in user is playing right nowTests
python3 -m unittest now-playing/test_lotus_now_playing.py.now-playing/in CI.Not done yet (needs approval)
lotus-nowplaying(non-admin;navidrome user create) and/etc/lotus-now-playing/env. My attempt was blocked by the permission check./etc/lotus-now-playing/users.json, runnow-playing/install.sh, add the NPM/now-playing/location (Advanced config plus49.conf).🤖 Generated with Claude Code
https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA