Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 committed Aug 8, 2024
2 parents 523b5b5 + 59531d4 commit c0a3096
Show file tree
Hide file tree
Showing 91 changed files with 14,083 additions and 13,157 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ Dockerfile
settings.json
src/node_modules
admin/node_modules
ui/node_modules
node_modules
5 changes: 2 additions & 3 deletions .github/workflows/frontend-admin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
# rules.
-
name: Install all dependencies and symlink for ep_etherpad-lite
run: bin/installDeps.sh
run: pnpm i
#-
# name: Install etherpad plugins
# run: rm -Rf node_modules/ep_align/static/tests/*
Expand All @@ -92,7 +92,6 @@ jobs:
- name: Build admin frontend
working-directory: admin
run: |
pnpm install
pnpm run build
# name: Run the frontend admin tests
# shell: bash
Expand Down Expand Up @@ -124,7 +123,7 @@ jobs:
- name: Run the frontend admin tests
shell: bash
run: |
pnpm run dev &
pnpm run prod &
connected=false
can_connect() {
curl -sSfo /dev/null http://localhost:9001/ || return 1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Run the frontend tests
shell: bash
run: |
pnpm run dev &
pnpm run prod &
connected=false
can_connect() {
curl -sSfo /dev/null http://localhost:9001/ || return 1
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
- name: Run the frontend tests
shell: bash
run: |
pnpm run dev &
pnpm run prod &
connected=false
can_connect() {
curl -sSfo /dev/null http://localhost:9001/ || return 1
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
- name: Run the frontend tests
shell: bash
run: |
pnpm run dev &
pnpm run prod &
connected=false
can_connect() {
curl -sSfo /dev/null http://localhost:9001/ || return 1
Expand Down
109 changes: 14 additions & 95 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,111 +61,30 @@ jobs:
name: Run the backend tests
shell: msys2 {0}
run: cd src && 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/[email protected]
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@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 all dependencies and symlink for ep_etherpad-lite
run: .\bin\installOnWindows.bat
working-directory: etherpad
-
name: Run Etherpad
working-directory: etherpad/src
run: |
pnpm install cypress
.\node_modules\.bin\cypress.cmd install --force
pnpm i
pnpm exec playwright install --with-deps
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
pnpm exec cypress run --config-file ./tests/frontend/cypress/cypress.config.js
# On release, upload windows zip to GitHub release tab
pnpm exec playwright install chromium --with-deps
pnpm run test-ui --project=chromium
# On release, create release
-
name: Rename to etherpad-lite-win.zip
shell: powershell
run: mv etherpad-win.zip etherpad-lite-win.zip
- name: upload binaries to release
- name: Generate Changelog
if: ${{startsWith(github.ref, 'refs/tags/v') }}
working-directory: bin
run: pnpm run generateChangelog ${{ github.ref }} > ${{ github.workspace }}-CHANGELOG.txt
with:
tag: ${{ github.ref }}
- name: Release
uses: softprops/action-gh-release@v2
if: ${{startsWith(github.ref, 'refs/tags/v') }}
with:
files: etherpad-lite-win.zip
body_path: ${{ github.workspace }}-CHANGELOG.txt
make_latest: true
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 2.2.0

### 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


Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# Author: muxator

FROM node:alpine AS adminbuild

RUN npm install -g [email protected]
WORKDIR /opt/etherpad-lite
COPY ./ ./
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
COPY . .
RUN pnpm install
RUN pnpm run build:ui


FROM node:alpine AS build
Expand Down Expand Up @@ -115,8 +115,8 @@ COPY --chown=etherpad:etherpad ./pnpm-workspace.yaml ./package.json ./
FROM build AS development

COPY --chown=etherpad:etherpad ./src/package.json .npmrc ./src/
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/admin/dist ./src/templates/admin
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/ui/dist ./src/static/oidc
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

RUN bin/installDeps.sh && \
if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ]; then \
Expand All @@ -130,8 +130,8 @@ ENV NODE_ENV=production
ENV ETHERPAD_PRODUCTION=true

COPY --chown=etherpad:etherpad ./src ./src
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/admin/dist ./src/templates/admin
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/ui/dist ./src/static/oidc
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

RUN bin/installDeps.sh && rm -rf ~/.npm && rm -rf ~/.local && rm -rf ~/.cache && \
if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ]; then \
Expand Down
73 changes: 8 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,76 +98,19 @@ volumes:
etherpad-var:
```
### Requirements
[Node.js](https://nodejs.org/) >= **18.18.2**.
### GNU/Linux and other UNIX-like systems
#### Quick install on Debian/Ubuntu
Install the latest Node.js LTS per [official install instructions](https://github.com/nodesource/distributions#installation-instructions), then:
```sh
git clone --branch master https://github.com/ether/etherpad-lite.git &&
cd etherpad-lite &&
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:
### Windows, macOS, Linux
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`
1. Download the latest Node.js runtime from [nodejs.org](https://nodejs.org/).
2. Install pnpm: `npm install -g pnpm` (Administrator privileges may be required).
3. Clone the repository: `git clone -b master`
4. Run `pnpm i`
5. Run `pnpm run build:etherpad`
6. Run `pnpm run prod`
7. Visit `http://localhost:9001` in your browser.

### Docker container

Expand Down
24 changes: 12 additions & 12 deletions admin/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "admin",
"private": true,
"version": "2.1.1",
"version": "2.2.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -18,23 +18,23 @@
"@radix-ui/react-toast": "^1.2.1",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.2.25",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^9.6.0",
"eslint": "^9.8.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.7",
"i18next": "^23.11.5",
"eslint-plugin-react-refresh": "^0.4.9",
"i18next": "^23.12.2",
"i18next-browser-languagedetector": "^8.0.0",
"lucide-react": "^0.400.0",
"lucide-react": "^0.426.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.52.1",
"react-i18next": "^14.1.0",
"react-router-dom": "^6.24.1",
"react-hook-form": "^7.52.2",
"react-i18next": "^15.0.1",
"react-router-dom": "^6.26.0",
"socket.io-client": "^4.7.5",
"typescript": "^5.5.3",
"vite": "^5.3.3",
"typescript": "^5.5.4",
"vite": "^5.4.0",
"vite-plugin-static-copy": "^1.0.6",
"vite-plugin-svgr": "^4.2.0",
"zustand": "^4.5.4"
Expand Down
8 changes: 4 additions & 4 deletions admin/src/pages/PadPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ export const PadPage = ()=>{
ascending: !searchParams.ascending
})
}}><Trans i18nKey="ep_admin_pads:ep_adminpads2_padname"/></th>
<th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'lastEdited')} onClick={()=>{
<th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'userCount')} onClick={()=>{
setSearchParams({
...searchParams,
sortBy: 'lastEdited',
sortBy: 'userCount',
ascending: !searchParams.ascending
})
}}><Trans i18nKey="ep_admin_pads:ep_adminpads2_pad-user-count"/></th>
<th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'userCount')} onClick={()=>{
<th className={determineSorting(searchParams.sortBy, searchParams.ascending, 'lastEdited')} onClick={()=>{
setSearchParams({
...searchParams,
sortBy: 'userCount',
sortBy: 'lastEdited',
ascending: !searchParams.ascending
})
}}><Trans i18nKey="ep_admin_pads:ep_adminpads2_last-edited"/></th>
Expand Down
Loading

0 comments on commit c0a3096

Please sign in to comment.