Website access: one settings page, a list of independently switchable features, and presets that switch a bundle of them on.
The boss first asked for website modes — maintenance, a dev mode, a
third nobody remembers — then wanted to mix and match what the modes do,
which makes modes the wrong unit. So each feature is a checkbox with an
explanation and, where it needs one, its own area of options; the old
modes are presets/0 — a button that sets settings, nothing else, and
everything stays adjustable after.
The features, each in its own context:
Gate— the password gate, a hard block before anyone sees anythingRedirect— send public visitors to the production siteNotice— a banner on every page- site closed —
PhoenixKit.Modules.Maintenance, part of core; the "Maintenance" and "Under construction" presets switch it on - hide from search engines — the crawlers module's
noindex, shared AllowedAddresses— addresses that pass the gate and the redirect
Every setting goes through PhoenixKit.Settings, so V184's history
records who switched what and when (opts carry actor_uuid: and
source:). Environment.read/0 describes how the install is running, to
suggest a preset — never to switch one on.
Summary
Functions
How this install is running — see Environment.
The features, in page order, each with its current state: on? is
"actually enforced right now", switched_on? the checkbox, ready?
whether the checkbox would take effect (a gate needs a password, a
redirect a URL, a notice a text), needs says what is missing.
The presets: a name, what it is for, and what it switches. Applying one only sets settings; every feature stays adjustable after.
Switches one feature's checkbox. opts carry the history's actor/source.
Types
Functions
How this install is running — see Environment.
@spec features() :: [feature()]
The features, in page order, each with its current state: on? is
"actually enforced right now", switched_on? the checkbox, ready?
whether the checkbox would take effect (a gate needs a password, a
redirect a URL, a notice a text), needs says what is missing.
The presets: a name, what it is for, and what it switches. Applying one only sets settings; every feature stays adjustable after.
Switches one feature's checkbox. opts carry the history's actor/source.