my-homelab-configs/apps/website
juvenal.diaz 0de35a7113
Homelab Main / validate (push) Waiting to run Details
Homelab Main / running-update (push) Blocked by required conditions Details
Homelab Main / debian-ops (push) Blocked by required conditions Details
Retire legacy OpenWrt provisioning
2026-11-06 21:46:12 -06:00
..
architecture Generate homelab Christmas tree ornaments 2026-11-06 19:43:37 -06:00
images migration: incorporate repository secrets and apply clean application definitions 2026-05-19 08:06:40 -05:00
lang Retire legacy OpenWrt provisioning 2026-11-06 21:46:12 -06:00
ollama Add dedicated website translation model 2026-06-10 10:34:00 -06:00
partials Updating translation endpoint so its reachable 2026-05-29 12:05:30 -06:00
Dockerfile chore: update website PHP runtime 2026-10-21 20:33:41 -06:00
Juvenal-Diaz-CV.pdf Add updated CV PDF download 2026-11-06 15:57:13 -06:00
README.md Generate website diagrams during deployment 2026-11-06 19:48:01 -06:00
blog.php Retire legacy OpenWrt provisioning 2026-11-06 21:46:12 -06:00
buildkitd.toml Update debian ip 2026-06-26 22:50:19 -06:00
cv-theme.js Fixing theme button 2026-05-29 11:12:20 -06:00
cv.php Add updated CV PDF download 2026-11-06 15:57:13 -06:00
demos.php Improve portfolio mobile and resume accessibility 2026-11-06 11:44:18 -06:00
gnu.webp migration: incorporate repository secrets and apply clean application definitions 2026-05-19 08:06:40 -05:00
homelab-tree.php Generate homelab Christmas tree ornaments 2026-11-06 19:43:37 -06:00
httpd-php-fpm.conf Add cache headers for website static output 2026-06-04 10:59:23 -06:00
ideas_helper.php Collect visitor homelab ideas safely 2026-05-25 21:12:51 -06:00
index.php Improve portfolio mobile and resume accessibility 2026-11-06 11:44:18 -06:00
kustomization.yaml Add application egress NetworkPolicies 2026-06-29 17:09:45 -06:00
lang_helper.php Improve portfolio mobile and resume accessibility 2026-11-06 11:44:18 -06:00
namespace.yaml feat: add explicit website-production namespace manifest 2026-05-19 08:46:33 -05:00
network-policy.yaml Add application egress NetworkPolicies 2026-06-29 17:09:45 -06:00
opcache.ini Run website with Apache PHP-FPM and OPcache 2026-06-04 09:50:23 -06:00
php-fpm-runtime.conf Run website with Apache PHP-FPM and OPcache 2026-06-04 09:50:23 -06:00
render-static-pages.sh Fix website render parse failure 2026-09-26 12:00:37 -06:00
save_idea.php Collect visitor homelab ideas safely 2026-05-25 21:12:51 -06:00
save_lang.php Add homelab provisioning automation 2026-05-26 11:46:38 -06:00
start-website.sh Run website with Apache PHP-FPM and OPcache 2026-06-04 09:50:23 -06:00
styles.css Improve portfolio mobile and resume accessibility 2026-11-06 11:44:18 -06:00
translate.php Update debian ip 2026-06-26 22:50:19 -06:00
translation.js Updating translation endpoint so its reachable 2026-05-29 12:05:30 -06:00
visitor-ideas.js Pre-render website read pages 2026-06-04 10:42:21 -06:00
visitor_ideas.php Pre-render website read pages 2026-06-04 10:42:21 -06:00
web-app.yaml Adding limits 2026-07-02 17:32:25 -06:00

README.md

Website Runtime

The portfolio website keeps Apache at the core while moving PHP execution to PHP-FPM.

Runtime Shape

  • Base image: php:8.5.12-fpm-alpine
  • Web server: Alpine Apache, listening on container port 8080
  • PHP runtime: PHP-FPM on 127.0.0.1:9000
  • PHP cache: OPcache enabled, with timestamp validation disabled for immutable image deploys
  • Dynamic storage: /var/www/localhost/htdocs/db mounted from the retained website-db PVC

Apache routes *.php through proxy_fcgi to PHP-FPM. The startup script starts PHP-FPM in the background and then runs Apache in the foreground.

Static Render Path

render-static-pages.sh runs during the image build and renders static HTML for the read-heavy pages:

  • /
  • /cv.php
  • /blog.php
  • /demos.php
  • /homelab-tree.php

Static output is generated for the committed static languages under /static-pages/<lang>/. Apache rewrites supported static-language requests to those generated HTML files. Requests for runtime-generated languages still fall through to PHP so the translation workflow continues to work.

blog.php no longer renders visitor ideas directly into the HTML. Recent ideas are served by visitor_ideas.php and loaded by visitor-ideas.js, which keeps the blog page cacheable while preserving the write path through save_idea.php.

Blog content and architecture

The detailed blog diagram is generated from the public model in architecture/model.json and the profile and host inventory in homelab.yml. Jeannie regenerates it automatically in a temporary website build directory before calculating the image tag. The generator reads only explicitly referenced inventory values, maps host identifiers to public labels, and does not include addresses, credentials, or live health. Adding a profile or changing its runtime requires a model review. CI also validates that generation succeeds. PyYAML is required on Debian; Ruby's YAML parser is used as a fallback where PyYAML is unavailable. Graphify remains a code-navigation aid, not an architecture source of truth.

The Christmas tree retains its festive artwork and uses the curated architecture/tree-model.json for its technology ornaments and explanations. The Learning category marks experiments rather than production claims. Edit the model when technologies or descriptions change; jeannie apps website automatically generates the tree data in the temporary build directory. The generator checks the shared profile model and any explicit inventory references; technologies without inventory references are editorial and need manual review. Generated files in the checkout are reference snapshots and do not need to be updated for a Jeannie website deployment. The tree illustrates configured technologies, not current service health.

Keep blog.php, homelab-tree.php and lang/en.php aligned with homelab.yml and the code map. The blog distinguishes the three exclusive cluster profiles and the confirmed native-node readiness milestone from still-unverified platform/app rollout completion. The generated diagram itself does not report whether any service is currently running.

lang_helper.php merges localized strings over the English dictionary. Revised operational entries currently use that fallback where old Nahuatl translations described a topology that is no longer current. Refresh those translations against the updated English source; do not retain stale infrastructure claims. Adding an activity or stack entry also requires adding its key in blog.php.

Website changes require the normal image build and app delivery path to refresh pre-rendered pages and immutable OPcache. Editing these sources does not update the running site, and a deployment should wait for the current transition to end.

Cache Path

The website sets cache headers for pre-rendered HTML:

Cache-Control: public, max-age=300, s-maxage=3600

Dynamic write and translation endpoints are marked no-store:

  • save_idea.php
  • visitor_ideas.php
  • translate.php
  • save_lang.php

The OCI edge nginx layer handles gzip, cache HITs, HTTP/2, TLS session reuse, client keepalive, and upstream keepalive to the Traefik backend. CSS and JavaScript keep the edge's longer immutable asset policy.

Translation Flow

Unsupported browser languages call the same-origin translate.php endpoint. The endpoint sanitizes and batches text, checks Redis per string, calls the custom website-translator Ollama model only for cache misses, writes fresh translations back to Redis with a TTL, then returns results in the original order. The browser never calls the private Ollama address directly.

n8n is deployed separately at https://n8n.lab2025.duckdns.org and receives OLLAMA_BASE_URL=http://192.168.100.73:11434 so workflows can prewarm translations or run batch jobs against the Debian-host Ollama API.

Translation Observability

translate.php emits one structured JSON log event for each valid translation request. The event name is website_translation and the payload does not include source text or translated text.

Useful fields:

  • cache_hits
  • cache_misses
  • ollama_latency_ms
  • failed_json_parse_count
  • timeout_count
  • status
  • reason

In Loki, filter website logs for "event":"website_translation" to inspect cache behavior, Ollama latency, JSON parse failures, and timeout failures.

Validation

Do not build images locally. The image is built and deployed by the Debian homelab path and Gitea Actions.

Local source validation that does not build the image:

shellcheck apps/website/start-website.sh apps/website/render-static-pages.sh
find apps/website -name "*.php" -print0 | xargs -0 -n1 php -l
node --check apps/website/visitor-ideas.js
kubectl kustomize apps/website >/tmp/website-kustomize.yaml

Static rendering can be checked without Docker by copying the app to a temporary directory and running:

sh render-static-pages.sh /path/to/copied/apps/website