Compare commits

..

No commits in common. "develop" and "v2.0.1" have entirely different histories.

363 changed files with 43366 additions and 36002 deletions

View file

@ -25,5 +25,3 @@ Dockerfile
settings.json settings.json
src/node_modules src/node_modules
admin/node_modules admin/node_modules
ui/node_modules
node_modules

View file

@ -1,17 +0,0 @@
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
# editorconfig-tools is unable to ignore longs strings or urls
max_line_length = off
[CHANGELOG.md]
indent_size = 4
[*.bat]
end_of_line = crlf

View file

@ -4,15 +4,15 @@
# Always ensure to load the env variables in every terminal session. # Always ensure to load the env variables in every terminal session.
# Otherwise the env variables will not be available # Otherwise the env variables will not be available
DOCKER_COMPOSE_APP_PORT_PUBLISHED=9001 DOCKER_COMPOSE_APP_DEV_PORT_PUBLISHED=9001
DOCKER_COMPOSE_APP_PORT_TARGET=9001 DOCKER_COMPOSE_APP_DEV_PORT_TARGET=9001
# IMPORTANT: When the env var DEFAULT_PAD_TEXT is unset or empty, then the pad is not established (not the landing page). # IMPORTANT: When the env var DEFAULT_PAD_TEXT is unset or empty, then the pad is not established (not the landing page).
# The env var DEFAULT_PAD_TEXT seems to be mandatory in the latest version of etherpad. # The env var DEFAULT_PAD_TEXT seems to be mandatory in the latest version of etherpad.
DOCKER_COMPOSE_APP_DEV_ENV_DEFAULT_PAD_TEXT="Welcome to etherpad" DOCKER_COMPOSE_APP_DEV_ENV_DEFAULT_PAD_TEXT="Welcome to etherpad"
DOCKER_COMPOSE_APP_ADMIN_PASSWORD= DOCKER_COMPOSE_APP_DEV_ADMIN_PASSWORD=
DOCKER_COMPOSE_POSTGRES_DATABASE=db DOCKER_COMPOSE_POSTGRES_DEV_ENV_POSTGRES_DATABASE=db
DOCKER_COMPOSE_POSTGRES_PASSWORD=etherpad-lite-password DOCKER_COMPOSE_POSTGRES_DEV_ENV_POSTGRES_PASSWORD=etherpad-lite-password
DOCKER_COMPOSE_POSTGRES_USER=etherpad-lite-user DOCKER_COMPOSE_POSTGRES_DEV_ENV_POSTGRES_USER=etherpad-lite-user

View file

@ -1,18 +0,0 @@
# Please copy and rename this file.
#
# !Attention!
# Always ensure to load the env variables in every terminal session.
# Otherwise the env variables will not be available
DOCKER_COMPOSE_APP_DEV_PORT_PUBLISHED=9001
DOCKER_COMPOSE_APP_DEV_PORT_TARGET=9001
# IMPORTANT: When the env var DEFAULT_PAD_TEXT is unset or empty, then the pad is not established (not the landing page).
# The env var DEFAULT_PAD_TEXT seems to be mandatory in the latest version of etherpad.
DOCKER_COMPOSE_APP_DEV_ENV_DEFAULT_PAD_TEXT="Welcome to etherpad"
DOCKER_COMPOSE_APP_DEV_ADMIN_PASSWORD=
DOCKER_COMPOSE_POSTGRES_DEV_ENV_POSTGRES_DATABASE=db
DOCKER_COMPOSE_POSTGRES_DEV_ENV_POSTGRES_PASSWORD=etherpad-lite-password
DOCKER_COMPOSE_POSTGRES_DEV_ENV_POSTGRES_USER=etherpad-lite-user

View file

@ -10,11 +10,7 @@ updates:
schedule: schedule:
interval: "daily" interval: "daily"
- package-ecosystem: "npm" - package-ecosystem: "npm"
directory: "/" directory: "/src"
schedule: schedule:
interval: "daily" interval: "daily"
versioning-strategy: "increase" versioning-strategy: "increase"
open-pull-requests-limit: 30
groups:
dev-dependencies:
dependency-type: "development"

View file

@ -1,13 +1,7 @@
name: "Backend tests" name: "Backend tests"
# any branch is useful for testing before a PR is submitted # any branch is useful for testing before a PR is submitted
on: on: [push, pull_request]
push:
paths-ignore:
- "doc/**"
pull_request:
paths-ignore:
- "doc/**"
permissions: permissions:
contents: read contents: read
@ -24,7 +18,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
node: [20, 22, 23] node: [18, 20, 21]
steps: steps:
- -
name: Checkout repository name: Checkout repository
@ -33,10 +27,10 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -53,7 +47,7 @@ jobs:
run: pnpm config set auto-install-peers false run: pnpm config set auto-install-peers false
- -
name: Install libreoffice name: Install libreoffice
uses: awalsh128/cache-apt-pkgs-action@v1.5.0 uses: awalsh128/cache-apt-pkgs-action@v1.4.2
with: with:
packages: libreoffice libreoffice-pdfimport packages: libreoffice libreoffice-pdfimport
version: 1.0 version: 1.0
@ -69,9 +63,6 @@ jobs:
- -
name: Run the backend tests name: Run the backend tests
run: pnpm test run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: pnpm run test:vitest
withpluginsLinux: withpluginsLinux:
# run on pushes to any branch # run on pushes to any branch
@ -84,7 +75,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
node: [20, 22, 23] node: [18, 20, 21]
steps: steps:
- -
name: Checkout repository name: Checkout repository
@ -93,10 +84,10 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -113,7 +104,7 @@ jobs:
run: pnpm config set auto-install-peers false run: pnpm config set auto-install-peers false
- -
name: Install libreoffice name: Install libreoffice
uses: awalsh128/cache-apt-pkgs-action@v1.5.0 uses: awalsh128/cache-apt-pkgs-action@v1.4.2
with: with:
packages: libreoffice libreoffice-pdfimport packages: libreoffice libreoffice-pdfimport
version: 1.0 version: 1.0
@ -136,6 +127,7 @@ jobs:
ep_font_size ep_font_size
ep_hash_auth ep_hash_auth
ep_headings2 ep_headings2
ep_image_upload
ep_markdown ep_markdown
ep_readonly_guest ep_readonly_guest
ep_set_title_on_pad ep_set_title_on_pad
@ -145,9 +137,6 @@ jobs:
- -
name: Run the backend tests name: Run the backend tests
run: pnpm test run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: pnpm run test:vitest
withoutpluginsWindows: withoutpluginsWindows:
# run on pushes to any branch # run on pushes to any branch
@ -165,10 +154,10 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -199,11 +188,7 @@ jobs:
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json" powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
- -
name: Run the backend tests name: Run the backend tests
working-directory: src run: cd src && pnpm test
run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: pnpm run test:vitest
withpluginsWindows: withpluginsWindows:
# run on pushes to any branch # run on pushes to any branch
@ -221,11 +206,11 @@ jobs:
- -
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 22 node-version: 21
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -258,6 +243,7 @@ jobs:
ep_font_size ep_font_size
ep_hash_auth ep_hash_auth
ep_headings2 ep_headings2
ep_image_upload
ep_markdown ep_markdown
ep_readonly_guest ep_readonly_guest
ep_set_title_on_pad ep_set_title_on_pad
@ -283,8 +269,4 @@ jobs:
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json" powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
- -
name: Run the backend tests name: Run the backend tests
working-directory: src run: cd src && pnpm test
run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: pnpm run test:vitest

View file

@ -1,70 +0,0 @@
# Workflow for deploying static content to GitHub Pages
name: Deploy Docs to GitHub Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["develop"]
paths:
- doc/** # Only run workflow when changes are made to the doc directory
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
packages: read
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.0.4
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Only install direct dependencies
run: pnpm config set auto-install-peers false
- name: Install dependencies
run: pnpm install
- name: Build app
working-directory: doc
run: pnpm run docs:build
env:
COMMIT_REF: ${{ github.sha }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './doc/.vitepress/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View file

@ -6,8 +6,6 @@ on:
pull_request: pull_request:
# The branches below must be a subset of the branches above # The branches below must be a subset of the branches above
branches: [develop] branches: [develop]
paths-ignore:
- 'doc/**'
schedule: schedule:
- cron: '0 13 * * 1' - cron: '0 13 * * 1'

View file

@ -1,13 +1,9 @@
name: Docker name: Docker
on: on:
pull_request: pull_request:
paths-ignore:
- 'doc/**'
push: push:
branches: branches:
- 'develop' - 'develop'
paths-ignore:
- 'doc/**'
tags: tags:
- 'v?[0-9]+.[0-9]+.[0-9]+' - 'v?[0-9]+.[0-9]+.[0-9]+'
env: env:
@ -22,9 +18,6 @@ jobs:
- -
name: Check out name: Check out
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
path: etherpad
- -
name: Set up QEMU name: Set up QEMU
if: github.event_name == 'push' if: github.event_name == 'push'
@ -34,9 +27,9 @@ jobs:
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- -
name: Build and export to Docker name: Build and export to Docker
uses: docker/build-push-action@v6 uses: docker/build-push-action@v5
with: with:
context: ./etherpad context: .
target: production target: production
load: true load: true
tags: ${{ env.TEST_TAG }} tags: ${{ env.TEST_TAG }}
@ -47,10 +40,10 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 'lts/*' node-version: 'lts/*'
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -65,7 +58,6 @@ jobs:
${{ runner.os }}-pnpm-store- ${{ runner.os }}-pnpm-store-
- -
name: Test name: Test
working-directory: etherpad
run: | run: |
docker run --rm -d -p 9001:9001 --name test ${{ env.TEST_TAG }} docker run --rm -d -p 9001:9001 --name test ${{ env.TEST_TAG }}
./bin/installDeps.sh ./bin/installDeps.sh
@ -102,11 +94,10 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- -
name: Build and push name: Build and push
id: build-docker
if: github.event_name == 'push' if: github.event_name == 'push'
uses: docker/build-push-action@v6 uses: docker/build-push-action@v5
with: with:
context: ./etherpad context: .
target: production target: production
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: true push: true
@ -116,29 +107,7 @@ jobs:
uses: peter-evans/dockerhub-description@v4 uses: peter-evans/dockerhub-description@v4
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
with: with:
readme-filepath: ./etherpad/README.md
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: etherpad/etherpad repository: etherpad/etherpad
enable-url-completion: true enable-url-completion: true
- name: Check out
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
uses: actions/checkout@v4
with:
path: ether-charts
repository: ether/ether-charts
token: ${{ secrets.ETHER_CHART_TOKEN }}
- name: Update tag in values-dev.yaml
if: success() && github.ref == 'refs/heads/develop'
working-directory: ether-charts
run: |
sed -i 's/tag: ".*"/tag: "${{ steps.build-docker.outputs.digest }}"/' values-dev.yaml
- name: Commit and push changes
working-directory: ether-charts
if: success() && github.ref == 'refs/heads/develop'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add values-dev.yaml
git commit -m 'Update develop image tag'
git push

View file

@ -1,23 +1,21 @@
# Leave the powered by Sauce Labs bit in as this means we get additional concurrency # Leave the powered by Sauce Labs bit in as this means we get additional concurrency
name: "Frontend admin tests powered by Sauce Labs" name: "Frontend admin tests powered by Sauce Labs"
on: on: [push]
push:
paths-ignore:
- 'doc/**'
permissions: permissions:
contents: read # to fetch code (actions/checkout) contents: read # to fetch code (actions/checkout)
jobs: jobs:
withplugins: withplugins:
if: ${{ github.actor != 'dependabot[bot]' }}
name: with plugins name: with plugins
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
node: [20, 22, 23] node: [20, 21]
steps: steps:
- -
@ -33,10 +31,10 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -49,13 +47,6 @@ jobs:
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-pnpm-store- ${{ runner.os }}-pnpm-store-
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Only install direct dependencies - name: Only install direct dependencies
run: pnpm config set auto-install-peers false run: pnpm config set auto-install-peers false
#- #-
@ -75,7 +66,7 @@ jobs:
# rules. # rules.
- -
name: Install all dependencies and symlink for ep_etherpad-lite name: Install all dependencies and symlink for ep_etherpad-lite
run: pnpm i run: bin/installDeps.sh
#- #-
# name: Install etherpad plugins # name: Install etherpad plugins
# run: rm -Rf node_modules/ep_align/static/tests/* # run: rm -Rf node_modules/ep_align/static/tests/*
@ -91,7 +82,7 @@ jobs:
run: "sed -i 's/\"enableAdminUITests\": false/\"enableAdminUITests\": true,\\n\"users\":{\"admin\":{\"password\":\"changeme1\",\"is_admin\":true}}/' settings.json" run: "sed -i 's/\"enableAdminUITests\": false/\"enableAdminUITests\": true,\\n\"users\":{\"admin\":{\"password\":\"changeme1\",\"is_admin\":true}}/' settings.json"
- -
name: increase maxHttpBufferSize name: increase maxHttpBufferSize
run: "sed -i 's/\"maxHttpBufferSize\": 50000/\"maxHttpBufferSize\": 10000000/' settings.json" run: "sed -i 's/\"maxHttpBufferSize\": 10000/\"maxHttpBufferSize\": 10000000/' settings.json"
- -
name: Disable import/export rate limiting name: Disable import/export rate limiting
run: | run: |
@ -99,6 +90,7 @@ jobs:
- name: Build admin frontend - name: Build admin frontend
working-directory: admin working-directory: admin
run: | run: |
pnpm install
pnpm run build pnpm run build
# name: Run the frontend admin tests # name: Run the frontend admin tests
# shell: bash # shell: bash
@ -130,7 +122,7 @@ jobs:
- name: Run the frontend admin tests - name: Run the frontend admin tests
shell: bash shell: bash
run: | run: |
pnpm run prod & pnpm run dev &
connected=false connected=false
can_connect() { can_connect() {
curl -sSfo /dev/null http://localhost:9001/ || return 1 curl -sSfo /dev/null http://localhost:9001/ || return 1

View file

@ -1,10 +1,7 @@
# Leave the powered by Sauce Labs bit in as this means we get additional concurrency # Leave the powered by Sauce Labs bit in as this means we get additional concurrency
name: "Frontend tests powered by Sauce Labs" name: "Frontend tests powered by Sauce Labs"
on: on: [push]
push:
paths-ignore:
- 'doc/**'
permissions: permissions:
contents: read # to fetch code (actions/checkout) contents: read # to fetch code (actions/checkout)
@ -26,11 +23,11 @@ jobs:
- -
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 22 node-version: 21
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -56,17 +53,10 @@ jobs:
- -
name: Create settings.json name: Create settings.json
run: cp ./src/tests/settings.json settings.json run: cp ./src/tests/settings.json settings.json
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Run the frontend tests - name: Run the frontend tests
shell: bash shell: bash
run: | run: |
pnpm run prod & pnpm run dev &
connected=false connected=false
can_connect() { can_connect() {
curl -sSfo /dev/null http://localhost:9001/ || return 1 curl -sSfo /dev/null http://localhost:9001/ || return 1
@ -99,11 +89,11 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 22 node-version: 21
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -126,17 +116,10 @@ jobs:
run: echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})" run: echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})"
- name: Create settings.json - name: Create settings.json
run: cp ./src/tests/settings.json settings.json run: cp ./src/tests/settings.json settings.json
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Run the frontend tests - name: Run the frontend tests
shell: bash shell: bash
run: | run: |
pnpm run prod & pnpm run dev &
connected=false connected=false
can_connect() { can_connect() {
curl -sSfo /dev/null http://localhost:9001/ || return 1 curl -sSfo /dev/null http://localhost:9001/ || return 1
@ -173,18 +156,11 @@ jobs:
- -
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 22 node-version: 21
- name: Cache playwright binaries - uses: pnpm/action-setup@v3
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- uses: pnpm/action-setup@v4
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -213,7 +189,7 @@ jobs:
- name: Run the frontend tests - name: Run the frontend tests
shell: bash shell: bash
run: | run: |
pnpm run prod & pnpm run dev &
connected=false connected=false
can_connect() { can_connect() {
curl -sSfo /dev/null http://localhost:9001/ || return 1 curl -sSfo /dev/null http://localhost:9001/ || return 1

34
.github/workflows/lint-package-lock.yml vendored Normal file
View file

@ -0,0 +1,34 @@
name: "Lint"
# any branch is useful for testing before a PR is submitted
on: [push, pull_request]
permissions:
contents: read
jobs:
lint-package-lock:
# run on pushes to any branch
# run on PRs from external forks
if: |
(github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: package-lock.json
runs-on: ubuntu-latest
steps:
-
name: Checkout repository
uses: actions/checkout@v4
-
uses: actions/setup-node@v4
with:
node-version: 20
-
name: Run lockfile-lint on package-lock.json
run: >
npx lockfile-lint
--path src/package-lock.json
--allowed-hosts npm
--allowed-schemes https:
--allowed-schemes github:
--allowed-urls github:mapbox/node-sqlite3#593c9d498be2510d286349134537e3bf89401c4a

View file

@ -1,13 +1,7 @@
name: "Loadtest" name: "Loadtest"
# any branch is useful for testing before a PR is submitted # any branch is useful for testing before a PR is submitted
on: on: [push, pull_request]
push:
paths-ignore:
- "doc/**"
pull_request:
paths-ignore:
- "doc/**"
permissions: permissions:
contents: read contents: read
@ -29,10 +23,10 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -73,10 +67,10 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -144,10 +138,10 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash

View file

@ -1,13 +1,7 @@
name: "Perform type checks" name: "Perform type checks"
# any branch is useful for testing before a PR is submitted # any branch is useful for testing before a PR is submitted
on: on: [push, pull_request]
push:
paths-ignore:
- "doc/**"
pull_request:
paths-ignore:
- "doc/**"
permissions: permissions:
contents: read contents: read
@ -26,10 +20,10 @@ jobs:
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash

View file

@ -1,13 +1,7 @@
name: "rate limit" name: "rate limit"
# any branch is useful for testing before a PR is submitted # any branch is useful for testing before a PR is submitted
on: on: [push, pull_request]
push:
paths-ignore:
- "doc/**"
pull_request:
paths-ignore:
- "doc/**"
permissions: permissions:
contents: read contents: read
@ -29,10 +23,10 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -48,7 +42,7 @@ jobs:
- -
name: docker network name: docker network
run: docker network create --subnet=172.23.0.0/16 ep_net run: docker network create --subnet=172.23.42.0/16 ep_net
- -
name: build docker image name: build docker image
run: | run: |

View file

@ -1,13 +1,7 @@
name: "Upgrade from latest release" name: "Upgrade from latest release"
# any branch is useful for testing before a PR is submitted # any branch is useful for testing before a PR is submitted
on: on: [push, pull_request]
push:
paths-ignore:
- "doc/**"
pull_request:
paths-ignore:
- "doc/**"
permissions: permissions:
contents: read contents: read
@ -24,26 +18,26 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
node: [20, 22, 23] node: [18, 20, 21]
steps: steps:
- -
name: Check out latest release name: Check out latest release
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: develop #FIXME change to master when doing release ref: master
- -
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Only install direct dependencies - name: Only install direct dependencies
run: pnpm config set auto-install-peers false run: pnpm config set auto-install-peers false
- name: Install libreoffice - name: Install libreoffice
uses: awalsh128/cache-apt-pkgs-action@v1.5.0 uses: awalsh128/cache-apt-pkgs-action@v1.4.2
with: with:
packages: libreoffice libreoffice-pdfimport packages: libreoffice libreoffice-pdfimport
version: 1.0 version: 1.0
@ -62,7 +56,7 @@ jobs:
run: pnpm config set auto-install-peers false run: pnpm config set auto-install-peers false
- -
name: Install libreoffice name: Install libreoffice
uses: awalsh128/cache-apt-pkgs-action@v1.5.0 uses: awalsh128/cache-apt-pkgs-action@v1.4.2
with: with:
packages: libreoffice libreoffice-pdfimport packages: libreoffice libreoffice-pdfimport
version: 1.0 version: 1.0
@ -85,6 +79,7 @@ jobs:
ep_font_size ep_font_size
ep_hash_auth ep_hash_auth
ep_headings2 ep_headings2
ep_image_upload
ep_markdown ep_markdown
ep_readonly_guest ep_readonly_guest
ep_set_title_on_pad ep_set_title_on_pad

View file

@ -1,20 +1,13 @@
name: "Windows Build" name: "Windows Build"
# any branch is useful for testing before a PR is submitted # any branch is useful for testing before a PR is submitted
on: on: [push, pull_request]
push:
paths-ignore:
- "doc/**"
pull_request:
paths-ignore:
- "doc/**"
permissions: permissions:
contents: read contents: read
jobs: jobs:
build-zip: build-zip:
permissions: write-all
# run on pushes to any branch # run on pushes to any branch
# run on PRs from external forks # run on PRs from external forks
if: | if: |
@ -35,11 +28,11 @@ jobs:
- -
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 22 node-version: 21
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v3
name: Install pnpm name: Install pnpm
with: with:
version: 9.0.4 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory
shell: bash shell: bash
@ -61,26 +54,112 @@ jobs:
- -
name: Run the backend tests name: Run the backend tests
shell: msys2 {0} shell: msys2 {0}
working-directory: src run: cd src && pnpm test
run: pnpm test -
name: Build the .zip
shell: msys2 {0}
run: bin/buildForWindows.sh
-
name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: etherpad-win.zip
path: etherpad-win.zip
build-exe:
if: |
(github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Build .exe
needs: build-zip
runs-on: windows-latest
steps:
-
name: Checkout repository
uses: actions/checkout@v4
-
name: Download .zip
uses: actions/download-artifact@v4
with:
name: etherpad-win.zip
path: ..
-
name: Extract .zip
working-directory: ..
run: 7z x etherpad-win.zip -oetherpad-zip
-
name: Create installer
uses: joncloud/makensis-action@v4.1
with:
script-file: 'bin/nsis/etherpad.nsi'
-
name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: etherpad-win.exe
path: etherpad-win.exe
deploy-zip:
# run on pushes to any branch
# run on PRs from external forks
permissions:
contents: write
if: |
(github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: Deploy
needs: build-zip
runs-on: windows-latest
steps:
-
name: Download zip
uses: actions/download-artifact@v4
with:
name: etherpad-win.zip
-
name: Extract Etherpad
run: 7z x etherpad-win.zip -oetherpad
-
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Only install direct dependencies
run: pnpm config set auto-install-peers false
- name: Install all dependencies and symlink for ep_etherpad-lite
run: .\bin\installOnWindows.bat
working-directory: etherpad
- -
name: Run Etherpad name: Run Etherpad
working-directory: src working-directory: etherpad/src
run: | run: |
pnpm i pnpm install cypress
pnpm exec playwright install --with-deps .\node_modules\.bin\cypress.cmd install --force
pnpm run prod & pnpm run prod &
curl --connect-timeout 10 --max-time 20 --retry 5 --retry-delay 10 --retry-max-time 60 --retry-connrefused http://127.0.0.1:9001/p/test curl --connect-timeout 10 --max-time 20 --retry 5 --retry-delay 10 --retry-max-time 60 --retry-connrefused http://127.0.0.1:9001/p/test
pnpm exec playwright install chromium --with-deps pnpm exec cypress run --config-file ./tests/frontend/cypress/cypress.config.js
pnpm run test-ui --project=chromium # On release, upload windows zip to GitHub release tab
# On release, create release -
- name: Generate Changelog name: Rename to etherpad-lite-win.zip
if: ${{startsWith(github.ref, 'refs/tags/v') }} shell: powershell
working-directory: bin run: mv etherpad-win.zip etherpad-lite-win.zip
run: pnpm run generateChangelog ${{ github.ref }} > ${{ github.workspace }}-CHANGELOG.txt - name: upload binaries to release
- name: Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
if: ${{startsWith(github.ref, 'refs/tags/v') }} if: ${{startsWith(github.ref, 'refs/tags/v') }}
with: with:
body_path: ${{ github.workspace }}-CHANGELOG.txt files: etherpad-lite-win.zip
make_latest: true

1
.gitignore vendored
View file

@ -27,4 +27,3 @@ plugin_packages
/src/test-results /src/test-results
playwright-report playwright-report
state.json state.json
/src/static/oidc

View file

@ -1,120 +1,3 @@
# 2.3.0
### Notable enhancements and fixes
- Added possibility to cluster Etherpads behind reverse proxy. There is now a new reverse proxy designed for Etherpads that handles multiple Etherpads and the created pads in them. It will assign the pad assignement to an Etherpad at random but once the choice was made it will always reverse proxy the same backend. This allows to host multiple concurrent Etherpads and benefit from multi core systems even though one Etherpad is singlethreaded.
- Added reverse proxy configuration for replacing Nginx. In the past there were some issues with nginx and its configuration. This reverse proxy allows you to handle your configuration with ease.
If you want to find out more about the reverse proxy method check out the repository https://github.com/ether/etherpad-proxy . It also contains a sample docker-compose file with three Etherpads and one etherpad-proxy. Of course you need to adapt the settings.json.template to your liking and map it into the reverse proxy image before you are ready :).
- Added client authorization to work with Etherpad. Before it would get blocked because it doesn't have the required claim. As this is now fixed etherpad-proxy can also work with your new OAuth2 configuration and retrieve a token via client credentials flow.
# 2.2.7
### Notable enhancements and fixes
- We migrated all important pages to React 19 and React Router v7
Besides that only dependency updates.
-> Have a merry Christmas and a happy new year. 🎄 🎁
# 2.2.6
### Notable enhancements and fixes
- Added option to delete a pad by the creator. This option can be found in the settings menu. When you click on it you get a confirm dialog and after that you have the chance to completely erase the pad.
# 2.2.5
### Notable enhancements and fixes
- Fixed timeslider not scrolling when the revision count is a multiple of 100
- Added new Restful API for version 2 of Etherpad. It is available at /api-docs
# 2.2.4
### Notable enhancements and fixes
- Switched to new SQLite backend
- Fixed rusty-store-kv module not found
# 2.2.3
### Notable enhancements and fixes
- Introduced a new in process database `rustydb` that represents a fast key value store written in Rust.
- Readded window._ as a shortcut for getting text
- Added support for migrating any ueberdb database to another. You can now switch as you please. See here: https://docs.etherpad.org/cli.html
- Further Typescript movements
- A lot of security issues fixed and reviewed in this release. Please update.
# 2.2.2
### Notable enhancements and fixes
- Removal of Etherpad require kernel: We finally managed to include esbuild to bundle our frontend code together. So no matter how many plugins your server has it is always one JavaScript file. This boosts performance dramatically.
- Added log layoutType: This lets you print the log in either colored or basic (black and white text)
- Introduced esbuild for bundling CSS files
- Cache all files to be bundled in memory for faster load speed
# 2.1.1
### Notable enhancements and fixes
- Fixed failing Docker build when checked out as git submodule. Thanks to @neurolabs
- Fixed: Fallback to websocket and polling when unknown(old) config is present for socket io
- Fixed: Next page disabled if zero page by @samyakj023
- On CTRL+CLICK bring the window back to focus by Helder Sepulveda
# 2.1.0
### Notable enhancements and fixes
- Added PWA support. You can now add your Etherpad instance to your home screen on your mobile device or desktop.
- Fixed live plugin manager versions clashing. Thanks to @yacchin1205
- Fixed a bug in the pad panel where pagination was not working correctly when sorting by pad name
### Compatibility changes
- Reintroduced APIKey.txt support. You can now switch between APIKey and OAuth2.0 authentication. This can be toggled with the setting authenticationMethod. The default is OAuth2. If you want to use the APIKey method you can set that to `apikey`.
# 2.0.3
### Notable enhancements and fixes
- Added documentation for replacing apikeys with oauth2
- Bumped live plugin manager to 0.20.0. Thanks to @fgreinacher
- Added better documentation for using docker-compose with Etherpad
# 2.0.2
### Notable enhancements and fixes
- Fixed the locale loading in the admin panel
- Added OAuth2.0 support for the Etherpad API. You can now log in into the Etherpad API with your admin user using OAuth2
### Compatibility changes
- The tests now require generating a token from the OAuth secret. You can find the `generateJWTToken` in the common.ts script for plugin endpoint updates.
# 2.0.1 # 2.0.1
### Notable enhancements and fixes ### Notable enhancements and fixes
@ -142,8 +25,8 @@ Besides that only dependency updates.
- Bin folder: The bin folder has been moved from the src folder to the root folder. This change was necessary as the contained scripts do not represent core functionality of the user. - Bin folder: The bin folder has been moved from the src folder to the root folder. This change was necessary as the contained scripts do not represent core functionality of the user.
- Starting Etherpad: Etherpad can now be started with a single command: `pnpm run prod` in the root directory. - Starting Etherpad: Etherpad can now be started with a single command: `pnpm run prod` in the root directory.
- Installing Etherpad: Etherpad no longer symlinks itself in the root directory. This is now also taken care by pnpm, and it just creates a node_modules folder with the src directory`s ep_etherpad-lite folder - Installing Etherpad: Etherpad no longer symlinks itself in the root directory. This is now also taken care by pnpm, and it just creates a node_modules folder with the src directory`s ep_etherpad-lite folder
- Plugins can now be installed simply via the command: `pnpm run plugins i first-plugin second-plugin` or if you want to install from path you can do: - Plugins can now be installed simply via the command: `pnpm run install-plugins first-plugin second-plugin` or if you want to install from path you can do:
`pnpm run plugins i --path ../path-to-plugin` `pnpm run install-plugins --path ../path-to-plugin`
# 1.9.7 # 1.9.7

View file

@ -3,17 +3,15 @@
# https://github.com/ether/etherpad-lite # https://github.com/ether/etherpad-lite
# #
# Author: muxator # Author: muxator
ARG BUILD_ENV=git
FROM node:alpine AS adminbuild FROM node:alpine as adminBuild
RUN npm install -g pnpm@latest
WORKDIR /opt/etherpad-lite WORKDIR /opt/etherpad-lite
COPY . . COPY ./admin ./admin
RUN pnpm install RUN cd ./admin && npm install -g pnpm && pnpm install && pnpm run build --outDir ./dist
RUN pnpm run build:ui
FROM node:alpine AS build FROM node:alpine as build
LABEL maintainer="Etherpad team, https://github.com/ether/etherpad-lite" LABEL maintainer="Etherpad team, https://github.com/ether/etherpad-lite"
# Set these arguments when building the image from behind a proxy # Set these arguments when building the image from behind a proxy
@ -42,22 +40,6 @@ ARG SETTINGS=./settings.json.docker
# ETHERPAD_PLUGINS="ep_codepad ep_author_neat" # ETHERPAD_PLUGINS="ep_codepad ep_author_neat"
ARG ETHERPAD_PLUGINS= ARG ETHERPAD_PLUGINS=
# local plugins to install while building the container. By default no plugins are
# installed.
# If given a value, it has to be a space-separated, quoted list of plugin names.
#
# EXAMPLE:
# ETHERPAD_LOCAL_PLUGINS="../ep_my_plugin ../ep_another_plugin"
ARG ETHERPAD_LOCAL_PLUGINS=
# github plugins to install while building the container. By default no plugins are
# installed.
# If given a value, it has to be a space-separated, quoted list of plugin names.
#
# EXAMPLE:
# ETHERPAD_GITHUB_PLUGINS="ether/ep_plugin"
ARG ETHERPAD_GITHUB_PLUGINS=
# Control whether abiword will be installed, enabling exports to DOC/PDF/ODT formats. # Control whether abiword will be installed, enabling exports to DOC/PDF/ODT formats.
# By default, it is not installed. # By default, it is not installed.
# If given any value, abiword will be installed. # If given any value, abiword will be installed.
@ -75,7 +57,7 @@ ARG INSTALL_ABIWORD=
ARG INSTALL_SOFFICE= ARG INSTALL_SOFFICE=
# Install dependencies required for modifying access. # Install dependencies required for modifying access.
RUN apk add --no-cache shadow bash RUN apk add shadow bash
# Follow the principle of least privilege: run as unprivileged user. # Follow the principle of least privilege: run as unprivileged user.
# #
# Running as non-root enables running this image in platforms like OpenShift # Running as non-root enables running this image in platforms like OpenShift
@ -100,9 +82,9 @@ RUN mkdir -p "${EP_DIR}" && chown etherpad:etherpad "${EP_DIR}"
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199
RUN \ RUN \
mkdir -p /usr/share/man/man1 && \ mkdir -p /usr/share/man/man1 && \
npm install pnpm@latest -g && \ npm install pnpm -g && \
apk update && apk upgrade && \ apk update && apk upgrade && \
apk add --no-cache \ apk add \
ca-certificates \ ca-certificates \
curl \ curl \
git \ git \
@ -114,65 +96,32 @@ USER etherpad
WORKDIR "${EP_DIR}" WORKDIR "${EP_DIR}"
# etherpads version feature requires this. Only copy what is really needed # etherpads version feature requires this. Only copy what is really needed
COPY --chown=etherpad:etherpad ./.git/HEAD ./.git/HEAD
COPY --chown=etherpad:etherpad ./.git/refs ./.git/refs
COPY --chown=etherpad:etherpad ${SETTINGS} ./settings.json COPY --chown=etherpad:etherpad ${SETTINGS} ./settings.json
COPY --chown=etherpad:etherpad ./var ./var COPY --chown=etherpad:etherpad ./var ./var
COPY --chown=etherpad:etherpad ./bin ./bin COPY --chown=etherpad:etherpad ./bin ./bin
COPY --chown=etherpad:etherpad ./pnpm-workspace.yaml ./package.json ./ COPY --chown=etherpad:etherpad ./pnpm-workspace.yaml ./package.json ./
FROM build as development
COPY --chown=etherpad:etherpad ./src/package.json .npmrc ./src/pnpm-lock.yaml ./src/
FROM build AS build_git COPY --chown=etherpad:etherpad --from=adminBuild /opt/etherpad-lite/admin/dist ./src/templates/admin
ONBUILD COPY --chown=etherpad:etherpad ./.git/HEA[D] ./.git/HEAD
ONBUILD COPY --chown=etherpad:etherpad ./.git/ref[s] ./.git/refs
FROM build AS build_copy
FROM build_${BUILD_ENV} AS development
ARG ETHERPAD_PLUGINS=
ARG ETHERPAD_LOCAL_PLUGINS=
ARG ETHERPAD_LOCAL_PLUGINS_ENV=
ARG ETHERPAD_GITHUB_PLUGINS=
COPY --chown=etherpad:etherpad ./src/ ./src/
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/ templates/admin./src/templates/admin
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/static/oidc ./src/static/oidc
COPY --chown=etherpad:etherpad ./local_plugin[s] ./local_plugins/
RUN bash -c ./bin/installLocalPlugins.sh
RUN bin/installDeps.sh && \ RUN bin/installDeps.sh && \
if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_GITHUB_PLUGINS}" ]; then \ { [ -z "${ETHERPAD_PLUGINS}" ] || pnpm run install-plugins ${ETHERPAD_PLUGINS}; }
pnpm run plugins i ${ETHERPAD_PLUGINS} ${ETHERPAD_GITHUB_PLUGINS:+--github ${ETHERPAD_GITHUB_PLUGINS}}; \
fi
FROM build as production
FROM build_${BUILD_ENV} AS production
ARG ETHERPAD_PLUGINS=
ARG ETHERPAD_LOCAL_PLUGINS=
ARG ETHERPAD_LOCAL_PLUGINS_ENV=
ARG ETHERPAD_GITHUB_PLUGINS=
ENV NODE_ENV=production ENV NODE_ENV=production
ENV ETHERPAD_PRODUCTION=true ENV ETHERPAD_PRODUCTION=true
COPY --chown=etherpad:etherpad ./src ./src COPY --chown=etherpad:etherpad ./src ./src
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/templates/admin ./src/templates/admin COPY --chown=etherpad:etherpad --from=adminBuild /opt/etherpad-lite/admin/dist ./src/templates/admin
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/static/oidc ./src/static/oidc
COPY --chown=etherpad:etherpad ./local_plugin[s] ./local_plugins/ RUN bin/installDeps.sh && rm -rf ~/.npm && \
{ [ -z "${ETHERPAD_PLUGINS}" ] || pnpm run install-plugins ${ETHERPAD_PLUGINS}; }
RUN bash -c ./bin/installLocalPlugins.sh
RUN bin/installDeps.sh && \
if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_GITHUB_PLUGINS}" ]; then \
pnpm run plugins i ${ETHERPAD_PLUGINS} ${ETHERPAD_GITHUB_PLUGINS:+--github ${ETHERPAD_GITHUB_PLUGINS}}; \
fi
# Copy the configuration file. # Copy the configuration file.
COPY --chown=etherpad:etherpad ${SETTINGS} "${EP_DIR}"/settings.json COPY --chown=etherpad:etherpad ${SETTINGS} "${EP_DIR}"/settings.json

164
README.md
View file

@ -1,6 +1,6 @@
# Etherpad: A real-time collaborative editor for the web # Etherpad: A real-time collaborative editor for the web
![Demo Etherpad Animated Jif](doc/public/etherpad_demo.gif "Etherpad in action") ![Demo Etherpad Animated Jif](doc/images/etherpad_demo.gif "Etherpad in action")
## About ## About
@ -21,6 +21,7 @@ We're looking for maintainers and have some funding available. Please contact J
### Code Quality ### Code Quality
[![Code Quality](https://github.com/ether/etherpad-lite/actions/workflows/codeql-analysis.yml/badge.svg?color=%2344b492)](https://github.com/ether/etherpad-lite/actions/workflows/codeql-analysis.yml) [![Code Quality](https://github.com/ether/etherpad-lite/actions/workflows/codeql-analysis.yml/badge.svg?color=%2344b492)](https://github.com/ether/etherpad-lite/actions/workflows/codeql-analysis.yml)
[![package.lock](https://github.com/ether/etherpad-lite/actions/workflows/lint-package-lock.yml/badge.svg?color=%2344b492)](https://github.com/ether/etherpad-lite/actions/workflows/lint-package-lock.yml)
### Testing ### Testing
@ -43,74 +44,74 @@ We're looking for maintainers and have some funding available. Please contact J
## Installation ## Installation
### Docker-Compose
```yaml
services:
app:
user: "0: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: ${DOCKER_COMPOSE_APP_ADMIN_PASSWORD:-admin}
DB_CHARSET: ${DOCKER_COMPOSE_APP_DB_CHARSET:-utf8mb4}
DB_HOST: postgres
DB_NAME: ${DOCKER_COMPOSE_POSTGRES_DATABASE:-etherpad}
DB_PASS: ${DOCKER_COMPOSE_POSTGRES_PASSWORD:-admin}
DB_PORT: ${DOCKER_COMPOSE_POSTGRES_PORT:-5432}
DB_TYPE: "postgres"
DB_USER: ${DOCKER_COMPOSE_POSTGRES_USER:-admin}
# For now, the env var DEFAULT_PAD_TEXT cannot be unset or empty; it seems to be mandatory in the latest version of etherpad
DEFAULT_PAD_TEXT: ${DOCKER_COMPOSE_APP_DEFAULT_PAD_TEXT:- }
DISABLE_IP_LOGGING: ${DOCKER_COMPOSE_APP_DISABLE_IP_LOGGING:-false}
SOFFICE: ${DOCKER_COMPOSE_APP_SOFFICE:-null}
TRUST_PROXY: ${DOCKER_COMPOSE_APP_TRUST_PROXY:-true}
restart: always
ports:
- "${DOCKER_COMPOSE_APP_PORT_PUBLISHED:-9001}:${DOCKER_COMPOSE_APP_PORT_TARGET:-9001}"
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: ${DOCKER_COMPOSE_POSTGRES_DATABASE:-etherpad}
POSTGRES_PASSWORD: ${DOCKER_COMPOSE_POSTGRES_PASSWORD:-admin}
POSTGRES_PORT: ${DOCKER_COMPOSE_POSTGRES_PORT:-5432}
POSTGRES_USER: ${DOCKER_COMPOSE_POSTGRES_USER:-admin}
PGDATA: /var/lib/postgresql/data/pgdata
restart: always
# Exposing the port is not needed unless you want to access this database instance from the host.
# Be careful when other postgres docker container are running on the same port
# ports:
# - "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:
plugins:
etherpad-var:
```
### Requirements ### Requirements
[Node.js](https://nodejs.org/) >= **18.18.2**. [Node.js](https://nodejs.org/) >= **18.18.2**.
### Windows, macOS, Linux ### GNU/Linux and other UNIX-like systems
1. Download the latest Node.js runtime from [nodejs.org](https://nodejs.org/). #### Quick install on Debian/Ubuntu
2. Install pnpm: `npm install -g pnpm` (Administrator privileges may be required).
3. Clone the repository: `git clone -b master` Install the latest Node.js LTS per [official install instructions](https://github.com/nodesource/distributions#installation-instructions), then:
4. Run `pnpm i` ```sh
5. Run `pnpm run build:etherpad` git clone --branch master https://github.com/ether/etherpad-lite.git &&
6. Run `pnpm run prod` cd etherpad-lite &&
7. Visit `http://localhost:9001` in your browser. bin/run.sh
```
#### Manual install
You'll need Git and [Node.js](https://nodejs.org/) installed.
**As any user (we recommend creating a separate user called etherpad):**
1. Move to a folder where you want to install Etherpad.
2. Clone the Git repository: `git clone --branch master
https://github.com/ether/etherpad-lite.git`
3. Change into the new directory containing the cloned source code: `cd
etherpad-lite`
4. Run `bin/run.sh` and open http://127.0.0.1:9001 in your browser.
To update to the latest released version, execute `git pull origin`. The next
start with `bin/run.sh` will update the dependencies.
### Windows
#### Prebuilt Windows package
This package runs on any Windows machine. You can perform a manual installation
via git for development purposes, but as this uses symlinks which performs
unreliably on Windows, please stick to the prebuilt package if possible.
1. [Download the latest Windows package](https://etherpad.org/#download)
2. Extract the folder
Run `start.bat` and open <http://localhost:9001> in your browser.
#### Manually install on Windows
You'll need [Node.js](https://nodejs.org) and (optionally, though recommended)
git.
1. Grab the source, either:
* download <https://github.com/ether/etherpad-lite/zipball/master>
* or `git clone --branch master
https://github.com/ether/etherpad-lite.git`
2. With a "Run as administrator" command prompt execute
`bin\installOnWindows.bat`
Now, run `start.bat` and open http://localhost:9001 in your browser.
Update to the latest version with `git pull origin`, then run
`bin\installOnWindows.bat`, again.
If cloning to a subdirectory within another project, you may need to do the
following:
1. Start the server manually (e.g. `node src/node/server.ts`)
2. Edit the db `filename` in `settings.json` to the relative directory with
the file (e.g. `application/lib/etherpad-lite/var/dirty.db`)
3. Add auto-generated files to the main project `.gitignore`
### Docker container ### Docker container
@ -120,9 +121,9 @@ Find [here](doc/docker.adoc) information on running Etherpad in a container.
Etherpad is very customizable through plugins. Etherpad is very customizable through plugins.
![Basic install](doc/public/etherpad_basic.png "Basic Installation") ![Basic install](doc/images/etherpad_basic.png "Basic Installation")
![Full Features](doc/public/etherpad_full_features.png "You can add a lot of plugins !") ![Full Features](doc/images/etherpad_full_features.png "You can add a lot of plugins !")
### Available Plugins ### Available Plugins
@ -138,7 +139,7 @@ Alternatively, you can install plugins from the command line:
```sh ```sh
cd /path/to/etherpad-lite cd /path/to/etherpad-lite
pnpm run plugins i ep_${plugin_name} pnpm run install-plugins ep_${plugin_name}
``` ```
Also see [the plugin wiki Also see [the plugin wiki
@ -150,7 +151,7 @@ Run the following command in your Etherpad folder to get all of the features
visible in the above demo gif: visible in the above demo gif:
```sh ```sh
pnpm run plugins i \ pnpm run install-plugins \
ep_align \ ep_align \
ep_comments_page \ ep_comments_page \
ep_embedded_hyperlinks2 \ ep_embedded_hyperlinks2 \
@ -174,31 +175,6 @@ following plugins:
that each user's chosen color, display name, comment ownership, etc. is that each user's chosen color, display name, comment ownership, etc. is
strongly linked to their account. strongly linked to their account.
### Upgrade Etherpad
Run the following command in your Etherpad folder to upgrade
1. Stop any running Etherpad (manual, systemd ...)
2. Get present version
```sh
git -P tag --contains
```
3. List versions available
```sh
git -P tag --list "v*" --merged
```
4. Select the version
```sh
git checkout v2.2.5
git switch -c v2.2.5
```
5. Upgrade Etherpad
```sh
./bin/run.sh
```
6. Stop with [CTRL-C]
7. Restart your Etherpad service
## Next Steps ## Next Steps
### Tweak the settings ### Tweak the settings
@ -235,7 +211,7 @@ edit `settings.json` and restart Etherpad each time.
Open http://127.0.0.1:9001/p/test#skinvariantsbuilder in your browser and start Open http://127.0.0.1:9001/p/test#skinvariantsbuilder in your browser and start
playing! playing!
![Skin Variant](doc/public/etherpad_skin_variants.gif "Skin variants") ![Skin Variant](doc/images/etherpad_skin_variants.gif "Skin variants")
## Helpful resources ## Helpful resources

View file

@ -1,42 +1,39 @@
{ {
"name": "admin", "name": "admin",
"private": true, "private": true,
"version": "2.3.0", "version": "2.0.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"build-copy": "tsc && vite build --outDir ../src/templates/admin --emptyOutDir",
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {},
"@radix-ui/react-switch": "^1.2.5"
},
"devDependencies": { "devDependencies": {
"@radix-ui/react-dialog": "^1.1.14", "@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-toast": "^1.2.14", "@radix-ui/react-toast": "^1.1.5",
"@types/react": "^19.1.8", "i18next": "^23.10.1",
"@types/react-dom": "^19.1.6", "i18next-browser-languagedetector": "^7.2.0",
"@typescript-eslint/eslint-plugin": "^8.34.0", "lucide-react": "^0.356.0",
"@typescript-eslint/parser": "^8.34.0", "react": "^18.2.0",
"@vitejs/plugin-react-swc": "^3.10.2", "react-dom": "^18.2.0",
"eslint": "^9.28.0", "react-hook-form": "^7.51.0",
"eslint-plugin-react-hooks": "^5.2.0", "react-i18next": "^14.1.0",
"eslint-plugin-react-refresh": "^0.4.20", "react-router-dom": "^6.22.3",
"i18next": "^25.2.1", "zustand": "^4.5.2",
"i18next-browser-languagedetector": "^8.2.0", "@types/react": "^18.2.56",
"lucide-react": "^0.515.0", "@types/react-dom": "^18.2.19",
"react": "^19.1.0", "@typescript-eslint/eslint-plugin": "^7.0.2",
"react-dom": "^19.1.0", "@typescript-eslint/parser": "^7.0.2",
"react-hook-form": "^7.57.0", "@vitejs/plugin-react-swc": "^3.5.0",
"react-i18next": "^15.5.3", "eslint": "^8.56.0",
"react-router-dom": "^7.6.2", "eslint-plugin-react-hooks": "^4.6.0",
"socket.io-client": "^4.8.1", "eslint-plugin-react-refresh": "^0.4.5",
"typescript": "^5.8.2", "socket.io-client": "^4.7.4",
"vite": "^6.3.5", "typescript": "^5.2.2",
"vite-plugin-static-copy": "^3.0.0", "vite": "^5.1.4",
"vite-plugin-svgr": "^4.3.0", "vite-plugin-static-copy": "^1.0.1",
"zustand": "^5.0.5" "vite-plugin-svgr": "^4.2.0"
} }
} }

View file

@ -14,7 +14,6 @@
"ep_adminpads2_autoupdate.title": "Aktiviert oder deaktiviert automatische Aktualisierungen für die aktuelle Abfrage.", "ep_adminpads2_autoupdate.title": "Aktiviert oder deaktiviert automatische Aktualisierungen für die aktuelle Abfrage.",
"ep_adminpads2_confirm": "Willst du das Pad {{padID}} wirklich löschen?", "ep_adminpads2_confirm": "Willst du das Pad {{padID}} wirklich löschen?",
"ep_adminpads2_delete.value": "Löschen", "ep_adminpads2_delete.value": "Löschen",
"ep_adminpads2_cleanup": "Historie aufräumen",
"ep_adminpads2_last-edited": "Zuletzt bearbeitet", "ep_adminpads2_last-edited": "Zuletzt bearbeitet",
"ep_adminpads2_loading": "Lädt...", "ep_adminpads2_loading": "Lädt...",
"ep_adminpads2_manage-pads": "Pads verwalten", "ep_adminpads2_manage-pads": "Pads verwalten",

View file

@ -4,7 +4,6 @@
"ep_adminpads2_autoupdate.title": "Enables or disables automatic updates for the current query.", "ep_adminpads2_autoupdate.title": "Enables or disables automatic updates for the current query.",
"ep_adminpads2_confirm": "Do you really want to delete the pad {{padID}}?", "ep_adminpads2_confirm": "Do you really want to delete the pad {{padID}}?",
"ep_adminpads2_delete.value": "Delete", "ep_adminpads2_delete.value": "Delete",
"ep_adminpads2_cleanup": "Cleanup revisions",
"ep_adminpads2_last-edited": "Last edited", "ep_adminpads2_last-edited": "Last edited",
"ep_adminpads2_loading": "Loading…", "ep_adminpads2_loading": "Loading…",
"ep_adminpads2_manage-pads": "Manage pads", "ep_adminpads2_manage-pads": "Manage pads",

View file

@ -1,4 +1,4 @@
import {useEffect, useState} from 'react' import {useEffect} from 'react'
import './App.css' import './App.css'
import {connect} from 'socket.io-client' import {connect} from 'socket.io-client'
import {isJSONClean} from './utils/utils.ts' import {isJSONClean} from './utils/utils.ts'
@ -6,23 +6,22 @@ import {NavLink, Outlet, useNavigate} from "react-router-dom";
import {useStore} from "./store/store.ts"; import {useStore} from "./store/store.ts";
import {LoadingScreen} from "./utils/LoadingScreen.tsx"; import {LoadingScreen} from "./utils/LoadingScreen.tsx";
import {Trans, useTranslation} from "react-i18next"; import {Trans, useTranslation} from "react-i18next";
import {Cable, Construction, Crown, NotepadText, Wrench, PhoneCall, LucideMenu} from "lucide-react"; import {Cable, Construction, Crown, NotepadText, Wrench} from "lucide-react";
const WS_URL = import.meta.env.DEV ? 'http://localhost:9001' : '' const WS_URL = import.meta.env.DEV? 'http://localhost:9001' : ''
export const App = () => { export const App = ()=> {
const setSettings = useStore(state => state.setSettings); const setSettings = useStore(state => state.setSettings);
const {t} = useTranslation() const {t} = useTranslation()
const navigate = useNavigate() const navigate = useNavigate()
const [sidebarOpen, setSidebarOpen] = useState<boolean>(true)
useEffect(() => { useEffect(() => {
fetch('/admin-auth/', { fetch('/admin-auth/', {
method: 'POST' method: 'POST'
}).then((value) => { }).then((value)=>{
if (!value.ok) { if(!value.ok){
navigate('/login') navigate('/login')
} }
}).catch(() => { }).catch(()=>{
navigate('/login') navigate('/login')
}) })
}, []); }, []);
@ -76,7 +75,7 @@ export const App = () => {
useStore.getState().setShowLoading(false); useStore.getState().setShowLoading(false);
}); });
settingSocket.on('saveprogress', (status) => { settingSocket.on('saveprogress', (status)=>{
console.log(status) console.log(status)
}) })
@ -86,7 +85,7 @@ export const App = () => {
} }
}, []); }, []);
return <div id="wrapper" className={`${sidebarOpen ? '': 'closed' }`}> return <div id="wrapper">
<LoadingScreen/> <LoadingScreen/>
<div className="menu"> <div className="menu">
<div className="inner-menu"> <div className="inner-menu">
@ -94,23 +93,14 @@ export const App = () => {
<Crown width={40} height={40}/> <Crown width={40} height={40}/>
<h1>Etherpad</h1> <h1>Etherpad</h1>
</span> </span>
<ul onClick={()=>{ <ul>
if (window.innerWidth < 768) {
setSidebarOpen(false)
}
}}>
<li><NavLink to="/plugins"><Cable/><Trans i18nKey="admin_plugins"/></NavLink></li> <li><NavLink to="/plugins"><Cable/><Trans i18nKey="admin_plugins"/></NavLink></li>
<li><NavLink to={"/settings"}><Wrench/><Trans i18nKey="admin_settings"/></NavLink></li> <li><NavLink to={"/settings"}><Wrench/><Trans i18nKey="admin_settings"/></NavLink></li>
<li><NavLink to={"/help"}> <Construction/> <Trans i18nKey="admin_plugins_info"/></NavLink></li> <li> <NavLink to={"/help"}> <Construction/> <Trans i18nKey="admin_plugins_info"/></NavLink></li>
<li><NavLink to={"/pads"}><NotepadText/><Trans <li><NavLink to={"/pads"}><NotepadText/><Trans i18nKey="ep_admin_pads:ep_adminpads2_manage-pads"/></NavLink></li>
i18nKey="ep_admin_pads:ep_adminpads2_manage-pads"/></NavLink></li>
<li><NavLink to={"/shout"}><PhoneCall/>Communication</NavLink></li>
</ul> </ul>
</div> </div>
</div> </div>
<button id="icon-button" onClick={() => {
setSidebarOpen(!sidebarOpen)
}}><LucideMenu/></button>
<div className="innerwrapper"> <div className="innerwrapper">
<Outlet/> <Outlet/>
</div> </div>

View file

@ -1,4 +1,4 @@
import {FC, JSX, ReactElement} from "react"; import {FC, ReactElement} from "react";
export type IconButtonProps = { export type IconButtonProps = {
icon: JSX.Element, icon: JSX.Element,

View file

@ -1,13 +0,0 @@
export type ShoutType = {
type: string,
data:{
type: string,
payload: {
message: {
message: string,
sticky: boolean
},
timestamp: number
}
}
}

View file

@ -2,7 +2,6 @@
--etherpad-color: #0f775b; --etherpad-color: #0f775b;
--etherpad-comp: #9C8840; --etherpad-comp: #9C8840;
--etherpad-light: #99FF99; --etherpad-light: #99FF99;
--sidebar-width: 20em;
} }
@font-face { @font-face {
@ -29,21 +28,17 @@ body {
} }
div.menu { div.menu {
left: 0;
transition: left .3s;
height: 100vh; height: 100vh;
font-size: 16px; font-size: 16px;
font-weight: bolder; font-weight: bolder;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: var(--sidebar-width); max-width: 20%;
z-index: 99; min-width: 20%;
position: fixed;
} }
.icon-button{
.icon-button {
display: flex; display: flex;
gap: 10px; gap: 10px;
background-color: var(--etherpad-color); background-color: var(--etherpad-color);
@ -113,7 +108,7 @@ div.menu li {
div.menu li:has(.active) { div.menu li:has(.active) {
background-color: #9C885C; background-color: #9C885C ;
} }
div.menu li a { div.menu li a {
@ -121,15 +116,13 @@ div.menu li a {
} }
div.innerwrapper { div.innerwrapper {
transition: margin-left .3s;
isolation: isolate;
background-color: #F0F0F0; background-color: #F0F0F0;
overflow: auto; overflow: auto;
height: 100vh; height: 100vh;
flex-grow: 100; flex-grow: 100;
margin-left: var(--sidebar-width); padding: 20px;
padding: 20px 20px 20px;
} }
div.innerwrapper-err { div.innerwrapper-err {
@ -137,9 +130,11 @@ div.innerwrapper-err {
} }
#wrapper { #wrapper {
display: flex;
background: none repeat scroll 0px 0px #FFFFFF; background: none repeat scroll 0px 0px #FFFFFF;
box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.2); box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.2);
min-height: 100%; /*always display a scrollbar*/ min-height: 100%;/*always display a scrollbar*/
} }
h1 { h1 {
@ -178,17 +173,14 @@ input {
.sort { .sort {
cursor: pointer; cursor: pointer;
} }
.sort:after { .sort:after {
content: '▲▼' content: '▲▼'
} }
.sort.up:after { .sort.up:after {
content: '▲' content:'▲'
} }
.sort.down:after { .sort.down:after {
content: '▼' content:'▼'
} }
@ -204,14 +196,11 @@ table {
margin: 20px 0; margin: 20px 0;
} }
.table-container {
width: 100%;
overflow: auto;
max-height: 90vh;
}
#available-plugins th:first-child, #available-plugins th:nth-child(2) {
#available-plugins th:first-child, #available-plugins th:nth-child(2){
text-align: center; text-align: center;
} }
@ -223,40 +212,35 @@ td, th {
display: none; display: none;
} }
#installed-plugins td > div { #installed-plugins td>div {
position: relative; /* Allows us to position the loading indicator relative to this row */ position: relative;/* Allows us to position the loading indicator relative to this row */
display: inline-block; /*make this fill the whole cell*/ display: inline-block; /*make this fill the whole cell*/
width: 100%; width:100%;
} }
.messages { .messages {
height: 5em; height: 5em;
} }
.messages * { .messages * {
display: none; display: none;
text-align: center; text-align: center;
} }
.messages .fetching { .messages .fetching {
display: block; display: block;
} }
.progress { .progress {
position: absolute; position: absolute;
top: 0; top: 0; left: 0; bottom:0; right:0;
left: 0;
bottom: 0;
right: 0;
padding: auto; padding: auto;
background: rgb(255, 255, 255); background: rgb(255,255,255);
display: none; display: none;
} }
#search-progress.progress { #search-progress.progress {
padding-top: 20%; padding-top: 20%;
background: rgba(255, 255, 255, 0.3); background: rgba(255,255,255,0.3);
} }
.progress * { .progress * {
@ -266,20 +250,11 @@ td, th {
color: #666; color: #666;
} }
.settings-page {
display: flex;
flex-direction: column;
gap: 20px;
height: 100%;
}
.settings { .settings {
flex-grow: max(1, 1);
outline: none; outline: none;
width: 100%; width: 100%;
min-height: 80vh;
resize: none; resize: none;
font-family: monospace;
} }
#response { #response {
@ -318,45 +293,17 @@ pre {
word-wrap: break-word; word-wrap: break-word;
} }
#icon-button {
color: var(--etherpad-color);
top: 10px;
background-color: transparent;
border: none;
z-index: 99;
position: absolute;
left: 10px;
}
.inner-menu span:nth-child(2) {
display: flex;
margin-top: 30px;
}
#wrapper.closed .menu {
left: calc(-1 * var(--sidebar-width));
}
#wrapper.closed .innerwrapper {
margin-left: 0;
}
@media (max-width: 800px) { @media (max-width: 800px) {
div.innerwrapper { div.innerwrapper {
margin-left: 0; padding: 0 15px 15px 15px;
}
.inner-menu {
border-radius: 0;
} }
div.menu { div.menu {
padding: 1px 15px 0 15px;
position: static;
height: auto; height: auto;
border-right: none; border-right: none;
--sidebar-width: 100%; width: auto;
float: left; float: left;
} }
@ -420,7 +367,6 @@ pre {
.login-background { .login-background {
background-image: url("/fond.jpg"); background-image: url("/fond.jpg");
background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
display: flex; display: flex;
@ -434,11 +380,12 @@ pre {
margin-top: 1rem; margin-top: 1rem;
} }
.login-inner-box [type=submit] { .login-inner-box [type=submit]{
margin-top: 2rem; margin-top: 2rem;
} }
.login-textinput { .login-textinput {
width: 100%; width: 100%;
padding: 10px; padding: 10px;
@ -449,20 +396,14 @@ pre {
} }
.login-box { .login-box {
width: 20%;
padding: 20px; padding: 20px;
border-radius: 40px; border-radius: 40px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
background-color: #fff; background-color: #fff;
} }
.login-inner-box{
@media (max-width: 900px) {
.login-box {
width: 90%
}
}
.login-inner-box {
position: relative; position: relative;
padding: 20px; padding: 20px;
} }
@ -530,6 +471,7 @@ pre {
} }
.ToastViewport { .ToastViewport {
position: fixed; position: fixed;
top: 10px; top: 10px;
@ -567,24 +509,19 @@ pre {
column-gap: 15px; column-gap: 15px;
align-items: center; align-items: center;
} }
.ToastRoot[data-state='open'] { .ToastRoot[data-state='open'] {
animation: slideIn 150ms cubic-bezier(0.16, 1, 0.3, 1); animation: slideIn 150ms cubic-bezier(0.16, 1, 0.3, 1);
} }
.ToastRoot[data-state='closed'] { .ToastRoot[data-state='closed'] {
animation: hide 100ms ease-in; animation: hide 100ms ease-in;
} }
.ToastRoot[data-swipe='move'] { .ToastRoot[data-swipe='move'] {
transform: translateX(var(--radix-toast-swipe-move-x)); transform: translateX(var(--radix-toast-swipe-move-x));
} }
.ToastRoot[data-swipe='cancel'] { .ToastRoot[data-swipe='cancel'] {
transform: translateX(0); transform: translateX(0);
transition: transform 200ms ease-out; transition: transform 200ms ease-out;
} }
.ToastRoot[data-swipe='end'] { .ToastRoot[data-swipe='end'] {
animation: swipeOut 100ms ease-out; animation: swipeOut 100ms ease-out;
} }
@ -651,7 +588,7 @@ pre {
border-color: transparent; border-color: transparent;
border-radius: 20px; border-radius: 20px;
height: 2.5rem; height: 2.5rem;
width: 100%; width: 100vh;
padding: 5px 5px 5px 30px; padding: 5px 5px 5px 30px;
} }
@ -659,25 +596,6 @@ pre {
outline: none; outline: none;
} }
.send-message {
position: relative;
}
.send-message input {
width: auto;
}
.send-message {
}
.send-message svg {
position: absolute;
right: 3px;
bottom: -3px;
left: auto !important;
}
.search-field svg { .search-field svg {
position: absolute; position: absolute;
left: 3px; left: 3px;
@ -738,7 +656,7 @@ table tbody tr.active-row {
} }
.pad-pagination { .pad-pagination{
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 10px; gap: 10px;
@ -765,7 +683,7 @@ table tbody tr.active-row {
align-self: center; align-self: center;
} }
.pad-pagination > span { .pad-pagination >span {
font-size: 20px; font-size: 20px;
} }
@ -807,64 +725,3 @@ input, button, select, optgroup, textarea {
right: 10px; right: 10px;
color: #666; color: #666;
} }
.SwitchRoot {
align-self: center;
width: 60px;
height: 30px;
background-color: black;
border-radius: 9999px;
position: relative;
box-shadow: 0 2px 10px var(--black-a7);
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.SwitchRoot:focus {
box-shadow: 0 0 0 2px black;
}
.SwitchRoot[data-state='checked'] {
background-color: var(--etherpad-color);
}
.SwitchThumb {
display: block;
width: 20px;
height: 20px;
background-color: white;
border-radius: 9999px;
box-shadow: 0 2px 2px var(--black-a7);
transition: transform 100ms;
transform: translateX(2px);
will-change: transform;
}
.SwitchThumb[data-state='checked'] {
transform: translateX(25px);
}
.Label {
color: white;
font-size: 15px;
line-height: 1;
}
.message {
position: relative;
padding: 10px;
border: 1px solid #e0e0e0;
margin: 10px 20px 10px 10px;
border-radius: 10px 0 10px 10px;
background-color: var(--etherpad-color);
color: white
}
.search-pads {
text-align: center;
}
.search-pads-body tr td:last-child {
display: flex;
justify-content: center;
}

View file

@ -12,7 +12,6 @@ import {I18nextProvider} from "react-i18next";
import i18n from "./localization/i18n.ts"; import i18n from "./localization/i18n.ts";
import {PadPage} from "./pages/PadPage.tsx"; import {PadPage} from "./pages/PadPage.tsx";
import {ToastDialog} from "./utils/Toast.tsx"; import {ToastDialog} from "./utils/Toast.tsx";
import {ShoutPage} from "./pages/ShoutPage.tsx";
const router = createBrowserRouter(createRoutesFromElements( const router = createBrowserRouter(createRoutesFromElements(
<><Route element={<App/>}> <><Route element={<App/>}>
@ -21,7 +20,6 @@ const router = createBrowserRouter(createRoutesFromElements(
<Route path="/settings" element={<SettingsPage/>}/> <Route path="/settings" element={<SettingsPage/>}/>
<Route path="/help" element={<HelpPage/>}/> <Route path="/help" element={<HelpPage/>}/>
<Route path="/pads" element={<PadPage/>}/> <Route path="/pads" element={<PadPage/>}/>
<Route path="/shout" element={<ShoutPage/>}/>
</Route><Route path="/login"> </Route><Route path="/login">
<Route index element={<LoginScreen/>}/> <Route index element={<LoginScreen/>}/>
</Route></> </Route></>

View file

@ -21,7 +21,7 @@ export const HelpPage = () => {
return <div key={hookName+i}> return <div key={hookName+i}>
<h3>{hookName}</h3> <h3>{hookName}</h3>
<ul> <ul>
{Object.keys(hooks[hookName]).map((hook, i) => <li key={hook+i}>{hook} {Object.keys(hooks[hookName]).map((hook, i) => <li>{hook}
<ul key={hookName+hook+i}> <ul key={hookName+hook+i}>
{Object.keys(hooks[hookName][hook]).map((subHook, i) => <li key={i}>{subHook}</li>)} {Object.keys(hooks[hookName][hook]).map((subHook, i) => <li key={i}>{subHook}</li>)}
</ul> </ul>
@ -46,12 +46,12 @@ export const HelpPage = () => {
</div> </div>
<h2><Trans i18nKey="admin_plugins.installed"/></h2> <h2><Trans i18nKey="admin_plugins.installed"/></h2>
<ul> <ul>
{helpData.installedPlugins.map((plugin, i) => <li key={plugin+i}>{plugin}</li>)} {helpData.installedPlugins.map((plugin, i) => <li key={i}>{plugin}</li>)}
</ul> </ul>
<h2><Trans i18nKey="admin_plugins_info.parts"/></h2> <h2><Trans i18nKey="admin_plugins_info.parts"/></h2>
<ul> <ul>
{helpData.installedParts.map((part, i) => <li key={part+i}>{part}</li>)} {helpData.installedParts.map((part, i) => <li key={i}>{part}</li>)}
</ul> </ul>
<h2><Trans i18nKey="admin_plugins_info.hooks"/></h2> <h2><Trans i18nKey="admin_plugins_info.hooks"/></h2>

View file

@ -4,54 +4,16 @@ import {InstalledPlugin, PluginDef, SearchParams} from "./Plugin.ts";
import {useDebounce} from "../utils/useDebounce.ts"; import {useDebounce} from "../utils/useDebounce.ts";
import {Trans, useTranslation} from "react-i18next"; import {Trans, useTranslation} from "react-i18next";
import {SearchField} from "../components/SearchField.tsx"; import {SearchField} from "../components/SearchField.tsx";
import {ArrowUpFromDot, Download, Trash} from "lucide-react"; import {Download, Trash} from "lucide-react";
import {IconButton} from "../components/IconButton.tsx"; import {IconButton} from "../components/IconButton.tsx";
import {determineSorting} from "../utils/sorting.ts";
export const HomePage = () => { export const HomePage = () => {
const pluginsSocket = useStore(state=>state.pluginsSocket) const pluginsSocket = useStore(state=>state.pluginsSocket)
const [plugins,setPlugins] = useState<PluginDef[]>([]) const [plugins,setPlugins] = useState<PluginDef[]>([])
const installedPlugins = useStore(state=>state.installedPlugins) const [installedPlugins, setInstalledPlugins] = useState<InstalledPlugin[]>([])
const setInstalledPlugins = useStore(state=>state.setInstalledPlugins)
const [searchParams, setSearchParams] = useState<SearchParams>({
offset: 0,
limit: 99999,
sortBy: 'name',
sortDir: 'asc',
searchTerm: ''
})
const filteredInstallablePlugins = useMemo(()=>{
return plugins.sort((a, b)=>{
if(searchParams.sortBy === "version"){
if(searchParams.sortDir === "asc"){
return a.version.localeCompare(b.version)
}
return b.version.localeCompare(a.version)
}
if(searchParams.sortBy === "last-updated"){
if(searchParams.sortDir === "asc"){
return a.time.localeCompare(b.time)
}
return b.time.localeCompare(a.time)
}
if (searchParams.sortBy === "name") {
if(searchParams.sortDir === "asc"){
return a.name.localeCompare(b.name)
}
return b.name.localeCompare(a.name)
}
return 0
})
}, [plugins, searchParams])
const sortedInstalledPlugins = useMemo(()=>{ const sortedInstalledPlugins = useMemo(()=>{
return useStore.getState().installedPlugins.sort((a, b)=>{ return installedPlugins.sort((a, b)=>{
if(a.name < b.name){ if(a.name < b.name){
return -1 return -1
} }
@ -61,8 +23,14 @@ export const HomePage = () => {
return 0 return 0
}) })
} ,[installedPlugins, searchParams]) } ,[installedPlugins])
const [searchParams, setSearchParams] = useState<SearchParams>({
offset: 0,
limit: 99999,
sortBy: 'name',
sortDir: 'asc',
searchTerm: ''
})
const [searchTerm, setSearchTerm] = useState<string>('') const [searchTerm, setSearchTerm] = useState<string>('')
const {t} = useTranslation() const {t} = useTranslation()
@ -79,16 +47,17 @@ export const HomePage = () => {
}) })
pluginsSocket.on('results:updatable', (data) => { pluginsSocket.on('results:updatable', (data) => {
const newInstalledPlugins = useStore.getState().installedPlugins.map(plugin => { data.updatable.forEach((pluginName: string) => {
if (data.updatable.includes(plugin.name)) { setInstalledPlugins(installedPlugins.map(plugin => {
if (plugin.name === pluginName) {
return { return {
...plugin, ...plugin,
updatable: true updatable: true
} }
} }
return plugin return plugin
}))
}) })
setInstalledPlugins(newInstalledPlugins)
}) })
pluginsSocket.on('finished:install', () => { pluginsSocket.on('finished:install', () => {
@ -124,20 +93,17 @@ export const HomePage = () => {
if (!pluginsSocket) { if (!pluginsSocket) {
return return
} }
pluginsSocket?.emit('search', searchParams) pluginsSocket?.emit('search', searchParams)
pluginsSocket!.on('results:search', (data: { pluginsSocket!.on('results:search', (data: {
results: PluginDef[] results: PluginDef[]
}) => { }) => {
setPlugins(data.results) setPlugins(data.results)
}) })
pluginsSocket!.on('results:searcherror', (data: {error: string}) => {
console.log(data.error)
useStore.getState().setToastState({
open: true,
title: "Error retrieving plugins",
success: false
})
})
}, [searchParams, pluginsSocket]); }, [searchParams, pluginsSocket]);
const uninstallPlugin = (pluginName: string)=>{ const uninstallPlugin = (pluginName: string)=>{
@ -151,6 +117,7 @@ export const HomePage = () => {
setPlugins(plugins.filter(plugin=>plugin.name !== pluginName)) setPlugins(plugins.filter(plugin=>plugin.name !== pluginName))
} }
useDebounce(()=>{ useDebounce(()=>{
setSearchParams({ setSearchParams({
...searchParams, ...searchParams,
@ -159,7 +126,6 @@ export const HomePage = () => {
}) })
}, 500, [searchTerm]) }, 500, [searchTerm])
return <div> return <div>
<h1><Trans i18nKey="admin_plugins"/></h1> <h1><Trans i18nKey="admin_plugins"/></h1>
@ -176,12 +142,12 @@ export const HomePage = () => {
<tbody style={{overflow: 'auto'}}> <tbody style={{overflow: 'auto'}}>
{sortedInstalledPlugins.map((plugin, index) => { {sortedInstalledPlugins.map((plugin, index) => {
return <tr key={index}> return <tr key={index}>
<td><a rel="noopener noreferrer" href={`https://npmjs.com/${plugin.name}`} target="_blank">{plugin.name}</a></td> <td>{plugin.name}</td>
<td>{plugin.version}</td> <td>{plugin.version}</td>
<td> <td>
{ {
plugin.updatable ? plugin.updatable ?
<IconButton onClick={() => installPlugin(plugin.name)} icon={<ArrowUpFromDot/>} title="Update"></IconButton> <button onClick={() => installPlugin(plugin.name)}>Update</button>
: <IconButton disabled={plugin.name == "ep_etherpad-lite"} icon={<Trash/>} title={<Trans i18nKey="admin_plugins.installed_uninstall.value"/>} onClick={() => uninstallPlugin(plugin.name)}/> : <IconButton disabled={plugin.name == "ep_etherpad-lite"} icon={<Trash/>} title={<Trans i18nKey="admin_plugins.installed_uninstall.value"/>} onClick={() => uninstallPlugin(plugin.name)}/>
} }
</td> </td>
@ -194,39 +160,18 @@ export const HomePage = () => {
<h2><Trans i18nKey="admin_plugins.available"/></h2> <h2><Trans i18nKey="admin_plugins.available"/></h2>
<SearchField onChange={v=>{setSearchTerm(v.target.value)}} placeholder={t('admin_plugins.available_search.placeholder')} value={searchTerm}/> <SearchField onChange={v=>{setSearchTerm(v.target.value)}} placeholder={t('admin_plugins.available_search.placeholder')} value={searchTerm}/>
<div className="table-container">
<table id="available-plugins"> <table id="available-plugins">
<thead> <thead>
<tr> <tr>
<th className={determineSorting(searchParams.sortBy, searchParams.sortDir == "asc", 'name')} onClick={()=>{ <th><Trans i18nKey="admin_plugins.name"/></th>
setSearchParams({
...searchParams,
sortBy: 'name',
sortDir: searchParams.sortDir === "asc"? "desc": "asc"
})
}}>
<Trans i18nKey="admin_plugins.name" /></th>
<th style={{width: '30%'}}><Trans i18nKey="admin_plugins.description"/></th> <th style={{width: '30%'}}><Trans i18nKey="admin_plugins.description"/></th>
<th className={determineSorting(searchParams.sortBy, searchParams.sortDir == "asc", 'version')} onClick={()=>{ <th><Trans i18nKey="admin_plugins.version"/></th>
setSearchParams({ <th><Trans i18nKey="admin_plugins.last-update"/></th>
...searchParams,
sortBy: 'version',
sortDir: searchParams.sortDir === "asc"? "desc": "asc"
})
}}><Trans i18nKey="admin_plugins.version"/></th>
<th className={determineSorting(searchParams.sortBy, searchParams.sortDir == "asc", 'last-updated')} onClick={()=>{
setSearchParams({
...searchParams,
sortBy: 'last-updated',
sortDir: searchParams.sortDir === "asc"? "desc": "asc"
})
}}><Trans i18nKey="admin_plugins.last-update"/></th>
<th><Trans i18nKey="ep_admin_pads:ep_adminpads2_action"/></th> <th><Trans i18nKey="ep_admin_pads:ep_adminpads2_action"/></th>
</tr> </tr>
</thead> </thead>
<tbody style={{overflow: 'auto'}}> <tbody style={{overflow: 'auto'}}>
{(filteredInstallablePlugins.length > 0) ? {plugins.map((plugin) => {
filteredInstallablePlugins.map((plugin) => {
return <tr key={plugin.name}> return <tr key={plugin.name}>
<td><a rel="noopener noreferrer" href={`https://npmjs.com/${plugin.name}`} target="_blank">{plugin.name}</a></td> <td><a rel="noopener noreferrer" href={`https://npmjs.com/${plugin.name}`} target="_blank">{plugin.name}</a></td>
<td>{plugin.description}</td> <td>{plugin.description}</td>
@ -236,12 +181,8 @@ export const HomePage = () => {
<IconButton icon={<Download/>} onClick={() => installPlugin(plugin.name)} title={<Trans i18nKey="admin_plugins.available_install.value"/>}/> <IconButton icon={<Download/>} onClick={() => installPlugin(plugin.name)} title={<Trans i18nKey="admin_plugins.available_install.value"/>}/>
</td> </td>
</tr> </tr>
}) })}
:
<tr><td colSpan={5}>{searchTerm == '' ? <Trans i18nKey="pad.loading"/>: <Trans i18nKey="admin_plugins.available_not-found"/>}</td></tr>
}
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
} }

View file

@ -46,7 +46,7 @@ export const LoginScreen = ()=>{
<input {...register('username', { <input {...register('username', {
required: true required: true
})} className="login-textinput input-control" type="text" placeholder="Username"/> })} className="login-textinput input-control" type="text" placeholder="Username"/>
<div>Password</div> <div>Passwort</div>
<span className="icon-input"> <span className="icon-input">
<input {...register('password', { <input {...register('password', {
required: true required: true

View file

@ -6,7 +6,7 @@ import {useDebounce} from "../utils/useDebounce.ts";
import {determineSorting} from "../utils/sorting.ts"; import {determineSorting} from "../utils/sorting.ts";
import * as Dialog from "@radix-ui/react-dialog"; import * as Dialog from "@radix-ui/react-dialog";
import {IconButton} from "../components/IconButton.tsx"; import {IconButton} from "../components/IconButton.tsx";
import {ChevronLeft, ChevronRight, Eye, Trash2, FileStack} from "lucide-react"; import {ChevronLeft, ChevronRight, Eye, Trash2} from "lucide-react";
import {SearchField} from "../components/SearchField.tsx"; import {SearchField} from "../components/SearchField.tsx";
export const PadPage = ()=>{ export const PadPage = ()=>{
@ -23,11 +23,10 @@ export const PadPage = ()=>{
const pads = useStore(state=>state.pads) const pads = useStore(state=>state.pads)
const [currentPage, setCurrentPage] = useState<number>(0) const [currentPage, setCurrentPage] = useState<number>(0)
const [deleteDialog, setDeleteDialog] = useState<boolean>(false) const [deleteDialog, setDeleteDialog] = useState<boolean>(false)
const [errorText, setErrorText] = useState<string|null>(null)
const [padToDelete, setPadToDelete] = useState<string>('') const [padToDelete, setPadToDelete] = useState<string>('')
const pages = useMemo(()=>{ const pages = useMemo(()=>{
if(!pads){ if(!pads){
return 0; return [0]
} }
return Math.ceil(pads!.total / searchParams.limit) return Math.ceil(pads!.total / searchParams.limit)
@ -69,35 +68,12 @@ export const PadPage = ()=>{
results: newPads results: newPads
}) })
}) })
settingsSocket.on('results:cleanupPadRevisions', (data)=>{
let newPads = useStore.getState().pads?.results ?? []
if (data.error) {
setErrorText(data.error)
return
}
newPads.forEach((pad)=>{
if (pad.padName === data.padId) {
pad.revisionNumber = data.keepRevisions
}
})
useStore.getState().setPads({
results: newPads,
total: useStore.getState().pads!.total
})
})
}, [settingsSocket, pads]); }, [settingsSocket, pads]);
const deletePad = (padID: string)=>{ const deletePad = (padID: string)=>{
settingsSocket?.emit('deletePad', padID) settingsSocket?.emit('deletePad', padID)
} }
const cleanupPad = (padID: string)=>{
settingsSocket?.emit('cleanupPadRevisions', padID)
}
return <div> return <div>
@ -124,26 +100,11 @@ export const PadPage = ()=>{
</Dialog.Content> </Dialog.Content>
</Dialog.Portal> </Dialog.Portal>
</Dialog.Root> </Dialog.Root>
<Dialog.Root open={errorText !== null}>
<Dialog.Portal>
<Dialog.Overlay className="dialog-confirm-overlay"/>
<Dialog.Content className="dialog-confirm-content">
<div>
<div>Error occured: {errorText}</div>
<div className="settings-button-bar">
<button onClick={() => {
setErrorText(null)
}}>OK</button>
</div>
</div>
</Dialog.Content>
</Dialog.Portal>
</Dialog.Root>
<h1><Trans i18nKey="ep_admin_pads:ep_adminpads2_manage-pads"/></h1> <h1><Trans i18nKey="ep_admin_pads:ep_adminpads2_manage-pads"/></h1>
<SearchField value={searchTerm} onChange={v=>setSearchTerm(v.target.value)} placeholder={t('ep_admin_pads:ep_adminpads2_search-heading')}/> <SearchField value={searchTerm} onChange={v=>setSearchTerm(v.target.value)} placeholder={t('ep_admin_pads:ep_adminpads2_search-heading')}/>
<table> <table>
<thead> <thead>
<tr className="search-pads"> <tr>
<th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'padName')} onClick={()=>{ <th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'padName')} onClick={()=>{
setSearchParams({ setSearchParams({
...searchParams, ...searchParams,
@ -151,19 +112,19 @@ export const PadPage = ()=>{
ascending: !searchParams.ascending ascending: !searchParams.ascending
}) })
}}><Trans i18nKey="ep_admin_pads:ep_adminpads2_padname"/></th> }}><Trans i18nKey="ep_admin_pads:ep_adminpads2_padname"/></th>
<th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'userCount')} onClick={()=>{
setSearchParams({
...searchParams,
sortBy: 'userCount',
ascending: !searchParams.ascending
})
}}><Trans i18nKey="ep_admin_pads:ep_adminpads2_pad-user-count"/></th>
<th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'lastEdited')} onClick={()=>{ <th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'lastEdited')} onClick={()=>{
setSearchParams({ setSearchParams({
...searchParams, ...searchParams,
sortBy: 'lastEdited', sortBy: 'lastEdited',
ascending: !searchParams.ascending ascending: !searchParams.ascending
}) })
}}><Trans i18nKey="ep_admin_pads:ep_adminpads2_pad-user-count"/></th>
<th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'userCount')} onClick={()=>{
setSearchParams({
...searchParams,
sortBy: 'userCount',
ascending: !searchParams.ascending
})
}}><Trans i18nKey="ep_admin_pads:ep_adminpads2_last-edited"/></th> }}><Trans i18nKey="ep_admin_pads:ep_adminpads2_last-edited"/></th>
<th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'revisionNumber')} onClick={()=>{ <th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'revisionNumber')} onClick={()=>{
setSearchParams({ setSearchParams({
@ -175,7 +136,7 @@ export const PadPage = ()=>{
<th><Trans i18nKey="ep_admin_pads:ep_adminpads2_action"/></th> <th><Trans i18nKey="ep_admin_pads:ep_adminpads2_action"/></th>
</tr> </tr>
</thead> </thead>
<tbody className="search-pads-body"> <tbody>
{ {
pads?.results?.map((pad)=>{ pads?.results?.map((pad)=>{
return <tr key={pad.padName}> return <tr key={pad.padName}>
@ -189,9 +150,6 @@ export const PadPage = ()=>{
setPadToDelete(pad.padName) setPadToDelete(pad.padName)
setDeleteDialog(true) setDeleteDialog(true)
}}/> }}/>
<IconButton icon={<FileStack/>} title={<Trans i18nKey="ep_admin_pads:ep_adminpads2_cleanup"/>} onClick={()=>{
cleanupPad(pad.padName)
}}/>
<IconButton icon={<Eye/>} title="view" onClick={()=>window.open(`/p/${pad.padName}`, '_blank')}/> <IconButton icon={<Eye/>} title="view" onClick={()=>window.open(`/p/${pad.padName}`, '_blank')}/>
</div> </div>
</td> </td>
@ -208,12 +166,11 @@ export const PadPage = ()=>{
offset: (Number(currentPage)-1)*searchParams.limit}) offset: (Number(currentPage)-1)*searchParams.limit})
}}><ChevronLeft/><span>Previous Page</span></button> }}><ChevronLeft/><span>Previous Page</span></button>
<span>{currentPage+1} out of {pages}</span> <span>{currentPage+1} out of {pages}</span>
<button disabled={pages == 0 || pages == currentPage+1} onClick={()=>{ <button disabled={pages == currentPage+1} onClick={()=>{
const newCurrentPage = currentPage+1 setCurrentPage(currentPage+1)
setCurrentPage(newCurrentPage)
setSearchParams({ setSearchParams({
...searchParams, ...searchParams,
offset: (Number(newCurrentPage))*searchParams.limit offset: (Number(currentPage)-1)*searchParams.limit
}) })
}}><span>Next Page</span><ChevronRight/></button> }}><span>Next Page</span><ChevronRight/></button>
</div> </div>

View file

@ -20,7 +20,7 @@ export type SearchParams = {
searchTerm: string, searchTerm: string,
offset: number, offset: number,
limit: number, limit: number,
sortBy: 'name'|'version'|'last-updated', sortBy: 'name'|'version',
sortDir: 'asc'|'desc' sortDir: 'asc'|'desc'
} }

View file

@ -1,14 +1,14 @@
import {useStore} from "../store/store.ts"; import {useStore} from "../store/store.ts";
import {isJSONClean, cleanComments} from "../utils/utils.ts"; import {isJSONClean} from "../utils/utils.ts";
import {Trans} from "react-i18next"; import {Trans} from "react-i18next";
import {IconButton} from "../components/IconButton.tsx"; import {IconButton} from "../components/IconButton.tsx";
import {RotateCw, Save} from "lucide-react"; import {RotateCw, Save} from "lucide-react";
export const SettingsPage = ()=>{ export const SettingsPage = ()=>{
const settingsSocket = useStore(state=>state.settingsSocket) const settingsSocket = useStore(state=>state.settingsSocket)
const settings = cleanComments(useStore(state=>state.settings)) const settings = useStore(state=>state.settings)
return <div className="settings-page"> return <div>
<h1><Trans i18nKey="admin_settings.current"/></h1> <h1><Trans i18nKey="admin_settings.current"/></h1>
<textarea value={settings} className="settings" onChange={v => { <textarea value={settings} className="settings" onChange={v => {
useStore.getState().setSettings(v.target.value) useStore.getState().setSettings(v.target.value)

View file

@ -1,76 +0,0 @@
import {useEffect, useState} from "react";
import {SendHorizonal} from 'lucide-react'
import {useStore} from "../store/store.ts";
import * as Switch from '@radix-ui/react-switch';
import {ShoutType} from "../components/ShoutType.ts";
export const ShoutPage = ()=>{
const [totalUsers, setTotalUsers] = useState(0);
const [message, setMessage] = useState<string>("");
const [sticky, setSticky] = useState<boolean>(false);
const socket = useStore(state => state.settingsSocket);
const [shouts, setShouts] = useState<ShoutType[]>([]);
useEffect(() => {
fetch('/stats')
.then(response => response.json())
.then(data => setTotalUsers(data.totalUsers));
}, []);
useEffect(() => {
if(socket) {
socket.on('shout', (shout) => {
setShouts([...shouts, shout])
})
}
}, [socket, shouts])
const sendMessage = () => {
socket?.emit('shout', {
message,
sticky
});
setMessage('')
}
return (
<div>
<h1>Communication</h1>
{totalUsers > 0 && <p>There {totalUsers>1?"are":"is"} currently {totalUsers} user{totalUsers>1?"s":""} online</p>}
<div style={{height: '80vh', display: 'flex', flexDirection: 'column'}}>
<div style={{flexGrow: 1, backgroundColor: 'white', overflowY: "auto"}}>
{
shouts.map((shout) => {
return (
<div key={shout.data.payload.timestamp} className="message">
<div>{shout.data.payload.message.message}</div>
<div style={{display: 'flex'}}>
<div style={{flexGrow: 1}}></div>
<div
style={{color: "lightgray"}}>{new Date(shout.data.payload.timestamp).toLocaleTimeString()
+ " " + new Date(shout.data.payload.timestamp).toLocaleDateString()}</div>
</div>
</div>
)
})
}
</div>
<form onSubmit={(e) => {
e.preventDefault()
sendMessage()
}} className="send-message search-field" style={{display: 'flex', gap: '10px'}}>
<Switch.Root title="Change sticky message" className="SwitchRoot" checked={sticky}
onCheckedChange={() => {
setSticky(!sticky);
}}>
<Switch.Thumb className="SwitchThumb"/>
</Switch.Root>
<input required value={message} onChange={v=>setMessage(v.target.value)}
style={{width: '100%', paddingRight: '55px', backgroundColor: '#e0e0e0', flexGrow: 1}}/>
<SendHorizonal style={{bottom: '5px', right: '9px', color: '#0f775b'}} onClick={()=>sendMessage()}/>
</form>
</div>
</div>
)
}

View file

@ -1,7 +1,6 @@
import {create} from "zustand"; import {create} from "zustand";
import {Socket} from "socket.io-client"; import {Socket} from "socket.io-client";
import {PadSearchResult} from "../utils/PadSearch.ts"; import {PadSearchResult} from "../utils/PadSearch.ts";
import {InstalledPlugin} from "../pages/Plugin.ts";
type ToastState = { type ToastState = {
description?:string, description?:string,
@ -23,9 +22,7 @@ type StoreState = {
toastState: ToastState, toastState: ToastState,
setToastState: (val: ToastState)=>void, setToastState: (val: ToastState)=>void,
pads: PadSearchResult|undefined, pads: PadSearchResult|undefined,
setPads: (pads: PadSearchResult)=>void, setPads: (pads: PadSearchResult)=>void
installedPlugins: InstalledPlugin[],
setInstalledPlugins: (plugins: InstalledPlugin[])=>void
} }
@ -46,7 +43,5 @@ export const useStore = create<StoreState>()((set) => ({
success: false success: false
}, },
pads: undefined, pads: undefined,
setPads: (pads)=>set({pads}), setPads: (pads)=>set({pads})
installedPlugins: [],
setInstalledPlugins: (plugins)=>set({installedPlugins: plugins})
})); }));

View file

@ -1,14 +1,5 @@
export const cleanComments = (json: string|undefined)=>{ const minify = (json: string)=>{
if (json !== undefined){
json = json.replace(/\/\*.*?\*\//g, ""); // remove single line comments
json = json.replace(/ *\/\*.*(.|\n)*?\*\//g, ""); // remove multi line comments
json = json.replace(/[ \t]+$/gm, ""); // trim trailing spaces
json = json.replace(/^(\n)/gm, ""); // remove empty lines
}
return json;
}
export const minify = (json: string)=>{
let tokenizer = /"|(\/\*)|(\*\/)|(\/\/)|\n|\r/g, let tokenizer = /"|(\/\*)|(\*\/)|(\/\/)|\n|\r/g,
in_string = false, in_string = false,
in_multiline_comment = false, in_multiline_comment = false,
@ -58,6 +49,9 @@ export const minify = (json: string)=>{
return new_str.join(""); return new_str.join("");
} }
export const isJSONClean = (data: string) => { export const isJSONClean = (data: string) => {
let cleanSettings = minify(data); let cleanSettings = minify(data);
// this is a bit naive. In theory some key/value might contain the sequences ',]' or ',}' // this is a bit naive. In theory some key/value might contain the sequences ',]' or ',}'

View file

@ -15,8 +15,7 @@ export default defineConfig({
})], })],
base: '/admin', base: '/admin',
build:{ build:{
outDir: '../src/templates/admin', outDir: '../src/templates/admin'
emptyOutDir: true,
}, },
server:{ server:{
proxy: { proxy: {
@ -28,10 +27,7 @@ export default defineConfig({
'/admin-auth/': { '/admin-auth/': {
target: 'http://localhost:9001', target: 'http://localhost:9001',
changeOrigin: true, changeOrigin: true,
}, rewrite: (path) => path.replace(/^\/admin-prox/, '/admin/')
'/stats': {
target: 'http://localhost:9001',
changeOrigin: true,
} }
} }
} }

View file

@ -50,13 +50,21 @@ rm -rf src/node_modules || true
#$(try cd ./bin/installDeps.sh) #$(try cd ./bin/installDeps.sh)
# Install admin frontend # Install admin frontend
cd admin
try pnpm install try pnpm install
try pnpm run build:etherpad try pnpm run build
cd ..
# Nuke the admin folder as it is not needed anymore :D # Nuke the admin folder as it is not needed anymore :D
rm -rf admin rm -rf admin
rm -rf oidc
rm -rf src/node_modules export NODE_ENV=production
try pnpm install --production
log "copy the windows settings template..." log "copy the windows settings template..."
try cp settings.json.template settings.json try cp settings.json.template settings.json

View file

@ -25,5 +25,4 @@ if (process.argv.length !== 2) throw new Error('Use: node bin/checkAllPads.js');
console.log(`Pad ${padId}: OK`); console.log(`Pad ${padId}: OK`);
})); }));
console.log('Finished.'); console.log('Finished.');
process.exit(0)
})(); })();

View file

@ -11,19 +11,12 @@ process.on('unhandledRejection', (err) => { throw err; });
if (process.argv.length !== 3) throw new Error('Use: node bin/checkPad.js $PADID'); if (process.argv.length !== 3) throw new Error('Use: node bin/checkPad.js $PADID');
// @ts-ignore // @ts-ignore
const padId = process.argv[2]; const padId = process.argv[2];
(async () => {
const performCheck = async () => {
const db = require('ep_etherpad-lite/node/db/DB'); const db = require('ep_etherpad-lite/node/db/DB');
await db.init(); await db.init();
console.log("Checking if " + padId + " exists")
const padManager = require('ep_etherpad-lite/node/db/PadManager'); const padManager = require('ep_etherpad-lite/node/db/PadManager');
if (!await padManager.doesPadExists(padId)) throw new Error('Pad does not exist'); if (!await padManager.doesPadExists(padId)) throw new Error('Pad does not exist');
const pad = await padManager.getPad(padId); const pad = await padManager.getPad(padId);
await pad.check(); await pad.check();
console.log('Finished checking pad.'); console.log('Finished.');
process.exit(0) })();
}
performCheck()
.then(e=>console.log("Finished"))
.catch(e=>console.log("Finished with errors"))

View file

@ -1,17 +0,0 @@
import {PackageData} from "ep_etherpad-lite/node/types/PackageInfo";
import {writeFileSync} from "fs";
import {installedPluginsPath} from "ep_etherpad-lite/static/js/pluginfw/installer";
const pluginsModule = require('ep_etherpad-lite/static/js/pluginfw/plugins');
export const persistInstalledPlugins = async () => {
const plugins:PackageData[] = []
const installedPlugins = {plugins: plugins};
for (const pkg of Object.values(await pluginsModule.getPackages()) as PackageData[]) {
installedPlugins.plugins.push({
name: pkg.name,
version: pkg.version,
});
}
installedPlugins.plugins = [...new Set(installedPlugins.plugins)];
writeFileSync(installedPluginsPath, JSON.stringify(installedPlugins));
};

View file

@ -14,7 +14,6 @@ import path from "node:path";
import querystring from "node:querystring"; import querystring from "node:querystring";
import axios from 'axios' import axios from 'axios'
import process from "node:process";
process.on('unhandledRejection', (err) => { throw err; }); process.on('unhandledRejection', (err) => { throw err; });
@ -54,5 +53,4 @@ const settings = require('ep_etherpad-lite/node/utils/Settings');
if (res.data.code === 1) throw new Error(`Error creating session: ${JSON.stringify(res.data)}`); if (res.data.code === 1) throw new Error(`Error creating session: ${JSON.stringify(res.data)}`);
console.log('Session made: ====> create a cookie named sessionID and set the value to', console.log('Session made: ====> create a cookie named sessionID and set the value to',
res.data.data.sessionID); res.data.data.sessionID);
process.exit(0)
})(); })();

View file

@ -49,5 +49,4 @@ const settings = require('ep_etherpad-lite/tests/container/loadSettings').loadSe
} }
} }
console.log(`Deleted ${deleteCount} sessions`); console.log(`Deleted ${deleteCount} sessions`);
process.exit(0)
})(); })();

View file

@ -38,5 +38,4 @@ const apikey = fs.readFileSync(filePath, {encoding: 'utf-8'});
const deleteAttempt = await axios.post(uri); const deleteAttempt = await axios.post(uri);
if (deleteAttempt.data.code === 1) throw new Error(`Error deleting pad ${deleteAttempt.data}`); if (deleteAttempt.data.code === 1) throw new Error(`Error deleting pad ${deleteAttempt.data}`);
console.log('Deleted pad', deleteAttempt.data); console.log('Deleted pad', deleteAttempt.data);
process.exit(0)
})(); })();

View file

@ -60,5 +60,4 @@ const padId = process.argv[2];
} }
console.log('finished'); console.log('finished');
process.exit(0)
})(); })();

View file

@ -1,39 +0,0 @@
import {readFileSync} from "node:fs";
const changelog = readFileSync('../changelog.md')
const changelogText = changelog.toString()
const changelogLines = changelogText.split('\n')
let cliArgs = process.argv.slice(2)
let tagVar = cliArgs[0]
if (!tagVar) {
console.error("No tag provided")
process.exit(1)
}
tagVar = tagVar.replace("refs/tags/v", "")
let startNum = -1
let endline = 0
let counter = 0
for (const line of changelogLines) {
if (line.trim().startsWith("#") && (line.match(new RegExp("#", "g"))||[]).length === 1) {
if (startNum !== -1) {
endline = counter-1
break
}
const sanitizedLine = line.replace("#","").trim()
if(sanitizedLine.includes(tagVar)) {
startNum = counter
}
}
counter++
}
let currentReleaseNotes = changelogLines.slice(startNum, endline).join('\n')
console.log(currentReleaseNotes)

View file

@ -6,8 +6,7 @@ import util from "node:util";
const fs = require('fs'); const fs = require('fs');
import log4js from 'log4js'; import log4js from 'log4js';
import readline from 'readline'; import readline from 'readline';
import {Database} from "ueberdb2"; import ueberDB from "ueberdb2";
import process from "node:process";
const settings = require('ep_etherpad-lite/node/utils/Settings'); const settings = require('ep_etherpad-lite/node/utils/Settings');
process.on('unhandledRejection', (err) => { throw err; }); process.on('unhandledRejection', (err) => { throw err; });
@ -57,7 +56,7 @@ const unescape = (val: string) => {
writeInterval: 100, writeInterval: 100,
json: false, // data is already json encoded json: false, // data is already json encoded
}; };
const db = new Database( // eslint-disable-line new-cap const db = new ueberDB.Database( // eslint-disable-line new-cap
settings.dbType, settings.dbType,
settings.dbSettings, settings.dbSettings,
dbWrapperSettings, dbWrapperSettings,
@ -97,8 +96,6 @@ const unescape = (val: string) => {
'depended on dbms this may take some time..\n'); 'depended on dbms this may take some time..\n');
const closeDB = util.promisify(db.close.bind(db)); const closeDB = util.promisify(db.close.bind(db));
// @ts-ignore
await closeDB(null); await closeDB(null);
log(`finished, imported ${keyNo} keys.`); log(`finished, imported ${keyNo} keys.`);
process.exit(0)
})(); })();

View file

@ -1,51 +0,0 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
trim() {
local var="$*"
# remove leading whitespace characters
var="${var#"${var%%[![:space:]]*}"}"
# remove trailing whitespace characters
var="${var%"${var##*[![:space:]]}"}"
printf '%s' "$var"
}
# Move to the Etherpad base directory.
MY_DIR=$(cd "${0%/*}" && pwd -P) || exit 1
cd "${MY_DIR}/.." || exit 1
# Source constants and useful functions
. bin/functions.sh
PNPM_OPTIONS=
if [ ! -z "${NODE_ENV-}" ]; then
if [ "$NODE_ENV" == 'production' ]; then
PNPM_OPTIONS='--prod'
fi
fi
if [ ! -z "${ETHERPAD_LOCAL_PLUGINS_ENV-}" ]; then
if [ "$ETHERPAD_LOCAL_PLUGINS_ENV" == 'production' ]; then
PNPM_OPTIONS='--prod'
elif [ "$ETHERPAD_LOCAL_PLUGINS_ENV" == 'development' ]; then
PNPM_OPTIONS='-D'
fi
fi
if [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ]; then
readarray -d ' ' plugins <<< "${ETHERPAD_LOCAL_PLUGINS}"
for plugin in "${plugins[@]}"; do
plugin=$(trim "$plugin")
if [ -d "local_plugins/${plugin}" ]; then
echo "Installing plugin: '${plugin}'"
pnpm install -w ${PNPM_OPTIONS:-} "local_plugins/${plugin}/"
else
( echo "Error. Directory 'local_plugins/${plugin}' for local plugin " \
"'${plugin}' missing" >&2 )
exit 1
fi
done
else
echo 'No local plugings to install.'
fi

View file

@ -19,15 +19,6 @@ IF EXIST admin (
cd /D .. cd /D ..
) )
:: Install ui only if available
IF EXIST ui (
cd /D .\ui
dir
cmd /C pnpm i || exit /B 1
cmd /C pnpm run build || exit /B 1
cd /D ..
)
cmd /C pnpm i || exit /B 1 cmd /C pnpm i || exit /B 1

53
bin/installPlugins.ts Normal file
View file

@ -0,0 +1,53 @@
'use strict';
import {writeFileSync} from 'fs'
import {linkInstaller, installedPluginsPath} from "ep_etherpad-lite/static/js/pluginfw/installer";
import {PackageData} from "ep_etherpad-lite/node/types/PackageInfo";
const pluginsModule = require('ep_etherpad-lite/static/js/pluginfw/plugins');
if (process.argv.length === 2) {
console.error('Expected at least one argument!');
process.exit(1);
}
let plugins = process.argv.slice(2)
let installFromPath = false;
const thirdOptPlug = plugins[0]
console.log("Third option: ", thirdOptPlug)
if (thirdOptPlug && thirdOptPlug.includes('path')) {
installFromPath = true
plugins.splice(plugins.indexOf('--path'), 1);
}
const persistInstalledPlugins = async () => {
const plugins:PackageData[] = []
const installedPlugins = {plugins: plugins};
for (const pkg of Object.values(await pluginsModule.getPackages()) as PackageData[]) {
installedPlugins.plugins.push({
name: pkg.name,
version: pkg.version,
});
}
installedPlugins.plugins = [...new Set(installedPlugins.plugins)];
writeFileSync(installedPluginsPath, JSON.stringify(installedPlugins));
};
async function run() {
for (const plugin of plugins) {
if(installFromPath) {
console.log(`Installing plugin from path: ${plugin}`);
await linkInstaller.installFromPath(plugin);
continue;
}
console.log(`Installing plugin from registry: ${plugin}`)
await linkInstaller.installPlugin(plugin);
}
}
(async () => {
await run();
await persistInstalledPlugins();
})();

View file

@ -1,63 +0,0 @@
import {exec} from 'child_process'
import fs from 'fs'
import path from 'path'
import pjson from '../src/package.json'
const VERSION=pjson.version
console.log(`Building docs for version ${VERSION}`)
const createDirIfNotExists = (dir: fs.PathLike) => {
if (!fs.existsSync(dir)){
fs.mkdirSync(dir)
}
}
function copyFolderSync(from: fs.PathLike, to: fs.PathLike) {
if(fs.existsSync(to)){
const stat = fs.lstatSync(to)
if (stat.isDirectory()){
fs.rmSync(to, { recursive: true })
}
else{
fs.rmSync(to)
}
}
fs.mkdirSync(to);
fs.readdirSync(from).forEach(element => {
if (fs.lstatSync(path.join(<string>from, element)).isFile()) {
if (typeof from === "string") {
if (typeof to === "string") {
fs.copyFileSync(path.join(from, element), path.join(to, element))
}
}
} else {
if (typeof from === "string") {
if (typeof to === "string") {
copyFolderSync(path.join(from, element), path.join(to, element))
}
}
}
});
}
exec('asciidoctor -v', (err,stdout)=>{
if (err){
console.log('Please install asciidoctor')
console.log('https://asciidoctor.org/docs/install-toolchain/')
process.exit(1)
}
});
createDirIfNotExists('../out')
createDirIfNotExists('../out/doc')
createDirIfNotExists('../out/doc/api')
exec(`asciidoctor -D ../out/doc ../doc/index.adoc ../*/**.adoc -a VERSION=${VERSION}`)
exec(`asciidoctor -D ../out/doc/api ../doc/api/*.adoc -a VERSION=${VERSION}`)
copyFolderSync('../doc/public/', '../out/doc/')

View file

@ -1,83 +0,0 @@
// DB migration
import {readFileSync} from 'node:fs'
import {Database, DatabaseType} from "ueberdb2";
import path from "node:path";
const settings = require('ep_etherpad-lite/node/utils/Settings');
// file1 = source, file2 = target
// pnpm run migrateDB --file1 <db1.json> --file2 <db2.json>
const arg = process.argv.slice(2);
if (arg.length != 4) {
console.error('Wrong number of arguments!. Call with pnpm run migrateDB --file1 source.json target.json')
process.exit(1)
}
type SettingsConfig = {
dbType: string,
dbSettings: any
}
/*
{
"dbType": "<your-db-type>",
"dbSettings": {
<your-db-settings>
}
}
*/
let firstDBSettingsFile: string
let secondDBSettingsFile: string
if (arg[0] == "--file1") {
firstDBSettingsFile = arg[1]
} else if (arg[0] === "--file2") {
secondDBSettingsFile = arg[1]
}
if (arg[2] == "--file1") {
firstDBSettingsFile = arg[3]
} else if (arg[2] === "--file2") {
secondDBSettingsFile = arg[3]
}
const settingsfile = JSON.parse(readFileSync(path.join(settings.root,firstDBSettingsFile!)).toString()) as SettingsConfig
const settingsfile2 = JSON.parse(readFileSync(path.join(settings.root,secondDBSettingsFile!)).toString()) as SettingsConfig
console.log(settingsfile2)
if ("filename" in settingsfile.dbSettings) {
settingsfile.dbSettings.filename = path.join(settings.root, settingsfile.dbSettings.filename)
console.log(settingsfile.dbType + " location is "+ settingsfile.dbSettings.filename)
}
if ("filename" in settingsfile2.dbSettings) {
settingsfile2.dbSettings.filename = path.join(settings.root, settingsfile2.dbSettings.filename)
console.log(settingsfile2.dbType + " location is "+ settingsfile2.dbSettings.filename)
}
const ueberdb1 = new Database(settingsfile.dbType as DatabaseType, settingsfile.dbSettings)
const ueberdb2 = new Database(settingsfile2.dbType as DatabaseType, settingsfile2.dbSettings)
const handleSync = async ()=>{
await ueberdb1.init()
await ueberdb2.init()
const allKeys = await ueberdb1.findKeys('*','')
for (const key of allKeys) {
const foundVal = await ueberdb1.get(key)!
await ueberdb2.set(key, foundVal)
}
}
handleSync().then(()=>{
console.log("Done syncing dbs")
}).catch(e=>{
console.log(`Error syncing db ${e}`)
})

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
import process from 'node:process'; import process from 'node:process';
import {Database} from "ueberdb2"; import ueberDB from "ueberdb2";
import log4js from 'log4js'; import log4js from 'log4js';
import util from 'util'; import util from 'util';
const settings = require('ep_etherpad-lite/node/utils/Settings'); const settings = require('ep_etherpad-lite/node/utils/Settings');
@ -23,7 +23,7 @@ process.on('unhandledRejection', (err) => { throw err; });
cache: '0', // The cache slows things down when you're mostly writing. cache: '0', // The cache slows things down when you're mostly writing.
writeInterval: 0, // Write directly to the database, don't buffer writeInterval: 0, // Write directly to the database, don't buffer
}; };
const db = new Database( // eslint-disable-line new-cap const db = new ueberDB.Database( // eslint-disable-line new-cap
settings.dbType, settings.dbType,
settings.dbSettings, settings.dbSettings,
dbWrapperSettings, dbWrapperSettings,
@ -31,7 +31,7 @@ process.on('unhandledRejection', (err) => { throw err; });
await db.init(); await db.init();
console.log('Waiting for dirtyDB to parse its file.'); console.log('Waiting for dirtyDB to parse its file.');
const dirty = new Database('dirty', `${__dirname}/../var/dirty.db`); const dirty = await new ueberDB.Database('dirty',`${__dirname}/../var/dirty.db`);
await dirty.init(); await dirty.init();
const keys = await dirty.findKeys('*', '') const keys = await dirty.findKeys('*', '')
@ -57,5 +57,4 @@ process.on('unhandledRejection', (err) => { throw err; });
await db.close(null); await db.close(null);
await dirty.close(null); await dirty.close(null);
console.log('Finished.'); console.log('Finished.');
process.exit(0)
})(); })();

View file

@ -1,26 +1,25 @@
{ {
"name": "bin", "name": "bin",
"version": "2.3.0", "version": "2.0.1",
"description": "", "description": "",
"main": "checkAllPads.js", "main": "checkAllPads.js",
"directories": { "directories": {
"doc": "doc" "doc": "doc"
}, },
"dependencies": { "dependencies": {
"axios": "^1.8.4", "axios": "^1.6.8",
"ep_etherpad-lite": "workspace:../src", "ep_etherpad-lite": "workspace:../src",
"log4js": "^6.9.1", "log4js": "^6.9.1",
"semver": "^7.7.2", "semver": "^7.6.0",
"tsx": "^4.20.3", "tsx": "^4.7.1",
"ueberdb2": "^5.0.14" "ueberdb2": "^4.2.63"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^24.0.1", "@types/node": "^20.11.27",
"@types/semver": "^7.7.0", "@types/semver": "^7.5.8",
"typescript": "^5.8.2" "typescript": "^5.4.2"
}, },
"scripts": { "scripts": {
"makeDocs": "node --import tsx make_docs.ts",
"checkPad": "node --import tsx checkPad.ts", "checkPad": "node --import tsx checkPad.ts",
"checkAllPads": "node --import tsx checkAllPads.ts", "checkAllPads": "node --import tsx checkAllPads.ts",
"createUserSession": "node --import tsx createUserSession.ts", "createUserSession": "node --import tsx createUserSession.ts",
@ -33,9 +32,7 @@
"rebuildPad": "node --import tsx rebuildPad.ts", "rebuildPad": "node --import tsx rebuildPad.ts",
"stalePlugins": "node --import tsx ./plugins/stalePlugins.ts", "stalePlugins": "node --import tsx ./plugins/stalePlugins.ts",
"checkPlugin": "node --import tsx ./plugins/checkPlugin.ts", "checkPlugin": "node --import tsx ./plugins/checkPlugin.ts",
"plugins": "node --import tsx ./plugins.ts", "install-plugins": "node --import tsx ./installPlugins.ts"
"generateChangelog": "node --import tsx generateReleaseNotes.ts",
"migrateDB": "node --import tsx migrateDB.ts"
}, },
"author": "", "author": "",
"license": "ISC" "license": "ISC"

View file

@ -1,117 +0,0 @@
'use strict';
import {linkInstaller, checkForMigration} from "ep_etherpad-lite/static/js/pluginfw/installer";
import {persistInstalledPlugins} from "./commonPlugins";
import fs from "node:fs";
const settings = require('ep_etherpad-lite/node/utils/Settings');
if (process.argv.length === 2) {
console.error('Expected at least one argument!');
process.exit(1);
}
let args = process.argv.slice(2)
const possibleActions = [
"i",
"install",
"rm",
"remove",
"ls",
"list"
]
const install = ()=> {
const argsAsString: string = args.join(" ");
const regexRegistryPlugins = /(?<=i\s)(.*?)(?=--github|--path|$)/;
const regexLocalPlugins = /(?<=--path\s)(.*?)(?=--github|$)/;
const regexGithubPlugins = /(?<=--github\s)(.*?)(?=--path|$)/;
const registryPlugins = argsAsString.match(regexRegistryPlugins)?.[0]?.split(" ")?.filter(s => s) || [];
const localPlugins = argsAsString.match(regexLocalPlugins)?.[0]?.split(" ")?.filter(s => s) || [];
const githubPlugins = argsAsString.match(regexGithubPlugins)?.[0]?.split(" ")?.filter(s => s) || [];
async function run() {
for (const plugin of registryPlugins) {
if (possibleActions.includes(plugin)){
continue
}
console.log(`Installing plugin from registry: ${plugin}`)
if (plugin.includes('@')) {
const [name, version] = plugin.split('@');
await linkInstaller.installPlugin(name, version);
continue;
}
await linkInstaller.installPlugin(plugin);
}
for (const plugin of localPlugins) {
console.log(`Installing plugin from path: ${plugin}`);
await linkInstaller.installFromPath(plugin);
}
for (const plugin of githubPlugins) {
console.log(`Installing plugin from github: ${plugin}`);
await linkInstaller.installFromGitHub(plugin);
}
}
(async () => {
await checkForMigration();
await run();
await persistInstalledPlugins();
})();
}
const list = ()=>{
const walk = async () => {
const plugins = fs.readFileSync(settings.root+"/var/installed_plugins.json", "utf-8")
const pluginNames = JSON.parse(plugins).plugins.map((plugin: any) => plugin.name).join(", ")
console.log("Installed plugins are:", pluginNames)
}
(async () => {
await walk();
})();
}
const remove = (plugins: string[])=>{
const walk = async () => {
for (const plugin of plugins) {
console.log(`Uninstalling plugin: ${plugin}`)
await linkInstaller.uninstallPlugin(plugin);
}
await persistInstalledPlugins();
}
(async () => {
await checkForMigration();
await walk();
})();
}
let action = args[0];
switch (action) {
case "install":
install();
break;
case "i":
install();
break;
case "ls":
list();
break;
case "list":
list();
break;
case "rm":
remove(args.slice(1));
break;
default:
console.error('Expected at least one argument!');
process.exit(1);
}

View file

@ -474,6 +474,6 @@ log4js.configure({
logger.info('No changes.'); logger.info('No changes.');
} }
} }
logger.info('Finished'); logger.info('Finished');
process.exit(0)
})(); })();

View file

@ -69,7 +69,7 @@ jobs:
working-directory: ./etherpad-lite working-directory: ./etherpad-lite
run: | run: |
pnpm link --global $PLUGIN_NAME pnpm link --global $PLUGIN_NAME
pnpm run plugins i --path ../../plugin pnpm run install-plugins --path ../../plugin
env: env:
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }} PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
- name: Link ep_etherpad-lite - name: Link ep_etherpad-lite

View file

@ -78,7 +78,7 @@ jobs:
- name: Run the frontend tests - name: Run the frontend tests
shell: bash shell: bash
run: | run: |
pnpm run prod & pnpm run dev &
connected=false connected=false
can_connect() { can_connect() {
curl -sSfo /dev/null http://localhost:9001/ || return 1 curl -sSfo /dev/null http://localhost:9001/ || return 1

View file

@ -3,7 +3,6 @@
// Returns a list of stale plugins and their authors email // Returns a list of stale plugins and their authors email
import axios from 'axios' import axios from 'axios'
import process from "node:process";
const currentTime = new Date(); const currentTime = new Date();
(async () => { (async () => {
@ -20,5 +19,4 @@ const currentTime = new Date();
console.log(`${name}, ${res.data[plugin].data.maintainers[0].email}`); console.log(`${name}, ${res.data[plugin].data.maintainers[0].email}`);
} }
} }
process.exit(0)
})(); })();

View file

@ -7,8 +7,6 @@
// As of v14, Node.js does not exit when there is an unhandled Promise rejection. Convert an // As of v14, Node.js does not exit when there is an unhandled Promise rejection. Convert an
// unhandled rejection into an uncaught exception, which does cause Node.js to exit. // unhandled rejection into an uncaught exception, which does cause Node.js to exit.
import process from "node:process";
process.on('unhandledRejection', (err) => { throw err; }); process.on('unhandledRejection', (err) => { throw err; });
if (process.argv.length !== 4 && process.argv.length !== 5) { if (process.argv.length !== 4 && process.argv.length !== 5) {
@ -84,5 +82,4 @@ const newPadId = process.argv[4] || `${padId}-rebuilt`;
await db.shutdown(); await db.shutdown();
console.info('finished'); console.info('finished');
process.exit(0)
})(); })();

View file

@ -197,7 +197,7 @@ try {
try { try {
console.log('Building documentation...'); console.log('Building documentation...');
run('pnpm run makeDocs'); run('node ./make_docs.js');
console.log('Updating ether.github.com master branch...'); console.log('Updating ether.github.com master branch...');
run('git pull --ff-only', {cwd: '../ether.github.com/'}); run('git pull --ff-only', {cwd: '../ether.github.com/'});
console.log('Committing documentation...'); console.log('Committing documentation...');

View file

@ -57,5 +57,4 @@ let valueCount = 0;
} }
console.info(`Finished: Replaced ${valueCount} values in the database`); console.info(`Finished: Replaced ${valueCount} values in the database`);
process.exit(0)
})(); })();

View file

@ -22,7 +22,7 @@ Please type 'Etherpad rocks my socks' (or restart with the '--root'
argument) if you still want to start it as root: argument) if you still want to start it as root:
EOF EOF
printf "> " >&2 printf "> " >&2
read -r rocks read rocks
[ "$rocks" = "Etherpad rocks my socks" ] || fatal "Your input was incorrect" [ "$rocks" = "Etherpad rocks my socks" ] || fatal "Your input was incorrect"
fi fi
@ -32,11 +32,9 @@ bin/installDeps.sh "$@" || exit 1
## Create the admin ui ## Create the admin ui
if [ -z "$NODE_ENV" ] || [ "$NODE_ENV" = "development" ]; then if [ -z "$NODE_ENV" ] || [ "$NODE_ENV" = "development" ]; then
ADMIN_UI_PATH="$(dirname "$0")/../admin" ADMIN_UI_PATH="$(dirname $0)/../admin"
UI_PATH="$(dirname "$0")/../ui"
log "Creating the admin UI..." log "Creating the admin UI..."
(cd "$ADMIN_UI_PATH" && pnpm run build) (cd $ADMIN_UI_PATH && pnpm run build)
(cd "$UI_PATH" && pnpm run build)
else else
log "Cannot create the admin UI in production mode" log "Cannot create the admin UI in production mode"
fi fi
@ -45,4 +43,4 @@ fi
log "Starting Etherpad..." log "Starting Etherpad..."
# cd src # cd src
exec pnpm run prod "$@" exec pnpm run dev "$@"

View file

@ -39,7 +39,7 @@
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
"resolveJsonModule": true, /* Enable importing .json files. */ // "resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */

2
doc/.gitignore vendored
View file

@ -1,2 +0,0 @@
.vitepress/cache
dist

View file

@ -1,79 +0,0 @@
import { defineConfig } from 'vitepress'
import {version} from '../../package.json'
// https://vitepress.dev/reference/site-config
const commitRef = process.env.COMMIT_REF?.slice(0, 8) || 'dev'
export default defineConfig({
title: "Etherpad Documentation",
description: "Next Generation Collaborative Document Editing",
base: '/',
themeConfig: {
search: {
provider: 'local'
},
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Getting started', link: '/docker.md' }
],
logo:'/favicon.ico',
sidebar: {
'/': [
{
link: '/',
text: 'About',
items: [
{ text: 'Docker', link: '/docker.md' },
{ text: 'Localization', link: '/localization.md' },
{ text: 'Cookies', link: '/cookies.md' },
{ text: 'Plugins', link: '/plugins.md' },
{ text: 'Stats', link: '/stats.md' },
{text: 'Skins', link: '/skins.md' },
{text: 'Demo', link: '/demo.md' },
{text: 'CLI', link: '/cli.md'},
]
},
{
text: 'API',
link: '/api/',
items: [
{ text: 'Changeset', link: '/api/changeset_library.md' },
{text: 'Editbar', link: '/api/editbar.md' },
{text: 'EditorInfo', link: '/api/editorInfo.md' },
{text: 'Embed Parameters', link: '/api/embed_parameters.md' },
{text: 'Hooks Client Side', link: '/api/hooks_client-side.md' },
{text: 'Hooks Server Side', link: '/api/hooks_server-side.md' },
{text: 'Plugins', link: '/api/pluginfw.md' },
{text: 'Toolbar', link: '/api/toolbar.md' },
{text: 'HTTP API', link: '/api/http_api.md' },
]
},
{
text: 'Old Docs',
items: [
{ text: 'Easysync description', link: '/etherpad-lite/easysync/easysync-full-description.pdf' },
{ text: 'Easysync notes', link: '/etherpad-lite/easysync/easysync-notes.pdf' }
]
}
],
'/stats': [
{
text: 'Stats',
items:[
{ text: 'Stats', link: '/stats/' }
]
}
]
},
footer: {
message: `Published under Apache License`,
copyright: `(${commitRef}) v${version} by Etherpad Foundation`
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/ether/etherpad-lite' }
]
}
})

View file

@ -1,22 +0,0 @@
<script setup lang="ts">
defineProps<{ svg: string }>()
</script>
<template>
<figure class="svg-image-root" v-html="svg" />
</template>
<style>
.svg-image-root {
background-color: #eee;
border-radius: 8px;
padding: 1ch;
margin: 1ch 0;
}
html.dark .svg-image-root {
background-color: #313641;
}
.svg-image-root svg text {
font-family: var(--vp-font-family-base);
}
</style>

View file

@ -1,12 +0,0 @@
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './styles/vars.css'
import SvgImage from './components/SvgImage.vue'
export default {
extends: DefaultTheme,
enhanceApp({ app }) {
app.component('SvgImage', SvgImage)
},
} satisfies Theme

View file

@ -1,77 +0,0 @@
/**
* Colors
* -------------------------------------------------------------------------- */
:root {
--vp-c-brand: #646cff;
--vp-c-brand-light: #747bff;
--vp-c-brand-lighter: #9499ff;
--vp-c-brand-lightest: #bcc0ff;
--vp-c-brand-dark: #535bf2;
--vp-c-brand-darker: #454ce1;
--vp-c-brand-dimm: rgba(100, 108, 255, 0.08);
}
/**
* Component: Button
* -------------------------------------------------------------------------- */
:root {
--vp-button-brand-border: var(--vp-c-brand-light);
--vp-button-brand-text: var(--vp-c-white);
--vp-button-brand-bg: var(--vp-c-brand);
--vp-button-brand-hover-border: var(--vp-c-brand-light);
--vp-button-brand-hover-text: var(--vp-c-white);
--vp-button-brand-hover-bg: var(--vp-c-brand-light);
--vp-button-brand-active-border: var(--vp-c-brand-light);
--vp-button-brand-active-text: var(--vp-c-white);
--vp-button-brand-active-bg: var(--vp-button-brand-bg);
}
/**
* Component: Home
* -------------------------------------------------------------------------- */
:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(
120deg,
#0f775b 30%,
#0f775b
);
--vp-home-hero-image-background-image: linear-gradient(
-45deg,
#0f775b 50%,
#0f775b 50%
);
--vp-home-hero-image-filter: blur(40px);
}
@media (min-width: 640px) {
:root {
--vp-home-hero-image-filter: blur(56px);
}
}
@media (min-width: 960px) {
:root {
--vp-home-hero-image-filter: blur(72px);
}
}
/**
* Component: Custom Block
* -------------------------------------------------------------------------- */
:root {
--vp-custom-block-tip-border: var(--vp-c-brand);
--vp-custom-block-tip-text: var(--vp-c-brand-darker);
--vp-custom-block-tip-bg: var(--vp-c-brand-dimm);
}
.dark {
--vp-custom-block-tip-border: var(--vp-c-brand);
--vp-custom-block-tip-text: var(--vp-c-brand-lightest);
--vp-custom-block-tip-bg: var(--vp-c-brand-dimm);
}

View file

@ -1,44 +0,0 @@
# Changeset Library
The [changeset
library](https://github.com/ether/etherpad-lite/blob/develop/src/static/js/Changeset.ts)
provides tools to create, read, and apply changesets.
## Changeset
```javascript
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
```
A changeset describes the difference between two revisions of a document. When a
user edits a pad, the browser generates and sends a changeset to the server,
which relays it to the other users and saves a copy (so that every past revision
is accessible).
A transmitted changeset looks like this:
```
'Z:z>1|2=m=b*0|1+1$\n'
```
## Attribute Pool
```javascript
const AttributePool = require('ep_etherpad-lite/static/js/AttributePool');
```
Changesets do not include any attribute keyvalue pairs. Instead, they use
numeric identifiers that reference attributes kept in an [attribute
pool](https://github.com/ether/etherpad-lite/blob/develop/src/static/js/AttributePool.js).
This attribute interning reduces the transmission overhead of attributes that
are used many times.
There is one attribute pool per pad, and it includes every current and
historical attribute used in the pad.
## Further Reading
Detailed information about the changesets & Easysync protocol:
* [Easysync Protocol](https://github.com/ether/etherpad-lite/blob/develop/doc/easysync/easysync-notes.pdf)
* [Etherpad and EasySync Technical Manual](https://github.com/ether/etherpad-lite/blob/develop/doc/easysync/easysync-full-description.pdf)

View file

@ -1,36 +0,0 @@
# Editbar
Located in `src/static/js/pad_editbar.js`
## isEnabled()
If the editorbar contains the class `enabledtoolbar`, it is enabled.
## disable()
Disables the editorbar. This is done by adding the class `disabledtoolbar` and removing the enabledtoolbar
## toggleDropDown(dropdown)
Shows the dropdown `div.popup` whose `id` equals `dropdown`.
## registerCommand(cmd, callback)
Register a handler for a specific command. Commands are fired if the corresponding button is clicked or the corresponding select is changed.
## registerAceCommand(cmd, callback)
Creates an ace callstack and calls the callback with an ace instance (and a toolbar item, if applicable): `callback(cmd, ace, item)`.
Example:
```
toolbar.registerAceCommand("insertorderedlist", function (cmd, ace) {
ace.ace_doInsertOrderedList();
});
```
## registerDropdownCommand(cmd, dropdown)
Ties a `div.popup` where `id` equals `dropdown` to a `command` fired by clicking a button.
## triggerCommand(cmd[, item])
Triggers a command (optionally with some internal representation of the toolbar item that triggered it).

View file

@ -1,208 +0,0 @@
# EditorInfo
Location: `src/static/js/ace2_inner.js`
## editorInfo.ace_replaceRange(start, end, text)
This function replaces a range (from `start` to `end`) with `text`.
## editorInfo.ace_getRep()
Returns the `rep` object. The rep object consists of the following properties:
- `lines`: Implemented as a skip list
- `selStart`: The start of the selection
- `selEnd`: The end of the selection
- `selFocusAtStart`: Whether the selection is focused at the start
- `alltext`: The entire text of the document
- `alines`: The entire text of the document, split into lines
- `apool`: The pool of attributes
## editorInfo.ace_getAuthor()
Returns the authors of the pad. If the pad has no authors, it returns an empty object.
## editorInfo.ace_inCallStack()
Returns true if the editor is in the call stack.
## editorInfo.ace_inCallStackIfNecessary(?)
Executes the function if the editor is in the call stack.
## editorInfo.ace_focus(?)
Focuses the editor.
## editorInfo.ace_importText(?)
Imports text into the editor.
## editorInfo.ace_importAText(?)
Imports text and attributes into the editor.
## editorInfo.ace_exportText(?)
Exports the text from the editor.
## editorInfo.ace_editorChangedSize(?)
Changes the size of the editor.
## editorInfo.ace_setOnKeyPress(?)
Sets the key press event.
## editorInfo.ace_setOnKeyDown(?)
Sets the key down event.
## editorInfo.ace_setNotifyDirty(?)
Sets the dirty notification.
## editorInfo.ace_dispose(?)
Disposes the editor.
## editorInfo.ace_setEditable(bool)
Sets the editor to be editable or not.
## editorInfo.ace_execCommand(?)
Executes a command.
## editorInfo.ace_callWithAce(fn, callStack, normalize)
Calls a function with the ace instance.
## editorInfo.ace_setProperty(key, value)
Sets a property.
## editorInfo.ace_setBaseText(txt)
Sets the base text.
## editorInfo.ace_setBaseAttributedText(atxt, apoolJsonObj)
Sets the base attributed text.
## editorInfo.ace_applyChangesToBase(c, optAuthor, apoolJsonObj)
Applies changes to the base.
## editorInfo.ace_prepareUserChangeset()
Prepares the user changeset.
## editorInfo.ace_applyPreparedChangesetToBase()
Applies the prepared changeset to the base.
## editorInfo.ace_setUserChangeNotificationCallback(f)
Sets the user change notification callback.
## editorInfo.ace_setAuthorInfo(author, info)
Sets the author info.
## editorInfo.ace_fastIncorp(?)
Incorporates changes quickly.
## editorInfo.ace_isCaret(?)
Returns true if the caret is at the specified position.
## editorInfo.ace_getLineAndCharForPoint(?)
Returns the line and character for a point.
## editorInfo.ace_performDocumentApplyAttributesToCharRange(?)
Applies attributes to a character range.
## editorInfo.ace_setAttributeOnSelection(attribute, enabled)
Sets an attribute on current range.
Example: `call.editorInfo.ace_setAttributeOnSelection("turkey::balls", true); // turkey is the attribute here, balls is the value
Notes: to remove the attribute pass enabled as false
## editorInfo.ace_toggleAttributeOnSelection(?)
Toggles an attribute on the current range.
## editorInfo.ace_getAttributeOnSelection(attribute, prevChar)
Returns a boolean if an attribute exists on a selected range.
prevChar value should be true if you want to get the previous Character attribute instead of the current selection for example
if the caret is at position 0,1 (after first character) it's probable you want the attributes on the character at 0,0
The attribute should be the string name of the attribute applied to the selection IE subscript
Example usage: Apply the activeButton Class to a button if an attribute is on a highlighted/selected caret position or range.
Example `var isItThere = documentAttributeManager.getAttributeOnSelection("turkey::balls", true);`
See the ep_subscript plugin for an example of this function in action.
Notes: Does not work on first or last character of a line. Suffers from a race condition if called with aceEditEvent.
## editorInfo.ace_performSelectionChange(?)
Performs a selection change.
## editorInfo.ace_doIndentOutdent(?)
Indents or outdents the selection.
## editorInfo.ace_doUndoRedo(?)
Undoes or redoes the last action.
## editorInfo.ace_doInsertUnorderedList(?)
Inserts an unordered list.
## editorInfo.ace_doInsertOrderedList(?)
Inserts an ordered list.
## editorInfo.ace_performDocumentApplyAttributesToRange()
Applies attributes to a range.
## editorInfo.ace_getAuthorInfos()
Returns an info object about the author. Object key = author_id and info includes author's bg color value.
Use to define your own authorship.
## editorInfo.ace_performDocumentReplaceRange(start, end, newText)
This function replaces a range (from [x1,y1] to [x2,y2]) with `newText`.
## editorInfo.ace_performDocumentReplaceCharRange(startChar, endChar, newText)
This function replaces a range (from y1 to y2) with `newText`.
## editorInfo.ace_renumberList(lineNum)
If you delete a line, calling this method will fix the line numbering.
## editorInfo.ace_doReturnKey()
Forces a return key at the current caret position.
## editorInfo.ace_isBlockElement(element)
Returns true if your passed element is registered as a block element.
## editorInfo.ace_getLineListType(lineNum)
Returns the line's html list type.
## editorInfo.ace_caretLine()
Returns X position of the caret.
## editorInfo.ace_caretColumn()
Returns Y position of the caret.
## editorInfo.ace_caretDocChar()
Returns the Y offset starting from [x=0,y=0]
## editorInfo.ace_isWordChar(?)
Returns true if the character is a word character.

View file

@ -1,75 +0,0 @@
# Embed parameters
You can easily embed your etherpad-lite into any webpage by using iframes. You can configure the embedded pad using embed parameters.
Example:
Cut and paste the following code into any webpage to embed a pad. The parameters below will hide the chat and the line numbers and will auto-focus on Line 4.
```
<iframe src='http://pad.test.de/p/PAD_NAME#L4?showChat=false&showLineNumbers=false' width=600 height=400></iframe>
```
## showLineNumbers
* Boolean
Default: true
## showControls
* Boolean
Default: true
## showChat
* Boolean
Default: true
## useMonospaceFont
* Boolean
Default: false
## userName
* String
Default: "unnamed"
Example: `userName=Etherpad%20User`
## userColor
* String (css hex color value)
Default: randomly chosen by pad server
Example: `userColor=%23ff9900`
## noColors
* Boolean
Default: false
## alwaysShowChat
* Boolean
Default: false
## lang
* String
Default: en
Example: `lang=ar` (translates the interface into Arabic)
## rtl
* Boolean
Default: true
Displays pad text from right to left.
## #L
* Int
Default: 0
Focuses pad at specific line number and places caret at beginning of this line
Special note: Is not a URL parameter but instead of a Hash value

View file

@ -4,7 +4,7 @@ Most of these hooks are called during or in order to set up the formatting
process. process.
=== documentReady === documentReady
Called from: `src/templates/pad.html` Called from: src/templates/pad.html
Things in context: Things in context:
@ -14,7 +14,7 @@ This hook proxies the functionality of jQuery's `$(document).ready` event.
=== aceDomLinePreProcessLineAttributes === aceDomLinePreProcessLineAttributes
Called from: `src/static/js/domline.js` Called from: src/static/js/domline.js
Things in context: Things in context:
@ -36,7 +36,7 @@ more.
=== aceDomLineProcessLineAttributes === aceDomLineProcessLineAttributes
Called from: `src/static/js/domline.js` Called from: src/static/js/domline.js
Things in context: Things in context:
@ -58,7 +58,7 @@ more.
=== aceCreateDomLine === aceCreateDomLine
Called from: `src/static/js/domline.js` Called from: src/static/js/domline.js
Things in context: Things in context:
@ -78,7 +78,7 @@ question, and cls will be the new class of the element going forward.
=== acePostWriteDomLineHTML === acePostWriteDomLineHTML
Called from: `src/static/js/domline.js` Called from: src/static/js/domline.js
Things in context: Things in context:
@ -89,7 +89,7 @@ page.
=== aceAttribsToClasses === aceAttribsToClasses
Called from: `src/static/js/linestylefilter.js` Called from: src/static/js/linestylefilter.js
Things in context: Things in context:
@ -107,7 +107,7 @@ be parsed into a valid class string.
=== aceAttribClasses === aceAttribClasses
Called from: `src/static/js/linestylefilter.js` Called from: src/static/js/linestylefilter.js
Things in context: Things in context:
1. Attributes - Object of Attributes 1. Attributes - Object of Attributes
@ -127,7 +127,7 @@ exports.aceAttribClasses = function(hook_name, attr, cb){
=== aceGetFilterStack === aceGetFilterStack
Called from: `src/static/js/linestylefilter.js` Called from: src/static/js/linestylefilter.js
Things in context: Things in context:
@ -143,7 +143,7 @@ later used by the aceCreateDomLine hook (documented above).
=== aceEditorCSS === aceEditorCSS
Called from: `src/static/js/ace.js` Called from: src/static/js/ace.js
Things in context: None Things in context: None
@ -152,7 +152,7 @@ should be an array of resource urls or paths relative to the plugins directory.
=== aceInitInnerdocbodyHead === aceInitInnerdocbodyHead
Called from: `src/static/js/ace.js` Called from: src/static/js/ace.js
Things in context: Things in context:
@ -165,7 +165,7 @@ editor HTML document.
=== aceEditEvent === aceEditEvent
Called from: `src/static/js/ace2_inner.js` Called from: src/static/js/ace2_inner.js
Things in context: Things in context:
@ -182,7 +182,7 @@ your plugin) that use the information provided by the edit event.
=== aceRegisterNonScrollableEditEvents === aceRegisterNonScrollableEditEvents
Called from: `src/static/js/ace2_inner.js` Called from: src/static/js/ace2_inner.js
Things in context: None Things in context: None
@ -203,7 +203,7 @@ exports.aceRegisterNonScrollableEditEvents = function(){
=== aceRegisterBlockElements === aceRegisterBlockElements
Called from: `src/static/js/ace2_inner.js` Called from: src/static/js/ace2_inner.js
Things in context: None Things in context: None
@ -213,7 +213,7 @@ call for those elements.
=== aceInitialized === aceInitialized
Called from: `src/static/js/ace2_inner.js` Called from: src/static/js/ace2_inner.js
Things in context: Things in context:
@ -228,7 +228,7 @@ use in formatting hooks.
=== postAceInit === postAceInit
Called from: `src/static/js/pad.js` Called from: src/static/js/pad.js
Things in context: Things in context:
@ -240,7 +240,7 @@ Things in context:
=== postToolbarInit === postToolbarInit
Called from: `src/static/js/pad_editbar.js` Called from: src/static/js/pad_editbar.js
Things in context: Things in context:
@ -255,14 +255,14 @@ Usage examples:
=== postTimesliderInit === postTimesliderInit
Called from: `src/static/js/timeslider.js` Called from: src/static/js/timeslider.js
There doesn't appear to be any example available of this particular hook being There doesn't appear to be any example available of this particular hook being
used, but it gets fired after the timeslider is all set up. used, but it gets fired after the timeslider is all set up.
=== goToRevisionEvent === goToRevisionEvent
Called from: `src/static/js/broadcast.js` Called from: src/static/js/broadcast.js
Things in context: Things in context:
@ -274,7 +274,7 @@ be any example available of this particular hook being used.
=== userJoinOrUpdate === userJoinOrUpdate
Called from: `src/static/js/pad_userlist.js` Called from: src/static/js/pad_userlist.js
Things in context: Things in context:

View file

@ -1,527 +0,0 @@
# Client-side hooks
Most of these hooks are called during or in order to set up the formatting
process.
## documentReady
Called from: `src/templates/pad.html`
Things in context:
nothing
This hook proxies the functionality of jQuery's `$(document).ready` event.
## aceDomLinePreProcessLineAttributes
Called from: `src/static/js/domline.js`
Things in context:
1. domline - The current DOM line being processed
2. cls - The class of the current block element (useful for styling)
This hook is called for elements in the DOM that have the "lineMarkerAttribute"
set. You can add elements into this category with the aceRegisterBlockElements
hook above. This hook is run BEFORE the numbered and ordered lists logic is
applied.
The return value of this hook should have the following structure:
`{ preHtml: String, postHtml: String, processedMarker: Boolean }`
The preHtml and postHtml values will be added to the HTML display of the
element, and if processedMarker is true, the engine won't try to process it any
more.
## aceDomLineProcessLineAttributes
Called from: `src/static/js/domline.js`
Things in context:
1. domline - The current DOM line being processed
2. cls - The class of the current block element (useful for styling)
This hook is called for elements in the DOM that have the "lineMarkerAttribute"
set. You can add elements into this category with the aceRegisterBlockElements
hook above. This hook is run AFTER the ordered and numbered lists logic is
applied.
The return value of this hook should have the following structure:
`{ preHtml: String, postHtml: String, processedMarker: Boolean }`
The preHtml and postHtml values will be added to the HTML display of the
element, and if processedMarker is true, the engine won't try to process it any
more.
## aceCreateDomLine
Called from: `src/static/js/domline.js`
Things in context:
1. domline - the current DOM line being processed
2. cls - The class of the current element (useful for styling)
This hook is called for any line being processed by the formatting engine,
unless the aceDomLineProcessLineAttributes hook from above returned true, in
which case this hook is skipped.
The return value of this hook should have the following structure:
`{ extraOpenTags: String, extraCloseTags: String, cls: String }`
extraOpenTags and extraCloseTags will be added before and after the element in
question, and cls will be the new class of the element going forward.
## acePostWriteDomLineHTML
Called from: `src/static/js/domline.js`
Things in context:
1. node - the DOM node that just got written to the page
This hook is for right after a node has been fully formatted and written to the
page.
## aceAttribsToClasses
Called from: `src/static/js/linestylefilter.js`
Things in context:
1. linestylefilter - the JavaScript object that's currently processing the ace
attributes
2. key - the current attribute being processed
3. value - the value of the attribute being processed
This hook is called during the attribute processing procedure, and should be
used to translate key, value pairs into valid HTML classes that can be inserted
into the DOM.
The return value for this function should be a list of classes, which will then
be parsed into a valid class string.
## aceAttribClasses
Called from: `src/static/js/linestylefilter.js`
Things in context:
1. Attributes - Object of Attributes
This hook is called when attributes are investigated on a line. It is useful if
you want to add another attribute type or property type to a pad.
Example:
```
exports.aceAttribClasses = function(hook_name, attr, cb){
attr.sub = 'tag:sub';
cb(attr);
}
```
## aceGetFilterStack
Called from: `src/static/js/linestylefilter.js`
Things in context:
1. linestylefilter - the JavaScript object that's currently processing the ace
attributes
2. browser - an object indicating which browser is accessing the page
This hook is called to apply custom regular expression filters to a set of
styles. The one example available is the ep_linkify plugin, which adds internal
links. They use it to find the telltale `[[ ]]` syntax that signifies internal
links, and finding that syntax, they add in the internalHref attribute to be
later used by the aceCreateDomLine hook (documented above).
## aceEditorCSS
Called from: `src/static/js/ace.js`
Things in context: None
This hook is provided to allow custom CSS files to be loaded. The return value
should be an array of resource urls or paths relative to the plugins directory.
## aceInitInnerdocbodyHead
Called from: `src/static/js/ace.js`
Things in context:
1. iframeHTML - the HTML of the editor iframe up to this point, in array format
This hook is called during the creation of the editor HTML. The array should
have lines of HTML added to it, giving the plugin author a chance to add in
meta, script, link, and other tags that go into the `<head>` element of the
editor HTML document.
## aceEditEvent
Called from: `src/static/js/ace2_inner.js`
Things in context:
1. callstack - a bunch of information about the current action
2. editorInfo - information about the user who is making the change
3. rep - information about where the change is being made
4. documentAttributeManager - information about attributes in the document (this
is a mystery to me)
This hook is made available to edit the edit events that might occur when
changes are made. Currently you can change the editor information, some of the
meanings of the edit, and so on. You can also make internal changes (internal to
your plugin) that use the information provided by the edit event.
## aceRegisterNonScrollableEditEvents
Called from: `src/static/js/ace2_inner.js`
Things in context: None
When aceEditEvent (documented above) finishes processing the event, it scrolls
the viewport to make caret visible to the user, but if you don't want that
behavior to happen you can use this hook to register which edit events should
not scroll viewport. The return value of this hook should be a list of event
names.
Example:
```
exports.aceRegisterNonScrollableEditEvents = function(){
return [ 'repaginate', 'updatePageCount' ];
}
```
## aceRegisterBlockElements
Called from: `src/static/js/ace2_inner.js`
Things in context: None
The return value of this hook will add elements into the "lineMarkerAttribute"
category, making the aceDomLineProcessLineAttributes hook (documented below)
call for those elements.
## aceInitialized
Called from: `src/static/js/ace2_inner.js`
Things in context:
1. editorInfo - information about the user who will be making changes through
the interface, and a way to insert functions into the main ace object (see
ep_headings)
2. rep - information about where the user's cursor is
3. documentAttributeManager - some kind of magic
This hook is for inserting further information into the ace engine, for later
use in formatting hooks.
## postAceInit
Called from: `src/static/js/pad.js`
Things in context:
1. ace - the ace object that is applied to this editor.
2. clientVars - Object containing client-side configuration such as author ID
and plugin settings. Your plugin can manipulate this object via the
`clientVars` server-side hook.
3. pad - the pad object of the current pad.
## postToolbarInit
Called from: `src/static/js/pad_editbar.js`
Things in context:
1. ace - the ace object that is applied to this editor.
2. toolbar - Editbar instance. See below for the Editbar documentation.
Can be used to register custom actions to the toolbar.
Usage examples:
* [https://github.com/tiblu/ep_authorship_toggle]()
## postTimesliderInit
Called from: `src/static/js/timeslider.js`
There doesn't appear to be any example available of this particular hook being
used, but it gets fired after the timeslider is all set up.
## goToRevisionEvent
Called from: `src/static/js/broadcast.js`
Things in context:
1. rev - The newRevision
This hook gets fired both on timeslider load (as timeslider shows a new
revision) and when the new revision is showed to a user. There doesn't appear to
be any example available of this particular hook being used.
## userJoinOrUpdate
Called from: `src/static/js/pad_userlist.js`
Things in context:
1. info - the user information
This hook is called on the client side whenever a user joins or changes. This
can be used to create notifications or an alternate user list.
## `chatNewMessage`
Called from: `src/static/js/chat.js`
This hook runs on the client side whenever a chat message is received from the
server. It can be used to create different notifications for chat messages. Hook
functions can modify the `author`, `authorName`, `duration`, `rendered`,
`sticky`, `text`, and `timeStr` context properties to change how the message is
processed. The `text` and `timeStr` properties may contain HTML and come
pre-sanitized; plugins should be careful to sanitize any added user input to
avoid introducing an XSS vulnerability.
Context properties:
* `authorName`: The display name of the user that wrote the message.
* `author`: The author ID of the user that wrote the message.
* `text`: Sanitized message HTML, with URLs wrapped like `<a
href="url">url</a>`. (Note that `message.text` is not sanitized or processed
in any way.)
* `message`: The raw message object as received from the server, except with
time correction and a default `authorId` property if missing. Plugins must not
modify this object. Warning: Unlike `text`, `message.text` is not
pre-sanitized or processed in any way.
* `rendered` - Used to override the default message rendering. Initially set to
`null`. If the hook function sets this to a DOM element object or a jQuery
object, then that object will be used as the rendered message UI. Otherwise,
if this is set to `null`, then Etherpad will render a default UI for the
message using the other context properties.
* `sticky` (boolean): Whether the gritter notification should fade out on its
own or just sit there until manually closed.
* `timestamp`: When the chat message was sent (milliseconds since epoch),
corrected using the difference between the local clock and the server's clock.
* `timeStr`: The message timestamp as a formatted string.
* `duration`: How long (in milliseconds) to display the gritter notification (0
to disable).
## `chatSendMessage`
Called from: `src/static/js/chat.js`
This hook runs on the client side whenever the user sends a new chat message.
Plugins can mutate the message object to change the message text or add metadata
to control how the message will be rendered by the `chatNewMessage` hook.
Context properties:
* `message`: The message object that will be sent to the Etherpad server.
## collectContentPre
Called from: `src/static/js/contentcollector.js`
Things in context:
1. cc - the contentcollector object
2. state - the current state of the change being made
3. tname - the tag name of this node currently being processed
4. styl - the style applied to the node (probably CSS) -- Note the typo
5. cls - the HTML class string of the node
This hook is called before the content of a node is collected by the usual
methods. The cc object can be used to do a bunch of things that modify the
content of the pad. See, for example, the heading1 plugin for etherpad original.
E.g. if you need to apply an attribute to newly inserted characters, call
cc.doAttrib(state, "attributeName") which results in an attribute
attributeName=true.
If you want to specify also a value, call cc.doAttrib(state,
"attributeName::value") which results in an attribute attributeName=value.
## collectContentImage
Called from: `src/static/js/contentcollector.js`
Things in context:
1. cc - the contentcollector object
2. state - the current state of the change being made
3. tname - the tag name of this node currently being processed
4. style - the style applied to the node (probably CSS)
5. cls - the HTML class string of the node
6. node - the node being modified
This hook is called before the content of an image node is collected by the
usual methods. The cc object can be used to do a bunch of things that modify the
content of the pad.
Example:
```
exports.collectContentImage = function(name, context){
context.state.lineAttributes.img = context.node.outerHTML;
}
```
## collectContentPost
Called from: `src/static/js/contentcollector.js`
Things in context:
1. cc - the contentcollector object
2. state - the current state of the change being made
3. tname - the tag name of this node currently being processed
4. style - the style applied to the node (probably CSS)
5. cls - the HTML class string of the node
This hook is called after the content of a node is collected by the usual
methods. The cc object can be used to do a bunch of things that modify the
content of the pad. See, for example, the heading1 plugin for etherpad original.
## handleClientMessage_`name`
Called from: `src/static/js/collab_client.js`
Things in context:
1. payload - the data that got sent with the message (use it for custom message
content)
This hook gets called every time the client receives a message of type `name`.
This can most notably be used with the new HTTP API call, "sendClientsMessage",
which sends a custom message type to all clients connected to a pad. You can
also use this to handle existing types.
`collab_client.js` has a pretty extensive list of message types, if you want to
take a look.
## aceStartLineAndCharForPoint-aceEndLineAndCharForPoint
Called from: src/static/js/ace2_inner.js
Things in context:
1. callstack - a bunch of information about the current action
2. editorInfo - information about the user who is making the change
3. rep - information about where the change is being made
4. root - the span element of the current line
5. point - the starting/ending element where the cursor highlights
6. documentAttributeManager - information about attributes in the document
This hook is provided to allow a plugin to turn DOM node selection into
[line,char] selection. The return value should be an array of [line,char]
## aceKeyEvent
Called from: `src/static/js/ace2_inner.js`
Things in context:
1. callstack - a bunch of information about the current action
2. editorInfo - information about the user who is making the change
3. rep - information about where the change is being made
4. documentAttributeManager - information about attributes in the document
5. evt - the fired event
This hook is provided to allow a plugin to handle key events.
The return value should be true if you have handled the event.
## collectContentLineText
Called from: `src/static/js/contentcollector.js`
Things in context:
1. cc - the contentcollector object
2. state - the current state of the change being made
3. tname - the tag name of this node currently being processed
4. text - the text for that line
This hook allows you to validate/manipulate the text before it's sent to the
server side. To change the text, either:
* Set the `text` context property to the desired value and return `undefined`.
* (Deprecated) Return a string. If a hook function changes the `text` context
property, the return value is ignored. If no hook function changes `text` but
multiple hook functions return a string, the first one wins.
Example:
```
exports.collectContentLineText = (hookName, context) => {
context.text = tweakText(context.text);
};
```
## collectContentLineBreak
Called from: `src/static/js/contentcollector.js`
Things in context:
1. cc - the contentcollector object
2. state - the current state of the change being made
3. tname - the tag name of this node currently being processed
This hook is provided to allow whether the br tag should induce a new magic
domline or not. The return value should be either true(break the line) or false.
## disableAuthorColorsForThisLine
Called from: `src/static/js/linestylefilter.js`
Things in context:
1. linestylefilter - the JavaScript object that's currently processing the ace
attributes
2. text - the line text
3. class - line class
This hook is provided to allow whether a given line should be deliniated with
multiple authors. Multiple authors in one line cause the creation of magic span
lines. This might not suit you and now you can disable it and handle your own
deliniation. The return value should be either true(disable) or false.
## aceSetAuthorStyle
Called from: `src/static/js/ace2_inner.js`
Things in context:
1. dynamicCSS - css manager for inner ace
2. outerDynamicCSS - css manager for outer ace
3. parentDynamicCSS - css manager for parent document
4. info - author style info
5. author - author info
6. authorSelector - css selector for author span in inner ace
This hook is provided to allow author highlight style to be modified. Registered
hooks should return 1 if the plugin handles highlighting. If no plugin returns
1, the core will use the default background-based highlighting.
## aceSelectionChanged
Called from: `src/static/js/ace2_inner.js`
Things in context:
1. rep - information about where the user's cursor is
2. documentAttributeManager - information about attributes in the document
This hook allows a plugin to react to a cursor or selection change,
perhaps to update a UI element based on the style at the cursor location.

View file

@ -1,117 +0,0 @@
# Hooks
A hook function is registered with a hook via the plugin's `ep.json` file. See
the Plugins section for details. A hook may have many registered functions from
different plugins.
Some hooks call their registered functions one at a time until one of them
returns a value. Others always call all of their registered functions and
combine the results (if applicable).
## Registered hook functions
Note: The documentation in this section applies to every hook unless the
hook-specific documentation says otherwise.
### Arguments
Hook functions are called with three arguments:
1. `hookName` - The name of the hook being invoked.
2. `context` - An object with some relevant information about the context of the
call. See the hook-specific documentation for details.
3. `cb` - For asynchronous operations this callback can be called to signal
completion and optionally provide a return value. The callback takes a single
argument, the meaning of which depends on the hook (see the "Return values"
section for general information that applies to most hooks). This callback
always returns `undefined`.
### Expected behavior
The presence of a callback parameter suggests that every hook function can run
asynchronously. While that is the eventual goal, there are some legacy hooks
that expect their hook functions to provide a value synchronously. For such
hooks, the hook functions must do one of the following:
* Call the callback with a non-Promise value (`undefined` is acceptable) and
return `undefined`, in that order.
* Return a non-Promise value other than `undefined` (`null` is acceptable) and
never call the callback. Note that `async` functions *always* return a
Promise, so they must never be used for synchronous hooks.
* Only have two parameters (`hookName` and `context`) and return any non-Promise
value (`undefined` is acceptable).
For hooks that permit asynchronous behavior, the hook functions must do one or
more of the following:
* Return `undefined` and call the callback, in either order.
* Return something other than `undefined` (`null` is acceptable) and never call
the callback. Note that `async` functions *always* return a Promise, so they
must never call the callback.
* Only have two parameters (`hookName` and `context`).
Note that the acceptable behaviors for asynchronous hook functions is a superset
of the acceptable behaviors for synchronous hook functions.
WARNING: The number of parameters is determined by examining
[Function.length](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length),
which does not count [default
parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters)
or ["rest"
parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
To avoid problems, do not use default or rest parameters when defining hook
functions.
### Return values
A hook function can provide a value to Etherpad in one of the following ways:
* Pass the desired value as the first argument to the callback.
* Return the desired value directly. The value must not be `undefined` unless
the hook function only has two parameters. (Hook functions with three
parameters that want to provide `undefined` should instead use the callback.)
* For hooks that permit asynchronous behavior, return a Promise that resolves to
the desired value.
* For hooks that permit asynchronous behavior, pass a Promise that resolves to
the desired value as the first argument to the callback.
Examples:
```javascript
exports.exampleOne = (hookName, context, callback) => {
return 'valueOne';
};
exports.exampleTwo = (hookName, context, callback) => {
callback('valueTwo');
return;
};
// ONLY FOR HOOKS THAT PERMIT ASYNCHRONOUS BEHAVIOR
exports.exampleThree = (hookName, context, callback) => {
return new Promise('valueThree');
};
// ONLY FOR HOOKS THAT PERMIT ASYNCHRONOUS BEHAVIOR
exports.exampleFour = (hookName, context, callback) => {
callback(new Promise('valueFour'));
return;
};
// ONLY FOR HOOKS THAT PERMIT ASYNCHRONOUS BEHAVIOR
exports.exampleFive = async (hookName, context) => {
// Note that this function is async, so it actually returns a Promise that
// is resolved to 'valueFive'.
return 'valueFive';
};
```
Etherpad collects the values provided by the hook functions into an array,
filters out all `undefined` values, then flattens the array one level.
Flattening one level makes it possible for a hook function to behave as if it
were multiple separate hook functions.
For example: Suppose a hook has eight registered functions that return the
following values: `1`, `[2]`, `['3a', '3b']` `[[4]]`, `undefined`,
`[undefined]`, `[]`, and `null`. The value returned to the caller of the hook is
`[1, 2, '3a', '3b', [4], undefined, null]`.

View file

@ -2,7 +2,7 @@
These hooks are called on server-side. These hooks are called on server-side.
=== loadSettings === loadSettings
Called from: `src/node/server.ts` Called from: src/node/server.ts
Things in context: Things in context:
@ -11,7 +11,7 @@ Things in context:
Use this hook to receive the global settings in your plugin. Use this hook to receive the global settings in your plugin.
=== shutdown === shutdown
Called from: `src/node/server.ts` Called from: src/node/server.ts
Things in context: None Things in context: None
@ -34,7 +34,7 @@ exports.shutdown = async (hookName, context) => {
---- ----
=== pluginUninstall === pluginUninstall
Called from: `src/static/js/pluginfw/installer.js` Called from: src/static/js/pluginfw/installer.js
Things in context: Things in context:
@ -43,7 +43,7 @@ Things in context:
If this hook returns an error, the callback to the uninstall function gets an error as well. This mostly seems useful for handling additional features added in based on the installation of other plugins, which is pretty cool! If this hook returns an error, the callback to the uninstall function gets an error as well. This mostly seems useful for handling additional features added in based on the installation of other plugins, which is pretty cool!
=== pluginInstall === pluginInstall
Called from: `src/static/js/pluginfw/installer.js` Called from: src/static/js/pluginfw/installer.js
Things in context: Things in context:
@ -123,7 +123,7 @@ Context properties:
=== expressCloseServer === expressCloseServer
Called from: `src/node/hooks/express.js` Called from: src/node/hooks/express.js
Things in context: Nothing Things in context: Nothing
@ -142,7 +142,7 @@ exports.expressCloseServer = async () => {
---- ----
=== eejsBlock_`<name>` === eejsBlock_`<name>`
Called from: `src/node/eejs/index.js` Called from: src/node/eejs/index.js
Things in context: Things in context:

File diff suppressed because it is too large Load diff

View file

@ -1,728 +0,0 @@
# HTTP API
## What can I do with this API?
The API gives another web application control of the pads. The basic functions are
* create/delete pads
* grant/forbid access to pads
* get/set pad content
The API is designed in a way, so you can reuse your existing user system with their permissions, and map it to Etherpad. Means: Your web application still has to do authentication, but you can tell Etherpad via the api, which visitors should get which permissions. This allows Etherpad to fit into any web application and extend it with real-time functionality. You can embed the pads via an iframe into your website.
Take a look at [HTTP API client libraries](https://github.com/ether/etherpad-lite/wiki/HTTP-API-client-libraries) to check if a library in your favorite programming language is available.
### OpenAPI
OpenAPI (formerly swagger) definitions are exposed under `/api/openapi.json` (latest) and `/api/{version}/openapi.json`. You can use official tools like [Swagger Editor](https://editor.swagger.io/) to view and explore them.
## Examples
### Example 1
A portal (such as WordPress) wants to give a user access to a new pad. Let's assume the user have the internal id 7 and his name is michael.
Portal maps the internal userid to an etherpad author.
#### Request
```http
GET /api/1/createAuthorIfNotExistsFor?name=Michael&authorMapper=7
```
### Response
```json
{"code": 0, "message":"ok", "data": {"authorID": "a.s8oes9dhwrvt0zif"}}
```
#### Request
> Portal maps the internal userid to an etherpad group:
```http
GET http://pad.domain/api/1/createGroupIfNotExistsFor?groupMapper=7
```
### Response
```json
{"code": 0, "message":"ok", "data": {"groupID": "g.s8oes9dhwrvt0zif"}}
```
> Portal creates a pad in the userGroup
#### Request
```http
GET http://pad.domain/api/1/createGroupPad?groupID=g.s8oes9dhwrvt0zif&padName=samplePad&text=This is the first sentence in the pad
```
#### Response
```json
{"code": 0, "message":"ok", "data": null}
```
> Portal starts the session for the user on the group:
#### Request
```http
GET http://pad.domain/api/1/createSession?groupID=g.s8oes9dhwrvt0zif&authorID=a.s8oes9dhwrvt0zif&validUntil=1312201246
```
### Response
```json
{"code": 0, "message":"ok", "data": {"sessionID": "s.s8oes9dhwrvt0zif"}}
```
Portal places the cookie "sessionID" with the given value on the client and creates an iframe including the pad.
### Example 2
A portal (such as WordPress) wants to transform the contents of a pad that multiple admins edited into a blog post.
Portal retrieves the contents of the pad for entry into the db as a blog post:
> Request: `http://pad.domain/api/1/getText?&padID=g.s8oes9dhwrvt0zif$123`
>
> Response: `{code: 0, message:"ok", data: {text:"Welcome Text"}}`
Portal submits content into new blog post
> Portal.AddNewBlog(content)
## Usage
### API version
The latest version is `1.2.15`
The current version can be queried via /api.
### Request Format
The API is accessible via HTTP. Starting from **1.8**, API endpoints can be invoked indifferently via GET or POST.
The URL of the HTTP request is of the form: `/api/$APIVERSION/$FUNCTIONNAME`. $APIVERSION depends on the endpoint you want to use. Depending on the verb you use (GET or POST) **parameters** can be passed differently.
When invoking via GET (mandatory until **1.7.5** included), parameters must be included in the query string (example: `/api/$APIVERSION/$FUNCTIONNAME?param1=value1`). Please note that starting with nodejs 8.14+ the total size of HTTP request headers has been capped to 8192 bytes. This limits the quantity of data that can be sent in an API request.
Starting from Etherpad **1.8** it is also possible to invoke the HTTP API via POST. In this case, querystring parameters will still be accepted, but **any parameter with the same name sent via POST will take precedence**. If you need to send large chunks of text (for example, for `setText()`) it is advisable to invoke via POST.
Example with cURL using GET (toy example, no encoding):
```
curl "http://pad.domain/api/1/setText?padID=padname&text=this_text_will_NOT_be_encoded_by_curl_use_next_example"
```
Example with cURL using GET (better example, encodes text):
```
curl "http://pad.domain/api/1/setText?padID=padname" --get --data-urlencode "text=Text sent via GET with proper encoding. For big documents, please use POST"
```
Example with cURL using POST:
```
curl "http://pad.domain/api/1/setText?padID=padname" --data-urlencode "text=Text sent via POST with proper encoding. For big texts (>8 KB), use this method"
```
### Response Format
Responses are valid JSON in the following format:
```json
{
"code": number,
"message": string,
"data": obj
}
```
* **code** a return code
* **0** everything ok
* **1** wrong parameters
* **2** internal error
* **3** no such function
* **4** no or wrong API Key
* **message** a status message. It's ok if everything is fine, else it contains an error message
* **data** the payload
### Overview
![API Overview](https://i.imgur.com/d0nWp.png)
## Data Types
* **groupID** a string, the unique id of a group. Format is g.16RANDOMCHARS, for example g.s8oes9dhwrvt0zif
* **sessionID** a string, the unique id of a session. Format is s.16RANDOMCHARS, for example s.s8oes9dhwrvt0zif
* **authorID** a string, the unique id of an author. Format is a.16RANDOMCHARS, for example a.s8oes9dhwrvt0zif
* **readOnlyID** a string, the unique id of a readonly relation to a pad. Format is r.16RANDOMCHARS, for example r.s8oes9dhwrvt0zif
* **padID** a string, format is GROUPID$PADNAME, for example the pad test of group g.s8oes9dhwrvt0zif has padID g.s8oes9dhwrvt0zif$test
### Authentication
Authentication works via an OAuth token that is sent with each request as an Authorization header, i.e. `Authorization: Bearer YOUR_TOKEN`. You can add new clients that can sign in via the API by adding new entries to the sso section in the settings.json.
#### Example for browser login clients
This example illustrates how to add a new client that can sign in via the API using the browser login method. This method is used for users trying to sign in to the API via the browser. You can log in with the users in the settings.json file. The redirect URI is the URL where the user is redirected after the login. This is normally your etherpad instance url.
```json
{
"client_id": "admin_client",
"client_secret": "admin",
"grant_types": ["authorization_code"],
"response_types": ["code"],
"redirect_uris": ["http://my-etherpad-instance.com"],
}
```
#### Example for services
This example illustrates how to add a new client that can sign in via the API using the client credentials method. This method is used for services trying to sign in to the API where there is no browser.
E.g. a service that creates a pad for a user or a service that inserts a text into a pad. Just make sure that the secret is complex enough as anybody who knows the secret can access the API.
```json
{
"client_id": "client_credentials",
"redirect_uris": [],
"response_types": [],
"grant_types": ["code"],
"client_secret": "client_credentials",
"extraParams": [
{
"name": "admin",
"value": "true"
}
]
}
```
Obtain a Bearer token:
`curl --request POST --url 'https://your.server.tld/oidc/token' --header 'content-type: application/x-www-form-urlencoded' --data grant_type=client_credentials --data client_id=client_credentials --data client_secret=client_credentials`
### Node Interoperability
All functions will also be available through a node module accessible from other node.js applications.
## API Methods
### Groups
Pads can belong to a group. The padID of grouppads is starting with a groupID like `g.asdfasdfasdfasdf$test`
#### createGroup()
* API >= 1
creates a new group
*Example returns:*
* `{code: 0, message:"ok", data: {groupID: g.s8oes9dhwrvt0zif}}`
#### createGroupIfNotExistsFor(groupMapper)
* API >= 1
this functions helps you to map your application group ids to Etherpad group ids
*Example returns:*
* `{code: 0, message:"ok", data: {groupID: g.s8oes9dhwrvt0zif}}`
#### deleteGroup(groupID)
* API >= 1
deletes a group
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"groupID does not exist", data: null}`
#### listPads(groupID)
* API >= 1
returns all pads of this group
*Example returns:*
* `{code: 0, message:"ok", data: {padIDs : ["g.s8oes9dhwrvt0zif$test", "g.s8oes9dhwrvt0zif$test2"]}`
* `{code: 1, message:"groupID does not exist", data: null}`
#### createGroupPad(groupID, padName, [text], [authorId])
* API >= 1
* `authorId` in API >= 1.3.0
creates a new pad in this group
*Example returns:*
* `{code: 0, message:"ok", data: {padID: "g.s8oes9dhwrvt0zif$test"}`
* `{code: 1, message:"padName does already exist", data: null}`
* `{code: 1, message:"groupID does not exist", data: null}`
#### listAllGroups()
* API >= 1.1
lists all existing groups
*Example returns:*
* `{code: 0, message:"ok", data: {groupIDs: ["g.mKjkmnAbSMtCt8eL", "g.3ADWx6sbGuAiUmCy"]}}`
* `{code: 0, message:"ok", data: {groupIDs: []}}`
### Author
These authors are bound to the attributes the users choose (color and name).
#### createAuthor([name])
* API >= 1
creates a new author
*Example returns:*
* `{code: 0, message:"ok", data: {authorID: "a.s8oes9dhwrvt0zif"}}`
#### createAuthorIfNotExistsFor(authorMapper [, name])
* API >= 1
this functions helps you to map your application author ids to Etherpad author ids
*Example returns:*
* `{code: 0, message:"ok", data: {authorID: "a.s8oes9dhwrvt0zif"}}`
#### listPadsOfAuthor(authorID)
* API >= 1
returns an array of all pads this author contributed to
*Example returns:*
* `{code: 0, message:"ok", data: {padIDs: ["g.s8oes9dhwrvt0zif$test", "g.s8oejklhwrvt0zif$foo"]}}`
* `{code: 1, message:"authorID does not exist", data: null}`
#### getAuthorName(authorID)
* API >= 1.1
Returns the Author Name of the author
*Example returns:*
* `{code: 0, message:"ok", data: {authorName: "John McLear"}}`
-> can't be deleted cause this would involve scanning all the pads where this author was
### Session
Sessions can be created between a group and an author. This allows an author to access more than one group. The sessionID will be set as a cookie to the client and is valid until a certain date. The session cookie can also contain multiple comma-separated sessionIDs, allowing a user to edit pads in different groups at the same time. Only users with a valid session for this group, can access group pads. You can create a session after you authenticated the user at your web application, to give them access to the pads. You should save the sessionID of this session and delete it after the user logged out.
#### createSession(groupID, authorID, validUntil)
* API >= 1
creates a new session. validUntil is an unix timestamp in seconds
*Example returns:*
* `{code: 0, message:"ok", data: {sessionID: "s.s8oes9dhwrvt0zif"}}`
* `{code: 1, message:"groupID doesn't exist", data: null}`
* `{code: 1, message:"authorID doesn't exist", data: null}`
* `{code: 1, message:"validUntil is in the past", data: null}`
#### deleteSession(sessionID)
* API >= 1
deletes a session
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"sessionID does not exist", data: null}`
#### getSessionInfo(sessionID)
* API >= 1
returns information about a session
*Example returns:*
* `{code: 0, message:"ok", data: {authorID: "a.s8oes9dhwrvt0zif", groupID: g.s8oes9dhwrvt0zif, validUntil: 1312201246}}`
* `{code: 1, message:"sessionID does not exist", data: null}`
#### listSessionsOfGroup(groupID)
* API >= 1
returns all sessions of a group
*Example returns:*
* `{"code":0,"message":"ok","data":{"s.oxf2ras6lvhv2132":{"groupID":"g.s8oes9dhwrvt0zif","authorID":"a.akf8finncvomlqva","validUntil":2312905480}}}`
* `{code: 1, message:"groupID does not exist", data: null}`
#### listSessionsOfAuthor(authorID)
* API >= 1
returns all sessions of an author
*Example returns:*
* `{"code":0,"message":"ok","data":{"s.oxf2ras6lvhv2132":{"groupID":"g.s8oes9dhwrvt0zif","authorID":"a.akf8finncvomlqva","validUntil":2312905480}}}`
* `{code: 1, message:"authorID does not exist", data: null}`
### Pad Content
Pad content can be updated and retrieved through the API
#### getText(padID, [rev])
* API >= 1
returns the text of a pad
*Example returns:*
* `{code: 0, message:"ok", data: {text:"Welcome Text"}}`
* `{code: 1, message:"padID does not exist", data: null}`
#### setText(padID, text, [authorId])
* API >= 1
* `authorId` in API >= 1.3.0
Sets the text of a pad.
If your text is long (>8 KB), please invoke via POST and include `text` parameter in the body of the request, not in the URL (since Etherpad **1.8**).
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"padID does not exist", data: null}`
* `{code: 1, message:"text too long", data: null}`
#### appendText(padID, text, [authorId])
* API >= 1.2.13
* `authorId` in API >= 1.3.0
Appends text to a pad.
If your text is long (>8 KB), please invoke via POST and include `text` parameter in the body of the request, not in the URL (since Etherpad **1.8**).
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"padID does not exist", data: null}`
* `{code: 1, message:"text too long", data: null}`
#### getHTML(padID, [rev])
* API >= 1
returns the text of a pad formatted as HTML
*Example returns:*
* `{code: 0, message:"ok", data: {html:"Welcome Text<br>More Text"}}`
* `{code: 1, message:"padID does not exist", data: null}`
#### setHTML(padID, html, [authorId])
* API >= 1
* `authorId` in API >= 1.3.0
sets the text of a pad based on HTML, HTML must be well-formed. Malformed HTML will send a warning to the API log.
If `html` is long (>8 KB), please invoke via POST and include `html` parameter in the body of the request, not in the URL (since Etherpad **1.8**).
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"padID does not exist", data: null}`
#### getAttributePool(padID)
* API >= 1.2.8
returns the attribute pool of a pad
*Example returns:*
* `{ "code":0,
"message":"ok",
"data": {
"pool":{
"numToAttrib":{
"0":["author","a.X4m8bBWJBZJnWGSh"],
"1":["author","a.TotfBPzov54ihMdH"],
"2":["author","a.StiblqrzgeNTbK05"],
"3":["bold","true"]
},
"attribToNum":{
"author,a.X4m8bBWJBZJnWGSh":0,
"author,a.TotfBPzov54ihMdH":1,
"author,a.StiblqrzgeNTbK05":2,
"bold,true":3
},
"nextNum":4
}
}
}`
* `{"code":1,"message":"padID does not exist","data":null}`
#### getRevisionChangeset(padID, [rev])
* API >= 1.2.8
get the changeset at a given revision, or last revision if 'rev' is not defined.
*Example returns:*
* `{ "code" : 0,
"message" : "ok",
"data" : "Z:1>6b|5+6b$Welcome to Etherpad!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nGet involved with Etherpad at https://etherpad.org\n"
}`
* `{"code":1,"message":"padID does not exist","data":null}`
* `{"code":1,"message":"rev is higher than the head revision of the pad","data":null}`
#### createDiffHTML(padID, startRev, endRev)
* API >= 1.2.7
returns an object of diffs from 2 points in a pad
*Example returns:*
* `{"code":0,"message":"ok","data":{"html":"<style>\n.authora_HKIv23mEbachFYfH {background-color: #a979d9}\n.authora_n4gEeMLsv1GivNeh {background-color: #a9b5d9}\n.removed {text-decoration: line-through; -ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=80)'; filter: alpha(opacity=80); opacity: 0.8; }\n</style>Welcome to Etherpad!<br><br>This pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!<br><br>Get involved with Etherpad at <a href=\"http&#x3a;&#x2F;&#x2F;etherpad&#x2e;org\">http:&#x2F;&#x2F;etherpad.org</a><br><span class=\"authora_HKIv23mEbachFYfH\">aw</span><br><br>","authors":["a.HKIv23mEbachFYfH",""]}}`
* `{"code":4,"message":"no or wrong API Key","data":null}`
#### restoreRevision(padId, rev, [authorId])
* API >= 1.2.11
* `authorId` in API >= 1.3.0
* Example returns:*
* `{code:0, message:"ok", data:null}`
* `{code: 1, message:"padID does not exist", data: null}`
### Chat
#### getChatHistory(padID, [start, end])
* API >= 1.2.7
returns
* a part of the chat history, when `start` and `end` are given
* the whole chat history, when no extra parameters are given
*Example returns:*
* `{"code":0,"message":"ok","data":{"messages":[{"text":"foo","userId":"a.foo","time":1359199533759,"userName":"test"},{"text":"bar","userId":"a.foo","time":1359199534622,"userName":"test"}]}}`
* `{code: 1, message:"start is higher or equal to the current chatHead", data: null}`
* `{code: 1, message:"padID does not exist", data: null}`
#### getChatHead(padID)
* API >= 1.2.7
returns the chatHead (last number of the last chat-message) of the pad
*Example returns:*
* `{code: 0, message:"ok", data: {chatHead: 42}}`
* `{code: 1, message:"padID does not exist", data: null}`
#### appendChatMessage(padID, text, authorID [, time])
* API >= 1.2.12
creates a chat message, saves it to the database and sends it to all connected clients of this pad
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"text is no string", data: null}`
### Pad
Group pads are normal pads, but with the name schema GROUPID$PADNAME. A security manager controls access of them and it's forbidden for normal pads to include a $ in the name.
#### createPad(padID, [text], [authorId])
* API >= 1
* `authorId` in API >= 1.3.0
creates a new (non-group) pad. Note that if you need to create a group Pad, you should call **createGroupPad**.
You get an error message if you use one of the following characters in the padID: "/", "?", "&" or "#".
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"padID does already exist", data: null}`
* `{code: 1, message:"malformed padID: Remove special characters", data: null}`
#### getRevisionsCount(padID)
* API >= 1
returns the number of revisions of this pad
*Example returns:*
* `{code: 0, message:"ok", data: {revisions: 56}}`
* `{code: 1, message:"padID does not exist", data: null}`
#### getSavedRevisionsCount(padID)
* API >= 1.2.11
returns the number of saved revisions of this pad
*Example returns:*
* `{code: 0, message:"ok", data: {savedRevisions: 42}}`
* `{code: 1, message:"padID does not exist", data: null}`
#### listSavedRevisions(padID)
* API >= 1.2.11
returns the list of saved revisions of this pad
*Example returns:*
* `{code: 0, message:"ok", data: {savedRevisions: [2, 42, 1337]}}`
* `{code: 1, message:"padID does not exist", data: null}`
#### saveRevision(padID [, rev])
* API >= 1.2.11
saves a revision
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"padID does not exist", data: null}`
#### padUsersCount(padID)
* API >= 1
returns the number of user that are currently editing this pad
*Example returns:*
* `{code: 0, message:"ok", data: {padUsersCount: 5}}`
#### padUsers(padID)
* API >= 1.1
returns the list of users that are currently editing this pad
*Example returns:*
* `{code: 0, message:"ok", data: {padUsers: [{colorId:"#c1a9d9","name":"username1","timestamp":1345228793126,"id":"a.n4gEeMLsvg12452n"},{"colorId":"#d9a9cd","name":"Hmmm","timestamp":1345228796042,"id":"a.n4gEeMLsvg12452n"}]}}`
* `{code: 0, message:"ok", data: {padUsers: []}}`
#### deletePad(padID)
* API >= 1
deletes a pad
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"padID does not exist", data: null}`
#### copyPad(sourceID, destinationID[, force=false])
* API >= 1.2.8
copies a pad with full history and chat. If force is true and the destination pad exists, it will be overwritten.
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"padID does not exist", data: null}`
#### copyPadWithoutHistory(sourceID, destinationID, [force=false], [authorId])
* API >= 1.2.15
* `authorId` in API >= 1.3.0
copies a pad without copying the history and chat. If force is true and the destination pad exists, it will be overwritten.
Note that all the revisions will be lost! In most of the cases one should use `copyPad` API instead.
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"padID does not exist", data: null}`
#### movePad(sourceID, destinationID[, force=false])
* API >= 1.2.8
moves a pad. If force is true and the destination pad exists, it will be overwritten.
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"padID does not exist", data: null}`
#### getReadOnlyID(padID)
* API >= 1
returns the read only link of a pad
*Example returns:*
* `{code: 0, message:"ok", data: {readOnlyID: "r.s8oes9dhwrvt0zif"}}`
* `{code: 1, message:"padID does not exist", data: null}`
#### getPadID(readOnlyID)
* API >= 1.2.10
returns the id of a pad which is assigned to the readOnlyID
*Example returns:*
* `{code: 0, message:"ok", data: {padID: "p.s8oes9dhwrvt0zif"}}`
* `{code: 1, message:"padID does not exist", data: null}`
#### setPublicStatus(padID, publicStatus)
* API >= 1
sets a boolean for the public status of a group pad
*Example returns:*
* `{code: 0, message:"ok", data: null}`
* `{code: 1, message:"padID does not exist", data: null}`
* `{code: 1, message:"You can only get/set the publicStatus of pads that belong to a group", data: null}`
#### getPublicStatus(padID)
* API >= 1
return true of false
*Example returns:*
* `{code: 0, message:"ok", data: {publicStatus: true}}`
* `{code: 1, message:"padID does not exist", data: null}`
* `{code: 1, message:"You can only get/set the publicStatus of pads that belong to a group", data: null}`
#### listAuthorsOfPad(padID)
* API >= 1
returns an array of authors who contributed to this pad
*Example returns:*
* `{code: 0, message:"ok", data: {authorIDs : ["a.s8oes9dhwrvt0zif", "a.akf8finncvomlqva"]}`
* `{code: 1, message:"padID does not exist", data: null}`
#### getLastEdited(padID)
* API >= 1
returns the timestamp of the last revision of the pad
*Example returns:*
* `{code: 0, message:"ok", data: {lastEdited: 1340815946602}}`
* `{code: 1, message:"padID does not exist", data: null}`
#### sendClientsMessage(padID, msg)
* API >= 1.1
sends a custom message of type `msg` to the pad
*Example returns:*
```json
{"code": 0, "message":"ok", "data": {}}
```
```json
{"code": 1, "message":"padID does not exist", "data": null}
```
#### checkToken()
* API >= 1.2
returns ok when the current api token is valid
*Example returns:*
```json
{"code":0,"message":"ok","data":null}
```
```json
{"code":4,"message":"no or wrong API Key","data":null}
```
### Pads
#### listAllPads()
* API >= 1.2.1
lists all pads on this epl instance
*Example returns:*
```json
{"code": 0, "message":"ok", "data": {"padIDs": ["testPad", "thePadsOfTheOthers"]}}
```
### Global
#### getStats()
* API >= 1.2.14
get stats of the etherpad instance
*Example returns*
```json
{"code":0,"message":"ok","data":{"totalPads":3,"totalSessions": 2,"totalActivePads": 1}}
```

View file

@ -1,3 +0,0 @@
# API documentation
This part of the documentation is about the API of Etherpad. It is intended for developers who want to write applications that interact with Etherpad instances or plugins.

View file

@ -1,22 +0,0 @@
# Plugin Framework
`require("ep_etherpad-lite/static/js/plugingfw/plugins")`
## plugins.update
`require("ep_etherpad-lite/static/js/plugingfw/plugins").update()` will use npm
to list all installed modules and read their ep.json files, registering the
contained hooks. A hook registration is a pair of a hook name and a function
reference (filename for require() plus function name)
## hooks.callAll
`require("ep_etherpad-lite/static/js/plugingfw/hooks").callAll("hook_name",
{argname:value})` will call all hook functions registered for `hook_name` with
`{argname:value}`.
## hooks.aCallAll
?
## ...

View file

@ -1,46 +0,0 @@
# Toolbar controller
src/node/utils/toolbar.js
## button(opts)
* {Object} `opts`
* `command` - this command fill be fired on the editbar on click
* `localizationId` - will be set as `data-l10-id`
* `class` - here you can add additional classes to the button
Returns: {Button}
Example:
```
var orderedlist = toolbar.button({
command: "insertorderedlist",
localizationId: "pad.toolbar.ol.title",
class: "buttonicon buttonicon-insertorderedlist"
})
```
You can also create buttons with text:
```
var myButton = toolbar.button({
command: "myButton",
localizationId: "myPlugin.toolbar.myButton",
class: "buttontext"
})
```
## selectButton(opts)
* {Object} `opts`
* `id` - id of the menu item
* `selectId` - id of the select element
* `command` - this command fill be fired on the editbar on change
Returns: {SelectButton}
## SelectButton.addOption(value, text, attributes)
* {String} value - The value of this option
* {String} text - the label text used for this option
* {Object} attributes - any additional html attributes go here (e.g. `data-l10n-id`)
## registerButton(name, item)
* {String} name - used to reference the item in the toolbar config in settings.json
* {Button|SelectButton} item - the button to add

View file

@ -1,29 +0,0 @@
# CLI
You can find different tools for migrating things, checking your Etherpad health in the bin directory.
One of these is the migrateDB command. It takes two settings.json files and copies data from one source to another one.
In this example we migrate from the old dirty db to the new rustydb engine. So we copy these files to the root of the etherpad-directory.
````json
{
"dbType": "dirty",
"dbSettings": {
"filename": "./var/rusty.db"
}
}
````
````json
{
"dbType": "rustydb",
"dbSettings": {
"filename": "./var/rusty2.db"
}
}
````
After that we need to move the data from dirty to rustydb.
Therefore, we call `pnpm run migrateDB --file1 test1.json --file2 test2.json` with these two files in our root directories. After some time the data should be copied over to the new database.

View file

@ -1,18 +0,0 @@
# Cookies
Cookies used by Etherpad.
| Name | Sample value | Domain | Path | Expires/max-age | Http-only | Secure | Usage description |
|-------------------|----------------------------------|-------------|------|-----------------|-----------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| express_sid | s%3A7yCNjRmTW8ylGQ53I2IhOwYF9... | example.org | / | Session | true | true | Session ID of the [Express web framework](https://expressjs.com). When Etherpad is behind a reverse proxy, and an administrator wants to use session stickiness, he may use this cookie. If you are behind a reverse proxy, please remember to set `trustProxy: true` in `settings.json`. Set in [webaccess.js#L131](https://github.com/ether/etherpad-lite/blob/01497aa399690e44393e91c19917d11d025df71b/src/node/hooks/express/webaccess.js#L131). |
| language | en | example.org | / | Session | false | true | The language of the UI (e.g.: `en-GB`, `it`). Set in [pad_editor.js#L111](https://github.com/ether/etherpad-lite/blob/01497aa399690e44393e91c19917d11d025df71b/src/static/js/pad_editor.js#L111). |
| prefs / prefsHttp | %7B%22epThemesExtTheme%22... | example.org | /p | year 3000 | false | true | Client-side preferences (e.g.: font family, chat always visible, show authorship colors, ...). Set in [pad_cookie.js#L49](https://github.com/ether/etherpad-lite/blob/01497aa399690e44393e91c19917d11d025df71b/src/static/js/pad_cookie.js#L49). `prefs` is used if Etherpad is accessed over HTTPS, `prefsHttp` if accessed over HTTP. For more info see https://github.com/ether/etherpad-lite/issues/3179. |
| token | t.tFzkihhhBf4xKEpCK3PU | example.org | / | 60 days | false | true | A random token representing the author, of the form `t.randomstring_of_lenght_20`. The random string is generated by the client, at ([pad.js#L55-L66](https://github.com/ether/etherpad-lite/blob/01497aa399690e44393e91c19917d11d025df71b/src/static/js/pad.js#L55-L66)). This cookie is always set by the client (at [pad.js#L153-L158](https://github.com/ether/etherpad-lite/blob/01497aa399690e44393e91c19917d11d025df71b/src/static/js/pad.js#L153-L158)) without any solicitation from the server. It is used for all the pads accessed via the web UI (not used for the HTTP API). On the server side, its value is accessed at [SecurityManager.js#L33](https://github.com/ether/etherpad-lite/blob/01497aa399690e44393e91c19917d11d025df71b/src/node/db/SecurityManager.js#L33). |
For more info, visit the related discussion at https://github.com/ether/etherpad-lite/issues/3563.
Etherpad HTTP API clients may make use (if they choose so) to send another cookie:
| Name | Sample value | Domain | Usage description |
|-----------|------------------------------------|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| sessionID | s.1c70968b333b25476a2c7bdd0e0bed17 | example.org | Sessions can be created between a group and an author. This allows an author to access more than one group. The sessionID will be set as a cookie to the client and is valid until a certain date. The session cookie can also contain multiple comma-separated sessionIDs, allowing a user to edit pads in different groups at the same time. More info - https://github.com/ether/etherpad-lite/blob/develop/doc/api/http_api.md#session |

View file

@ -1,19 +0,0 @@
# Demo of Etherpad
This is a demo of Etherpad. It shows how to use Etherpad and what it can do.
## The toolbar
![The toolbar](/etherpad_basic.png)
## The pad
![The pad](/etherpad_demo.gif)
## Etherpad with a virtual webcam
![Etherpad full features](/etherpad_full_features.png)
## Etherpad skin variants
![Etherpad skin variants](/etherpad_skin_variants.gif)

View file

@ -510,7 +510,7 @@ For the editor container, you can also make it full width by adding `full-width-
| `SOCKETIO_MAX_HTTP_BUFFER_SIZE` | `SOCKETIO_MAX_HTTP_BUFFER_SIZE`
| The maximum size (in bytes) of a single message accepted via Socket.IO. If a client sends a larger message, its connection gets closed to prevent DoS (memory exhaustion) attacks. | The maximum size (in bytes) of a single message accepted via Socket.IO. If a client sends a larger message, its connection gets closed to prevent DoS (memory exhaustion) attacks.
| `50000` | `10000`
| `LOAD_TEST` | `LOAD_TEST`
| Allow Load Testing tools to hit the Etherpad Instance. WARNING: this will disable security on the instance. | Allow Load Testing tools to hit the Etherpad Instance. WARNING: this will disable security on the instance.

View file

@ -1,331 +0,0 @@
# Docker
The official Docker image is available on https://hub.docker.com/r/etherpad/etherpad.
## Downloading from Docker Hub
If you are ok downloading a [prebuilt image from Docker Hub](https://hub.docker.com/r/etherpad/etherpad), these are the commands:
```bash
# gets the latest published version
docker pull etherpad/etherpad
# gets a specific version
docker pull etherpad/etherpad:1.8.0
```
## Build a personalized container
If you want to use a personalized settings file, **you will have to rebuild your image**.
All of the following instructions are as a member of the `docker` group.
By default, the Etherpad Docker image is built and run in `production` mode: no development dependencies are installed, and asset bundling speeds up page load time.
### Rebuilding with custom settings
Edit `<BASEDIR>/settings.json.docker` at your will. When rebuilding the image, this file will be copied inside your image and renamed to `settings.json`.
**Each configuration parameter can also be set via an environment variable**, using the syntax `"${ENV_VAR}"` or `"${ENV_VAR:default_value}"`. For details, refer to `settings.json.template`.
### Rebuilding including some plugins
If you want to install some plugins in your container, it is sufficient to list them in the ETHERPAD_PLUGINS build variable.
The variable value has to be a space separated, double quoted list of plugin names (see examples).
Some plugins will need personalized settings. Just refer to the previous section, and include them in your custom `settings.json.docker`.
### Rebuilding including export functionality for DOC/PDF/ODT
If you want to be able to export your pads to DOC/PDF/ODT files, you can install
either Abiword or Libreoffice via setting a build variable.
#### Via Abiword
For installing Abiword, set the `INSTALL_ABIWORD` build variable to any value.
Also, you will need to configure the path to the abiword executable
via setting the `abiword` property in `<BASEDIR>/settings.json.docker` to
`/usr/bin/abiword` or via setting the environment variable `ABIWORD` to
`/usr/bin/abiword`.
#### Via Libreoffice
For installing Libreoffice instead, set the `INSTALL_SOFFICE` build variable
to any value.
Also, you will need to configure the path to the libreoffice executable
via setting the `soffice` property in `<BASEDIR>/settings.json.docker` to
`/usr/bin/soffice` or via setting the environment variable `SOFFICE` to
`/usr/bin/soffice`.
### Examples
Build a Docker image from the currently checked-out code:
```bash
docker build --tag <YOUR_USERNAME>/etherpad .
```
Include two plugins in the container:
```bash
docker build --build-arg ETHERPAD_PLUGINS="ep_comments_page ep_author_neat" --tag <YOUR_USERNAME>/etherpad .
```
## Running your instance:
To run your instance:
```bash
docker run --detach --publish <DESIRED_PORT>:9001 <YOUR_USERNAME>/etherpad
```
And point your browser to `http://<YOUR_IP>:<DESIRED_PORT>`
## Options available by default
The `settings.json.docker` available by default allows to control almost every setting via environment variables.
### General
| Variable | Description | Default |
| ------------------ | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `TITLE` | The name of the instance | `Etherpad` |
| `FAVICON` | favicon default name, or a fully specified URL to your own favicon | `favicon.ico` |
| `DEFAULT_PAD_TEXT` | The default text of a pad | `Welcome to Etherpad! This pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents! Get involved with Etherpad at https://etherpad.org` |
| `IP` | IP which etherpad should bind at. Change to `::` for IPv6 | `0.0.0.0` |
| `PORT` | port which etherpad should bind at | `9001` |
| `ADMIN_PASSWORD` | the password for the `admin` user (leave unspecified if you do not want to create it) | |
| `USER_PASSWORD` | the password for the first user `user` (leave unspecified if you do not want to create it) | |
### Database
| Variable | Description | Default |
| ------------- | -------------------------------------------------------------- | --------------------------------------------------------------------- |
| `DB_TYPE` | a database supported by https://www.npmjs.com/package/ueberdb2 | not set, thus will fall back to `DirtyDB` (please choose one instead) |
| `DB_HOST` | the host of the database | |
| `DB_PORT` | the port of the database | |
| `DB_NAME` | the database name | |
| `DB_USER` | a database user with sufficient permissions to create tables | |
| `DB_PASS` | the password for the database username | |
| `DB_CHARSET` | the character set for the tables (only required for MySQL) | |
| `DB_FILENAME` | in case `DB_TYPE` is `DirtyDB` or `sqlite`, the database file. | `var/dirty.db`, `var/etherpad.sq3` |
If your database needs additional settings, you will have to use a personalized `settings.json.docker` and rebuild the container (or otherwise put the updated `settings.json` inside your image).
### Pad Options
| Variable | Description | Default |
| -------------------------------- | ----------- | ------- |
| `PAD_OPTIONS_NO_COLORS` | | `false` |
| `PAD_OPTIONS_SHOW_CONTROLS` | | `true` |
| `PAD_OPTIONS_SHOW_CHAT` | | `true` |
| `PAD_OPTIONS_SHOW_LINE_NUMBERS` | | `true` |
| `PAD_OPTIONS_USE_MONOSPACE_FONT` | | `false` |
| `PAD_OPTIONS_USER_NAME` | | `null` |
| `PAD_OPTIONS_USER_COLOR` | | `null` |
| `PAD_OPTIONS_RTL` | | `false` |
| `PAD_OPTIONS_ALWAYS_SHOW_CHAT` | | `false` |
| `PAD_OPTIONS_CHAT_AND_USERS` | | `false` |
| `PAD_OPTIONS_LANG` | | `null` |
### Shortcuts
| Variable | Description | Default |
| ----------------------------------- | ------------------------------------------------ | ------- |
| `PAD_SHORTCUTS_ENABLED_ALT_F9` | focus on the File Menu and/or editbar | `true` |
| `PAD_SHORTCUTS_ENABLED_ALT_C` | focus on the Chat window | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_S` | save a revision | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_Z` | undo/redo | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_Y` | redo | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_I` | italic | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_B` | bold | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_U` | underline | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_H` | backspace | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_5` | strike through | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_SHIFT_1` | ordered list | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_SHIFT_2` | shows a gritter popup showing a line author | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_SHIFT_L` | unordered list | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_SHIFT_N` | ordered list | `true` |
| `PAD_SHORTCUTS_ENABLED_CMD_SHIFT_C` | clear authorship | `true` |
| `PAD_SHORTCUTS_ENABLED_DELETE` | | `true` |
| `PAD_SHORTCUTS_ENABLED_RETURN` | | `true` |
| `PAD_SHORTCUTS_ENABLED_ESC` | in mozilla versions 14-19 avoid reconnecting pad | `true` |
| `PAD_SHORTCUTS_ENABLED_TAB` | indent | `true` |
| `PAD_SHORTCUTS_ENABLED_CTRL_HOME` | scroll to top of pad | `true` |
| `PAD_SHORTCUTS_ENABLED_PAGE_UP` | | `true` |
| `PAD_SHORTCUTS_ENABLED_PAGE_DOWN` | | `true` |
### Skins
You can use the UI skin variants builder at `/p/test#skinvariantsbuilder`
For the colibris skin only, you can choose how to render the three main containers:
* toolbar (top menu with icons)
* editor (containing the text of the pad)
* background (area outside of editor, mostly visible when using page style)
For each of the 3 containers you can choose 4 color combinations:
* super-light
* light
* dark
* super-dark
For the editor container, you can also make it full width by adding `full-width-editor` variant (by default editor is rendered as a page, with a max-width of 900px).
| Variable | Description | Default |
| --------------- | ------------------------------------------------------------------------------ | --------------------------------------------------------- |
| `SKIN_NAME` | either `no-skin`, `colibris` or an existing directory under `src/static/skins` | `colibris` |
| `SKIN_VARIANTS` | multiple skin variants separated by spaces | `super-light-toolbar super-light-editor light-background` |
### Logging
| Variable | Description | Default |
| -------------------- | ---------------------------------------------------- | ------- |
| `LOGLEVEL` | valid values are `DEBUG`, `INFO`, `WARN` and `ERROR` | `INFO` |
| `DISABLE_IP_LOGGING` | Privacy: disable IP logging | `false` |
### Advanced
| Variable | Description | Default |
|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| `COOKIE_SAME_SITE` | Value of the SameSite cookie property. | `"Lax"` |
| `COOKIE_SESSION_LIFETIME` | How long (ms) a user can be away before they must log in again. | `864000000` (10 days) |
| `COOKIE_SESSION_REFRESH_INTERVAL` | How often (ms) to write the latest cookie expiration time. | `86400000` (1 day) |
| `SHOW_SETTINGS_IN_ADMIN_PAGE` | hide/show the settings.json in admin page | `true` |
| `TRUST_PROXY` | set to `true` if you are using a reverse proxy in front of Etherpad (for example: Traefik for SSL termination via Let's Encrypt). This will affect security and correctness of the logs if not done | `false` |
| `IMPORT_MAX_FILE_SIZE` | maximum allowed file size when importing a pad, in bytes. | `52428800` (50 MB) |
| `IMPORT_EXPORT_MAX_REQ_PER_IP` | maximum number of import/export calls per IP. | `10` |
| `IMPORT_EXPORT_RATE_LIMIT_WINDOW` | the call rate for import/export requests will be estimated in this time window (in milliseconds) | `90000` |
| `COMMIT_RATE_LIMIT_DURATION` | duration of the rate limit window for commits by individual users/IPs (in seconds) | `1` |
| `COMMIT_RATE_LIMIT_POINTS` | maximum number of changes per IP to allow during the rate limit window | `10` |
| `SUPPRESS_ERRORS_IN_PAD_TEXT` | Should we suppress errors from being visible in the default Pad Text? | `false` |
| `REQUIRE_SESSION` | If this option is enabled, a user must have a session to access pads. This effectively allows only group pads to be accessed. | `false` |
| `EDIT_ONLY` | Users may edit pads but not create new ones. Pad creation is only via the API. This applies both to group pads and regular pads. | `false` |
| `MINIFY` | If true, all css & js will be minified before sending to the client. This will improve the loading performance massively, but makes it difficult to debug the javascript/css | `true` |
| `MAX_AGE` | How long may clients use served javascript code (in seconds)? Not setting this may cause problems during deployment. Set to 0 to disable caching. | `21600` (6 hours) |
| `ABIWORD` | Absolute path to the Abiword executable. Abiword is needed to get advanced import/export features of pads. Setting it to null disables Abiword and will only allow plain text and HTML import/exports. | `null` |
| `SOFFICE` | This is the absolute path to the soffice executable. LibreOffice can be used in lieu of Abiword to export pads. Setting it to null disables LibreOffice exporting. | `null` |
| `ALLOW_UNKNOWN_FILE_ENDS` | Allow import of file types other than the supported ones: txt, doc, docx, rtf, odt, html & htm | `true` |
| `REQUIRE_AUTHENTICATION` | This setting is used if you require authentication of all users. Note: "/admin" always requires authentication. | `false` |
| `REQUIRE_AUTHORIZATION` | Require authorization by a module, or a user with is_admin set, see below. | `false` |
| `AUTOMATIC_RECONNECTION_TIMEOUT` | Time (in seconds) to automatically reconnect pad when a "Force reconnect" message is shown to user. Set to 0 to disable automatic reconnection. | `0` |
| `FOCUS_LINE_PERCENTAGE_ABOVE` | Percentage of viewport height to be additionally scrolled. e.g. 0.5, to place caret line in the middle of viewport, when user edits a line above of the viewport. Set to 0 to disable extra scrolling | `0` |
| `FOCUS_LINE_PERCENTAGE_BELOW` | Percentage of viewport height to be additionally scrolled. e.g. 0.5, to place caret line in the middle of viewport, when user edits a line below of the viewport. Set to 0 to disable extra scrolling | `0` |
| `FOCUS_LINE_PERCENTAGE_ARROW_UP` | Percentage of viewport height to be additionally scrolled when user presses arrow up in the line of the top of the viewport. Set to 0 to let the scroll to be handled as default by Etherpad | `0` |
| `FOCUS_LINE_DURATION` | Time (in milliseconds) used to animate the scroll transition. Set to 0 to disable animation | `0` |
| `FOCUS_LINE_CARET_SCROLL` | Flag to control if it should scroll when user places the caret in the last line of the viewport | `false` |
| `SOCKETIO_MAX_HTTP_BUFFER_SIZE` | The maximum size (in bytes) of a single message accepted via Socket.IO. If a client sends a larger message, its connection gets closed to prevent DoS (memory exhaustion) attacks. | `50000` |
| `LOAD_TEST` | Allow Load Testing tools to hit the Etherpad Instance. WARNING: this will disable security on the instance. | `false` |
| `DUMP_ON_UNCLEAN_EXIT` | Enable dumping objects preventing a clean exit of Node.js. WARNING: this has a significant performance impact. | `false` |
| `EXPOSE_VERSION` | Expose Etherpad version in the web interface and in the Server http header. Do not enable on production machines. | `false` |
### Add plugin configurations
It is possible to add arbitrary configurations for plugins by setting the `EP__PLUGIN__<PLUGIN_NAME>__<CONFIG_NAME>` environment variable. It is important to separate paths with a double underscore `__`.
For example, to configure the `ep_comments` plugin to use the `comments` database, you can set the following environment variables:
The original config looks like this:
```json
"ep_comments_page": {
"highlightSelectedText": true
},
```
We have two paths ep_comments_page and highlightSelectedText, so we need to set the following environment variable:
```yaml
EP__ep_comments_page__highlightSelectedText=true
```
### Examples
Use a Postgres database, no admin user enabled:
```shell
docker run -d \
--name etherpad \
-p 9001:9001 \
-e 'DB_TYPE=postgres' \
-e 'DB_HOST=db.local' \
-e 'DB_PORT=4321' \
-e 'DB_NAME=etherpad' \
-e 'DB_USER=dbusername' \
-e 'DB_PASS=mypassword' \
etherpad/etherpad
```
Run enabling the administrative user `admin`:
```shell
docker run -d \
--name etherpad \
-p 9001:9001 \
-e 'ADMIN_PASSWORD=supersecret' \
etherpad/etherpad
```
Run a test instance running DirtyDB on a persistent volume:
```shell
docker run -d \
-v etherpad_data:/opt/etherpad-lite/var \
-p 9001:9001 \
etherpad/etherpad
```
## Ready to use Docker Compose
```yaml
services:
app:
user: "0: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: ${DOCKER_COMPOSE_APP_ADMIN_PASSWORD:-admin}
DB_CHARSET: ${DOCKER_COMPOSE_APP_DB_CHARSET:-utf8mb4}
DB_HOST: postgres
DB_NAME: ${DOCKER_COMPOSE_POSTGRES_DATABASE:-etherpad}
DB_PASS: ${DOCKER_COMPOSE_POSTGRES_PASSWORD:-admin}
DB_PORT: ${DOCKER_COMPOSE_POSTGRES_PORT:-5432}
DB_TYPE: "postgres"
DB_USER: ${DOCKER_COMPOSE_POSTGRES_USER:-admin}
# For now, the env var DEFAULT_PAD_TEXT cannot be unset or empty; it seems to be mandatory in the latest version of etherpad
DEFAULT_PAD_TEXT: ${DOCKER_COMPOSE_APP_DEFAULT_PAD_TEXT:- }
DISABLE_IP_LOGGING: ${DOCKER_COMPOSE_APP_DISABLE_IP_LOGGING:-false}
SOFFICE: ${DOCKER_COMPOSE_APP_SOFFICE:-null}
TRUST_PROXY: ${DOCKER_COMPOSE_APP_TRUST_PROXY:-true}
restart: always
ports:
- "${DOCKER_COMPOSE_APP_PORT_PUBLISHED:-9001}:${DOCKER_COMPOSE_APP_PORT_TARGET:-9001}"
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: ${DOCKER_COMPOSE_POSTGRES_DATABASE:-etherpad}
POSTGRES_PASSWORD: ${DOCKER_COMPOSE_POSTGRES_PASSWORD:-admin}
POSTGRES_PORT: ${DOCKER_COMPOSE_POSTGRES_PORT:-5432}
POSTGRES_USER: ${DOCKER_COMPOSE_POSTGRES_USER:-admin}
PGDATA: /var/lib/postgresql/data/pgdata
restart: always
# Exposing the port is not needed unless you want to access this database instance from the host.
# Be careful when other postgres docker container are running on the same port
# ports:
# - "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data/pgdata
volumes:
postgres_data:
plugins:
etherpad-var:
```

View file

@ -1,15 +0,0 @@
# About this Documentation
<!-- type=misc -->
The goal of this documentation is to comprehensively explain Etherpad,
both from a reference and a conceptual point of view.
Where appropriate, property types, method arguments, and the arguments
provided to event handlers are detailed in a list underneath the topic
heading.
Every `.html` file is generated based on the corresponding
`.md` file in the `doc/api/` folder in the source tree. The
documentation is generated using the `src/bin/doc/generate.js` program.
The HTML template is located at `doc/template.html`.

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 874 KiB

After

Width:  |  Height:  |  Size: 874 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 533 KiB

After

Width:  |  Height:  |  Size: 533 KiB

Before After
Before After

Some files were not shown because too many files have changed in this diff Show more