feat(packaging): publish Etherpad as a Snap#7558
feat(packaging): publish Etherpad as a Snap#7558JohnMcLear wants to merge 2 commits intoether:developfrom
Conversation
Adds first-class Snap packaging so Ubuntu / snapd users can install via `sudo snap install etherpad-lite`. - snap/snapcraft.yaml — core24, strict confinement, builds with pnpm against a pinned Node.js 22 runtime. Version is auto-derived from src/package.json so `snap info` tracks upstream release numbering. - snap/local/bin/etherpad-service — launch wrapper that seeds $SNAP_COMMON/etc/settings.json on first run (rewriting the default dirty-DB path to a writable $SNAP_COMMON location) and execs Etherpad via `node --import tsx/esm`. - snap/local/bin/etherpad-healthcheck-wrapper — HTTP probe for external supervisors, falling back to Node if curl isn't staged. - snap/local/bin/etherpad-cli — thin passthrough to Etherpad's bin/ scripts (importSqlFile, checkPad, etc.). - snap/hooks/configure — exposes `snap set etherpad-lite port=<n>` and `ip=<addr>` with validation, restarts the service when running. - snap/README.md — build / install / configure / publish instructions. - .github/workflows/snap-publish.yml — builds on every v* tag, uploads a short-lived artifact, publishes to `edge`, and then promotes to `stable` through a manually-approved GitHub Environment. Requires a one-time `snapcraft register etherpad-lite` plus provisioning of the `SNAPCRAFT_STORE_CREDENTIALS` repo secret (instructions inline). Pad data (dirty DB, logs) lives in /var/snap/etherpad-lite/common/ and survives snap refreshes. The read-only $SNAP squashfs is never written to at runtime. Refs ether#7529 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Review Summary by QodoAdd Snap packaging with automated Store publishing
WalkthroughsDescription• Adds first-class Snap packaging for Ubuntu/snapd users • Implements automated CI/CD pipeline for Snap Store publishing • Provides configuration hooks for port and IP binding • Includes health check and CLI wrapper utilities Diagramflowchart LR
A["Source Code"] -->|snapcraft.yaml| B["Build Snap"]
B -->|tag push| C["GitHub Actions"]
C -->|build| D["Snap Artifact"]
D -->|publish| E["Edge Channel"]
E -->|manual approval| F["Stable Channel"]
G["snap set config"] -->|configure hook| H["Port/IP Override"]
H -->|etherpad-service| I["Running Service"]
J["Health Check"] -->|HTTP probe| I
File Changes1. snap/snapcraft.yaml
|
Code Review by Qodo
1.
|
Addresses Qodo review feedback on ether#7558: 1. Settings file ignored: Etherpad's Settings loader reads `argv.settings`, not the `EP_SETTINGS` env var. Without `--settings`, the launcher's seeded $SNAP_COMMON/etc/settings.json is never loaded; Etherpad falls back to <install-root>/settings.json, which lives on the read-only squashfs — so the default dirty-DB path ends up unwritable and the daemon fails to persist pads. Fix: pass `--settings "${SETTINGS}"` to node; drop the EP_SETTINGS export. 2. `snap set` overrides were no-ops: the seeded settings.json carries the template's literal `"ip": "0.0.0.0"` / `"port": 9001` values, which override the env-based defaults Etherpad exposes via ${…} substitution. Users following the README saw the listener stay put after `snap set etherpad-lite port=…`. Fix: after copying the template on first run, rewrite the top-level `ip` and `port` lines to `"${IP:0.0.0.0}"` / `"${PORT:9001}"`. Use `0,/…/` anchors so the `dbSettings.port` entry further down stays literal. 3. Indentation: reflow the new shell scripts from 4-space to 2-space to match the repo style rule. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Adds first-class Snap packaging so Ubuntu / snapd users can install with
sudo snap install etherpad-lite.Part of #7529 — top-3 deployment targets (Snap, Apt, Home Assistant).
snap/snapcraft.yaml— core24, strict confinement, pnpm + pinned Node.js 22. Version auto-derived fromsrc/package.json.snap/local/bin/etherpad-service— launch wrapper; seedssettings.jsoninto$SNAP_COMMONon first run, rewrites dirty-DB path, execs vianode --import tsx/esm.snap/local/bin/etherpad-healthcheck-wrapper— HTTP/healthprobe for external supervisors.snap/local/bin/etherpad-cli— passthrough tobin/scripts (importSqlFile, checkPad, …).snap/hooks/configure— exposessnap set etherpad-lite port=<n>/ip=<addr>with validation.snap/README.md— build / install / configure / publish instructions..github/workflows/snap-publish.yml— tag-triggered build →edge→ gatedstablevia GitHub Environment approval.Pad data (dirty DB, logs) lives in
/var/snap/etherpad-lite/common/and survivessnap refresh. The read-only$SNAPsquashfs is never written to at runtime.Maintainer action required (one-time)
snapcraft register etherpad-lite— claims the name.SNAPCRAFT_STORE_CREDENTIALS:snap-store-stablewith required reviewers so stable promotion is gated.See https://snapcraft.io/docs/releasing-to-the-snap-store.
Test plan
snapcraftbuilds locally (LXD provider)sudo snap install --dangerous etherpad-lite_*.snapinstalls cleanly on Ubuntu 24.04curl http://127.0.0.1:9001/healthreturns 200 aftersudo snap start etherpad-litesudo snap set etherpad-lite port=9100 && sudo snap restart etherpad-literelocates the listener/var/snap/etherpad-lite/commonRefs #7529
🤖 Generated with Claude Code