summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-04-30ba: align go.mod toolchain version with Dockerfile and PLAN.md (Go 1.23)Paul Buetow
2026-04-30task oa: Add SECURE_COOKIES config to control session cookie Secure flagPaul Buetow
- Add SecureCookies bool to internal.Config (default true) - Update LoadConfig in internal/config.go to parse SECURE_COOKIES env var - Update setSessionCookie and clearSessionCookie in internal/api/handlers.go to read cfg.SecureCookies - Add tests verifying Secure=true/false and logout clears cookie accordingly - Update AGENTS.md and PLAN.md with new option documentation
2026-04-30task ia: fix media listing/filtering semantics (favorites bool, filesize ↵Paul Buetow
filters, permission scoping)
2026-04-30task ha: enforce upload limits, role checks, probing, thumbnails, cleanupPaul Buetow
- handlers.go: enforce MAX_UPLOAD_SIZE_MB via http.MaxBytesReader and http.MaxBytesError mapping to 413. - service/media.go: UploadMedia now verifies owner/admin, rejects unsupported extensions, probes metadata with ffprobe, generates video thumbnails, enforces unique filenames, and cleans up temp files + hard-deletes DB row on any failure. - Reconcile PLAN.md 500MB -> 100MB default to match AGENTS.md/config. - Add service and API tests for max-size rejection, unsupported extension, missing role, probe failure, thumbnail failure, cleanup, and success paths.
2026-04-30ga — implement thumbnail and set cover regeneration end to endPaul Buetow
- mediaService: implement RegenerateThumbnail and RegenerateSetCover - Inject thumb.Generator and probe.Prober into MediaService - Update NewMediaService constructor and all call sites - Add service tests for success, failure, permission denied, and not-found - Add API tests for cover regeneration and thumbnail error mapping - All tests pass
2026-04-30ja: implement public share landing page and improve error mappingPaul Buetow
- Add web/share.html with a minimal HTML5 video player, theme variables, centered layout, play overlay, and Back to Home link. - Update handleSharePage to return HTML for browser Accept headers (text/html or empty) and JSON for application/json. Return 410 Gone for expired shares. - Update handleShareStream to map service errors to distinct HTTP codes: ErrShareExpired -> 410, ErrShareNotFound/ErrMediaNotFound -> 404. - Improve ValidateShareToken and StreamSharedMedia to return sentinel errors (ErrShareNotFound, ErrShareExpired, ErrMediaNotFound) instead of generic string errors. - Update and add tests for share page HTML/JSON negotiation and share stream 404/410 responses.
2026-04-30fa: wire GCWorker startup and shutdown in cmd/mediaplayer/main.goPaul Buetow
- Refactor main into run(args) for testability and clean error propagation. - Create slog.Logger from cfg.LogLevel using TextHandler. - Instantiate service.NewGCWorker with store, clock, cfg.MediaRoot, and time.Duration(cfg.GCIntervalMinutes)*time.Minute. - Start GCWorker after construction and defer Stop for graceful shutdown. - Add cmd/mediaplayer/main_test.go as an integration smoke test wiring the GCWorker against a real SQLite store.
2026-04-30task ea: wire filesystem scanner into app and admin rescan endpointPaul Buetow
- Add scanner.Scanner and mediaRoot fields to adminService. - Update NewAdminService signature to accept scanner and mediaRoot. - Implement TriggerRescan delegation to injected scanner. - Wire probe.NewFFProber, thumb.NewFFmpegGenerator, and scanner.NewFSScanner in cmd/mediaplayer/main.go. - Add tests for TriggerRescan delegation, error propagation, and nil scanner.
2026-04-30task da: enforce media access and owner/admin role permissionsPaul Buetow
Changes: - MediaService.ListMedia now accepts userID and filters by allowed sets for non-admins via AllowedSetIDs in repository.MediaFilter. - Handlers pass userID into ListMedia; API returns 403 for forbidden. - Added verifyModifyAccess and verifySetModifyAccess helpers so only owners/admins can upload, soft-delete, restore, and regenerate thumbnails/covers; viewers are blocked. - GetMediaDetail, ToggleFavorite, AssignTag, RemoveTag, notes, and shares now consistently verifyAccess before proceeding. - Handlers handle ErrForbidden with 403 for soft-delete and restore. - Added negative tests proving viewers cannot mutate and unauthorized users cannot access/detail/tag/note/favorite/share inaccessible media.
2026-04-30Rename module to codeberg.org/snonux/play (task aa)Paul Buetow
- Update go.mod module path - Replace all internal imports from github.com/paul/kiss-media-player to codeberg.org/snonux/play - Run go mod tidy and gofmt -w .
2026-04-30fix(ca): translate sql.ErrNoRows to nil,nil for optional lookupsPaul Buetow
Repository methods that perform single-row queries now return (nil,nil) instead of leaking sql.ErrNoRows when a row is missing. This aligns with service-layer expectations (e.g. GetMediaDetail, ValidateSession, UpdateProgress, AssignTag, access checks) so normal missing data does not break app flows. Files changed: - internal/repository/media.go, user.go, set.go, set_permission.go, tag.go, note.go, playback_progress.go, playback_accumulator.go, session.go, share.go - internal/repository/sqlite_test.go (updated assertions) - internal/repository/sqlite_no_rows_test.go (new focused repository tests) - internal/service/no_rows_test.go (new focused service tests)
2026-04-30fix: allow static assets during bootstrap when no users existPaul Buetow
The BootstrapRedirect middleware was blocking /css/ and /js/ requests when no users existed, which prevented the bootstrap.html page from loading its stylesheets and scripts. This caused the form to submit as raw form data (rather than JSON via the JS API) and silently fail. - Added /css/* and /js/* to isBootstrapPublic() so static assets are served without redirect when no users exist. - Also added /images/, /favicon.svg, /manifest.json, and /sw.js for completeness.
2026-04-30refactor: use filepath.Join + filepath.Clean for filesystem pathsPaul Buetow
2026-04-30refactor: extract query param parsing from handleListMediaPaul Buetow
2026-04-30refactor: extract nil service check into helperPaul Buetow
2026-04-30refactor: split repository.Store into focused interfacesPaul Buetow
2026-04-30fix: exclude soft-deleted media from GetMediaByIDPaul Buetow
2026-04-30fix: seed random source in thumbnail generatorPaul Buetow
2026-04-30fix: add explicit permission checks to StreamMedia and DownloadMediaPaul Buetow
2026-04-29fix: correct LIKE escape in ListMediaPaul Buetow
2026-04-29fix: prevent GCWorker.Stop panic on nil ticker or double stopPaul Buetow
2026-04-29fix: prevent path traversal in UploadMediaPaul Buetow
2026-04-29fix: start HTTP server in main.goPaul Buetow
2026-04-29docs: create AGENTS.md documentationPaul Buetow
2026-04-29feat: create web PWA frontendPaul Buetow
2026-04-29feat: implement filesystem scannerPaul Buetow
2026-04-29feat(n9): Implement MediaService, AdminService, ProgressService, GCWorkerPaul Buetow
2026-04-29feat: Create Dockerfile, k8s manifests, and Magefile.go with ↵Paul Buetow
build/test/install targets (p9)
2026-04-29feat(q9): implement REST handlers, streaming, uploads, shares, notes, ↵Paul Buetow
progress, admin routes
2026-04-29q9: add table-driven httptest coverage for REST handlersPaul Buetow
Add comprehensive table-driven tests in handlers_more_test.go covering all previously un-tested handlers and middleware paths. Includes negative tests (nil service, invalid IDs, missing bodies, service errors) and real-file assertions for stream/download/thumbnail. coverage: 58.8% -> 94.9%
2026-04-29feat: implement bcrypt password hashing, session management, login/logout ↵Paul Buetow
handlers, and bootstrap flow (m9)
2026-04-29fix(model): add Permissions field to Set struct to sync with repository layerPaul Buetow
2026-04-29feat: SQLite schema migrations, repository interfaces, and concrete SQLite ↵Paul Buetow
implementations with :memory: table-driven tests (task l9)
2026-04-28feat(k9): Define domain model structs (Media, User, Set, Tag, Session, ↵Paul Buetow
Share, Note) in internal/model/ with zero external deps
2026-04-28h9: scaffold go project structurePaul Buetow
- Initialize go.mod (github.com/paul/kiss-media-player) - Add internal/version.go with const Version - Add internal/config.go with env-based Config struct and validation (PORT, MEDIA_ROOT, DB_PATH, MAX_UPLOAD_SIZE_MB, SESSION_TIMEOUT_HOURS, GC_INTERVAL_MINUTES, SHARE_DEFAULT_EXPIRY_DAYS, LOG_LEVEL) - Add table-driven config validation tests (defaults, overrides, invalid values) - Add cmd/mediaplayer/main.go with -version flag - Create directory scaffold: internal/{model,repository,scanner,probe,thumb, clock,auth,service,api,setassign}, web/{css,js}, k8s - Add .gitignore for binaries and data.db - Refactor env parsing into envInt/envString helpers per go-best-practices