The add-on's settings, with the Astro add-on's names (spec-0017 §1).
Environment variables win over config :dialecto_in_context, …:
url/DIALECTO_URL— the Dialecto that serves the overlay and the sidebar (defaulthttps://dialecto.eu);project/DIALECTO_PROJECT— a project slug or id, when the git remote isn't enough to find it;catalogs/DIALECTO_CATALOGS— the catalogs folder whose uncommitted files the sidebar warns about (defaultpriv/gettext);enabled/DIALECTO_IN_CONTEXT=off— switches the add-on off;paths/DIALECTO_PATHS(comma-separated) — path prefixes whose pages get the editor (default: every page), to keep it off admin screens, say;exclude_paths/DIALECTO_EXCLUDE_PATHS(comma-separated) — path prefixes whose pages never get it, even underpaths. For an app that wants every page but a few, such as the one that serves the sidebar.
Live-site editing (spec-0025 §4) adds four keys, read from the app config only and safe to commit:
mode—:dev,:liveor:off. Unset, it is:devin a development or test build and:offin any other; the build environment is read when this package compiles;repo—"owner/name", the Dialecto repo editors work on;origin— the site's own origin,"https://www.example.com". Required in:live(the plug falls back to the endpoint's configured URL). It is never taken from request headers, which a proxy can rewrite;public_key— the repo's"ed25519:…"key from its Dialecto settings. Without it,:livestays off.
Summary
Functions
The live-site settings, or nil unless :live has everything it needs: a
repo and a valid public_key, an origin that parses if one is set, and
the add-on not switched off. origin is nil when the plug should ask the
endpoint. Resolved once by resolve!/1.
The mode in force: the :mode setting, else the build's default. :dev in a
build whose default is :off (a production build) is refused and means :off.
Read from the value resolve!/1 stored at boot, so a lookup costs one term read.
The http(s) origin of url — lowercase, default port dropped, IPv6
bracketed — or nil for anything that isn't a web URL (the same form
Dialecto stores a repo's sites in).
True when the editor belongs on path: under settings.paths (any page when
unset) and not under settings.exclude_paths.
Reads the app config once and keeps the mode and live settings for the
requests and lookups that follow. The application calls it at boot, with
log? true so that a misconfigured :live says why it stayed off.
Settings from env (the OS environment) and app_env (the app config).
Types
@type mode() :: :dev | :live | :off
Functions
@spec live() :: live() | nil
The live-site settings, or nil unless :live has everything it needs: a
repo and a valid public_key, an origin that parses if one is set, and
the add-on not switched off. origin is nil when the plug should ask the
endpoint. Resolved once by resolve!/1.
@spec mode() :: mode()
The mode in force: the :mode setting, else the build's default. :dev in a
build whose default is :off (a production build) is refused and means :off.
Read from the value resolve!/1 stored at boot, so a lookup costs one term read.
The http(s) origin of url — lowercase, default port dropped, IPv6
bracketed — or nil for anything that isn't a web URL (the same form
Dialecto stores a repo's sites in).
True when the editor belongs on path: under settings.paths (any page when
unset) and not under settings.exclude_paths.
@spec resolve!(boolean()) :: :ok
Reads the app config once and keeps the mode and live settings for the
requests and lookups that follow. The application calls it at boot, with
log? true so that a misconfigured :live says why it stayed off.
Settings from env (the OS environment) and app_env (the app config).