etherpad-go

command module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Etherpad-Go-EXPERIMENTAL

A fast, modern, real-time collaborative editor written in Go

CI Go Version License Release Docker Image

Etherpad-Go is a performance-focused, 1:1(currently partial) rewrite of Etherpad in Go. The original implementation was written in Node.js (CommonJS). Rewriting Etherpad in Go allows us to leverage Go’s concurrency model, static typing, fast startup times, and lower memory usage however there are trade offs and this is an experimental branch so YMMV!

Etherpad-Go Logo

Etherpad in action

Etherpad is a real-time collaborative editor scalable to thousands of simultaneous users and supports full data export.


Quick Start (Binary)

The easiest way to run Etherpad-Go:

  1. Download the binary for your platform from the
    Releases page
  2. Run it:
./etherpad-go

Etherpad-Go starts in under a second and uses an in-memory database by default, which is sufficient for many use cases.

Open your browser at:
http://localhost:9001


Configuration

All configuration options are self-documented in the binary.

Show global options:

./etherpad-go --help

Show all configuration values:

./etherpad-go config show

Get a specific configuration value:

./etherpad-go config get <key>

In the Docker image the same commands work through docker exec (see Docker).

For customization, copy:

settings.json.template → settings.json

and adjust it to your needs.

Settings from the environment

Every setting can also come from an environment variable, which is handy for containers and Kubernetes secrets. The name is ETHERPAD_ plus the setting's path, matched without regard to case or underscores, so ETHERPAD_PADOPTIONS_SHOWCHAT and ETHERPAD_PAD_OPTIONS_SHOW_CHAT both set padOptions.showChat. A number is a place in a list, counted from 0:

ETHERPAD_SSO_ISSUER=https://pads.example.com
ETHERPAD_SSO_CLIENTS_0_CLIENT_ID=admin_client
ETHERPAD_SSO_CLIENTS_0_CLIENT_SECRET=...        # from a secret
ETHERPAD_SSO_CLIENTS_0_TYPE=admin
ETHERPAD_SSO_CLIENTS_0_REDIRECT_URIS=https://pads.example.com/admin/,https://pads.example.com/admin
ETHERPAD_SSO_CLIENTS_1_CLIENT_ID=user_client
ETHERPAD_SSO_CLIENTS_1_TYPE=user
  • Lists merge with the settings file, place by place. If settings.json has client 0, ETHERPAD_SSO_CLIENTS_0_CLIENT_SECRET replaces only its secret and the rest stays. The place after the last one adds an element. Places have no gaps: client 0 and 2 without 1 stops the start with an error. Spring Boot would replace the whole list instead.
  • Lists of plain values can also be given whole, comma separated: ETHERPAD_AVAILABLEEXPORTS=pdf,html, or place by place: …_GRANT_TYPES_0=authorization_code.
  • Values are typed by their setting. A text setting keeps the text as it is, so a secret 0123 stays 0123. A switch takes true or false, and a number setting takes a number. Anything else stops the start with the variable's name.
  • Maps with free keys need their parts spelled out with EP__ and double underscores (etherpad-lite's form), because a free key may itself contain underscores. This covers users, plugins and the sections of plugins: EP__users__alice__password=..., EP__ep_comments_page__highlightSelectedText=true. Places in lists work here too: EP__sso__clients__0__display_name=Admin.
  • A variable that matches no setting is reported at start-up: warning: ETHERPAD_PADOPTIONS_SHOWCHATT matches no setting and is ignored. The variables of the command line (ETHERPAD_SETTINGS_FILE, ETHERPAD_URL, ETHERPAD_API_KEY, …) and the ones Kubernetes sets for a Service named etherpad (ETHERPAD_SERVICE_HOST, ETHERPAD_PORT_9001_TCP…) are not reported.

The environment wins over settings.json, and ${VAR} / ${VAR:default} inside settings.json keeps working.

Behind a reverse proxy under a path

Etherpad can be served under a path such as https://example.org/pads/. The proxy strips the prefix and names it in the x-proxy-path header, for example with nginx:

location /pads/ {
    proxy_pass http://127.0.0.1:9001/;
    proxy_set_header x-proxy-path /pads;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

With "trustProxy": true the standard X-Forwarded-Prefix (Traefik, HAProxy) and X-Ingress-Path (Home Assistant) work too; without it they are ignored, since any client could send them when Etherpad is reachable directly. Pages, the admin UI, the websockets and /manifest.json then stay under the prefix. Pages that carry the prefix answer with Vary on these headers and are not stored by shared caches.


Compacting pad history

Long-lived pads collect revisions. etherpad-go compact collapses a pad's history (or keeps its last revisions) through the HTTP API of the running server, like etherpad-lite's bin/compactPad, bin/compactAllPads and bin/compactStalePads. It needs cleanup.enabled = true in the settings and an API key from the admin page. It is destructive: export what you cannot lose as .etherpad first.

export ETHERPAD_API_KEY=...                 # or --apikey
etherpad-go compact myPad                   # collapse all history of one pad
etherpad-go compact myPad --keep 50         # keep the last 50 revisions
etherpad-go compact --all --dry-run         # list every pad and its revisions, change nothing
etherpad-go compact --older-than 90         # pads not edited for 90 days

The server's address comes from --url, ETHERPAD_URL or the settings (http://<ip>:<port>). A pad that fails does not stop the run; the exit code is 1 when one did. In Docker: docker exec -e ETHERPAD_API_KEY=... <container> etherpad-go compact --all.

Docker

You can run Etherpad-Go using Docker.

Start Etherpad-Go with PostgreSQL:

docker compose up -d

Etherpad will be available at:
http://localhost:9001

The compose file can be found here:
docker-compose.yml

Build your own image
docker build -t etherpad-go .
Prebuilt images

Prebuilt images are available via GitHub Container Registry:

ghcr.io/ether/etherpad-go:<version>

To open a shell in a running container (busybox: ls, cat, less, grep, vi, …, no network tools):

docker exec -it etherpad_go sh

The configuration CLI is the image's etherpad-go, on the PATH:

docker exec etherpad_go etherpad-go config show
docker exec etherpad_go etherpad-go config get port
Files and the user in the image

The server runs as the unprivileged user 65532. It writes to two directories, which belong to that user in the image:

Directory What Mount a volume here for
/var the SQLite database (var/etherpad.db, the default) and the update state SQLite
/data settings.json (ETHERPAD_SETTINGS_FILE=/data/settings.json), also as saved in the admin UI settings

The ownership in the image only covers the directories themselves and a named Docker volume created from them. A host directory you bind-mount at /var or /data keeps its own owner and must be writable for 65532, or the server cannot open SQLite or save settings from the admin UI:

sudo chown -R 65532:65532 ./etherpad-data

A settings.json mounted at /settings.json is still read, as long as /data/settings.json does not exist. Settings saved in the admin UI go to /data/settings.json, which is then the one read. Relative favicon paths are still looked up in /, and so is /APIKEY.txt, whose key becomes a token on the first start with tokens; after that the file is ignored (see doc/http-api.md). If a settings file exists but cannot be read (no permission), the server does not start rather than fall back to the defaults.

Upgrading from an image that ran as root: a volume on /var belongs to root, and the server stops with attempt to write a readonly database. Hand it over once:

docker run --rm -v <volume>:/var alpine chown -R 65532:65532 /var

With Postgres or MySQL and no volume, nothing changes.

Several instances / Kubernetes

With PostgreSQL or MySQL, several Etherpad-Go instances can share one database behind a stateless load balancer or Ingress — no sticky sessions needed. The instances find each other through the database and only need to reach each other on port 7946 (TCP and UDP). See doc/cluster.md for how it works, the settings and a Kubernetes example.


Building from Source

Requirements
Installation
  1. Clone the repository:

    git clone https://github.com/ether/etherpad-go.git
    cd etherpad-go
    
  2. Build etherpad-go:

    go run main.go prepare
    
  3. Run the server. The server path is printed after a successful build:

    ./<your-built-binary>
    

Etherpad should start in less than a second.


Migration from Etherpad-Lite

You can migrate existing pads from Etherpad-Lite using the migration command:

migration 192.28.91.4:5432 \
  --type postgres \
  --username myOldEtherpadDBUser \
  --database myoldEtherpadDB

This connects to the old Etherpad-Lite database and migrates all pads to the Etherpad-Go database configured in settings.json or via environment variables.


Plugins

Etherpad-Go ships with 15 built-in plugins ported from the original Etherpad ecosystem. All plugins are disabled by default and can be enabled individually.

Available Plugins
Plugin Description
ep_align Text alignment (left, center, right, justify)
ep_author_hover Show author name on text hover
ep_chat_log_join_leave Log user join/leave events in the chat
ep_clear_formatting Remove all formatting from selected text
ep_cursortrace Show other users' cursor positions in real time
ep_font_color Change text color (6 colors)
ep_font_family Change font family (10 fonts)
ep_font_size Change font size (15 sizes from 8px to 60px)
ep_heading Heading levels (h1-h4)
ep_markdown Markdown editing support
ep_print Print the pad
ep_rss RSS feed for pad content
ep_spellcheck Browser spell checking
ep_table_of_contents Sidebar table of contents from headings
Enabling Plugins

Via settings.json:

{
  "plugins": {
    "ep_align": { "enabled": true },
    "ep_cursortrace": { "enabled": true },
    "ep_font_color": { "enabled": true }
  }
}

Or via environment variables:

ETHERPAD_PLUGINS_EP_ALIGN_ENABLED=true
ETHERPAD_PLUGINS_EP_CURSORTRACE_ENABLED=true

Status

Etherpad-Go is under active development. Feedback, issues, and contributions are welcome.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
assets
pad
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
lib
accounts
Package accounts is etherpad-go's account management: accounts (people, service accounts and the anonymous visitor), roles built from scopes, role assignments limited to pad patterns, and the rules that keep an instance from locking itself out or opening up by mistake.
Package accounts is etherpad-go's account management: accounts (people, service accounts and the anonymous visitor), roles built from scopes, role assignments limited to pad patterns, and the rules that keep an instance from locking itself out or opening up by mistake.
accounts/admincli
Package admincli is "etherpad-go admin": creating admins, resetting passwords and listing accounts from the command line, on the database of the settings.
Package admincli is "etherpad-go admin": creating admins, resetting passwords and listing accounts from the command line, on the database of the settings.
api
api/legacy
Package legacy serves etherpad-lite's HTTP API, /api/{version}/{function}, for clients written against it (Moodle, Nextcloud, WordPress plugins and the like).
Package legacy serves etherpad-lite's HTTP API, /api/{version}/{function}, for clients written against it (Moodle, Nextcloud, WordPress plugins and the like).
api/mcp
Package mcp serves the Model Context Protocol at /mcp: AI clients (Claude, …) read and edit pads and use their chat with a token (Authorization: Bearer ep_…).
Package mcp serves the Model Context Protocol at /mcp: AI clients (Claude, …) read and edit pads and use their chat with a token (Authorization: Bearer ep_…).
api/padlogin
Package padlogin is the optional login on pads: a person logs in on Etherpad's own OpenID Connect provider and keeps a session cookie; who does not log in has the visitors' rights (lib/accounts).
Package padlogin is the optional login on pads: a person logs in on Etherpad's own OpenID Connect provider and keeps a session cookie; who does not log in has the visitors' rights (lib/accounts).
api/session
Package session implements the Etherpad API session endpoints (createSession, getSessionInfo, deleteSession, listSessionsOfGroup, listSessionsOfAuthor from the original HTTP API).
Package session implements the Etherpad API session endpoints (createSession, getSessionInfo, deleteSession, listSessionsOfGroup, listSessionsOfAuthor from the original HTTP API).
api/tokentransfer
Package tokentransfer moves an author's identity to another browser (etherpad-lite's /tokenTransfer): the first browser asks for a code, the second redeems it within five minutes, once, and gets the same author token as an HttpOnly cookie plus the pad preferences.
Package tokentransfer moves an author's identity to another browser (etherpad-lite's /tokenTransfer): the first browser asks for a code, the second redeems it within five minutes, once, and gets the same author token as an HttpOnly cookie plus the pad preferences.
api/versionstatus
Package versionstatus answers /api/version-status: whether to tell the visitor of a pad that this Etherpad is a minor version or more behind.
Package versionstatus answers /api/version-status: whether to tell the visitor of a pad that this Etherpad is a minor version or more behind.
apikeys
Package apikeys manages the keys of the HTTP API (/api).
Package apikeys manages the keys of the HTTP API (/api).
cli
cluster
Package cluster passes live updates between Etherpad instances that share one database.
Package cluster passes live updates between Etherpad instances that share one database.
compact
Package compact is "etherpad-go compact": etherpad-lite's bin/compactPad, bin/compactAllPads and bin/compactStalePads as a command of the binary.
Package compact is "etherpad-go compact": etherpad-lite's bin/compactPad, bin/compactAllPads and bin/compactStalePads as a command of the binary.
db
io
lifecycle
Package lifecycle tracks whether this instance should receive traffic: not before it has started, and no longer once it is shutting down.
Package lifecycle tracks whether this instance should receive traffic: not before it has started, and no longer once it is shutting down.
mail
Package mail sends plain-text notices through an SMTP server (the updater's mails to the admin).
Package mail sends plain-text notices through an SMTP server (the updater's mails to the admin).
metrics
Package metrics holds the Prometheus instruments on the hot path of the pad message handler: etherpad-lite's prom-instruments (scaling dive, #7756).
Package metrics holds the Prometheus instruments on the hot path of the pad message handler: etherpad-lite's prom-instruments (scaling dive, #7756).
pad
paddiff
Package paddiff is a port of the original Etherpad src/node/utils/padDiff.ts.
Package paddiff is a port of the original Etherpad src/node/utils/padDiff.ts.
security
Package security provides the SecretRotator, a port of Etherpad's src/node/security/SecretRotator.ts.
Package security provides the SecretRotator, a port of Etherpad's src/node/security/SecretRotator.ts.
skin
Package skin knows what the server needs about the skins: the toolbar colour of the colibris variants, for the theme-color meta.
Package skin knows what the server needs about the skins: the toolbar colour of the colibris variants, for the theme-color meta.
socialmeta
Package socialmeta builds the Open Graph + Twitter Card <meta> tag block emitted on the homepage, pad page, and timeslider so URLs shared in chat apps (WhatsApp, Signal, Slack, ...) unfurl with a preview.
Package socialmeta builds the Open Graph + Twitter Card <meta> tag block emitted on the homepage, pad page, and timeslider so URLs shared in chat apps (WhatsApp, Signal, Slack, ...) unfurl with a preview.
test/testdb
Package testdb gives tests one shared Postgres and one shared MariaDB server per machine, and isolated databases on them.
Package testdb gives tests one shared Postgres and one shared MariaDB server per machine, and isolated databases on them.
tokens
Package tokens manages the tokens of accounts: API keys with their own scopes, pad pattern and expiry.
Package tokens manages the tokens of accounts: API keys with their own scopes, pad pattern and expiry.
updater
Package updater implements Etherpad-Go's self-update subsystem: a tiered (off / notify / manual / auto / autonomous) updater that checks GitHub releases, and — for writable single-binary installs — downloads the matching release binary, verifies it, atomically replaces the running executable and exits with code 75 so a process supervisor restarts into the new version.
Package updater implements Etherpad-Go's self-update subsystem: a tiered (off / notify / manual / auto / autonomous) updater that checks GitHub releases, and — for writable single-binary installs — downloads the matching release binary, verifies it, atomically replaces the running executable and exits with code 75 so a process supervisor restarts into the new version.
ws

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL