Appearance
Content sources
A site reads its pages from one or more content sources. Each source is one entry in the site's sources list. It names a connector (plugin), the URL paths it owns (owns), the connector's settings, and the names of the names of its credentials (credentials). Secrets never go into the configuration itself: the server looks each name up in its environment, then among the values its owner stored with foliwake credential set (see credentials).
Each page belongs to exactly one source. The owns paths of two sources must not overlap.
Available connectors
Connector (plugin) | Display name | Reads | Status |
|---|---|---|---|
local-markdown | Local Markdown | Markdown and images in a folder on the server or your computer | Built in, always on |
git-markdown | Git repository (Markdown) | Markdown and images from one branch of a GitHub or GitLab repository | On by default |
google-drive-markdown | Google Drive folder (Markdown) | Markdown files and images in a Google Drive folder | On by default |
google-docs | Google Docs | Explicitly mapped Google Docs documents and their images | On by default |
drupal | Drupal (articles) | Published Drupal article nodes, with images | On by default |
"On by default" means the engine's default plugin list selects the connector. An operator can still turn a connector off with an explicit plugin list file (FOLIWAKE_PLUGINS) that leaves it out.
A connector that does not ship with the engine is code that runs inside the engine process, with no isolation: it can read every site's credentials and the installation's secrets. Add only plugins you have reviewed to the plugin list file, and review each new version before you update it (see limitations).
To see what your server offers, run:
sh
foliwake source pluginsIt lists the installed connectors, the ones that are disabled by configuration, any that failed to load (with the reason), and providers that are planned but not available yet, such as Notion or WordPress.
Choose a connector
- Authors write Markdown in a folder next to the site. Use local Markdown. The quickstart sets it up.
- Content lives in a Git repository and changes through commits or pull requests. Use the Git connector: connect a Git repository.
- Authors keep Markdown files in a shared Drive folder, for example with Google Drive for desktop. Use the Drive connector: connect a Google Drive folder.
- Authors write in Google Docs. Use the Google Docs connector. It has no step-by-step guide yet.
- Content lives in Drupal. Use the Drupal connector: publish from Drupal and connect the Drupal editor.
One site can combine several sources, for example Git for /docs and Drupal for /news.
Add a source
There are three ways to add a source to a site:
CLI, checked first:
foliwake source addchecks the source before it saves anything. It checks the entry, the credentials, the connection, and the files with their page addresses. Then it asks, and saves:shfoliwake source add --site my-site --id docs --owns /docs --folder "<Drive folder link>" # Google Drive foliwake source add --site my-site --plugin git-markdown --id docs --owns /docs \ --repository https://github.com/acme/docs [--branch main] [--token DOCS_TOKEN] foliwake source add --site my-site --plugin drupal --id news --owns /articles \ --base-url https://cms.example.org --language en --language es--mappings rules.jsonadds path mapping rules;--check-onlysaves nothing;--yessaves without asking. A Google Drive source getsidentity: file-idand the key nameFOLIWAKE_GOOGLE_SA_KEYunless you pass--identityor--key. The same command run again changes nothing. Another entry under a used id is refused.Dashboard: open the site, then Sources › Add a source. The form shows the settings and credential fields of the chosen connector.
By hand:
foliwake site edit --site <site>opens the site's settings in your editor. Add an entry tosourcesand save.
Both check the entry before saving. Saving changes the configuration only. It does not sync, preview or publish.
Check a source
foliwake source check checks sources without changing anything: the entry, its credentials (set or not), the connection and, with --listing, the files the source would read and the page address each one would get.
sh
foliwake source check --site my-site # every source that syncs
foliwake source check --site my-site --source docs --listing # one source, with its files and addressesA file whose address comes from its own path: line shows "(decided by the file)". A file that no rule fits is listed with the reason: the first sync refuses until it is mapped or ignored. For a Google Drive source, a folder the service account cannot open names the account's e-mail address to share the folder with.
To check an entry before it is saved, give it as --input:
sh
foliwake source check --input '{"site": "my-site", "candidate": {"id": "docs", "plugin": "git-markdown", …}, "listing": {}}'An organisation admin's candidate follows the same rules as saving it (what an organisation admin may change): its credentials must be variables of the site (<SITE>__…, such as MY_SITE__DRIVE_KEY) and it may not name a path on the server (a local folder). Otherwise the check is refused with FIELD_SERVER_OWNED before anything is contacted, without saying whether the variable is set. The installation's owner checks any candidate.
Nothing is saved, synced or published. A listing reads the whole source once (for Google Drive, every Markdown file); the files are kept in the source's download cache, so the first sync after the source is saved does not read them again.
Path mapping rules (mappings) are not part of the dashboard form. Add them with foliwake site edit, or with foliwake site set --site <site> sources.<n>.mappings '<rules as JSON>'. The dashboard keeps them when you save the other settings. The Google Drive guide explains the rules; they work the same for every connector.
Sync, preview, publish
A sync reads a source into a private snapshot. Preview and live do not change until you preview and publish:
- Sync the source: Sources › Update source preview in the dashboard, or
foliwake source sync. - Review the preview.
- Publish the pages you reviewed from Pages in the dashboard, or with
foliwake publish.
See preview and publish for the details.
Disable a source
Disable a source when its pages should stay as they are while nothing is read from it any more, for example an old source whose pages moved to a new one at another path. A disabled source:
- is not synced: Update preview and
foliwake source syncskip it, and a sync or push that names it is refused; its errors no longer block a preview or a publication of the site; - keeps its pages in the preview from its last accepted snapshot (no new read), and keeps its pages on live until someone unpublishes them; publishing one of them publishes that kept version;
- keeps its page paths: no other source can take them;
- shows as Disabled on Sources and in
foliwake source list.
In the dashboard, open the source on Sources and choose Disable source… (site admins). Enable source… switches it back; its next sync continues from its kept snapshot. On a server, both are recorded with who changed it (the site's history and audit). Clients of the server's API call core sources.disable and sources.enable. On a server that keeps its sites in the site database, the CLI can set the flag directly:
sh
foliwake site set --site my-site sources.<n>.enabled false # what sources.disable writes (n: the source's index)
foliwake site set --site my-site sources.<n>.enabled --unset # enabled againIn a project file, write "enabled": false on the source's entry. A local Markdown folder cannot be disabled: it has no kept snapshot, preview reads the folder itself.
Credentials
A source's credentials maps each field the connector needs to a name, such as { "serviceAccountKey": "FOLIWAKE_GOOGLE_SA_KEY" }. The server finds the value of a name at each sync or check:
- in the server environment, when a variable of that name is set (it always wins);
- among the values stored on the server with
foliwake credential set.
sh
foliwake credential set FOLIWAKE_GOOGLE_SA_KEY --from-file key.json # the installation's owner only
printf %s "$TOKEN" | foliwake credential set FOLIWAKE_GIT_TOKEN_DOCS --from-stdin
foliwake credential list # set or not, where from, which sources use it
foliwake credential rm OLD_KEY # refused while a source uses the nameA value is read from a file or standard input, never from the command line, and is never shown again: not by list, not in errors or logs. A stored value is used by the next sync without a restart. Stored values live in <data>/credentials/ (one private file per name; FOLIWAKE_CREDENTIALS_DIR names another folder). Add --server to run the commands against a remote server.
