Skip to content

feat: add one-line installer script (#7466)#7485

Merged
JohnMcLear merged 4 commits intodevelopfrom
feat/one-line-installer
Apr 7, 2026
Merged

feat: add one-line installer script (#7466)#7485
JohnMcLear merged 4 commits intodevelopfrom
feat/one-line-installer

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Summary

Adds bin/installer.sh, a small POSIX shell script so users can install Etherpad with a single command (closes #7466):

curl -fsSL https://raw.githubusercontent.com/ether/etherpad-lite/master/bin/installer.sh | sh

The installer:

  • Verifies prerequisites (git, Node.js >= 18)
  • Installs pnpm globally if missing (with sudo fallback)
  • Clones etherpad-lite into ./etherpad-lite (configurable via ETHERPAD_DIR)
  • Runs pnpm i and pnpm run build:etherpad
  • Optionally starts Etherpad if ETHERPAD_RUN=1 is set

README updated to feature the one-liner prominently above the existing Docker-Compose and manual install instructions.

Configurable env vars

Variable Default Purpose
ETHERPAD_DIR etherpad-lite Target install directory
ETHERPAD_BRANCH master Branch / tag to clone
ETHERPAD_REPO https://github.com/ether/etherpad-lite.git Repo URL
ETHERPAD_RUN 0 If 1, start Etherpad after install
NO_COLOR unset Disable coloured output

Test plan

  • Tested locally end-to-end (clone → install → build → ready) on Linux with pnpm already on PATH
  • Verify on macOS
  • Verify on a fresh system without pnpm (the installer will run npm install -g pnpm, possibly via sudo)
  • Existing CI workflows still pass

🤖 Generated with Claude Code

Adds bin/installer.sh, a small POSIX shell script that:
- Verifies prerequisites (git, Node.js >= 18)
- Installs pnpm globally if missing (with sudo fallback)
- Clones etherpad-lite (configurable branch / dir)
- Runs `pnpm i` and `pnpm run build:etherpad`
- Optionally starts Etherpad if ETHERPAD_RUN=1

Users can now install Etherpad with a single command:

  curl -fsSL https://raw.githubusercontent.com/ether/etherpad-lite/master/bin/installer.sh | sh

README updated to feature the one-liner above the existing
Docker-Compose / manual install instructions.

Closes #7466

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Review Summary by Qodo

Add one-line installer script for Etherpad deployment

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add POSIX shell installer script for one-command Etherpad setup
• Script verifies prerequisites (git, Node.js >= 18) and installs pnpm
• Supports configurable installation directory, branch, and auto-start options
• Update README with quick install instructions and one-liner examples
Diagram
flowchart LR
  User["User runs curl one-liner"] --> Installer["bin/installer.sh"]
  Installer --> Check["Check prerequisites<br/>git, Node.js >= 18"]
  Check --> Pnpm["Install pnpm if needed"]
  Pnpm --> Clone["Clone etherpad-lite repo"]
  Clone --> Install["Run pnpm i"]
  Install --> Build["Run pnpm run build:etherpad"]
  Build --> Done["Installation complete"]
  Done --> Optional["Optional: Start with ETHERPAD_RUN=1"]
Loading

Grey Divider

File Changes

1. bin/installer.sh ✨ Enhancement +98/-0

POSIX shell installer for one-command setup

• New POSIX shell script enabling one-command Etherpad installation via curl
• Validates prerequisites (git, Node.js >= 18) with helpful error messages
• Automatically installs pnpm globally with sudo fallback if needed
• Clones repository with configurable branch/directory and runs build pipeline
• Supports optional auto-start via ETHERPAD_RUN=1 environment variable
• Includes colored output with step indicators (disableable via NO_COLOR)

bin/installer.sh


2. README.md 📝 Documentation +25/-0

Document quick one-liner installation method

• Add new "Quick install (one-liner)" section above Docker-Compose instructions
• Document curl-based installation command for macOS/Linux/WSL users
• Provide examples for basic install and install-with-auto-start workflows
• Explain post-install steps to run Etherpad and access web interface

README.md


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects bot commented Apr 7, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX Issues (0)

Grey Divider


Action required

1. Node version requirement mismatch🐞
Description
bin/installer.sh accepts Node.js >=18 (and README advertises >=18), but the repo declares
engines.node >=20, so the installer can proceed on Node 18/19 and then fail during dependency
install/build.
Code

bin/installer.sh[R34-51]

+ETHERPAD_DIR="${ETHERPAD_DIR:-etherpad-lite}"
+ETHERPAD_BRANCH="${ETHERPAD_BRANCH:-master}"
+ETHERPAD_REPO="${ETHERPAD_REPO:-https://github.com/ether/etherpad-lite.git}"
+REQUIRED_NODE_MAJOR=18
+
+step "Etherpad installer"
+
+# ---------- prerequisite checks ----------
+is_cmd git || fatal "git is required but not installed. See https://git-scm.com/downloads"
+
+if ! is_cmd node; then
+  fatal "Node.js is required (>= ${REQUIRED_NODE_MAJOR}). Install it from https://nodejs.org"
+fi
+
+NODE_MAJOR=$(node -p "process.versions.node.split('.')[0]")
+if [ "$NODE_MAJOR" -lt "$REQUIRED_NODE_MAJOR" ]; then
+  fatal "Node.js >= ${REQUIRED_NODE_MAJOR} required. You have $(node --version)."
+fi
Evidence
The installer enforces Node >=18, but both the root workspace and src package declare Node >=20,
meaning the installer’s prerequisite check is inconsistent with what the project requires and will
lead to failures for users on Node 18/19 following the new one-liner docs.

bin/installer.sh[34-51]
README.md[46-54]
package.json[44-46]
src/package.json[125-129]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The installer and README currently state/enforce Node.js >=18, but the project’s package.json engines require Node.js >=20. This mismatch will cause the quick install flow to accept unsupported Node versions and then fail later.
### Issue Context
- `bin/installer.sh` uses `REQUIRED_NODE_MAJOR=18` and checks `NODE_MAJOR` against it.
- The repo declares `engines.node: >=20.0.0` (root and src).
### Fix Focus Areas
- bin/installer.sh[34-51]
- README.md[46-54]
- README.md[126-138]
### Suggested fix
- Update the installer to require Node.js 20+ (and adjust messaging).
- Update README quick install and (optional but recommended) the Requirements section to explicitly mention Node.js >=20.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Branch ignored for existing dir🐞
Description
If ETHERPAD_DIR already exists and is a git repo, the installer runs git pull --ff-only without
checking out ETHERPAD_BRANCH or validating ETHERPAD_REPO, so it can silently install/build a
different version than requested.
Code

bin/installer.sh[R67-78]

+if [ -d "$ETHERPAD_DIR" ]; then
+  if [ -d "$ETHERPAD_DIR/.git" ]; then
+    warn "$ETHERPAD_DIR already exists; pulling latest changes."
+    (cd "$ETHERPAD_DIR" && git pull --ff-only) || \
+      fatal "git pull failed in existing $ETHERPAD_DIR"
+  else
+    fatal "$ETHERPAD_DIR exists and is not a git checkout. Aborting."
+  fi
+else
+  step "Cloning Etherpad ($ETHERPAD_BRANCH) into $ETHERPAD_DIR"
+  git clone --depth 1 --branch "$ETHERPAD_BRANCH" "$ETHERPAD_REPO" "$ETHERPAD_DIR"
+fi
Evidence
The script advertises/configures ETHERPAD_BRANCH (and supports ETHERPAD_REPO), but that
configuration is only applied in the fresh-clone path; the existing-checkout path never references
either variable and simply pulls the current branch from whatever remote is configured.

bin/installer.sh[34-38]
bin/installer.sh[67-78]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
When `$ETHERPAD_DIR` already exists, the installer does a plain `git pull --ff-only` and does not ensure the checkout matches `$ETHERPAD_BRANCH` (or that the remote matches `$ETHERPAD_REPO`). This can lead to silently building the wrong revision.
### Issue Context
The fresh clone path uses `git clone --branch "$ETHERPAD_BRANCH" "$ETHERPAD_REPO"`, but the existing repo path does not.
### Fix Focus Areas
- bin/installer.sh[67-78]
### Suggested fix
- In the existing repo path:
- Validate the remote (e.g., compare `git remote get-url origin` to `$ETHERPAD_REPO`, or at least warn/fatal on mismatch).
- Ensure a clean working tree (fatal if dirty).
- Fetch updates (`git fetch --tags --prune`) and then checkout/switch to `$ETHERPAD_BRANCH` (or detach at tag) before pulling/fast-forwarding.
- Optionally print which commit/branch was installed for clarity.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment thread bin/installer.sh
JohnMcLear and others added 2 commits April 7, 2026 16:14
- bin/installer.ps1: PowerShell port of installer.sh so the one-liner
  also works on Windows via 'irm ... | iex'.
- .github/workflows/installer-test.yml: end-to-end CI that runs each
  installer against the PR's own commit (via ETHERPAD_REPO/BRANCH env
  vars), verifies clone + node_modules + admin SPA artifacts, and
  smoke-tests by starting Etherpad and curling /api. Runs on
  ubuntu-latest, macos-latest, and windows-latest. Includes a
  shellcheck job for installer.sh.
- README: feature the Windows one-liner alongside the POSIX one.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Start-Process can't run pnpm.cmd directly ("not a valid Win32 application").
Wrap it via cmd.exe /c instead, and bump the wait window to 90s for slower
Windows runners. Also dump stderr alongside stdout when the smoke test
fails for easier debugging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JohnMcLear JohnMcLear requested review from SamTV12345 April 7, 2026 15:31
Two correctness issues caught by Qodo:

1. Node version mismatch: installer required Node >= 18, but the repo's
   engines.node is >= 20. Bump REQUIRED_NODE_MAJOR to 20 in both shell
   and PowerShell installers, and update the README's quick-install
   prerequisite and Requirements section to match.

2. Branch ignored for existing checkouts: when ETHERPAD_DIR already
   existed, the script ran 'git pull --ff-only' on whatever branch
   happened to be checked out, ignoring ETHERPAD_BRANCH and never
   verifying ETHERPAD_REPO. The existing-dir path now:
   - validates the remote URL matches ETHERPAD_REPO
   - refuses to clobber uncommitted changes (excluding pnpm-lock.yaml,
     which pnpm i rewrites during install)
   - fetches with --tags --prune
   - checks out ETHERPAD_BRANCH as a branch or detaches at it as a tag
   - prints the resulting commit short SHA for clarity

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JohnMcLear JohnMcLear merged commit 301ae4d into develop Apr 7, 2026
44 checks passed
@JohnMcLear JohnMcLear deleted the feat/one-line-installer branch April 7, 2026 16:10
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.

Create a "Getting started" or one liner

1 participant