etherpad-lite/bin
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
..
deb-src cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
nsis cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
plugins checkPlugin: flag absolute /static/plugins/ asset paths in templates (#5203) (#7535) 2026-04-18 17:09:02 +01:00
buildDebian.sh cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
buildForWindows.sh Feat/bundle js (#6511) 2024-07-18 08:51:30 +02:00
checkAllPads.ts Fixed bin scripts. 2024-08-08 21:23:10 +02:00
checkPad.ts Fixed checkPad script not returning 2024-07-12 08:34:53 +02:00
cleanRun.sh cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
commonPlugins.ts Enforce 2-space indentation across codebase (#7426) 2026-04-01 19:48:45 +01:00
convertSettings.json.template cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
createRelease.sh cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
createUserSession.ts chore: migrated settings to esm6 (#7062) 2025-08-04 22:42:50 +02:00
debugRun.sh cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
deleteAllGroupSessions.ts Fixed bin scripts. 2024-08-08 21:23:10 +02:00
deletePad.ts Fixed bin scripts. 2024-08-08 21:23:10 +02:00
extractPadData.ts Fixed bin scripts. 2024-08-08 21:23:10 +02:00
fastRun.sh chore: fixed fastRun.sh script (#7063) 2025-08-05 18:24:19 +02:00
functions.sh cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
generateReleaseNotes.ts chore: fixed generatereleasenotes to respect filename 2025-11-05 22:14:58 +01:00
importSqlFile.ts chore: migrated settings to esm6 (#7062) 2025-08-04 22:42:50 +02:00
installDeps.sh cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
installer.ps1 feat: add one-line installer script (#7466) (#7485) 2026-04-07 17:10:22 +01:00
installer.sh feat: add one-line installer script (#7466) (#7485) 2026-04-07 17:10:22 +01:00
installLocalPlugins.sh Fix installation of local plugins 2025-04-05 15:31:36 +02:00
make_docs.ts Enforce 2-space indentation across codebase (#7426) 2026-04-01 19:48:45 +01:00
migrateDB.ts chore: adapted documentation for migrateDB.ts (#7088) 2025-08-24 20:50:16 +02:00
migrateDirtyDBtoRealDB.ts chore: migrated settings to esm6 (#7062) 2025-08-04 22:42:50 +02:00
package.json build(deps-dev): bump the dev-dependencies group with 5 updates (#7536) 2026-04-17 17:21:33 +01:00
plugins.ts plugins.ts - absence of case = "remove" (#7141) 2025-09-29 19:26:30 +02:00
push-after-release.sh cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
rebuildPad.ts chore: migrated settings to esm6 (#7062) 2025-08-04 22:42:50 +02:00
release.ts chore: git tag without signature 2025-08-02 13:42:37 +02:00
repairPad.ts Fixed bin scripts. 2024-08-08 21:23:10 +02:00
run.sh Feat/bundle js (#6511) 2024-07-18 08:51:30 +02:00
safeRun.sh cleanup after workspace refactoring (#6174) 2024-02-21 21:50:11 +01:00
setup-trusted-publishers.sh fix: setup-trusted-publishers.sh works with real npm trust CLI (#7491) 2026-04-08 10:56:13 +01:00
tsconfig.json Removed deprecated js files. 2024-08-18 19:22:08 +02:00
updatePlugins.sh fix: use pnpm instead of npm in updatePlugins.sh (#7468) 2026-04-06 11:21:21 +01:00