etherpad-lite/bin/plugins
John McLear 0206e0447c
checkPlugin: flag absolute /static/plugins/ asset paths in templates (#5203) (#7535)
* checkPlugin: flag absolute /static/plugins/ paths in templates (#5203)

Plugin templates that reference assets as \`/static/plugins/...\`
(absolute) silently break any Etherpad instance hosted behind a reverse
proxy at a sub-path — the browser resolves the path against the domain
root instead of the proxy prefix and the asset 404s. The right form is
\`../static/plugins/...\` (relative), which ep_embedmedia PR #4 fixed
manually and which #5203 asked for as a mechanical check.

Walk \`templates/\` and \`static/\` of the plugin, scan every \`*.ejs\` /
\`*.html\` for \`/static/plugins/\` not preceded by a URL scheme, dot, or
word char (so \`https://host/static/plugins/...\` and already-correct
\`../static/plugins/...\` stay untouched). Warn normally; in \`autofix\`
mode rewrite to the relative form in place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* checkPlugin: skip autofix for static/*.html

Addresses Qodo review: HTML served from a plugin's static/ directory
resolves against /static/plugins/<plugin>/static/..., so rewriting
/static/plugins/... to ../static/plugins/... yields a broken URL. Keep
scanning static/ for warnings but no longer rewrite, and clarify the
remediation guidance to point at the file's own location.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 17:09:02 +01:00
..
lib fix: use atomic git push in plugin npmpublish workflow (#7494) 2026-04-08 12:38:41 +01:00
checkPlugin.ts checkPlugin: flag absolute /static/plugins/ asset paths in templates (#5203) (#7535) 2026-04-18 17:09:02 +01:00
getCorePlugins.sh Added updated workflow runners. 2024-03-16 20:38:05 +01:00
listOfficialPlugins cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
README.md cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
reTestAllPlugins.sh cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
stalePlugins.ts Fixed bin scripts. 2024-08-08 21:23:10 +02:00
updateAllPluginsScript.sh Added updated workflow runners. 2024-03-16 20:38:05 +01:00
updateCorePlugins.sh Added updated workflow runners. 2024-03-16 20:38:05 +01:00

The files in this folder are for Plugin developers.

Get suggestions to improve your Plugin

This code will check your plugin for known usual issues and some suggestions for improvements. No changes will be made to your project.

node src/bin/plugins/checkPlugin.js $PLUGIN_NAME$

Basic Example:

node src/bin/plugins/checkPlugin.js ep_webrtc

Autofixing - will autofix any issues it can

node src/bin/plugins/checkPlugin.js ep_whatever autofix

Autocommitting - fix issues and commit

node src/bin/plugins/checkPlugin.js ep_whatever autocommit

Autopush - fix issues, commit, push, and publish (highly dangerous)

node src/bin/plugins/checkPlugin.js ep_whatever autopush

All the plugins

Replace johnmclear with your github username

# Clones
cd node_modules
GHUSER=johnmclear; curl "https://api.github.com/users/$GHUSER/repos?per_page=1000" | grep -o 'git@[^"]*' | grep /ep_ | xargs -L1 git clone
cd ..

# autofixes and autocommits /pushes & npm publishes
for dir in node_modules/ep_*; do
  dir=${dir#node_modules/}
  [ "$dir" != ep_etherpad-lite ] || continue
  node src/bin/plugins/checkPlugin.js "$dir" autocommit
done

Automating update of ether organization plugins

getCorePlugins.sh
updateCorePlugins.sh