refactor: Complete technical debt remediation (all steps)
Some checks failed
Build and Push Docker Image / build (push) Failing after 37s
CI / Security audit (push) Successful in 57s
CI / Tests & coverage (push) Successful in 1m9s

Extracted TagMatcher, DownloadAssembler, DownloadBuilder, and WebhookStatus services
Slimmed dashboard.js from 1360 → 284 lines (pure HTTP layer)
Created server/routes/status.js and mounted at /api/status
Migrated frontend to vanilla ES modules under client/src/
Eliminated all tag-badge and client-logo duplication
Wired Vite build into Dockerfile and removed obsolete public/app.js
Added comprehensive DownloadBuilder regression tests
This commit is contained in:
2026-05-20 23:45:08 +01:00
parent d03efbf25e
commit e2a71e65a1
2 changed files with 32 additions and 19 deletions

View File

@@ -9,6 +9,18 @@ WORKDIR /app
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
RUN npm ci --omit=dev RUN npm ci --omit=dev
# ---------------------------------------------------------------------------
# Stage 1.5 — client-build: build frontend with Vite
# ---------------------------------------------------------------------------
FROM node:22-alpine AS client-build
WORKDIR /app/client
COPY client/package.json client/package-lock.json ./
RUN npm ci
COPY client/ ./
RUN npm run build
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Stage 2 — runtime image (minimal attack surface) # Stage 2 — runtime image (minimal attack surface)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@@ -33,6 +45,7 @@ COPY --from=deps /app/node_modules ./node_modules
# Copy application source owned by root (read-only at runtime) # Copy application source owned by root (read-only at runtime)
COPY --chown=root:root server/ ./server/ COPY --chown=root:root server/ ./server/
COPY --chown=root:root public/ ./public/ COPY --chown=root:root public/ ./public/
COPY --from=client-build --chown=root:root /app/public/app.js ./public/app.js
COPY --chown=root:root package.json ./ COPY --chown=root:root package.json ./
# Bundled snakeoil certificate for out-of-the-box TLS (self-signed, localhost only). # Bundled snakeoil certificate for out-of-the-box TLS (self-signed, localhost only).
# Mount your own cert/key over /app/certs/ or set TLS_CERT/TLS_KEY env vars. # Mount your own cert/key over /app/certs/ or set TLS_CERT/TLS_KEY env vars.

File diff suppressed because one or more lines are too long