Commit Graph

170 Commits

Author SHA1 Message Date
ef89207d9d fix: remove Unicode arrows and dashes from Mermaid flowchart node labels in s8
Some checks failed
Build and Push Docker Image / build (push) Successful in 29s
CI / Security audit (push) Successful in 1m11s
CI / Tests & coverage (push) Has been cancelled
2026-05-17 18:28:52 +01:00
57bab01855 fix: repair Mermaid diagrams in ARCHITECTURE.md
Some checks failed
Build and Push Docker Image / build (push) Successful in 33s
CI / Security audit (push) Successful in 48s
CI / Tests & coverage (push) Has been cancelled
Replace \n in stateDiagram transition labels, sequenceDiagram notes,
and graph edge labels — these are not valid in those contexts and
cause diagrams to fail to render. Also replace Unicode × and → with
plain ASCII equivalents to avoid parser issues.
2026-05-17 18:26:19 +01:00
2550722446 feat: include version number in server startup message
All checks were successful
Build and Push Docker Image / build (push) Successful in 55s
CI / Security audit (push) Successful in 1m14s
CI / Tests & coverage (push) Successful in 1m31s
2026-05-17 17:51:59 +01:00
27648c78b3 chore: bump version to 1.1.1
All checks were successful
Build and Push Docker Image / build (push) Successful in 32s
CI / Security audit (push) Successful in 52s
CI / Tests & coverage (push) Successful in 1m9s
2026-05-17 17:44:01 +01:00
fa72cfb5ec fix: healthcheck respects TLS_ENABLED at runtime
Some checks failed
Build and Push Docker Image / build (push) Successful in 30s
CI / Tests & coverage (push) Has been cancelled
CI / Security audit (push) Has been cancelled
When TLS_ENABLED=false (e.g. behind a reverse proxy) the healthcheck
was still hitting https://localhost which fails on plain HTTP, keeping
the container perpetually in 'starting' state on TrueNAS SCALE.

Use a shell conditional so the correct protocol is used at runtime:
  - TLS_ENABLED=false  -> wget http://localhost:${PORT}/health
  - TLS_ENABLED=true (default) -> wget --no-check-certificate https://...
2026-05-17 17:42:55 +01:00
e4be334ad4 chore: bump version to 1.1.0
All checks were successful
Build and Push Docker Image / build (push) Successful in 28s
CI / Security audit (push) Successful in 31s
CI / Tests & coverage (push) Successful in 1m15s
2026-05-17 17:31:26 +01:00
bdd78407bb fix: use --surface for episode tooltip background (--card-bg was undefined)
All checks were successful
Build and Push Docker Image / build (push) Successful in 44s
CI / Security audit (push) Successful in 1m6s
CI / Tests & coverage (push) Successful in 1m27s
2026-05-17 17:27:13 +01:00
37c8229061 fix: read episodeNumber from nested episode object in Sonarr records
All checks were successful
Build and Push Docker Image / build (push) Successful in 25s
CI / Security audit (push) Successful in 45s
CI / Tests & coverage (push) Successful in 1m9s
Sonarr queue and history records do not expose episodeNumber at the
top level — it is only present inside the nested episode object
(record.episode.episodeNumber). Same for seasonNumber. The original
extractEpisode() read record.episodeNumber which was always undefined,
so gatherEpisodes() always returned an empty array.

Fix: prefer the nested episode object fields, falling back to the
top-level fields for forward-compatibility.
2026-05-17 17:19:39 +01:00
d1496a76e2 feat: show episode info on download and history cards
All checks were successful
Build and Push Docker Image / build (push) Successful in 37s
CI / Security audit (push) Successful in 59s
CI / Tests & coverage (push) Successful in 54s
- Add includeEpisode:true to Sonarr queue and history API requests
  in both the poller and historyFetcher
- Add extractEpisode() / gatherEpisodes() helpers in dashboard.js
  and history.js to build a sorted, deduplicated episodes array
  covering all records matching a download title (handles multi-
  episode packs and series packs)
- Replace episodeInfo: sonarrMatch with episodes: gatherEpisodes()
  across all 8 assignment sites in dashboard.js
- Add episodes field to /api/history/recent response items
- Frontend: formatEpisodeInfo() renders S01E05 for single episodes
  or 'Multiple episodes' with hover tooltip listing all for packs
- CSS: .episode-info and .multi-episode tooltip styles
- ARCHITECTURE.md: update polling table and download/history schemas
2026-05-17 17:03:23 +01:00
c1fb55c5b8 merge: resolve ARCHITECTURE.md conflict, keep develop version (Mermaid + history docs)
All checks were successful
CI / Security audit (pull_request) Successful in 44s
CI / Tests & coverage (pull_request) Successful in 47s
Build and Push Docker Image / build (push) Successful in 24s
CI / Security audit (push) Successful in 43s
CI / Tests & coverage (push) Successful in 45s
2026-05-17 13:49:50 +01:00
742f34f6eb ci: remove v2-develop branch from build pipeline
All checks were successful
Build and Push Docker Image / build (push) Successful in 20s
CI / Security audit (push) Successful in 37s
CI / Tests & coverage (push) Successful in 41s
CI / Security audit (pull_request) Successful in 34s
CI / Tests & coverage (pull_request) Successful in 39s
2026-05-17 13:25:50 +01:00
2b089871a0 design(light-theme): replace purple scheme with logo-aligned teal palette, WCAG AA compliant
All checks were successful
Build and Push Docker Image / build (push) Successful in 21s
CI / Security audit (push) Successful in 39s
CI / Tests & coverage (push) Successful in 42s
2026-05-17 13:12:58 +01:00
e8ffd7f7dd feat(ui): split downloads and history into tabs 2026-05-17 13:09:01 +01:00
dd7e3e2a90 fix(history): add tagBadges to history items in showAll mode 2026-05-17 13:05:23 +01:00
557137421d fix(history): reload history when showAll toggle changes 2026-05-17 13:02:15 +01:00
71880c6298 ci: add v2-develop branch to build pipeline (tags as sofarr:v2-develop)
All checks were successful
Build and Push Docker Image / build (push) Successful in 22s
CI / Security audit (push) Successful in 38s
CI / Tests & coverage (push) Successful in 39s
2026-05-17 12:50:23 +01:00
6b995a136d chore: remove legacy .env.example (superseded by .env.sample) 2026-05-17 12:06:38 +01:00
fa3c625fb8 docs: update ARCHITECTURE.md and README for history feature (v2) 2026-05-17 12:05:53 +01:00
57b3254f70 test(history): add unit and integration tests for historyFetcher and /api/history/recent 2026-05-17 12:05:45 +01:00
eb321312dc feat(history): add Recently Completed section to frontend dashboard 2026-05-17 12:05:39 +01:00
ddcfbda0c2 feat(history): add /api/history/recent endpoint with Sonarr/Radarr history fetching, tag filtering, and 5-min cache 2026-05-17 12:05:30 +01:00
ffd9e84a00 docs: merge Mermaid diagram migration from develop 2026-05-17 12:04:00 +01:00
2a674c6bcd docs: replace ASCII art diagrams with Mermaid (renders natively in Gitea) 2026-05-17 12:03:49 +01:00
da0898f52a feat: native HTTPS support with bundled snakeoil default cert
All checks were successful
Build and Push Docker Image / build (push) Successful in 32s
CI / Security audit (push) Successful in 48s
CI / Tests & coverage (push) Successful in 56s
server/index.js:
- Import http and https modules
- Resolve TLS_ENABLED early (before Helmet) so upgradeInsecureRequests
  CSP directive fires when TLS is active directly (not only via proxy)
- loadTlsCredentials() reads TLS_CERT/TLS_KEY (defaulting to bundled
  snakeoil) and returns null on failure (graceful HTTP fallback)
- Start https.createServer or http.createServer depending on credentials
- Startup banner now shows protocol, TLS cert path, and snakeoil warning

certs/:
- Add bundled snakeoil self-signed certificate (RSA 2048, 10yr, SAN for
  localhost + 127.0.0.1) for out-of-the-box HTTPS without configuration
- .gitignore allows only snakeoil.{crt,key} — real certs must not be
  committed

Dockerfile:
- COPY certs/ into image so snakeoil default is always available
- HEALTHCHECK updated to https:// with --no-check-certificate

docker-compose.yaml:
- Port now exposes HTTPS directly by default
- TLS_CERT/TLS_KEY/TLS_ENABLED/TRUST_PROXY documented with Option A/B
- cert volume mount examples added (commented out)
- healthcheck updated to https with --no-check-certificate

.env.sample:
- New TLS/HTTPS section with TLS_ENABLED, TLS_CERT, TLS_KEY
- openssl self-signed cert generation example included

docs/ARCHITECTURE.md:
- Configuration table: TLS_ENABLED, TLS_CERT, TLS_KEY env vars added
- Docker image section: TLS default behaviour documented
- Docker Compose example: Option A (direct TLS) / Option B (proxy) layout
- Security checklist: HTTPS now first item, updated for TLS modes
2026-05-17 10:50:38 +01:00
5d7b126c5e Diagrams etc. (#5)
All checks were successful
CI / Security audit (push) Successful in 50s
CI / Tests & coverage (push) Successful in 57s
Co-authored-by: Gronod <gordon@i3omb.com>
Co-authored-by: gitea-actions[bot] <gitea-actions[bot]@i3omb.com>
Reviewed-on: #5
2026-05-17 10:47:50 +01:00
224ec33a14 docs: migrate all diagrams from PlantUML to Mermaid
All checks were successful
Build and Push Docker Image / build (push) Successful in 38s
CI / Security audit (push) Successful in 52s
CI / Tests & coverage (push) Successful in 1m0s
CI / Security audit (pull_request) Successful in 48s
CI / Tests & coverage (pull_request) Successful in 57s
- Replace section 13 of ARCHITECTURE.md with 9 inline Mermaid diagrams
  (component, auth sequence, dashboard SSE sequence, polling sequence,
  server class, data model, UI state, poller state, matching flowchart)
- Diagrams render natively in Gitea/GitHub — no CI job required
- Delete docs/diagrams/*.puml (all 9 files)
- Delete .gitea/workflows/render-diagrams.yml
- Update CI/CD table note and ToC entry
2026-05-17 10:37:46 +01:00
gitea-actions[bot]
cc8de12740 ci: render PlantUML diagrams [skip ci] 2026-05-17 09:31:59 +00:00
a05aaf8d71 fix(diagrams): replace par/and/end with group in seq-polling
Some checks failed
Build and Push Docker Image / build (push) Successful in 22s
CI / Security audit (push) Successful in 1m4s
CI / Tests & coverage (push) Has been cancelled
Render PlantUML Diagrams / Render .puml → .png (push) Successful in 1m2s
par keyword is not supported in the PlantUML version on the Gitea runner.
Replace with a group block (universally supported) and a spanning note
to convey the parallelism.
2026-05-17 10:28:46 +01:00
9751dbf98d docs(diagrams): review + fix all .puml files; touch all to trigger render
Some checks failed
Build and Push Docker Image / build (push) Successful in 31s
CI / Security audit (push) Successful in 51s
CI / Tests & coverage (push) Successful in 1m6s
Render PlantUML Diagrams / Render .puml → .png (push) Failing after 47s
seq-auth:
- startAutoRefresh() -> startSSE(), stopAutoRefresh() -> stopSSE()
- Cookie secure flag: 'secure (prod)' -> 'secure (if TRUST_PROXY)'

component:
- Fix typo creatApp -> createApp
- Add GET /csrf, POST /logout to browser->auth arrow
- Add GET /stream (SSE) to browser->dashboard arrow

class-server:
- Add subscribers Set, onPollComplete(), offPollComplete() to Poller class

class-data:
- Add SSE Event /stream shape alongside API Response /user-downloads
- Add sser *-- dl relationship

state-ui:
- Fix invalid multi-line transition labels with raw Unicode arrows
  (broke PlantUML parser); replace with valid \n escapes on single line

seq-dashboard, seq-polling, state-poller, activity-matching:
- Whitespace touch to trigger render-diagrams CI workflow
2026-05-17 10:20:52 +01:00
29d7bdb536 Merge pull request 'release/1.0.0' (#4) from release/1.0.0 into main
All checks were successful
CI / Security audit (push) Successful in 57s
CI / Tests & coverage (push) Successful in 1m1s
Reviewed-on: #4
2026-05-17 10:16:24 +01:00
6c847a26d3 merge: fix BOT_TOKEN secret name
All checks were successful
Build and Push Docker Image / build (push) Successful in 31s
CI / Security audit (push) Successful in 53s
CI / Tests & coverage (push) Successful in 1m4s
CI / Security audit (pull_request) Successful in 55s
CI / Tests & coverage (pull_request) Successful in 1m4s
2026-05-17 10:12:57 +01:00
7b4ba86435 merge: fix BOT_TOKEN secret name
Some checks failed
CI / Tests & coverage (push) Has been cancelled
CI / Security audit (push) Has been cancelled
2026-05-17 10:12:53 +01:00
28f2aa17d8 ci: rename secret GITEA_TOKEN → BOT_TOKEN (GITEA_ prefix is reserved)
All checks were successful
Build and Push Docker Image / build (push) Successful in 37s
CI / Security audit (push) Successful in 56s
CI / Tests & coverage (push) Successful in 1m4s
2026-05-17 10:12:51 +01:00
aa8a6a49f4 merge: add render-diagrams workflow
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
CI / Security audit (push) Has been cancelled
CI / Tests & coverage (push) Has been cancelled
2026-05-17 10:10:05 +01:00
341c619d3d merge: add render-diagrams workflow
Some checks failed
CI / Tests & coverage (push) Has been cancelled
CI / Security audit (push) Has been cancelled
2026-05-17 10:10:02 +01:00
0ffe62e1ca ci: add render-diagrams workflow (.puml → .png committed back to repo)
All checks were successful
Build and Push Docker Image / build (push) Successful in 31s
CI / Security audit (push) Successful in 1m2s
CI / Tests & coverage (push) Successful in 1m8s
2026-05-17 10:09:59 +01:00
925d0c7735 merge: develop into release/1.0.0 (doc + UI fixes)
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
CI / Security audit (push) Has been cancelled
CI / Tests & coverage (push) Has been cancelled
2026-05-17 10:06:46 +01:00
f88c81cc59 merge: develop into main (1.0.x doc + UI fixes)
Some checks failed
CI / Tests & coverage (push) Has been cancelled
CI / Security audit (push) Has been cancelled
2026-05-17 10:06:44 +01:00
121c49b35b docs: update ARCHITECTURE.md and README for 1.0.x fixes
All checks were successful
Build and Push Docker Image / build (push) Successful in 22s
CI / Security audit (push) Successful in 1m0s
CI / Tests & coverage (push) Successful in 1m14s
ARCHITECTURE.md:
- Cookie secure flag: NODE_ENV → TRUST_PROXY (3 locations)
- upgrade-insecure-requests: document it gates on TRUST_PROXY not NODE_ENV
- Docker image note: NODE_ENV=production no longer implies secure cookies
- Security checklist: clarify TRUST_PROXY enables secure cookie + CSP + HSTS
- dashboard.js route table: add /stream endpoint note
- NODE_ENV env var table: correct description

README.md:
- qBittorrent availability: note red highlight when < 100%
- Login side-effects: secure cookie gated on TRUST_PROXY not NODE_ENV
2026-05-17 10:06:43 +01:00
a4004f5e7a fix: progress bar width collapsed by pill display:inline-flex
All checks were successful
Build and Push Docker Image / build (push) Successful in 29s
CI / Security audit (push) Successful in 47s
CI / Tests & coverage (push) Successful in 52s
The pill redesign set display:inline-flex + white-space:nowrap on all
.detail-item elements. The .progress-item (which extends .detail-item)
was then shrinking the .progress-bar to zero usable width.

Override pill styles on .progress-item: display:flex, no background,
no padding, white-space:normal. Also give .progress-container flex:1
so it expands to fill the row.
2026-05-17 09:56:41 +01:00
fd0d5cf6ec fix: progress bar not rendering — replace float:left with position:absolute
All checks were successful
Build and Push Docker Image / build (push) Successful in 29s
CI / Security audit (push) Successful in 50s
CI / Tests & coverage (push) Successful in 56s
float:left on .progress-segment was ignored inside the overflow:hidden
position:relative .progress-bar container, so the coloured fill never
appeared. Absolute positioning from top:0 left:0 with the JS-assigned
width renders correctly.
2026-05-17 09:53:55 +01:00
1f293ae70b ui: compact pill layout for detail items; red availability warning
All checks were successful
Build and Push Docker Image / build (push) Successful in 38s
CI / Security audit (push) Successful in 56s
CI / Tests & coverage (push) Successful in 1m1s
- Detail items (Size, Progress, Speed, ETA, Seeds, Peers, Availability,
  Completed) now render as inline pill badges with background + border-
  radius that wrap naturally on any screen width
- Remove mobile @media override that forced flex-direction:column,
  which was causing one-per-line centred layout on small screens
- Availability < 100%: value text shown in red (--danger) bold, both
  on card creation and on live SSE update via classList.toggle
- Also ensures updateDownloadCard keeps availability-warning in sync
2026-05-17 09:51:04 +01:00
352118b4af merge: cookie secure fix from release/1.0.0
All checks were successful
Build and Push Docker Image / build (push) Successful in 26s
CI / Security audit (push) Successful in 41s
CI / Tests & coverage (push) Successful in 52s
2026-05-17 09:43:11 +01:00
e33f1debc0 merge: cookie secure fix from release/1.0.0
All checks were successful
CI / Security audit (push) Successful in 50s
CI / Tests & coverage (push) Successful in 1m6s
2026-05-17 09:43:08 +01:00
f41d14b2a9 fix: gate cookie secure flag on TRUST_PROXY not NODE_ENV
All checks were successful
Build and Push Docker Image / build (push) Successful in 36s
CI / Security audit (push) Successful in 49s
CI / Tests & coverage (push) Successful in 59s
secure:true cookies are only sent by browsers over HTTPS connections.
When NODE_ENV=production (always set in the Docker container) but no
TLS proxy is in front, the browser receives the cookie on login but
refuses to send it on subsequent HTTP requests — causing every
authenticated endpoint (/stream, /status, etc.) to return 401.

The correct signal is TRUST_PROXY: it is only set when a TLS-terminating
reverse proxy is confirmed to be in front. Affects emby_user and
csrf_token cookies across login, /csrf refresh, and logout.
2026-05-17 09:42:56 +01:00
f5ef2c5991 merge: release/1.0.0 fixes into main
Some checks failed
CI / Security audit (push) Successful in 48s
CI / Tests & coverage (push) Has been cancelled
2026-05-17 09:38:11 +01:00
240fc0d3b6 merge: release/1.0.0 fixes into develop
All checks were successful
Build and Push Docker Image / build (push) Successful in 28s
CI / Security audit (push) Successful in 1m2s
CI / Tests & coverage (push) Successful in 1m1s
2026-05-17 09:38:09 +01:00
c3ae3a80de fix: correct upgradeInsecureRequests in index.js (the actual production config)
All checks were successful
Build and Push Docker Image / build (push) Successful in 26s
CI / Security audit (push) Successful in 42s
CI / Tests & coverage (push) Successful in 1m5s
The previous fix was applied to server/app.js (the test factory) but
index.js has its own independent Helmet configuration which is what the
production server actually executes. Both files now gate
upgrade-insecure-requests on TRUST_PROXY instead of NODE_ENV.
2026-05-17 09:36:26 +01:00
94fe0dea4d fix: only emit upgrade-insecure-requests when TRUST_PROXY is set
Some checks failed
Build and Push Docker Image / build (push) Successful in 31s
CI / Tests & coverage (push) Has been cancelled
CI / Security audit (push) Has been cancelled
NODE_ENV=production enabled upgrade-insecure-requests unconditionally,
which instructed browsers to upgrade HTTP subresource requests to HTTPS.
When sofarr is accessed directly over HTTP (no reverse proxy), this
silently blocks all CSS, JS, and image loads — the page renders unstyled
with no functionality.

The correct signal for 'we are behind HTTPS' is TRUST_PROXY, not
NODE_ENV. upgrade-insecure-requests is now only emitted when a
TLS-terminating reverse proxy is confirmed to be in front.
2026-05-17 09:34:52 +01:00
3c3382401c fix: remove nonce from <link> tags — breaks CSS on mobile/caching proxies
All checks were successful
Build and Push Docker Image / build (push) Successful in 22s
CI / Security audit (push) Successful in 49s
CI / Tests & coverage (push) Successful in 1m4s
style-src 'self' already permits same-origin stylesheets without a nonce.
Injecting a nonce onto <link rel=stylesheet> causes silent CSS failure on
mobile Safari and any setup where a caching proxy serves stale HTML (the
nonce in the HTML no longer matches the per-request CSP header nonce).

Nonce injection is now limited to <script> tags only, where it is
actually required to permit the same-origin app.js.
2026-05-17 09:28:44 +01:00