diff --git a/.github/workflows/bun-audit.yml b/.github/workflows/bun-audit.yml index 468f7ee..6f709ea 100644 --- a/.github/workflows/bun-audit.yml +++ b/.github/workflows/bun-audit.yml @@ -2,7 +2,7 @@ name: Dependency Audit on: schedule: - - cron: '0 0 * * 0' # Weekly Sunday 00:00 UTC + - cron: '0 0 * * 0' workflow_dispatch: jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 158ef53..b16a4e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,6 @@ jobs: - run: bun install --frozen-lockfile - uses: j178/prek-action@v3.1.0 with: - # Branch protection applies to local commits, not CI checkouts. extra-args: --all-files --skip no-commit-to-branch - run: bunx tsc --noEmit -p electron/tsconfig.json diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index fea6bd4..7c98a4d 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -23,7 +23,6 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} - # Auto-merge waits for the required status checks enforced by the dev branch rules. - name: Enable automerge for patch and minor updates if: >- steps.metadata.outputs.package-ecosystem == 'bun' && diff --git a/bunfig.toml b/bunfig.toml index 2e87a1e..55af992 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,3 +1,2 @@ [install] -# Only resolve new package versions published at least 3 days ago (versions already pinned in bun.lock are unaffected) minimumReleaseAge = 259200 diff --git a/containers/nginx.conf b/containers/nginx.conf index 52bcd97..f564f79 100644 --- a/containers/nginx.conf +++ b/containers/nginx.conf @@ -1,20 +1,5 @@ -# Production server for the container image (copied to -# /etc/nginx/conf.d/default.conf in the Containerfile). -# -# The Content-Security-Policy here must stay in sync with the fallback -# in src/index.html (GitHub Pages cannot send custom HTTP headers, so the meta -# tag is its only enforcement). If the inline theme script in index.html -# changes, recompute its sha256 and update script-src in both places. -# The one intended difference: frame-ancestors exists only here, because -# browsers ignore it in a tag and log an error on every page load. -# -# Policy notes: -# - img-src allows blob:/data:/https: (IndexedDB posters via object URLs, -# inline SVG placeholder, TMDB/MyAnimeList/AniList CDN posters). -# - connect-src enumerates the API + image origins the app fetches from -# (poster save uses fetch() on image CDN URLs, so those need connect-src). -# - style-src 'unsafe-inline' is required: Angular injects component styles -# at runtime. No external stylesheets are used. +# style-src 'unsafe-inline' is required: Angular injects component styles +# at runtime. No external stylesheets are used. server { listen 80; server_name _; @@ -22,7 +7,7 @@ server { root /usr/share/nginx/html; index index.html; - add_header Content-Security-Policy "default-src 'self'; base-uri 'self'; form-action 'self'; object-src 'none'; frame-ancestors 'none'; script-src 'self' 'sha256-Hq3FIAQiTPolQXnEfi9wb+iJcaXWvqDZulbwr3WX+IE='; style-src 'self' 'unsafe-inline'; img-src 'self' blob: data: https:; connect-src 'self' https://api.themoviedb.org https://api.jikan.moe https://graphql.anilist.co https://image.tmdb.org https://cdn.myanimelist.net https://s4.anilist.co; font-src 'self' data:; manifest-src 'self'; worker-src 'self'" always; + add_header Content-Security-Policy "default-src 'self'; base-uri 'self'; form-action 'self'; object-src 'none'; frame-ancestors 'none'; script-src 'self' 'sha256-toZFmdk2CkvU3nyUgzTVJAy/6YfDgBH8RrDVwKZXNAo='; style-src 'self' 'unsafe-inline'; img-src 'self' blob: data: https:; connect-src 'self' https://api.themoviedb.org https://api.jikan.moe https://graphql.anilist.co https://image.tmdb.org https://cdn.myanimelist.net https://s4.anilist.co; font-src 'self' data:; manifest-src 'self'; worker-src 'self'" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "DENY" always; add_header Referrer-Policy "no-referrer" always; diff --git a/e2e/journey.e2e.ts b/e2e/journey.e2e.ts index d4031fd..ed5c241 100644 --- a/e2e/journey.e2e.ts +++ b/e2e/journey.e2e.ts @@ -1,9 +1,5 @@ import { expect, test } from '@playwright/test'; -// The one browser test. Component and service behaviour is covered by the -// Vitest specs; this proves what they cannot: the production bundle boots under -// its Content-Security-Policy, real clicks reach the controls, and the -// collection persists in the browser's own IndexedDB. test('add a series, watch an episode, and delete the series', async ({ page }) => { const title = 'Browser Journey Series'; const problems: string[] = []; @@ -48,7 +44,6 @@ test('add a series, watch an episode, and delete the series', async ({ page }) = await expect(page).toHaveURL(/\/items$/); await expect(page.getByText('No items found')).toBeVisible(); await nav.getByRole('link', { name: 'History' }).click(); - // History outlives its item by design. await expect(page.getByText(`${title} (deleted)`)).toBeVisible(); expect(problems).toEqual([]); diff --git a/e2e/serve.mjs b/e2e/serve.mjs index de1f76d..32cc3b1 100644 --- a/e2e/serve.mjs +++ b/e2e/serve.mjs @@ -1,5 +1,3 @@ -// Serves the production build for the browser tests, with the same SPA -// fallback as containers/nginx.conf. import { join, normalize } from 'node:path'; const root = join(import.meta.dirname, '../dist/watch-list/browser'); diff --git a/electron/preload.ts b/electron/preload.ts index 083d3fa..e92264a 100644 --- a/electron/preload.ts +++ b/electron/preload.ts @@ -1,7 +1,5 @@ import { contextBridge } from 'electron'; -// Expose a minimal, secure API surface. Extend here when IPC is needed. -// Keeping contextIsolation + sandbox enabled (see main.ts). contextBridge.exposeInMainWorld('electronAPI', { platform: process.platform, }); diff --git a/playwright.config.ts b/playwright.config.ts index bdfc82c..f7c6a84 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,8 +1,5 @@ import { defineConfig, devices } from '@playwright/test'; -// Set E2E_BASE_URL to test an already running deployment (CI points it at the -// nginx container, the only place the real security headers exist). Without it -// the production build is created and served locally. const externalBaseUrl = process.env['E2E_BASE_URL']; const localPort = 4300; // Playwright's downloaded Chromium cannot start on every OS (NixOS, for one). diff --git a/scripts/build.mjs b/scripts/build.mjs index 6ef2ca3..609ea64 100755 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -31,7 +31,6 @@ const version = getVersion(); const hash = getHash(); const buildDate = getBuildDate(); -// All args after script name are forwarded to ng build (e.g. --configuration=..., --base-href ...) const extraArgs = process.argv.slice(2); const defines = [ diff --git a/src/app/components/conflict-recovery/conflict-recovery.component.ts b/src/app/components/conflict-recovery/conflict-recovery.component.ts index 78e80c5..46c6ffd 100644 --- a/src/app/components/conflict-recovery/conflict-recovery.component.ts +++ b/src/app/components/conflict-recovery/conflict-recovery.component.ts @@ -1,7 +1,6 @@ import { Component, inject, input, output, signal } from '@angular/core'; import { StorageService } from '../../services/storage.service'; -/** Refresh shared collection state without navigating away from recoverable drafts. */ @Component({ selector: 'app-conflict-recovery', template: ` diff --git a/src/app/components/home/home.component.spec.ts b/src/app/components/home/home.component.spec.ts index de0e0c8..60667e7 100644 --- a/src/app/components/home/home.component.spec.ts +++ b/src/app/components/home/home.component.spec.ts @@ -270,14 +270,12 @@ describe('HomeComponent', () => { }); it('shows empty states for nextSeries/nextMovie', async () => { - // No series in list setup({ watchItems: [], inProgressSeries: [], nextSeries: null, nextMovie: null }); let fixture = TestBed.createComponent(HomeComponent); fixture.detectChanges(); await fixture.whenStable(); expect(fixture.nativeElement.textContent).toContain('No series in your watch list'); - // Has series but none in progress const seriesNotStarted = createItem({ id: 's1', title: 'S', @@ -296,7 +294,6 @@ describe('HomeComponent', () => { await fixture.whenStable(); expect(fixture.nativeElement.textContent).toContain('No series currently being watched'); - // Has in-progress but not watchable (all future) const inProg = createItem({ id: 's2', title: 'S2', @@ -310,7 +307,6 @@ describe('HomeComponent', () => { await fixture.whenStable(); expect(fixture.nativeElement.textContent).toContain('No aired series episodes available'); - // Movies setup({ watchItems: [], inProgressSeries: [], nextSeries: null, nextMovie: null }); fixture = TestBed.createComponent(HomeComponent); fixture.detectChanges(); diff --git a/src/app/components/home/home.component.ts b/src/app/components/home/home.component.ts index 1fd4c50..f879b24 100644 --- a/src/app/components/home/home.component.ts +++ b/src/app/components/home/home.component.ts @@ -55,7 +55,6 @@ import { DiscussionLinkComponent } from '../discussion-link/discussion-link.comp @if (nextSeries()) {
-