diff --git a/docs/config.md b/docs/config.md index ef8e3b5..b767c09 100644 --- a/docs/config.md +++ b/docs/config.md @@ -37,7 +37,8 @@ Merge rules: objects merge key-by-key; **arrays and scalars replace** wholesale. | `features.push` | bool | Web Push notifications — the Settings row **and** the re-subscribe-on-connect. | | `features.imageUpload` | bool | Composer image button **and** paste / drag-drop upload. | | `features.register` | bool | Account self-service: the "Create account" button, the "Forgot password" link, and their FAQ entries. | -| `plugins` | string[] | Plugin script URLs loaded at startup. See [Plugins](https://orbit.tchatou.fr/docs/plugins/). | +| `plugins` | string[] | Plugin script URLs loaded at startup — a bare URL runs in-page, or `{url, sandbox: true, permissions: […]}` runs isolated. See [Plugins](https://orbit.tchatou.fr/docs/plugins/). | +| `builtins` | string[] | Built-in **sandboxed** features to enable by name (opt-in; default `[]`). Currently `"dice"`. See [The sandbox](https://orbit.tchatou.fr/docs/sandbox/). | > `defaults.*` only seed a user's preferences the **first** time — once someone changes a setting, > it's stored in their browser and the config no longer overrides it. @@ -61,6 +62,7 @@ can still switch in **Settings**). The bundled plugins are localized too — see "report": { "service": "ReportServ", "target": "#staff" }, "defaults": { "theme": "dark", "compact": true, "lang": "" }, "features": { "push": true, "imageUpload": true, "register": false }, - "plugins": [] + "plugins": [], + "builtins": [] } ``` diff --git a/docs/plugins.md b/docs/plugins.md index fa9ff3a..c576800 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -169,3 +169,7 @@ they run with the same trust as the app itself. There is no user-uploaded plugin mechanism. Orbit deliberately does **not** expose internal modules or runtime component replacement — that would couple plugins to internals that are still moving. The API above is the stable surface. + +For code you don't fully trust — a community or third-party plugin — mark the +entry `sandbox: true` to run it in an isolated, capability-gated iframe instead. +See [The sandbox](https://orbit.tchatou.fr/docs/sandbox/). diff --git a/docs/sandbox.md b/docs/sandbox.md new file mode 100644 index 0000000..8be734d --- /dev/null +++ b/docs/sandbox.md @@ -0,0 +1,119 @@ +Section: Plugins +Order: 220 + +# The sandbox + +Most plugins run **in-page** — a trusted `