Skip to content

feat: add the umami analytics preset - #48

Merged
geodro merged 4 commits into
lerd-env:mainfrom
ExeQue:add-umami
Oct 23, 2026
Merged

geodro merged 4 commits into
lerd-env:mainfrom
ExeQue:add-umami

Conversation

@ExeQue

@ExeQue ExeQue commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Adds Umami, the privacy-focused web analytics tool, as a preset.

How it runs

  • Database: depends on the lerd postgres service. The Umami image cannot create its own database, so it uses lerd's default lerd database with its own schema (?schema=umami), which Prisma creates during the migrations it runs on boot. No manual step needed.
  • Domain: domain: umami is declared like rustfs's, because the tracker script is loaded by the browser from a site's own HTTPS origin, where localhost:3002 would be blocked as mixed content. As far as I can read AdoptDefaultServiceDomains, though, lerd only adopts a preset's domain for the built-in default presets. For now it has to be set by hand with lerd service domain umami umami.test. The field is kept so the domain applies once lerd adopts it for store presets too.
  • Embedding: Umami sends frame-ancestors 'self' by default, which stops the lerd UI from embedding the dashboard. ALLOWED_FRAME_URLS adds the lerd UI origins.
  • .env: following the rustfs pattern, UMAMI_SCRIPT_URL points at the domain (for the browser) and UMAMI_API_URL at the container (for the app), with env_detect on UMAMI_SCRIPT_URL.
  • Image: pinned to ghcr.io/umami-software/umami:3.4.
  • Login: admin / umami (Umami's default). It is in the description, and the Env tab shows it through env_vars.

Not included

  • Auto-login via dashboard_login: that needs dashboard_proxy, and Umami's BASE_PATH is baked in at build time, so the stock image cannot be served under /_svc/umami/.

Checks

  • test_render_schema.py, render_schema.py and readme_logos.py were run, and their output is committed.
  • schema_guard.py passes against main.
  • Tested locally on lerd 1.37.1 (WSL2): migrations apply, https://umami.test/script.js returns 200 from the host and from the PHP-FPM container, CORS preflight from a .test site returns 204, and the CSP returned by Umami lists the lerd UI origins in frame-ancestors, and the dashboard embeds in the lerd UI.

Umami runs against the lerd Postgres service in its own schema (lerd?schema=umami), since the image cannot create a database and Prisma creates the schema itself. Served on umami.test so the tracker loads over HTTPS from a site's origin, with ALLOWED_FRAME_URLS letting the lerd UI embed the dashboard.
@ExeQue
ExeQue requested a review from a team as a code owner October 23, 2026 18:42
The lerd database only exists on a Postgres whose data was first initialised with it, so umami now keeps its schema in the postgres database every install has. The tracker URL is written against localhost, which lerd env points at the service's domain once it has one, rather than naming umami.test outright.

dashboard_token_login has lerd-ui log in through umami's API and open the dashboard on /sso, since its base path is fixed at build time and the dashboard cannot be proxied. The key is new, so umami is authored in the schema 2 tree and rendered without it below.
The preset wrote keys no package reads. UMAMI_URL, UMAMI_USERNAME and UMAMI_PASSWORD are what still-code/laravel-umami takes, UMAMI_URL being the API base it posts its login to. Written against the container, it becomes the service's domain once umami has one, which both the app and the browser reach.
@geodro
geodro merged commit 9b663f0 into lerd-env:main Oct 23, 2026
2 checks passed
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