Skip to content

feat(presets): add memcached, rabbitmq, elasticsearch service presets#252

Merged
geodro merged 4 commits intomainfrom
feat/preset-memcached-rabbitmq-elasticsearch
Apr 24, 2026
Merged

feat(presets): add memcached, rabbitmq, elasticsearch service presets#252
geodro merged 4 commits intomainfrom
feat/preset-memcached-rabbitmq-elasticsearch

Conversation

@geodro
Copy link
Copy Markdown
Owner

@geodro geodro commented Apr 24, 2026

Summary

  • New memcached preset (memcached:1.6-alpine, no auth, no persistent data, detected via MEMCACHED_HOST in .env). For older Laravel / Drupal / WordPress projects.
  • New rabbitmq preset (rabbitmq:3-management-alpine with AMQP on 5672 and the management UI on 15672, default creds root / lerd, persistent /var/lib/rabbitmq so queues survive restarts, detected via RABBITMQ_HOST). Broadens worker support beyond Redis.
  • New elasticsearch preset (8.13.4 single-node with xpack.security.enabled=false so apps connect without TLS + auth in dev, 512m heap, persistent data dir, detected via composer elasticsearch/elasticsearch).

Tests extend TestListPresets_IncludesShippedPresets and add focused load tests for each: memcached must not declare data_dir, rabbitmq must persist /var/lib/rabbitmq, elasticsearch must run single-node with security off. Docs page gets the three new rows plus default credentials.

geodro added 4 commits April 24, 2026 11:04
Three new opt-in presets broaden the "drop my old project into lerd" surface
without bloating the built-in service list:

- memcached: in-memory key/value cache for older Laravel/Drupal/WordPress
  codebases. No auth, no persistent data, detects via MEMCACHED_HOST in .env.
- rabbitmq: 3-management-alpine with AMQP 5672 and the management UI on
  15672. Default creds root/lerd, persistent /var/lib/rabbitmq so queues
  survive restarts, detects via RABBITMQ_HOST.
- elasticsearch: 8.13.4 single-node with xpack security disabled so apps
  can connect without TLS+auth in dev. 512m heap, persistent data dir,
  detects via composer elasticsearch/elasticsearch.

Tests extend TestListPresets_IncludesShippedPresets and add targeted
load tests covering the non-obvious bits (memcached must not declare
data_dir, rabbitmq must persist, elasticsearch must set single-node +
security-off). Docs updated with the new rows and default credentials.
…tainer users

Custom services and presets can now declare:

- userns: written verbatim to UserNS= in the quadlet, e.g.
  "keep-id:uid=1000,gid=0" to map the host user 1:1 onto a non-root
  container UID.
- chown_data: bool that adds :U to the data_dir mount so podman
  re-chowns the host directory to the container's expected UID at
  mount time.

Both are needed for images like elasticsearch (UID 1000) that write to
their data dir on startup; without them rootless podman maps the host
user to a subuid that has no write access to the bind-mounted volume,
and the process dies with EACCES on node.lock. The bundled elasticsearch
preset adopts both. RabbitMQ verified clean without them (root entrypoint
drops privileges internally), memcached has no data_dir at all.

Tests cover the quadlet generator emitting UserNS and the :z,U mount
when the fields are set, and the unchanged :z-only behavior when they
are not. Schema documented in custom-services.md.
…ble ES CORS

New elasticvue preset (cars10/elasticvue:latest, ~30MB nginx SPA) pairs
with the elasticsearch service the same way phpmyadmin pairs with mysql:
depends_on auto-starts ES, the dashboard wires into the lerd UI iframe at
http://localhost:8083, and the cluster picker is pre-populated with the
lerd ES URL via ELASTICVUE_CLUSTERS. User still clicks Connect once on
first visit (upstream limitation, no auto-connect knob).

Two underlying fixes were needed to make this actually work:

- systemd quoting: GenerateCustomQuadlet now wraps the whole
  Environment="K=V" pair and escapes inner double quotes, mirroring the
  FrankenPHP generator. Without this, any env value containing JSON or
  quoted strings (e.g. ELASTICVUE_CLUSTERS, http.cors.allow-origin) was
  silently stripped of its quotes by systemd, yielding malformed JSON in
  the container or a YAML alias crash in ES.

- ES CORS: the elasticsearch preset now sets http.cors.enabled,
  http.cors.allow-origin, http.cors.allow-headers, http.cors.allow-methods
  so elasticvue's browser-side fetch can reach ES at localhost:9200.
  allow-origin must be wrapped in literal quotes because ES parses env
  vars as YAML and a bare '*' becomes an alias token that crashes
  SnakeYAML on boot.

UI: presetSuggestions map gains elasticsearch -> elasticvue, so the
elasticsearch detail panel shows the install-elasticvue banner when the
admin UI isn't installed, and an Open Elasticvue button when it is.
serviceDisplayLabels and dashboardIconSvg map gain entries for
elasticsearch, elasticvue, memcached, rabbitmq.

Tests cover the new env-quoting behaviour (JSON values round-trip, bare
data-dir defaults to :z only) and the elasticvue + ES CORS preset shape.
Some admin UIs (RabbitMQ's Cowboy management plugin) set session cookies
that browsers drop on cross-origin iframe POSTs, and have no SameSite
override exposed by the application. The pgadmin / phpmyadmin trick of
patching SESSION_COOKIE_SAMESITE = 'None' via a FileMount doesn't apply.

New CustomService field dashboard_external (yaml + json) marks a service
whose dashboard URL must open in a new browser tab rather than the lerd
UI iframe. The dashboard sidebar quick-launch icons hide external
dashboards (since clicking them would open in a new tab anyway), and
both openDashboardIframe and openAdminDashboard route external services
through window.open with noopener,noreferrer.

The rabbitmq preset adopts the flag so the management UI login works
without auth cookies being silently dropped.

Schema field documented in custom-services.md alongside userns and
chown_data. Tests lock in the elasticsearch preset's userns + chown_data
shape and the rabbitmq preset's dashboard_external shape so future
changes can't silently regress them.
@geodro geodro merged commit 57b2a3f into main Apr 24, 2026
3 checks passed
geodro added a commit that referenced this pull request Apr 24, 2026
Bundles four landed changes since beta.6:

- #252  Add memcached, rabbitmq, elasticsearch service presets.
- #256  Fix check-upstream-php workflow dispatch (was silently broken).
- #257  Stream per-phase progress during preset install in the Web UI.
- #258  Offline landing page for the installed PWA with lerd start +
        copy button; nginx vhost allowlists the new SW routes.
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.

1 participant