diff --git a/docker/etherpad/Dockerfile b/docker/etherpad/Dockerfile index f0f246e8ff..bb8e24b4fb 100644 --- a/docker/etherpad/Dockerfile +++ b/docker/etherpad/Dockerfile @@ -28,7 +28,7 @@ # stages of the multi stage build. ARG EP_DIR=/opt/etherpad-lite ARG SETTINGS=./settings.json.docker -ARG ETHERPAD_PLUGINS="ep_headings" +ARG ETHERPAD_PLUGINS="ep_headings2" FROM node:22-bookworm-slim AS adminBuild ARG EP_DIR @@ -40,10 +40,11 @@ RUN export DEBIAN_FRONTEND=noninteractive; \ apt-get -qq --no-install-recommends install ca-certificates git && \ apt-get -qq clean && \ rm -rf /var/lib/apt/lists/* +RUN npm install -g pnpm@9.0.4 RUN git clone https://github.com/ether/etherpad-lite ${EP_DIR} -RUN git checkout v2.1.1 -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 +RUN git checkout v2.2.4 +RUN pnpm install +RUN pnpm run build:ui FROM node:22-bookworm-slim AS build @@ -83,6 +84,14 @@ ARG ETHERPAD_PLUGINS # 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. # By default, it is not installed. # If given any value, abiword will be installed. @@ -140,17 +149,19 @@ USER etherpad RUN git clone https://github.com/ether/etherpad-lite ${EP_DIR} WORKDIR "${EP_DIR}" -RUN git checkout v2.1.1 +RUN git checkout v2.2.4 FROM build AS development ARG ETHERPAD_PLUGINS -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 +# This copy is not necessary as we clone and checkout in the build image +# 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 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}}; \ + if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ] || [ ! -z "${ETHERPAD_GITHUB_PLUGINS}" ]; then \ + pnpm run plugins i ${ETHERPAD_PLUGINS} ${ETHERPAD_LOCAL_PLUGINS:+--path ${ETHERPAD_LOCAL_PLUGINS}} ${ETHERPAD_GITHUB_PLUGINS:+--github ${ETHERPAD_GITHUB_PLUGINS}}; \ fi @@ -162,15 +173,16 @@ ARG ETHERPAD_PLUGINS ENV NODE_ENV=production ENV ETHERPAD_PRODUCTION=true -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 +# This copy is not necessary as we clone and checkout in the build image +# 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 RUN bin/installDeps.sh && rm -rf ~/.npm && rm -rf ~/.local && rm -rf ~/.cache && \ - if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ]; then \ - pnpm run plugins i ${ETHERPAD_PLUGINS} ${ETHERPAD_LOCAL_PLUGINS:+--path ${ETHERPAD_LOCAL_PLUGINS}}; \ + if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ] || [ ! -z "${ETHERPAD_GITHUB_PLUGINS}" ]; then \ + pnpm run plugins i ${ETHERPAD_PLUGINS} ${ETHERPAD_LOCAL_PLUGINS:+--path ${ETHERPAD_LOCAL_PLUGINS}} ${ETHERPAD_GITHUB_PLUGINS:+--github ${ETHERPAD_GITHUB_PLUGINS}}; \ fi - # Copy the configuration file. COPY --chown=etherpad:etherpad ${SETTINGS} "${EP_DIR}"/settings.json diff --git a/playbooks/roles/etherpad/tasks/main.yaml b/playbooks/roles/etherpad/tasks/main.yaml index 289872891a..7fc5676266 100644 --- a/playbooks/roles/etherpad/tasks/main.yaml +++ b/playbooks/roles/etherpad/tasks/main.yaml @@ -93,11 +93,6 @@ group: 5001 mode: '0440' -- name: Clean up from old ep_headings hack - file: - path: /etc/etherpad/node_modules - state: absent - - name: Remove npm package: name: diff --git a/playbooks/roles/etherpad/templates/etherpad.vhost.j2 b/playbooks/roles/etherpad/templates/etherpad.vhost.j2 index 2150a8b544..002738e4de 100644 --- a/playbooks/roles/etherpad/templates/etherpad.vhost.j2 +++ b/playbooks/roles/etherpad/templates/etherpad.vhost.j2 @@ -68,13 +68,16 @@ RewriteCond %{REQUEST_URI} !^/locales/ RewriteCond %{REQUEST_URI} !^/locales.json RewriteCond %{REQUEST_URI} !^/admin - RewriteCond %{REQUEST_URI} !^/p/ RewriteCond %{REQUEST_URI} !^/static/ RewriteCond %{REQUEST_URI} !^/pluginfw/ RewriteCond %{REQUEST_URI} !^/javascripts/ RewriteCond %{REQUEST_URI} !^/socket.io/ RewriteCond %{REQUEST_URI} !^/ep/ + RewriteCond %{REQUEST_URI} !^/ep_etherpad-lite/ RewriteCond %{REQUEST_URI} !^/minified/ + RewriteCond %{REQUEST_URI} !^/padbootstrap-.*\.min\.js$ + RewriteCond %{REQUEST_URI} !^/timeSliderBootstrap-.*\.min\.js$ + RewriteCond %{REQUEST_URI} !^/indexBootstrap-.*\.min\.js$ RewriteCond %{REQUEST_URI} !^/api/ RewriteCond %{REQUEST_URI} !^/ro/ RewriteCond %{REQUEST_URI} !^/error/ diff --git a/playbooks/roles/etherpad/templates/settings.json.j2 b/playbooks/roles/etherpad/templates/settings.json.j2 index 31fcddd6b1..40174c1c56 100644 --- a/playbooks/roles/etherpad/templates/settings.json.j2 +++ b/playbooks/roles/etherpad/templates/settings.json.j2 @@ -658,6 +658,13 @@ */ "loglevel": "INFO", + /* + * The log layout type to use. + * + * Valid values: basic, colored + */ + "logLayoutType": "colored", + /* Override any strings found in locale directories */ "customLocaleStrings": {}, diff --git a/zuul.d/docker-images/etherpad.yaml b/zuul.d/docker-images/etherpad.yaml index 53f90bc2e2..1416eb7214 100644 --- a/zuul.d/docker-images/etherpad.yaml +++ b/zuul.d/docker-images/etherpad.yaml @@ -11,7 +11,7 @@ repository: opendevorg/etherpad tags: - latest - - v2.1.1 + - v2.2.4 build_args: - EP_GID=5001 files: ðerpad_files