Running the wiki
Run and edit this wiki as a separate container.
This wiki ships with every Clipr release: what you read here applies to the installed version. It runs in its own container on its own hostname, is publicly readable and can optionally be edited in the browser by the admins of the Clipr installation.
Enabling it
- Choose a separate hostname for the wiki, e.g.
wiki.clipr.example.com, and point it via DNS (or in a home network via router or hosts file) to the same machine as Clipr. - Enable the wiki in
scripts/cliprctl setup --wizard– or by hand:
scripts/cliprctl config set CLIPR_WIKI_DOMAIN wiki.clipr.example.com
scripts/cliprctl config set CLIPR_WIKI_EDIT 1 # optional: edit in the browser
scripts/cliprctl overlay add docker-compose.wiki.yml
scripts/cliprctl deploy --build
Caddy obtains the certificate for the wiki hostname automatically (or issues it itself with CLIPR_TLS=internal). scripts/cliprctl health shows whether the wiki is reachable and whether editing is on.
Why a separate hostname? HTML is allowed in the wiki. On its own hostname it runs on a different origin than Clipr: even a flaw in the sanitising could not reach the app's session or data.
Editing
With CLIPR_WIKI_EDIT=1, Sign in appears at the bottom of the navigation. Sign-in goes through Clipr (single sign-on) and only succeeds for admins whose session meets the administration 2FA requirement.
Signed in, every page offers Edit, chapters additionally New page and New chapter. The editor has two views:
| View | For |
|---|---|
| Visual | Writing like in a word processor. / opens blocks (heading, list, table, code, image …). Mermaid code blocks show a preview. |
| Markdown | Source with a live preview next to it. The server renders the preview with the same rules as the final page. |
Markdown is always what gets saved. The visual editor normalises the formatting (e.g. list markers); HTML blocks are kept unchanged. Ctrl+S saves.
Per page and language you can set the title, the order in the menu (smaller numbers come first), a summary (one sentence below the title and on the chapter card) and hide it (visible to signed-in editors only). History shows the last 30 versions and restores them.
Shipped and local content
| Layer | Location | Properties |
|---|---|---|
| Shipped | docs/wiki in the repository, read-only in the image |
Comes fresh with every Clipr release. |
| Local | volume wiki-data |
Changes made on this installation. They override a shipped page at the same address. |
A shipped page changed locally carries the note Changed locally for signed-in editors; Reset to shipped version deletes the local version. Note: after an update the wiki keeps showing your local version even if the shipped one changed – so use local changes to shipped pages sparingly and create your own content as separate pages instead.
Structure of the content
docs/wiki/
_index.de.md start page
_index.en.md
administration/ chapter = folder
_index.de.md chapter description
backup.de.md page "backup", German
backup.en.md … and English
flow.png image, stored in the chapter
- Folder and file names form the address:
administration/backup.en.md→/en/administration/backup. Lowercase letters, digits and hyphens are allowed. - Both languages sit side by side. If one is missing, the wiki shows the other with a note.
- Every file starts with a header (front matter):
---
title: Backups
order: 40 # optional, order in the menu
summary: Back up, restore, keep the key safe. # optional (quote it if the text contains “: ”)
hidden: true # optional, signed-in editors only
---
Writing
- Links relative to the file:
[Configuration](configuration.md),[Section](backup.md#backing-up),[Start page](../). They work in the wiki and when reading on GitHub. - Images go into the chapter's folder and are linked relatively:
. Upload them in the editor with Insert image. - Diagrams as a code block with the language
mermaid; they appear in Clipr's colours, light and dark. - Callouts with HTML, blank lines around the Markdown content:
<div class="callout callout-tip">
**Tip:** content with *Markdown*.
</div>
Variants: callout-note, callout-tip, callout-warning, callout-danger. For an intro sentence: <p class="lead">…</p>. Collapsible sections: <details><summary>Title</summary>…</details>. Narrow phone screenshots: <figure class="shot-phone">, several side by side: <div class="shots">, entry tiles: <div class="tiles"><a class="tile" href="…"><b>Title</b>Text</a></div>.
At the end of every page, Next leads to the next page of the same main chapter – the order follows order.
What is allowed in the wiki
Markdown with tables, task lists, footnotes and definition lists, plus embedded HTML. Every page is sanitised against a fixed list of allowed elements when displayed:
- Allowed: text and structure elements (
p,h1–h6, lists, tables,blockquote,details/summary,figure,kbd,mark,sub,sup,abbr…), links, images from the wiki. - Removed:
script,style,iframe,object, forms and input fields,svg, event attributes (onclick…),styleattributes, links tojavascript:ordata:. - Links only
http,https,mailtoand wiki pages; external links open without a referrer. - Images only from the wiki itself – no images from foreign servers (no tracking of readers).
- Classes only from the list above (callouts,
lead); IDs get the prefixh-so they cannot shadow elements of the page. - Uploaded images (PNG, JPEG, WebP, GIF, at most
CLIPR_WIKI_MAX_IMAGE_MB) are re-encoded; metadata such as GPS position is removed. SVG is rejected.
Development: changes straight into the repository
To maintain the shipped documentation there is the overlay docker-compose.wiki-dev.yml. Changes made in the browser then go directly into docs/wiki and can be reviewed and committed with git:
scripts/cliprctl config set CLIPR_WIKI_DEV_UID "$(id -u)"
scripts/cliprctl config set CLIPR_WIKI_DEV_GID "$(id -g)"
scripts/cliprctl overlay add docker-compose.wiki-dev.yml
scripts/cliprctl deploy wiki --build
Only use this on your own development machine. New Clipr features bring their documentation in the same commit – in both languages. The tests in wiki/tests check that every variable is documented, both languages are complete and no link points nowhere.