Configuration files are Write configuration in TOML
- Comparing
- v1 to v2
- Current
- Read the document
Context
The panel is distributed as a single binary running FrankenPHP, per
as
ADR-0009 decides. Its configuration is held in typed
configuration objectsobjects, per as RFC-0002
describes, but nothing decides the format that
that configuration is written in.
A standalone PHP web application would typically write its configuration as PHP files. A panel distributed as a binary is not bound to that, and can read its configuration from whichever format suits the job.
Configuration is edited by the sysadmins who install and run the panel, and they should be able to do that without knowing PHP.
Decision
Configuration is written I will write configuration in TOML files, which sysadmins edit directly. The , and the panel does will not read configuration from
configuration
from PHP files.
Alternatives
PHP files. They are , which is what a standalone PHP web application would use, which . I rejected this because a panel distributed distributed
as a binary does
does not needneed them, and editing them requires knowing PHP.
JSON and YAML. Like TOML, both which are widely known. , as TOML is chosen over is. I rejected them because it TOML is the simplest of the
the three, ,
and the closest to what people are already used to.
Consequences
Easier:
- Sysadmins will edit configuration without knowing PHP, in a format close to what they already know.
Harder:
- The configuration component will need a TOML parser, and configuration
objectsobjects will be built from the arraysitit produces rather than written as PHP. ModulesModules will need a way to define how their configuration objects are loaded fromthosethose files.- Secrets will need to be kept out of the files, which are plain text, and supplied from the environment instead.
Constrained:
- Configuration will be limited to the values TOML can express: strings, numbers, booleans, dates and times, arrays and tables. Anything else will be built by a configuration object from those.
Sources
- Issue #31, Engine - Config - TOML, original text of in its edit history: the first written record of
the decision, which is
created. It gives the reason that a panel distributed as a binary need not use PHP files, and anticipates the TOML parser and the need for modules to define how their configuration is loaded. - Planning session, , not publicly available and first written down on : the decision, which is
decided, the reason that sysadmins should edit configuration without knowing PHP, and supplying secrets from the environment through interpolation. - JSON and YAML as the formats weighed against TOML, and why TOML was chosen: first written down on , with no record of when they were weighed.
- TOML v1.0.0: the values TOML can express.
Source adr/0010-toml-configuration.md · commit 9444a99 · published