Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 committed Jul 7, 2024
2 parents c45b7a3 + 8a9bda7 commit 523b5b5
Show file tree
Hide file tree
Showing 36 changed files with 1,564 additions and 1,887 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [18, 20, 21]
node: [18, 20, 22]
steps:
-
name: Checkout repository
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [18, 20, 21]
node: [18, 20, 22]
steps:
-
name: Checkout repository
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
-
uses: actions/setup-node@v4
with:
node-version: 21
node-version: 22
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: docker/setup-buildx-action@v3
-
name: Build and export to Docker
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
target: production
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
-
name: Build and push
if: github.event_name == 'push'
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
target: production
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/frontend-admin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ permissions:

jobs:
withplugins:
if: ${{ github.actor != 'dependabot[bot]' }}
name: with plugins
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node: [20, 21]
node: [20, 22]

steps:
-
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 @@ -26,7 +26,7 @@ jobs:
-
uses: actions/setup-node@v4
with:
node-version: 21
node-version: 22
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 21
node-version: 22
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
-
uses: actions/setup-node@v4
with:
node-version: 21
node-version: 22
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rate-limit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
-
name: docker network
run: docker network create --subnet=172.23.42.0/16 ep_net
run: docker network create --subnet=172.23.0.0/16 ep_net
-
name: build docker image
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upgrade-from-latest-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [18, 20, 21]
node: [18, 20, 22]
steps:
-
name: Check out latest release
uses: actions/checkout@v4
with:
ref: master
ref: develop #FIXME change to master when doing release
-
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
-
uses: actions/setup-node@v4
with:
node-version: 21
node-version: 22
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 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
Expand Down
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#
# Author: muxator

FROM node:alpine as adminBuild
FROM node:alpine AS adminbuild

WORKDIR /opt/etherpad-lite
COPY ./ ./
RUN cd ./admin && npm install -g [email protected] && pnpm install && pnpm run build --outDir ./dist
RUN cd ./ui && pnpm install && pnpm run build --outDir ./dist


FROM node:alpine as build
FROM node:alpine AS build
LABEL maintainer="Etherpad team, https://github.com/ether/etherpad-lite"

# Set these arguments when building the image from behind a proxy
Expand Down Expand Up @@ -105,33 +105,33 @@ USER etherpad
WORKDIR "${EP_DIR}"

# 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 ./.git/HEA[D] ./.git/HEAD
COPY --chown=etherpad:etherpad ./.git/ref[s] ./.git/refs
COPY --chown=etherpad:etherpad ${SETTINGS} ./settings.json
COPY --chown=etherpad:etherpad ./var ./var
COPY --chown=etherpad:etherpad ./bin ./bin
COPY --chown=etherpad:etherpad ./pnpm-workspace.yaml ./package.json ./

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

RUN bin/installDeps.sh && \
if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ]; then \
pnpm run plugins i ${ETHERPAD_PLUGINS} ${ETHERPAD_LOCAL_PLUGINS:+--path ${ETHERPAD_LOCAL_PLUGINS}}; \
fi


FROM build as production
FROM build AS production

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/admin/dist ./src/templates/admin
COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/ui/dist ./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
28 changes: 14 additions & 14 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.0",
"version": "2.1.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -11,32 +11,32 @@
"preview": "vite preview"
},
"dependencies": {
"@radix-ui/react-switch": "^1.0.3"
"@radix-ui/react-switch": "^1.1.0"
},
"devDependencies": {
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-toast": "^1.1.5",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-toast": "^1.2.1",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.2.25",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^9.2.0",
"eslint": "^9.6.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.7",
"i18next": "^23.11.5",
"i18next-browser-languagedetector": "^8.0.0",
"lucide-react": "^0.381.0",
"lucide-react": "^0.400.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.51.5",
"react-hook-form": "^7.52.1",
"react-i18next": "^14.1.0",
"react-router-dom": "^6.23.1",
"react-router-dom": "^6.24.1",
"socket.io-client": "^4.7.5",
"typescript": "^5.4.5",
"vite": "^5.2.12",
"vite-plugin-static-copy": "^1.0.3",
"typescript": "^5.5.3",
"vite": "^5.3.3",
"vite-plugin-static-copy": "^1.0.6",
"vite-plugin-svgr": "^4.2.0",
"zustand": "^4.5.2"
"zustand": "^4.5.4"
}
}
1 change: 1 addition & 0 deletions admin/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ td, th {
outline: none;
width: 100%;
resize: none;
font-family: monospace;
}

#response {
Expand Down
58 changes: 28 additions & 30 deletions admin/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,20 @@ export const HomePage = () => {
if (!pluginsSocket) {
return
}

pluginsSocket?.emit('search', searchParams)


pluginsSocket!.on('results:search', (data: {
results: PluginDef[]
}) => {
if (Array.isArray(data.results) && data.results.length > 0) {
setPlugins(data.results)
} else {
useStore.getState().setToastState({
open: true,
title: "Error retrieving plugins",
success: false
})
}
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]);

const uninstallPlugin = (pluginName: string)=>{
Expand All @@ -125,7 +120,6 @@ export const HomePage = () => {
setPlugins(plugins.filter(plugin=>plugin.name !== pluginName))
}


useDebounce(()=>{
setSearchParams({
...searchParams,
Expand Down Expand Up @@ -161,12 +155,12 @@ export const HomePage = () => {
</td>
</tr>
})}
</tbody>
</table>
</tbody>
</table>


<h2><Trans i18nKey="admin_plugins.available"/></h2>
<SearchField onChange={v=>{setSearchTerm(v.target.value)}} placeholder={t('admin_plugins.available_search.placeholder')} value={searchTerm}/>
<h2><Trans i18nKey="admin_plugins.available"/></h2>
<SearchField onChange={v=>{setSearchTerm(v.target.value)}} placeholder={t('admin_plugins.available_search.placeholder')} value={searchTerm}/>

<table id="available-plugins">
<thead>
Expand All @@ -179,17 +173,21 @@ export const HomePage = () => {
</tr>
</thead>
<tbody style={{overflow: 'auto'}}>
{plugins.map((plugin) => {
return <tr key={plugin.name}>
<td><a rel="noopener noreferrer" href={`https://npmjs.com/${plugin.name}`} target="_blank">{plugin.name}</a></td>
<td>{plugin.description}</td>
<td>{plugin.version}</td>
<td>{plugin.time}</td>
<td>
<IconButton icon={<Download/>} onClick={() => installPlugin(plugin.name)} title={<Trans i18nKey="admin_plugins.available_install.value"/>}/>
</td>
</tr>
})}
{(plugins.length > 0) ?
plugins.map((plugin) => {
return <tr key={plugin.name}>
<td><a rel="noopener noreferrer" href={`https://npmjs.com/${plugin.name}`} target="_blank">{plugin.name}</a></td>
<td>{plugin.description}</td>
<td>{plugin.version}</td>
<td>{plugin.time}</td>
<td>
<IconButton icon={<Download/>} onClick={() => installPlugin(plugin.name)} title={<Trans i18nKey="admin_plugins.available_install.value"/>}/>
</td>
</tr>
})
:
<tr><td colSpan={5}>{searchTerm == '' ? <Trans i18nKey="pad.loading"/>: <Trans i18nKey="admin_plugins.available_not-found"/>}</td></tr>
}
</tbody>
</table>
</div>
Expand Down
4 changes: 2 additions & 2 deletions admin/src/pages/PadPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const PadPage = ()=>{
const [padToDelete, setPadToDelete] = useState<string>('')
const pages = useMemo(()=>{
if(!pads){
return [0]
return 0;
}

return Math.ceil(pads!.total / searchParams.limit)
Expand Down Expand Up @@ -166,7 +166,7 @@ export const PadPage = ()=>{
offset: (Number(currentPage)-1)*searchParams.limit})
}}><ChevronLeft/><span>Previous Page</span></button>
<span>{currentPage+1} out of {pages}</span>
<button disabled={pages == currentPage+1} onClick={()=>{
<button disabled={pages == 0 || pages == currentPage+1} onClick={()=>{
const newCurrentPage = currentPage+1
setCurrentPage(newCurrentPage)
setSearchParams({
Expand Down
4 changes: 2 additions & 2 deletions admin/src/pages/SettingsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {useStore} from "../store/store.ts";
import {isJSONClean} from "../utils/utils.ts";
import {isJSONClean, cleanComments} from "../utils/utils.ts";
import {Trans} from "react-i18next";
import {IconButton} from "../components/IconButton.tsx";
import {RotateCw, Save} from "lucide-react";

export const SettingsPage = ()=>{
const settingsSocket = useStore(state=>state.settingsSocket)
const settings = useStore(state=>state.settings)
const settings = cleanComments(useStore(state=>state.settings))

return <div className="settings-page">
<h1><Trans i18nKey="admin_settings.current"/></h1>
Expand Down
Loading

0 comments on commit 523b5b5

Please sign in to comment.