From 647a0b6a4776e38a1a4b84919f58207846e295a2 Mon Sep 17 00:00:00 2001 From: Mathieu Moran Date: Mon, 22 Dec 2025 16:32:17 -0500 Subject: [PATCH] Readme file updates (#57) * Refactor READMEs and clarify optional features Co-authored-by: mathieumoran1 * Add video auth details and Let's Encrypt helper Co-authored-by: mathieumoran1 --------- Co-authored-by: Cursor Agent --- README.md | 12 ++- python_video_server/README.md | 143 +++++++++++++++++++++++----------- 2 files changed, 105 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 151b7a3..821ff58 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@ Little nodejs + mongodb app that I hack together with ChatGPT and Cursor to keep ## Features - User accounts: register, login, JWT auth -- Simple registration verification via `DOG_NAMES` +- Optional registration "verification" via `DOG_NAMES` (if unset, verification is skipped) - Mark nominees as watched (per user), with watched date - Browse movies by Oscar year + API for available years - User stats: watched count/ratio and watched titles -- Movie details pulled from OMDb (title/plot/rating/poster) via IMDb ID +- Movie details pulled from OMDb (title/plot/rating/poster) via IMDb ID (optional) - Admin movie management: add, edit (optionally refresh from OMDb), delete -- Built-in player page with multiple source options (VOD link, direct video file, embed) +- Built-in player page with multiple source options (VOD link, direct video URL, embed, or server file) - Resume playback: per-user playback progress saving (time/duration) - Global settings: active Oscar year, “completion” modal content for checklist - Password flows: admin temp password reset + forced change on next login @@ -35,7 +35,7 @@ MONGO_URI=mongodb://127.0.0.1:27017/oscars-pool # MongoDB connection string JWT_SECRET=replace-with-a-random-string # JWT signing secret (auth) # optional -DOG_NAMES=woof,WOOF,Woof # simple registration "verification" +DOG_NAMES=woof,WOOF,Woof # registration verification answers (comma-separated) OMDB_API=your_omdb_key # OMDb API key (movie info) ``` @@ -65,6 +65,10 @@ VIDEO_SESSION_MAX_AGE_SECONDS=28800 # video_auth cookie max-age (default: 8h) MOVIES_CACHE_TTL_MS=30000 # movies route cache TTL (default: 30000ms) ``` +Notes: +- The server serves the UI from `public/` (open `http://localhost:5000` by default). +- If you use `video_file` in a movie record, it must be a **relative path** under `VIDEO_FILES_DIR` (the backend blocks traversal/absolute paths). + ## Python video server (optional) There is also a standalone Python server in `python_video_server/` that mirrors `/api/video/:id` (Range streaming + JWT + Mongo). See `python_video_server/README.md` for full instructions. In addition to `MONGO_URI` and `JWT_SECRET`, you may need: diff --git a/python_video_server/README.md b/python_video_server/README.md index cf6151f..c188ba7 100644 --- a/python_video_server/README.md +++ b/python_video_server/README.md @@ -27,7 +27,7 @@ export CORS_ALLOW_ORIGINS="https://your-app.example.com" # default: "*" # Cookie behavior for /api/video/session export VIDEO_COOKIE_SAMESITE="Lax" # Lax|Strict|None (default: Lax) -# Mongo TLS / connectivity troubleshooting (Atlas, weird hosts, etc.) +# Mongo TLS / connectivity troubleshooting (Atlas, odd hosts, etc.) export MONGO_TLS_CA_FILE="/path/to/ca.pem" # prefer a valid CA bundle export MONGO_TLS_FORCE_TLS12="1" # force TLS 1.2 if TLS 1.3 breaks export MONGO_TLS_INSECURE="1" # NOT recommended; debug only @@ -36,63 +36,104 @@ export MONGO_CONNECT_TIMEOUT_MS="8000" export MONGO_SOCKET_TIMEOUT_MS="20000" ``` -## HTTPS (Let’s Encrypt, Python-only) +## Video auth / usage -This server can be served over HTTPS by running `uvicorn` with `--ssl-certfile` and `--ssl-keyfile`. -To obtain/renew a trusted cert from Let’s Encrypt **without installing system certbot**, this repo includes a small wrapper that uses the **`certbot` Python package**. +`GET /api/video/{movieId}` accepts auth in three ways (in priority order): -### 1) Issue a certificate (HTTP-01 standalone) +1) `video_auth` cookie (best for browser `