Lint / Shell (shellcheck) (push) Successful in 32s
Lint / JS (eslint) (push) Successful in 27s
Lint / No secrets in webhook configs (push) Successful in 13s
Lint / Python (ruff) (push) Successful in 13s
Lint / Secret scan (gitleaks) (push) Successful in 15s
Lint / Shell (shellcheck) (pull_request) Successful in 19s
Lint / No Hookshot webhook IDs in README (pull_request) Successful in 18s
Lint / JS (eslint) (pull_request) Successful in 24s
Lint / No secrets in webhook configs (pull_request) Successful in 13s
Lint / Landing page is rendered (matrix (pull_request) Successful in 12s
Lint / Python (ruff) (pull_request) Successful in 6s
Lint / Secret scan (gitleaks) (pull_request) Successful in 10s
Lint / Landing page is rendered (matrix (push) Successful in 6s
Lint / Python deps (pip-audit) (pull_request) Successful in 1m50s
Lint / Python deps (pip-audit) (push) Successful in 39s
Lint / No Hookshot webhook IDs in README (push) Successful in 7s
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
38 lines
1.6 KiB
Bash
38 lines
1.6 KiB
Bash
#!/bin/bash
|
|
# Install or update the now-playing service (cinny #491) on LXC 151.
|
|
# Run with this repo's main branch pulled to /opt/matrix-config:
|
|
# bash /opt/matrix-config/now-playing/install.sh
|
|
# First install: put the Navidrome login in /etc/lotus-now-playing/env first
|
|
# (NAVIDROME_USER=lotus-nowplaying / NAVIDROME_PASSWORD=...), mode 640 root:lotus-now-playing.
|
|
# Optional /etc/lotus-now-playing/users.json maps Matrix IDs whose SSO link has no
|
|
# email to their SSO username, e.g. {"@bigmanjeff:matrix.lotusguild.org": "jeff"}.
|
|
# Neither file is kept in this (public) repo. Safe to re-run.
|
|
set -euo pipefail
|
|
|
|
REPO=/opt/matrix-config
|
|
CONF=/etc/lotus-now-playing
|
|
|
|
id lotus-now-playing >/dev/null 2>&1 ||
|
|
useradd --system --no-create-home --home-dir /var/lib/lotus-now-playing --shell /usr/sbin/nologin lotus-now-playing
|
|
install -d -m750 -o root -g lotus-now-playing "$CONF"
|
|
install -D -m644 "$REPO/now-playing/lotus_now_playing.py" /opt/lotus-now-playing/lotus_now_playing.py
|
|
|
|
if [ ! -f "$CONF/env" ]; then
|
|
echo "missing $CONF/env (NAVIDROME_USER / NAVIDROME_PASSWORD); create it and re-run" >&2
|
|
exit 1
|
|
fi
|
|
chown root:lotus-now-playing "$CONF/env"
|
|
chmod 640 "$CONF/env"
|
|
if [ -f "$CONF/users.json" ]; then
|
|
chown root:lotus-now-playing "$CONF/users.json"
|
|
chmod 640 "$CONF/users.json"
|
|
fi
|
|
|
|
install -m644 "$REPO/systemd/lotus-now-playing.service" /etc/systemd/system/lotus-now-playing.service
|
|
systemctl daemon-reload
|
|
systemctl enable lotus-now-playing >/dev/null
|
|
systemctl restart lotus-now-playing
|
|
sleep 2
|
|
systemctl --no-pager --lines=5 status lotus-now-playing
|
|
curl -fsS http://127.0.0.1:8072/healthz && echo " (healthy)"
|