You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: fall back instead of stranding empty .pad files
initializeMissingFrontmatter hard-required protected pads, so a `.pad`
that arrived outside the UI -- over WebDAV, from another integration, or
from before the setting changed -- failed every open attempt with 403
when protected pads were off, even though public pads were available.
There was no way out for the user: recovery needs frontmatter the file
doesn't have.
Use the same fallback the template path already uses. It still closes the
`/initialize` bypass (nothing enabled means an exception), but produces an
openable pad whenever some type is allowed.
Rename resolveForTemplate() to resolveCreatableMode(), since it now serves
both callers, and note in its docblock that the fallback can widen access:
a protected template becomes a public pad when protected pads are off.
README, api-reference and templates docs say so too.
Copy file name to clipboardExpand all lines: docs/templates.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,4 +91,4 @@ Error responses:
91
91
-**Failed template materialisation falls back to a blank pad.** If anything in the listener throws (binding race, Etherpad unreachable, malformed template), the byte-copy NC made is wiped and the new file behaves like a normal empty `.pad` — the regular missing-frontmatter init kicks in on first open.
92
92
-**Placeholder substitution applies to both the plain-text and the HTML snapshot in the body**. If a placeholder ends up inside an HTML attribute (`<a href="{{date}}">`), it gets resolved too — keep placeholders in human-readable locations to avoid surprises.
93
93
-**No template registry** — every `.pad` in the user's *Templates* folder is a candidate. There's no separate "is a template" flag.
94
-
-**A template keeps its own access mode**, unless the admin switched that pad type off. In that case the pad is created in the enabled mode instead of failing, so the template's content still lands. With no pad type enabled at all, template creation is refused.
94
+
-**A template keeps its own access mode**, unless the admin switched that pad type off. In that case the pad is created in the enabled mode instead of failing, so the template's content still lands. With no pad type enabled at all, template creation is refused. Be aware this can widen access: a protected template creates a public pad when protected pads are off — on such an instance that is the only option, but the resulting pad is open to anyone with the link.
0 commit comments