Skip to content

Commit 79e3d46

Browse files
JohnMcLearclaude
andauthored
feat(settings): default settings.enablePluginPadOptions to true (#7841)
This flag gates the ep_* passthrough on padoptions that shipped in 3.0.0 (PR #7698). It was introduced as opt-in, but the intent in shipping it was to let plugins like ep_plugin_helpers' padToggle / padSelect ride the existing broadcast/persist rail out of the box — flipping the default closes the gap. Why now - ep_comments_page#422 (and sibling per-plugin reports discussed on Discord): stock 3.x deployments console.warn on every pad load because the helper detects clientVars.enablePluginPadOptions === false and tells the admin to flip it. With the flag default-true, the warning stops firing on fresh installs while still surfacing for operators who have explicitly opted out. - Plugins that already depend on ep_plugin_helpers >= 0.6 expect the pad-wide path to work; the default-false gate silently no-op'd pad.changePadOption('ep_*', …) and made the helper UI inert. Scope - Settings.ts default flipped to true; comment rewritten to describe the new "operator opt-out" model rather than the old AGENTS.MD §52 opt-in framing (that policy still applies to *new* features; this one has shipped and proven safe). - settings.json.template env-var substitution default flipped to true so docker / supervisor configs without an explicit value get the new behavior. - doc/plugins.md updated to match (default true, opt-out via settings.json) and the PluginCapabilities source comment. - Backend test describe-blocks relabeled — "true" is now "(default)", "false" is now "(operator opt-out)". Both branches still cover the same matrix so the size-cap / namespace-validation paths stay exercised. Compat - Existing deployments with an explicit `"enablePluginPadOptions": false` in settings.json keep that value — no migration needed. - Older clients only read clientVars.enablePluginPadOptions; the protocol shape is unchanged. Closes ep_comments_page#422 (helper warning suppression for stock deployments). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 29ee19b commit 79e3d46

5 files changed

Lines changed: 17 additions & 16 deletions

File tree

doc/plugins.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,15 +267,16 @@ below.
267267
### Runtime flag
268268

269269
The passthrough is gated by `settings.enablePluginPadOptions`, default
270-
`false`. Operators must opt in via `settings.json`:
270+
`true`. Operators who want to lock plugins out of pad-wide state can flip
271+
it in `settings.json`:
271272

272273
```json
273274
{
274-
"enablePluginPadOptions": true
275+
"enablePluginPadOptions": false
275276
}
276277
```
277278

278-
When enabled, the server reflects the value to every client via
279+
When enabled (the default), the server reflects the value to every client via
279280
`clientVars.enablePluginPadOptions` so plugins can detect both *capable*
280281
(static) and *active* (per-pad request) at the same point.
281282

settings.json.template

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,11 +853,11 @@
853853
* accepting pad-wide values under plugin-namespaced keys matching
854854
* /^ep_[a-z0-9_]+$/ (e.g. ep_table_of_contents). Values are validated
855855
* (JSON-safe, 64 KB per key, 256 KB total) and broadcast to every
856-
* connected client just like native pad-wide toggles. Disabled by
857-
* default; flip to true once your plugins (e.g. ep_plugin_helpers'
858-
* padToggle) require it. See doc/plugins.md.
856+
* connected client just like native pad-wide toggles. Enabled by
857+
* default; set to false to lock plugins out of pad-wide state. See
858+
* doc/plugins.md.
859859
**/
860-
"enablePluginPadOptions": "${ENABLE_PLUGIN_PAD_OPTIONS:false}",
860+
"enablePluginPadOptions": "${ENABLE_PLUGIN_PAD_OPTIONS:true}",
861861

862862
/*
863863
* Optional privacy banner shown once the pad loads. Disabled by default.

src/node/utils/PluginCapabilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// True when applyPadSettings (client + server) preserves keys matching
1414
// /^ep_[a-z0-9_]+$/ on pad.padOptions. The runtime gate is
15-
// settings.enablePluginPadOptions (default false), mirrored to clients via
15+
// settings.enablePluginPadOptions (default true), mirrored to clients via
1616
// clientVars.enablePluginPadOptions. See doc/plugins.md for the full
1717
// contract (key namespace, validation, size caps).
1818
export const padOptionsPluginPassthrough = true;

src/node/utils/Settings.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,11 @@ const settings: SettingsType = {
434434
updateServer: "https://static.etherpad.org",
435435
enableDarkMode: true,
436436
enablePadWideSettings: true,
437-
// New plugin-padOption passthrough is opt-in per AGENTS.MD §52 ("New
438-
// features should be placed behind feature flags and disabled by
439-
// default"). Flip to true to let plugins (e.g. ep_plugin_helpers'
440-
// padToggle) ride the existing padoptions broadcast/persist rail.
441-
enablePluginPadOptions: false,
437+
// Lets plugins (e.g. ep_plugin_helpers' padToggle / padSelect) ride the
438+
// existing padoptions broadcast/persist rail to store pad-wide options
439+
// under ep_* keys. Operators who want to lock plugin-driven pad-wide
440+
// state out can set this to false in settings.json.
441+
enablePluginPadOptions: true,
442442
allowPadDeletionByAllUsers: false,
443443
privacyBanner: {
444444
enabled: false,

src/tests/backend/specs/Pad.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ describe(__filename, function () {
214214
});
215215
afterEach(function () { console.warn = warnSpy; });
216216

217-
describe('with enablePluginPadOptions = true', function () {
217+
describe('with enablePluginPadOptions = true (default)', function () {
218218
before(function () { settings.enablePluginPadOptions = true; });
219219

220220
it('preserves ep_* keys verbatim so plugins can ride padoptions', function () {
@@ -285,10 +285,10 @@ describe(__filename, function () {
285285
});
286286
});
287287

288-
describe('with enablePluginPadOptions = false (default)', function () {
288+
describe('with enablePluginPadOptions = false (operator opt-out)', function () {
289289
before(function () { settings.enablePluginPadOptions = false; });
290290

291-
it('drops every ep_* key — feature flag is opt-in', function () {
291+
it('drops every ep_* key — operator has opted out of plugin pad-wide state', function () {
292292
const ps: any = Pad.Pad.normalizePadSettings({
293293
ep_table_of_contents: {enabled: true},
294294
ep_font_color: 'red',

0 commit comments

Comments
 (0)