From 372f34076b5e4a7ecda870c613961e9f86ba8240 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 16:19:00 +0000 Subject: [PATCH 1/4] Initial plan From 5e79db8fb69db93899f68dfa3a9ab2080284e0ed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 16:21:11 +0000 Subject: [PATCH 2/4] Add docker-compose.yml, .env.example, and update README for Etherpad deployment Co-authored-by: saurabh-khanna <54084054+saurabh-khanna@users.noreply.github.com> --- .env.example | 24 +++++++++++++++++++++++ README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++- docker-compose.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 .env.example create mode 100644 docker-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..136cdbc --- /dev/null +++ b/.env.example @@ -0,0 +1,24 @@ +# Copy this file to .env and edit the values before running docker compose up. + +# Etherpad admin password (used at /admin) — REQUIRED, must be changed +ADMIN_PASSWORD=REPLACE_WITH_STRONG_PASSWORD + +# Instance title shown in the browser +TITLE=Etherpad + +# Host port to expose Etherpad on +PORT=9001 + +# Default text shown in new pads (cannot be empty) +DEFAULT_PAD_TEXT=Welcome to Etherpad! + +# Set to true if Etherpad is behind a reverse proxy (e.g. nginx) +TRUST_PROXY=false + +# Disable logging of client IP addresses +DISABLE_IP_LOGGING=false + +# PostgreSQL credentials +POSTGRES_DB=etherpad +POSTGRES_USER=etherpad +POSTGRES_PASSWORD=REPLACE_WITH_STRONG_PASSWORD diff --git a/README.md b/README.md index 1e93ae1..ec6724e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,50 @@ # notes -Etherpad notes on Invisible Information Projects +A self-contained, deployable [Etherpad](https://etherpad.org) instance for Invisible Information Projects. + +## Requirements + +- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) + +## Quick start + +```bash +# 1. Copy the example environment file and edit the passwords / settings +cp .env.example .env +$EDITOR .env + +# 2. Start Etherpad (and its PostgreSQL database) +docker compose up -d + +# 3. Open Etherpad in your browser +open http://localhost:9001 +``` + +The admin interface is available at `http://localhost:9001/admin` using the +password set in `ADMIN_PASSWORD`. + +## Configuration + +All configuration is done through environment variables in the `.env` file. +See `.env.example` for the full list of available options. + +| Variable | Description | Default | +| -------------------- | ------------------------------------------------------- | ------------ | +| `ADMIN_PASSWORD` | Password for the `/admin` interface | `changeme` | +| `TITLE` | Instance title shown in the browser | `Etherpad` | +| `PORT` | Host port Etherpad is exposed on | `9001` | +| `DEFAULT_PAD_TEXT` | Default text inserted into new pads | ` ` | +| `TRUST_PROXY` | Set to `true` when running behind a reverse proxy | `false` | +| `DISABLE_IP_LOGGING` | Set to `true` to disable client IP logging | `false` | +| `POSTGRES_DB` | PostgreSQL database name | `etherpad` | +| `POSTGRES_USER` | PostgreSQL user | `etherpad` | +| `POSTGRES_PASSWORD` | PostgreSQL password | `changeme` | + +## Stopping + +```bash +docker compose down +``` + +Data is persisted in named Docker volumes (`postgres_data`, `etherpad-var`, +`plugins`) and will survive container restarts. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5445b40 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,43 @@ +services: + app: + user: "5001:0" + image: etherpad/etherpad:latest + tty: true + stdin_open: true + volumes: + - plugins:/opt/etherpad-lite/src/plugin_packages + - etherpad-var:/opt/etherpad-lite/var + depends_on: + - postgres + environment: + NODE_ENV: production + ADMIN_PASSWORD: ${ADMIN_PASSWORD:?Set ADMIN_PASSWORD in .env} + DB_HOST: postgres + DB_NAME: ${POSTGRES_DB:-etherpad} + DB_PASS: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env} + DB_PORT: 5432 + DB_TYPE: postgres + DB_USER: ${POSTGRES_USER:-etherpad} + DEFAULT_PAD_TEXT: ${DEFAULT_PAD_TEXT:- } + DISABLE_IP_LOGGING: ${DISABLE_IP_LOGGING:-false} + TITLE: ${TITLE:-Etherpad} + TRUST_PROXY: ${TRUST_PROXY:-true} + restart: always + ports: + - "${PORT:-9001}:9001" + + postgres: + image: postgres:15-alpine + environment: + POSTGRES_DB: ${POSTGRES_DB:-etherpad} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env} + POSTGRES_USER: ${POSTGRES_USER:-etherpad} + PGDATA: /var/lib/postgresql/data/pgdata + restart: always + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: + plugins: + etherpad-var: From d8b3f367fe078a74e80ff02e32e495cf36e2f9dc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 16:27:34 +0000 Subject: [PATCH 3/4] Add EC2 deployment guide and Amazon RDS support Co-authored-by: saurabh-khanna <54084054+saurabh-khanna@users.noreply.github.com> --- .env.example | 10 ++++++++ README.md | 54 ++++++++++++++++++++++++++++++++++++++---- docker-compose.rds.yml | 37 +++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 docker-compose.rds.yml diff --git a/.env.example b/.env.example index 136cdbc..d9fe56a 100644 --- a/.env.example +++ b/.env.example @@ -22,3 +22,13 @@ DISABLE_IP_LOGGING=false POSTGRES_DB=etherpad POSTGRES_USER=etherpad POSTGRES_PASSWORD=REPLACE_WITH_STRONG_PASSWORD + +# ── Amazon RDS / external PostgreSQL (optional) ───────────────────────────── +# Uncomment and fill in these variables when using docker-compose.rds.yml +# instead of the bundled PostgreSQL container. +# +# DB_HOST=your-instance.xxxxxx.us-east-1.rds.amazonaws.com +# DB_PORT=5432 +# DB_NAME=etherpad +# DB_USER=etherpad +# DB_PASS=REPLACE_WITH_STRONG_PASSWORD diff --git a/README.md b/README.md index ec6724e..2b4f0f2 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,49 @@ open http://localhost:9001 The admin interface is available at `http://localhost:9001/admin` using the password set in `ADMIN_PASSWORD`. +## Deploying to EC2 + +Everything is pre-configured: PostgreSQL runs as a sidecar container alongside +Etherpad — no separate database setup is required. + +```bash +# 1. Launch an EC2 instance (Amazon Linux 2023 / Ubuntu 22.04+) and SSH in. + +# 2. Install Docker and Docker Compose following the official guide: +# https://docs.docker.com/engine/install/ + +# 3. Clone this repository and configure it: +git clone https://github.com/invisibleinfo/notes.git +cd notes +cp .env.example .env +nano .env # set ADMIN_PASSWORD and POSTGRES_PASSWORD + +# 4. Start the stack: +docker compose up -d +``` + +Open port **9001** (or whichever `PORT` you set) in the EC2 security group for +inbound TCP traffic, then visit `http://:9001`. + +### Option B – use Amazon RDS instead of the bundled PostgreSQL + +If you already have an RDS PostgreSQL instance, you can skip the sidecar +container: + +```bash +# In .env, comment out POSTGRES_* and fill in the DB_* variables instead: +# DB_HOST=your-instance.xxxxxx.us-east-1.rds.amazonaws.com +# DB_PORT=5432 +# DB_NAME=etherpad +# DB_USER=etherpad +# DB_PASS=your-rds-password + +docker compose -f docker-compose.rds.yml up -d +``` + +The RDS security group must allow inbound TCP on port 5432 from the EC2 +instance's security group. + ## Configuration All configuration is done through environment variables in the `.env` file. @@ -30,15 +73,15 @@ See `.env.example` for the full list of available options. | Variable | Description | Default | | -------------------- | ------------------------------------------------------- | ------------ | -| `ADMIN_PASSWORD` | Password for the `/admin` interface | `changeme` | +| `ADMIN_PASSWORD` | Password for the `/admin` interface | **required** | | `TITLE` | Instance title shown in the browser | `Etherpad` | | `PORT` | Host port Etherpad is exposed on | `9001` | | `DEFAULT_PAD_TEXT` | Default text inserted into new pads | ` ` | -| `TRUST_PROXY` | Set to `true` when running behind a reverse proxy | `false` | +| `TRUST_PROXY` | Set to `true` when running behind a reverse proxy | `true` | | `DISABLE_IP_LOGGING` | Set to `true` to disable client IP logging | `false` | -| `POSTGRES_DB` | PostgreSQL database name | `etherpad` | -| `POSTGRES_USER` | PostgreSQL user | `etherpad` | -| `POSTGRES_PASSWORD` | PostgreSQL password | `changeme` | +| `POSTGRES_DB` | PostgreSQL database name (bundled DB) | `etherpad` | +| `POSTGRES_USER` | PostgreSQL user (bundled DB) | `etherpad` | +| `POSTGRES_PASSWORD` | PostgreSQL password (bundled DB) | **required** | ## Stopping @@ -48,3 +91,4 @@ docker compose down Data is persisted in named Docker volumes (`postgres_data`, `etherpad-var`, `plugins`) and will survive container restarts. + diff --git a/docker-compose.rds.yml b/docker-compose.rds.yml new file mode 100644 index 0000000..a463073 --- /dev/null +++ b/docker-compose.rds.yml @@ -0,0 +1,37 @@ +# Standalone Compose file for deploying Etherpad against Amazon RDS +# (or any external PostgreSQL). No bundled database container is started. +# +# Usage: +# docker compose -f docker-compose.rds.yml up -d +# +# Set the DB_* variables in your .env file (see .env.example). + +services: + app: + user: "5001:0" + image: etherpad/etherpad:latest + tty: true + stdin_open: true + volumes: + - plugins:/opt/etherpad-lite/src/plugin_packages + - etherpad-var:/opt/etherpad-lite/var + environment: + NODE_ENV: production + ADMIN_PASSWORD: ${ADMIN_PASSWORD:?Set ADMIN_PASSWORD in .env} + DB_HOST: ${DB_HOST:?Set DB_HOST to your RDS endpoint in .env} + DB_PORT: ${DB_PORT:-5432} + DB_NAME: ${DB_NAME:?Set DB_NAME in .env} + DB_USER: ${DB_USER:?Set DB_USER in .env} + DB_PASS: ${DB_PASS:?Set DB_PASS in .env} + DB_TYPE: postgres + DEFAULT_PAD_TEXT: ${DEFAULT_PAD_TEXT:- } # a single space; Etherpad requires a non-empty value + DISABLE_IP_LOGGING: ${DISABLE_IP_LOGGING:-false} + TITLE: ${TITLE:-Etherpad} + TRUST_PROXY: ${TRUST_PROXY:-true} + restart: always + ports: + - "${PORT:-9001}:9001" + +volumes: + plugins: + etherpad-var: From 6ed28284027cce3ad5409be4da32c0f64fd68eed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 16:42:15 +0000 Subject: [PATCH 4/4] Adapt deployment for Appliku: add Dockerfile + Procfile, update README and .env.example Co-authored-by: saurabh-khanna <54084054+saurabh-khanna@users.noreply.github.com> --- .env.example | 24 +++++++----- Dockerfile | 1 + Procfile | 1 + README.md | 83 ++++++++++++++++++++++++------------------ docker-compose.rds.yml | 2 +- docker-compose.yml | 2 +- 6 files changed, 65 insertions(+), 48 deletions(-) create mode 100644 Dockerfile create mode 100644 Procfile diff --git a/.env.example b/.env.example index d9fe56a..e73ffc0 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,6 @@ # Copy this file to .env and edit the values before running docker compose up. +# For Appliku production deployments, set these variables in the Appliku +# dashboard instead — do NOT commit a filled-in .env to the repository. # Etherpad admin password (used at /admin) — REQUIRED, must be changed ADMIN_PASSWORD=REPLACE_WITH_STRONG_PASSWORD @@ -6,29 +8,31 @@ ADMIN_PASSWORD=REPLACE_WITH_STRONG_PASSWORD # Instance title shown in the browser TITLE=Etherpad -# Host port to expose Etherpad on +# Host port to expose Etherpad on (local dev only; Appliku manages this) PORT=9001 # Default text shown in new pads (cannot be empty) DEFAULT_PAD_TEXT=Welcome to Etherpad! -# Set to true if Etherpad is behind a reverse proxy (e.g. nginx) +# Set to true if Etherpad is behind a reverse proxy (always true on Appliku) TRUST_PROXY=false # Disable logging of client IP addresses DISABLE_IP_LOGGING=false -# PostgreSQL credentials +# ── Local development: bundled PostgreSQL sidecar ──────────────────────────── +# Used by docker-compose.yml when running locally. Not needed on Appliku. POSTGRES_DB=etherpad POSTGRES_USER=etherpad POSTGRES_PASSWORD=REPLACE_WITH_STRONG_PASSWORD -# ── Amazon RDS / external PostgreSQL (optional) ───────────────────────────── -# Uncomment and fill in these variables when using docker-compose.rds.yml -# instead of the bundled PostgreSQL container. +# ── Production (Appliku / external PostgreSQL) ─────────────────────────────── +# Set these in the Appliku dashboard (App → Environment Variables). +# Appliku shows the values after you create a database in the dashboard. # -# DB_HOST=your-instance.xxxxxx.us-east-1.rds.amazonaws.com +# DB_TYPE=postgres +# DB_HOST= # DB_PORT=5432 -# DB_NAME=etherpad -# DB_USER=etherpad -# DB_PASS=REPLACE_WITH_STRONG_PASSWORD +# DB_NAME= +# DB_USER= +# DB_PASS= diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ef58358 --- /dev/null +++ b/Dockerfile @@ -0,0 +1 @@ +FROM etherpad/etherpad:2.6.1 diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..10d5b8d --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: node /opt/etherpad-lite/src/node/server.js diff --git a/README.md b/README.md index 2b4f0f2..d4b700c 100644 --- a/README.md +++ b/README.md @@ -23,52 +23,57 @@ open http://localhost:9001 The admin interface is available at `http://localhost:9001/admin` using the password set in `ADMIN_PASSWORD`. -## Deploying to EC2 +## Deploying with Appliku -Everything is pre-configured: PostgreSQL runs as a sidecar container alongside -Etherpad — no separate database setup is required. +[Appliku](https://appliku.com) manages the EC2 instance, builds the Docker +image from this repository, and provisions a separate PostgreSQL database — no +SSH or manual server setup is required. -```bash -# 1. Launch an EC2 instance (Amazon Linux 2023 / Ubuntu 22.04+) and SSH in. +### 1 — Connect your repository -# 2. Install Docker and Docker Compose following the official guide: -# https://docs.docker.com/engine/install/ +1. Log in to [app.appliku.com](https://app.appliku.com) and create a new + application. +2. Connect it to this GitHub repository. +3. Appliku detects the `Dockerfile` and `Procfile` automatically. -# 3. Clone this repository and configure it: -git clone https://github.com/invisibleinfo/notes.git -cd notes -cp .env.example .env -nano .env # set ADMIN_PASSWORD and POSTGRES_PASSWORD +### 2 — Add a PostgreSQL database -# 4. Start the stack: -docker compose up -d -``` +In the Appliku dashboard, go to **Databases → Add database** and create a +PostgreSQL instance. Appliku will make the connection credentials available as +environment variables you can reference in step 3. -Open port **9001** (or whichever `PORT` you set) in the EC2 security group for -inbound TCP traffic, then visit `http://:9001`. +### 3 — Set environment variables -### Option B – use Amazon RDS instead of the bundled PostgreSQL +In **App → Environment Variables**, add the following (use the values shown by +the Appliku database panel for the `DB_*` variables): -If you already have an RDS PostgreSQL instance, you can skip the sidecar -container: +| Variable | Value | +| -------------------- | --------------------------------------- | +| `ADMIN_PASSWORD` | A strong password for `/admin` | +| `DB_TYPE` | `postgres` | +| `DB_HOST` | Appliku DB host | +| `DB_PORT` | `5432` | +| `DB_NAME` | Appliku DB name | +| `DB_USER` | Appliku DB user | +| `DB_PASS` | Appliku DB password | +| `TRUST_PROXY` | `true` (Appliku sits behind a proxy) | +| `TITLE` | *(optional)* Instance title | +| `DISABLE_IP_LOGGING` | *(optional)* `true` to disable IP logs | -```bash -# In .env, comment out POSTGRES_* and fill in the DB_* variables instead: -# DB_HOST=your-instance.xxxxxx.us-east-1.rds.amazonaws.com -# DB_PORT=5432 -# DB_NAME=etherpad -# DB_USER=etherpad -# DB_PASS=your-rds-password - -docker compose -f docker-compose.rds.yml up -d -``` +### 4 — Deploy + +Click **Deploy** in the Appliku dashboard (or push a commit — Appliku +auto-deploys on every push). Etherpad will be available at the URL shown in the +dashboard. -The RDS security group must allow inbound TCP on port 5432 from the EC2 -instance's security group. +> **Note:** The `docker-compose.yml` in this repo is for **local development +> only**. Appliku uses the `Dockerfile` and `Procfile` for production +> deployments; the bundled PostgreSQL sidecar is not started. ## Configuration -All configuration is done through environment variables in the `.env` file. +All configuration is done through environment variables — in `.env` for local +development, or in the Appliku dashboard for production. See `.env.example` for the full list of available options. | Variable | Description | Default | @@ -79,9 +84,15 @@ See `.env.example` for the full list of available options. | `DEFAULT_PAD_TEXT` | Default text inserted into new pads | ` ` | | `TRUST_PROXY` | Set to `true` when running behind a reverse proxy | `true` | | `DISABLE_IP_LOGGING` | Set to `true` to disable client IP logging | `false` | -| `POSTGRES_DB` | PostgreSQL database name (bundled DB) | `etherpad` | -| `POSTGRES_USER` | PostgreSQL user (bundled DB) | `etherpad` | -| `POSTGRES_PASSWORD` | PostgreSQL password (bundled DB) | **required** | +| `DB_TYPE` | Database type (production) | `postgres` | +| `DB_HOST` | Database host (production / Appliku) | — | +| `DB_PORT` | Database port (production / Appliku) | `5432` | +| `DB_NAME` | Database name (production / Appliku) | — | +| `DB_USER` | Database user (production / Appliku) | — | +| `DB_PASS` | Database password (production / Appliku) | — | +| `POSTGRES_DB` | PostgreSQL database name (local dev / bundled DB) | `etherpad` | +| `POSTGRES_USER` | PostgreSQL user (local dev / bundled DB) | `etherpad` | +| `POSTGRES_PASSWORD` | PostgreSQL password (local dev / bundled DB) | **required** | ## Stopping diff --git a/docker-compose.rds.yml b/docker-compose.rds.yml index a463073..e96876e 100644 --- a/docker-compose.rds.yml +++ b/docker-compose.rds.yml @@ -9,7 +9,7 @@ services: app: user: "5001:0" - image: etherpad/etherpad:latest + image: etherpad/etherpad:2.6.1 tty: true stdin_open: true volumes: diff --git a/docker-compose.yml b/docker-compose.yml index 5445b40..9b9f41e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: app: user: "5001:0" - image: etherpad/etherpad:latest + image: etherpad/etherpad:2.6.1 tty: true stdin_open: true volumes: