ether / etherpad-lite

Etherpad: A modern really-real-time collaborative document editor.
http://docs.etherpad.org/
Apache License 2.0
16.13k stars 2.8k forks source link

Allow providing local plugins to Docker image #6243

Closed dhalenok closed 3 months ago

dhalenok commented 3 months ago

Due to new changes in the version 2.0, it's no longer possible to specify local plugins when building a Docker image.

In my testing, executing pnpm run install-plugins (one for remote and one for local plugins via --path) made it so only the plugins specified in the latest command were loaded.

This PR changes that, so you can specify both remote and local plugins in one command: pnpm run install-plugins ep_openid_connect --path ../ep_my_local_plugin. It should still be possible to specify only remote or local plugins.

In addition, this PR introduces a new Dockerfile argument called ETHERPAD_LOCAL_PLUGINS, value of which gets passed to install-plugins script.

There is, however, one thing left to do, which is copying the plugins to the docker image. IIRC, before v.2.0 the root directory of the repo was copied over, but it's no longer a case and I'm not too sure how to tackle it. One idea was that local plugins could be stored in a directory called pluginsor local_plugins and copied over to EP_DIRin Docker image:

COPY --chown=etherpad:etherpad ./plugins/ ./
SamTV12345 commented 3 months ago

Thanks for the suggestions.

dhalenok commented 3 months ago

@SamTV12345

Sorry for reviving this PR, but what do you think about adding

COPY --chown=etherpad:etherpad ./plugins/ ./

to the Dockerfile?

Or maybe you have some better ideas on how to copy local plugins into the docker image?

SamTV12345 commented 3 months ago

No worries. The problem is that the plugin folder won't be present on every computer. We could add the folder to git. Then it would work.

dhalenok commented 3 months ago

I've been able to circumvent the issue by storing local plugins in src directory on the host, and specifying build arg as ETHERPAD_LOCAL_PLUGINS="../src/plugins/ep_my_plugin".