From b2a8d3d5e03f7b36bc38d3e8fba5c125f8d59748 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Thu, 7 May 2026 16:53:49 +0200 Subject: [PATCH] feat(deploy): workshop_cache provisioning Adds /var/lib/left4me/workshop_cache to the deploy mkdir list (owned by the left4me runtime user). Updates deploy/README.md to document the new directory and the workshop overlay layout: web app downloads VPKs into the cache and symlinks them into overlays/{overlay_id}/left4dead2/addons/. Co-Authored-By: Claude Opus 4.7 (1M context) --- deploy/README.md | 7 +++++-- deploy/deploy-test-server.sh | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/deploy/README.md b/deploy/README.md index 704591e..ffc5ae1 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -12,7 +12,8 @@ The deployment uses these paths: - `/opt/left4me`: deployed repository contents. - `/var/lib/left4me/left4me.db`: SQLite database used by the web app. - `/var/lib/left4me/installation`: shared L4D2 installation. -- `/var/lib/left4me/overlays`: externally managed overlay directories. +- `/var/lib/left4me/overlays`: overlay directories. External (admin-managed) overlays still live at any relative path under here; new overlays created through the web UI use `${overlay_id}` as their path. +- `/var/lib/left4me/workshop_cache`: deduplicated cache of `.vpk` files downloaded for workshop overlays. One file per Steam item, named `{steam_id}.vpk`. Workshop overlays symlink into this tree. - `/var/lib/left4me/instances`: rendered instance specifications and per-instance state. - `/var/lib/left4me/runtime`: per-instance runtime mount directories. - `/var/lib/left4me/tmp`: temporary files used by deployment/runtime operations. @@ -69,4 +70,6 @@ Invalid references are rejected: - Empty path components such as `competitive//base`. - Symlink escapes that resolve outside `${LEFT4ME_ROOT}/overlays`. -Overlay content is external to the host library and deployment contract. Populate overlay directories separately before referencing them from blueprints or instance specs. +Overlay content for `external` (admin-managed) overlays is populated outside the host library — typically via SFTP. The web app does not write into them. + +`workshop` overlays are populated by the web app: it downloads `.vpk` files from the public Steam Web API into `${LEFT4ME_ROOT}/workshop_cache/{steam_id}.vpk` and creates absolute symlinks under `${LEFT4ME_ROOT}/overlays/{overlay_id}/left4dead2/addons/{steam_id}.vpk`. Both the cache and the overlay directory are owned by the `left4me` runtime user; if the web service ever runs as a different uid, ensure it shares a group with the host process and that both trees are group-readable. diff --git a/deploy/deploy-test-server.sh b/deploy/deploy-test-server.sh index 45bb294..4bf4516 100755 --- a/deploy/deploy-test-server.sh +++ b/deploy/deploy-test-server.sh @@ -95,6 +95,7 @@ $sudo_cmd mkdir -p \ /var/lib/left4me/overlays \ /var/lib/left4me/instances \ /var/lib/left4me/runtime \ + /var/lib/left4me/workshop_cache \ /var/lib/left4me/tmp $sudo_cmd chown -R left4me:left4me /var/lib/left4me /opt/left4me