diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..f521471dc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +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 diff --git a/.env.default b/.env.default index b78b5599a..e9b560b72 100644 --- a/.env.default +++ b/.env.default @@ -4,15 +4,15 @@ # 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 +DOCKER_COMPOSE_APP_PORT_PUBLISHED=9001 +DOCKER_COMPOSE_APP_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_APP_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 \ No newline at end of file +DOCKER_COMPOSE_POSTGRES_DATABASE=db +DOCKER_COMPOSE_POSTGRES_PASSWORD=etherpad-lite-password +DOCKER_COMPOSE_POSTGRES_USER=etherpad-lite-user diff --git a/.env.dev.default b/.env.dev.default new file mode 100644 index 000000000..b78b5599a --- /dev/null +++ b/.env.dev.default @@ -0,0 +1,18 @@ +# 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 \ No newline at end of file diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index e8fe12ae1..cb80f076b 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -36,7 +36,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash @@ -93,7 +93,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash @@ -163,7 +163,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash @@ -216,7 +216,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash diff --git a/.github/workflows/build-and-deploy-docs.yml b/.github/workflows/build-and-deploy-docs.yml index 107736faf..b09f8823d 100644 --- a/.github/workflows/build-and-deploy-docs.yml +++ b/.github/workflows/build-and-deploy-docs.yml @@ -38,7 +38,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c01bcc065..80031a877 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -47,7 +47,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash diff --git a/.github/workflows/frontend-admin-tests.yml b/.github/workflows/frontend-admin-tests.yml index cb9d74242..588f5ac9d 100644 --- a/.github/workflows/frontend-admin-tests.yml +++ b/.github/workflows/frontend-admin-tests.yml @@ -37,7 +37,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index 6966f6dc4..cbd8d870e 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -30,7 +30,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash @@ -96,7 +96,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash @@ -163,7 +163,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash diff --git a/.github/workflows/load-test.yml b/.github/workflows/load-test.yml index c5eab5889..ed98a20e7 100644 --- a/.github/workflows/load-test.yml +++ b/.github/workflows/load-test.yml @@ -32,7 +32,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash @@ -76,7 +76,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash @@ -147,7 +147,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash diff --git a/.github/workflows/perform-type-check.yml b/.github/workflows/perform-type-check.yml index 5f47f7076..638e75a13 100644 --- a/.github/workflows/perform-type-check.yml +++ b/.github/workflows/perform-type-check.yml @@ -29,7 +29,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash diff --git a/.github/workflows/rate-limit.yml b/.github/workflows/rate-limit.yml index 5cf8a7756..84e79552c 100644 --- a/.github/workflows/rate-limit.yml +++ b/.github/workflows/rate-limit.yml @@ -32,7 +32,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash diff --git a/.github/workflows/upgrade-from-latest-release.yml b/.github/workflows/upgrade-from-latest-release.yml index 5bc6efd1c..44eac09c4 100644 --- a/.github/workflows/upgrade-from-latest-release.yml +++ b/.github/workflows/upgrade-from-latest-release.yml @@ -38,7 +38,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Only install direct dependencies run: pnpm config set auto-install-peers false diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 37b8824f9..816de3957 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -38,7 +38,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash @@ -132,7 +132,7 @@ jobs: - uses: pnpm/action-setup@v3 name: Install pnpm with: - version: 8 + version: 9.0.4 run_install: false - name: Get pnpm store directory shell: bash diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e29702c5..75a789452 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# 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 @@ -25,7 +35,7 @@ - Socket io has been updated to 4.7.5. This means that the json.send function won't work anymore and needs to be changed to .emit('message', myObj) - Deprecating npm version 6 in favor of pnpm: We have made the decision to switch to the well established pnpm (https://pnpm.io/). It works by symlinking dependencies into a global directory allowing you to have a cleaner and more reliable environment. - Introducing Typescript to the Etherpad core: Etherpad core logic has been rewritten in Typescript allowing for compiler checking of errors. -- Rewritten Admin Panel: The Admin panel has been rewritten in React and now features a more pleasant user experience. It now also features an integrated pad searching with sorting functionality. +- Rewritten Admin Panel: The Admin panel has been rewritten in React and now features a more pleasant user experience. It now also features an integrated pad searching with sorting functionality. ### Notable enhancements and fixes @@ -35,7 +45,7 @@ * Enhancements - pnpm Workspaces: In addition to pnpm we introduced workspaces. A clean way to manage multiple bounded contexts like the admin panel or the bin folder. - 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 - 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 install-plugins --path ../path-to-plugin` @@ -45,7 +55,7 @@ ### Notable enhancements and fixes -* Added Live Plugin Manager: Plugins are now installed into a separate folder on the host system. This folder is called `plugin_packages`. +* Added Live Plugin Manager: Plugins are now installed into a separate folder on the host system. This folder is called `plugin_packages`. That way the plugins are separated from the normal etherpad installation. * Make repairPad.js more verbose * Fixed favicon not being loaded correctly @@ -68,19 +78,19 @@ That way the plugins are separated from the normal etherpad installation. ### Notable enhancements and fixes -* The support for the tidy program to tidy up HTML files has been removed. This decision was made because it hasn't been updated for years and also caused an incompability when exporting a pad with Abiword. +* The support for the tidy program to tidy up HTML files has been removed. This decision was made because it hasn't been updated for years and also caused an incompability when exporting a pad with Abiword. # 1.9.4 ### Compatibility changes -* Log4js has been updated to the latest version. As it involved a bump of 6 major version. +* Log4js has been updated to the latest version. As it involved a bump of 6 major version. A lot has changed since then. Most notably the console appender has been deprecated. You can find out more about it [here](https://github.com/log4js-node/log4js-node) ### Notable enhancements and fixes -* Fix for MySQL: The logger calls were incorrectly configured leading to a crash when e.g. somebody uses a different encoding than standard MySQL encoding. +* Fix for MySQL: The logger calls were incorrectly configured leading to a crash when e.g. somebody uses a different encoding than standard MySQL encoding. # 1.9.3 @@ -88,7 +98,7 @@ That way the plugins are separated from the normal etherpad installation. * express-rate-limit has been bumped to 7.0.0: This involves the breaking change that "max: 0" in the importExportRateLimiting is set to always trigger. So set it to your desired value. -If you haven't changed that value in the settings.json you are all set. +If you haven't changed that value in the settings.json you are all set. ### Notable enhancements and fixes @@ -107,7 +117,7 @@ If you haven't changed that value in the settings.json you are all set. * Enable session key rotation: This setting can be enabled in the settings.json. It changes the signing key for the cookie authentication in a fixed interval. * Bugfixes - * Fix appendRevision when creating a new pad via the API without a text. + * Fix appendRevision when creating a new pad via the API without a text. * Enhancements @@ -116,11 +126,11 @@ If you haven't changed that value in the settings.json you are all set. ### Compatibility changes -* No compability changes as JQuery maintains excellent backwards compatibility. +* No compability changes as JQuery maintains excellent backwards compatibility. #### For plugin authors -* Please update to JQuery 3.7. There is an excellent deprecation guide over [here](https://api.jquery.com/category/deprecated/). Version 3.1 to 3.7 are relevant for the upgrade. +* Please update to JQuery 3.7. There is an excellent deprecation guide over [here](https://api.jquery.com/category/deprecated/). Version 3.1 to 3.7 are relevant for the upgrade. # 1.9.1 @@ -128,7 +138,7 @@ If you haven't changed that value in the settings.json you are all set. * Security * Limit requested revisions in timeslider and export to head revision. (affects v1.9.0) - + * Bugfixes * revisions in `CHANGESET_REQ` (timeslider) and export (txt, html, custom) are now checked to be numbers. @@ -142,7 +152,7 @@ If you haven't changed that value in the settings.json you are all set. * tests: drop windows 7 test coverage & use chrome latest for admin tests * Require Node 16 for Etherpad and target Node 20 for testing - + # 1.9.0 ### Notable enhancements and fixes diff --git a/Dockerfile b/Dockerfile index 00b3f4b67..65fd6cd61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ FROM node:alpine as adminBuild WORKDIR /opt/etherpad-lite COPY ./ ./ -RUN cd ./admin && npm install -g pnpm && pnpm install && pnpm run build --outDir ./dist +RUN cd ./admin && npm install -g pnpm@9.0.4 && pnpm install && pnpm run build --outDir ./dist RUN cd ./ui && pnpm install && pnpm run build --outDir ./dist @@ -91,7 +91,7 @@ RUN mkdir -p "${EP_DIR}" && chown etherpad:etherpad "${EP_DIR}" # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199 RUN \ mkdir -p /usr/share/man/man1 && \ - npm install pnpm -g && \ + npm install pnpm@9.0.4 -g && \ apk update && apk upgrade && \ apk add --no-cache \ ca-certificates \ diff --git a/README.md b/README.md index b5da2534a..0fb5db326 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,63 @@ We're looking for maintainers and have some funding available. Please contact J ## 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/pgdata + +volumes: + postgres_data: + plugins: + etherpad-var: +``` + + + ### Requirements [Node.js](https://nodejs.org/) >= **18.18.2**. diff --git a/admin/package.json b/admin/package.json index 4554d9c8c..809f26bdd 100644 --- a/admin/package.json +++ b/admin/package.json @@ -1,7 +1,7 @@ { "name": "admin", "private": true, - "version": "2.0.2", + "version": "2.0.3", "type": "module", "scripts": { "dev": "vite", @@ -9,31 +9,33 @@ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview" }, - "dependencies": {}, + "dependencies": { + "@radix-ui/react-switch": "^1.0.3" + }, "devDependencies": { "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-toast": "^1.1.5", - "i18next": "^23.10.1", - "i18next-browser-languagedetector": "^7.2.1", - "lucide-react": "^0.365.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-hook-form": "^7.51.2", - "react-i18next": "^14.1.0", - "react-router-dom": "^6.22.3", - "zustand": "^4.5.2", - "@types/react": "^18.2.74", - "@types/react-dom": "^18.2.24", - "@typescript-eslint/eslint-plugin": "^7.5.0", - "@typescript-eslint/parser": "^7.5.0", + "@types/react": "^18.2.79", + "@types/react-dom": "^18.2.25", + "@typescript-eslint/eslint-plugin": "^7.7.0", + "@typescript-eslint/parser": "^7.7.0", "@vitejs/plugin-react-swc": "^3.5.0", "eslint": "^9.0.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.5", + "i18next": "^23.11.2", + "i18next-browser-languagedetector": "^7.2.1", + "lucide-react": "^0.372.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-hook-form": "^7.51.3", + "react-i18next": "^14.1.0", + "react-router-dom": "^6.22.3", "socket.io-client": "^4.7.5", - "typescript": "^5.4.4", - "vite": "^5.2.8", - "vite-plugin-static-copy": "^1.0.2", - "vite-plugin-svgr": "^4.2.0" + "typescript": "^5.4.5", + "vite": "^5.2.9", + "vite-plugin-static-copy": "^1.0.3", + "vite-plugin-svgr": "^4.2.0", + "zustand": "^4.5.2" } } diff --git a/admin/src/App.tsx b/admin/src/App.tsx index a1a1e4377..b3238ef9a 100644 --- a/admin/src/App.tsx +++ b/admin/src/App.tsx @@ -6,7 +6,7 @@ import {NavLink, Outlet, useNavigate} from "react-router-dom"; import {useStore} from "./store/store.ts"; import {LoadingScreen} from "./utils/LoadingScreen.tsx"; import {Trans, useTranslation} from "react-i18next"; -import {Cable, Construction, Crown, NotepadText, Wrench} from "lucide-react"; +import {Cable, Construction, Crown, NotepadText, Wrench, PhoneCall} from "lucide-react"; const WS_URL = import.meta.env.DEV? 'http://localhost:9001' : '' export const App = ()=> { @@ -96,8 +96,10 @@ export const App = ()=> {