Commit Graph

60 Commits

Author SHA1 Message Date
bvandeusen acd2c7f034 sqlc: add CountTracksByAlbum and SearchTracks for Subsonic browse (#295)
CountTracksByAlbum drives the songCount attr on AlbumRef; SearchTracks
backs the song facet of search3.
2026-04-19 19:02:27 +00:00
bvandeusen 97eb91f50b sqlc: add SearchArtists for Subsonic search3 (#295) 2026-04-19 19:02:14 +00:00
bvandeusen a498d20021 sqlc: add album listing/search queries for Subsonic browse (#295)
Adds ListAlbumsAlphaByName, ListAlbumsAlphaByArtist (with sqlc.embed
for the joined artist sort_name), ListAlbumsNewest, ListAlbumsRandom,
ListAlbumsByGenre, and SearchAlbums. Powers getAlbumList2 type filters
and the album facet of search3.
2026-04-19 19:02:03 +00:00
bvandeusen 98818fe28c fix(subsonic): check fmt.Fprintf return (errcheck lint) 2026-04-19 18:07:36 +00:00
bvandeusen 644af30a86 test(server): update New() call for new Subsonic arg 2026-04-19 17:40:10 +00:00
bvandeusen 5288e9d5df feat(server): wire subsonic.Mount under /rest 2026-04-19 17:40:05 +00:00
bvandeusen f8b0d78544 test(config): subsonic env override 2026-04-19 17:39:48 +00:00
bvandeusen e649ad2f66 feat(config): subsonic.allow_plaintext_password 2026-04-19 17:39:30 +00:00
bvandeusen 841a3d8165 test(subsonic): decodePassword + md5(password+salt) derivation 2026-04-19 17:39:12 +00:00
bvandeusen 1885d197d6 test(subsonic): envelope JSON/XML/JSONP + WriteFail 2026-04-19 17:39:03 +00:00
bvandeusen da2bb672f0 feat(subsonic): mount /rest router with /ping and /getLicense
Exposes each handler at /rest/name and /rest/name.view, GET+POST, for
client convention compatibility.
2026-04-19 17:38:44 +00:00
bvandeusen 2a75fc6687 feat(subsonic): ping.view + getLicense.view handlers 2026-04-19 17:38:34 +00:00
bvandeusen cdf56801cd feat(subsonic): auth middleware (apiKey / t+s / p gated)
apiKey (OpenSubsonic) is preferred. t+s uses md5(subsonic_password+salt)
with a constant-time compare. p is disabled by default and gated by
SubsonicConfig.AllowPlaintextPassword; enc:HEX obfuscation decoded.
Auth failures write a Subsonic "failed" envelope so clients don't see
HTTP 401.
2026-04-19 17:38:28 +00:00
bvandeusen fd408d78af feat(subsonic): response envelope with JSON/XML/JSONP emit
Renders one wire format per ?f= parameter; JSON wraps in
{"subsonic-response":...}, XML emits with xmlns, JSONP wraps in callback
or falls back to JSON when callback is empty.
2026-04-19 17:38:07 +00:00
bvandeusen 4a447e081d feat(subsonic): error code constants 2026-04-19 17:37:49 +00:00
bvandeusen f916cde8c8 chore(sqlc): regenerate models.go for subsonic_password 2026-04-19 17:37:40 +00:00
bvandeusen 2d153e1e9a chore(sqlc): regenerate users.sql.go for subsonic_password 2026-04-19 17:37:32 +00:00
bvandeusen bc22ec9a91 feat(db): add SetSubsonicPassword query
Allows setting or clearing the opt-in Subsonic legacy credential.
2026-04-19 17:37:18 +00:00
bvandeusen b5bf0cc9d6 feat(db): migration 0003 down — drop users.subsonic_password 2026-04-19 17:37:12 +00:00
bvandeusen 9fd3fec149 feat(db): migration 0003 - users.subsonic_password opt-in column
Subsonic token auth (t=md5(password+salt)) needs a reversibly stored
credential; bcrypt password_hash can't serve. NULL means the user has
not opted in, forcing apiKey (OpenSubsonic) instead.
2026-04-19 17:37:11 +00:00
bvandeusen 6e776810b2 M1/#293: RequireAdmin middleware + UserFromContext 2026-04-19 15:17:16 +00:00
bvandeusen c58061778c M1/#293: integration test for scanner walk + incremental 2026-04-19 15:17:09 +00:00
bvandeusen fdf28efef0 M1/#293: library scanner (walk + tag-parse + upsert + mtime incremental) 2026-04-19 15:16:48 +00:00
bvandeusen 968087198d M1/#293: update server_test for new New() signature 2026-04-19 15:16:22 +00:00
bvandeusen 8e91235b88 M1/#293: add /api/admin/scan route gated on X-API-Token 2026-04-19 15:16:15 +00:00
bvandeusen e3257a705a M1/#293: regenerate sqlc output for GetAlbumByArtistAndTitle 2026-04-19 15:15:50 +00:00
bvandeusen 918506168a M1/#293: add GetAlbumByArtistAndTitle for no-mbid dedupe 2026-04-19 15:15:35 +00:00
bvandeusen 29d32e3097 M1/#293: cover LibraryConfig env + yaml 2026-04-19 15:15:29 +00:00
bvandeusen 7cc7e17abc M1/#293: add LibraryConfig + env overrides 2026-04-19 15:15:12 +00:00
bvandeusen 442668874d M1/#292: integration test for admin bootstrap (MINSTREL_TEST_DATABASE_URL-gated) 2026-04-19 02:32:58 +00:00
bvandeusen 33f6514696 M1/#292: auth.Bootstrap for empty-users-table first-run admin 2026-04-19 02:32:43 +00:00
bvandeusen 9e59a0cf73 M1/#292: sqlc-generated users queries 2026-04-19 02:32:31 +00:00
bvandeusen 451971a9bd M1/#292: sqlc-generated tracks queries 2026-04-19 02:32:24 +00:00
bvandeusen da23c62262 M1/#292: sqlc-generated albums queries 2026-04-19 02:32:08 +00:00
bvandeusen 0377c58513 M1/#292: sqlc-generated artists queries 2026-04-19 02:31:58 +00:00
bvandeusen 2c10d4e23a M1/#292: sqlc-generated models (Album/Artist/Track/User) 2026-04-19 02:31:49 +00:00
bvandeusen e0baeb2980 M1/#292: sqlc-generated DBTX + Queries 2026-04-19 02:31:43 +00:00
bvandeusen 34ae7d6cde M1/#292: user queries (create + lookup by username/token + count) 2026-04-19 02:31:39 +00:00
bvandeusen 85673f9881 M1/#292: track queries (upsert-by-file_path/get-by-id/get-by-path/list-by-album) 2026-04-19 02:31:36 +00:00
bvandeusen 58b29cc4bd M1/#292: album queries (upsert/get/list-by-artist) 2026-04-19 02:31:31 +00:00
bvandeusen 7c46d8358f M1/#292: artist queries (upsert/get/list) 2026-04-19 02:31:27 +00:00
bvandeusen a243357ce6 M1/#292: down migration for core library 2026-04-19 02:31:23 +00:00
bvandeusen 75733a0f7f M1/#292: core library migration (artists/albums/tracks/users) 2026-04-19 02:31:21 +00:00
bvandeusen d7e04a757a M1/#292: test env overrides for admin bootstrap 2026-04-19 02:30:51 +00:00
bvandeusen 70cd49299a M1/#292: add Auth.AdminBootstrap config + env overrides 2026-04-19 02:30:39 +00:00
bvandeusen 79cd25b24a M1/#291: drop goose-style stub migration (replaced by 0001_init.*) 2026-04-19 01:35:23 +00:00
bvandeusen 08a627b10b M1/#291: placeholder down migration 2026-04-19 01:12:39 +00:00
bvandeusen ceb0161677 M1/#291: placeholder up migration to establish runner 2026-04-19 01:12:37 +00:00
bvandeusen 9c66736916 M1/#291: env-gated migration test against real postgres 2026-04-19 01:12:12 +00:00
bvandeusen 380a76c053 M1/#291: wire pgxpool + golang-migrate runner with embedded migrations 2026-04-19 01:12:02 +00:00