Skip to content

feat: x0 static variant — build script, Apache2 vhost, Docker container - #201

Draft
clauspruefer with Copilot wants to merge 1 commit into
mainfrom
copilot/add-static-x0-variant
Draft

feat: x0 static variant — build script, Apache2 vhost, Docker container#201
clauspruefer with Copilot wants to merge 1 commit into
mainfrom
copilot/add-static-x0-variant

Conversation

Copilot AI commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Introduces a fully self-contained static deployment path for x0, requiring no Python/PostgreSQL backend. Metadata files (object.json, skeleton.json, menu.json, text-data.json) are provided as templates to be filled in by the operator.

Changes

www/sysInitOnLoad.js

  • Adds sysVarTextDataFile support — if defined, replaces the hardcoded /python/getText.py endpoint for text data loading. Falls back to the original path when undefined; dynamic deployments are unaffected.
const TextDataURL = (typeof sysVarTextDataFile !== 'undefined') ? sysVarTextDataFile : '/python/getText.py';
sysFactory.ObjText.requestXMLRPCData(TextDataURL);

static/ — new top-level static deployment root

  • index.html — complete entry point with all JS <script> includes and hardcoded sysVar* config (sysVarPreLoadScript = undefined, sysVarMessageHandling = false, sysVarTextDataFile = "/data/text-data.json", etc.)
  • data/object.json, data/skeleton.json, data/menu.json, data/text-data.json — operator-supplied metadata templates; expected format for text-data.json:
    { "TEXT_ID": { "value_de": "...", "value_en": "..." } }

bin/build-static.sh

  • Copies all *.js from /www, static/ (Bootstrap/FontAwesome CSS), and image/ (favicon) into the output directory (defaults to static/). Does not overwrite data/ templates.

conf/vhost-x0-static.conf

  • Serves /var/www/vhosts/x0-static with AllowMethods GET POST (required — x0's JS loader uses POST even for static JSON fetches) and forces Content-Type: application/json on .json files.

docker/x0-static.dockerfile

  • Ubuntu 24.04 + Apache2; runs build-static.sh at image build time to assemble the static site from source. Enables mod_headers + mod_allowmethods. Exposes port 80.
  • docker/build-x0-static.sh — builds x0-static image.
  • docker/x0-start-static.sh — runs container, maps localhost:8080 → 80.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants