left4me/l4d2web
mwiegand ddf03c6fb8
feat(files): delete files-overlay.js stub + its script tag
Step 10/12 of docs/superpowers/plans/2026-05-17-files-overlay-rewrite.md.
End of Phase B.

The 19-line tombstone file at static/js/files-overlay.js had no code
since Step 4; it was kept around as a stable resolution target for the
<script> tag while the modules de-duplicated. After Step 9 made the
modules complete and stand-alone, the stub is just a wasted HTTP
request and a misleading filename in the manifest. Deleted, plus the
matching <script defer> tag in overlay_detail.html.

Final loader shape — exactly 4 script tags, all defer, all in
files-overlay/:
  1. core.js   — helpers, manager guard, action registry
  2. editor.js — URL-addressable editor (text + binary + new-file)
  3. dialogs.js — new-folder + delete-confirm + conflict
  4. uploads.js — upload queue + drag-drop + zip action

Verified live on /overlays/2 in Chromium:
  * Exactly 4 files-overlay script tags load (no more files-overlay.js)
  * window.__filesOverlay registry has its 10 keys; askConflict +
    withCollisionSuffix + handleAction + registerHandler all functions
  * File tree renders (3 file rows + 1 folder row, as before)
  * No legacy #files-editor-modal in DOM
  * No console errors
  * pytest still 580 passed, 1 skipped, 3 deselected

Phase B end-state vs. Phase A end-state:
  * editor.js: 550 → 309 lines (Step 9 gutted legacy)
  * files-overlay.js: 19 → 0 (deleted in this step)
  * 5 new pytest tests for the /files/new + binary template
  * Legacy <dialog id="files-editor-modal"> gone from
    overlay_detail.html
  * Editor flows (text edit, binary replace, create new) all run
    through the URL-addressable modal (?modal= deep-linkable)

Phase C (steps 11–12) is server-only: extract a shared path-resolution
helper between overlay_file_content + overlay_file_edit_page, then
delete /files/content if grep confirms no remaining callers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 16:22:12 +02:00
..
alembic feat(l4d2-web): add command_history table for RCON console transcript 2026-05-14 21:26:56 +02:00
l4d2web feat(files): delete files-overlay.js stub + its script tag 2026-05-17 16:22:12 +02:00
scripts fix(editor-v2): fix cm6 to rows-derived height, eliminate layout shift 2026-05-17 10:27:28 +02:00
tests feat(files): delete legacy editor dialog + gut editor.js legacy paths 2026-05-17 16:20:27 +02:00
alembic.ini chore(l4d2): flatten component layout 2026-05-05 23:47:06 +02:00
pyproject.toml refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00
README.md refactor(repo): uv workspace + hatchling + layout restructure 2026-05-15 22:04:29 +02:00

l4d2-web-app

Flask web app for managing L4D2 servers through user-private blueprints.

Key v1 behaviors

  • Local username/password login; no public signup
  • Admin-managed overlay catalog
  • Private blueprints per user
  • Server creation from blueprints (live-linked; no per-server blueprint overrides)
  • Async job model with persisted command logs in job_logs
  • Desired vs actual state model
  • Live logs for jobs and servers via SSE endpoints
  • Host operations go through l4d2ctl via a local host command runner, not direct l4d2host imports

Frontend constraints

  • Server-rendered templates (Jinja)
  • Vendored HTMX (static/vendor/htmx.min.js)
  • Custom CSS only
  • Tokenized, consistent link and accent colors

Development

From the workspace root (../):

uv sync          # creates .venv, installs l4d2host + l4d2web editable, plus dev deps
uv run pytest l4d2web/tests -q

Configuration

The web app reads these settings from the environment:

  • DATABASE_URL: SQLAlchemy database URL, for example sqlite:////var/lib/left4me/left4me.db.
  • SECRET_KEY: Flask secret key used for sessions and CSRF-sensitive state.
  • JOB_WORKER_THREADS: number of background job worker threads.

In the systemd deployment, environment is loaded from /etc/left4me/host.env and /etc/left4me/web.env.

Admin Bootstrap

Create the first admin account with the Flask CLI. Provide the password through LEFT4ME_ADMIN_PASSWORD:

LEFT4ME_ADMIN_PASSWORD='change-me' flask create-user <username> --admin