# Configuration and data stability commitment This document states what Runway promises about everything **outside** the Java API that an installation, a backup, a plugin package or a monitoring system depends on: the `runway.*` configuration keys, the files Runway keeps on disk, the backup archive, the plugin descriptor (`plugin.yml`), and the HTTP paths, metric names and logger names other systems are built against. It is the counterpart of [SPI-STABILITY.md](SPI-STABILITY.md), which covers the binary extension API. > **Status.** These rules bind from **`1.0.0`**: this document governs, and every change to a covered > surface is called out in the CHANGELOG ([`../CHANGELOG.md`](../CHANGELOG.md)). ## Why this exists An operator upgrading from `1.2` to `1.5` should not have to re-read every configuration key, re-test every backup, or rebuild a Prometheus dashboard. A plugin author should know which `plugin.yml` keys an older kernel will understand. That needs two things: a written promise per surface, and something **on disk** that says which version of a format a file is in, so that a later Runway can tell an old file from a new one and an older Runway can refuse a file it cannot read instead of quietly damaging it. Two markers carry that version: `external/layout.yml` for the data folder, and `formatVersion` in a backup's `manifest.yml`. ## What "compatible" means — the common rules Within one **major** line (`1.x`): 1. **Nothing covered is removed or changes meaning.** A configuration key keeps its meaning, its type and its default **unit**; a file keeps its location and the meaning of its fields; a metric keeps its name and tags. 2. **Additions are free.** New keys, new optional fields, new files, new metrics and new paths may appear in any minor release. Each has a default that reproduces the previous behaviour. 3. **Renames and removals take a deprecation cycle.** The old name keeps working for the rest of the major line, a startup `WARN` names the replacement, the configuration metadata marks it deprecated, and the changelog lists it under *Deprecated*. It is removed only in the next major. 4. **Defaults may be tuned** (a larger cap, a shorter cache lifetime) when the change does not alter what a correctly configured installation does; the changelog says so. A default that changes behaviour an operator relies on is treated like a rename. 5. **A breaking change is a new major** (`2.0`), called out in the changelog with upgrade steps. ## 1. The `runway.*` configuration namespace **Covered:** every key below, whether set in `external/application.yml`, as an environment variable (Spring's relaxed binding: `RUNWAY_STORAGE_EXTERNAL` sets `runway.storage.external`), or on the command line. **Where the list comes from.** The kernel builds `META-INF/spring-configuration-metadata.json` from its 18 `@ConfigurationProperties` classes and from `runway-app/src/main/resources/META-INF/additional-spring-configuration-metadata.json`, which describes the keys read through `@Value` or straight from the environment (the demo installer, two size caps, the plugin root and the node name). An IDE uses the same file for completion and type checks. A test (`ConfigurationMetadataTest`) fails the build if a key named in the shipped `application.yml`, or one of the `@Value`/environment keys, is missing from the metadata. Meanings are in [ADMINISTRATION.md](ADMINISTRATION.md) §8 and the section of the manual that owns each feature; the table below is the inventory. "Default" is the value the kernel uses when the key is absent. Where the shipped classpath `application.yml` sets a different value, both are shown. **`runway.app-activity.*`** — the application-realm activity log | Key | Type | Default | |---|---|---| | `enabled` | boolean | `true` | | `retention-days` | int | `90` | **`runway.backups.*`** | Key | Type | Default | |---|---|---| | `max-entry-bytes` | long (bytes) | `268435456` (256 MiB) | | `offsite-dir` | string (path) | _(blank — off)_ | | `retention.max-age-days` | int | `0` (no age limit) | | `retention.max-count` | int | `30` | | `schedule.cron` | string (6-field Spring cron) | `0 30 2 * * *` | | `schedule.enabled` | boolean | `false` | **`runway.bandwidth.*`** | Key | Type | Default | |---|---|---| | `enabled` | boolean | `true` | | `quota.default-monthly-bytes` | long (bytes) | `0` (no cap) | | `quota.per-site` | map: site id → long (bytes) | empty | | `retention-days` | int | `90` | | `snapshot-seconds` | int | `60` | **`runway.cluster.*`** — see *Not covered* below: clustering is opt-in and outside the 1.0 promise. | Key | Type | Default | |---|---|---| | `enabled` | boolean | `false` | | `cluster-name` | string | `runway` | | `topology` | enum `embedded` \| `client-server` | `embedded` | | `session-ttl` | duration | `30m` | | `sessions-map-name` | string | `runway.sessions` | | `events-topic-name` | string | `runway.events` | | `embedded.discovery` | string `tcp-ip` \| `multicast` | `tcp-ip` | | `embedded.members` | list of string | empty | | `embedded.port` | int | `5701` | | `embedded.port-auto-increment` | boolean | `true` | | `client.addresses` | list of string | empty | | `client.smart-routing` | boolean | `true` | **`runway.compression.*`** | Key | Type | Default | |---|---|---| | `enabled` | boolean | `true` | | `max-buffer-bytes` | long (bytes) | `4194304` (4 MiB) | | `mime-types` | list of string (replaces the default list) | `text/html`, `text/xml`, `text/plain`, `text/css`, `text/javascript`, `application/javascript`, `application/json`, `application/xml`, `image/svg+xml` | | `gzip.enabled` | boolean | `true` | | `gzip.min-size` | int (bytes) | `1024` | | `brotli.enabled` | boolean | `true` | | `brotli.min-size` | int (bytes) | `1024` | | `brotli.quality` | int `0..11` | `5` | **`runway.console.*`** — where the operator console answers (host only, read at startup; ADMINISTRATION §8.6) | Key | Type | Default | |---|---|---| | `hosts` | list of host names (case and port ignored) | empty: the default site's host names and host names that serve no site | **`runway.csp.*`** | Key | Type | Default | |---|---|---| | `mode` | enum `report` \| `enforce` \| `off` | `report` | | `default-src` | string | `'self'` | | `script-src` | string | `'self'` | | `style-src` | string | `'self' 'unsafe-inline'` | | `img-src` | string | `'self' data:` | | `font-src` | string | `'self'` | | `connect-src` | string | `'self'` | | `base-uri` | string | `'self'` | | `form-action` | string | `'self'` | | `frame-ancestors` | string | `'self'` | | `report-uri` | string | `/__csp-report` | | `upgrade-insecure-requests` | boolean | `false` | | `strict-dynamic` | boolean | `true` — `'strict-dynamic'` on the nonced kernel surfaces (console, login, recovery, wizard) | | `public-strict-dynamic` | boolean | `true` — public tenant pages get a nonce derived from the page's ETag plus `'strict-dynamic'`, stamped only on the scripts the `script-src` + `extra-hosts` + plugin-host allowlist would have run (never an inline script unless `script-src` has `'unsafe-inline'`); takes effect only while `strict-dynamic` is on and `mode` is not `off` | | `extra-hosts` | list of string | empty | The secret that keys public-page nonces is a file, not a key: `external/csp-nonce.key` (§2). **`runway.demo.*`** — unattended demo install (read via `@Value`) | Key | Type | Default | |---|---|---| | `first-run.id` | string | _(blank — nothing installed)_ | | `first-run.host` | string | _(blank — the demo's own host)_ | | `first-run.master-username` | string | `demo` | | `first-run.master-password` | string (secret) | _(blank)_ | **`runway.endpoints.*`** (read via `@Value`) | Key | Type | Default | |---|---|---| | `max-body-bytes` | long (bytes) | `10485760` (10 MiB) | | `max-form-bytes` | long (bytes) | `262144` (256 KiB) | `max-form-bytes` is the platform's **pre-authentication body budget**: the most body a caller who is **not signed in** can make the server read, on any path. It bounds the form (or multipart) body of a plugin route, which the kernel reads before authentication and the CSRF check (so the check and the route both see it); it also bounds **any** body a caller who is not signed in sends — to the sign-in, setup and password-recovery forms of both realms, to any console path, to the CSP report endpoint, to a `PUT`/`PATCH`/`DELETE` form, and to a plugin route of any method and type. Above it the request is answered `413`; a declared `Content-Length` above it is refused without reading. The effective value is the smaller of the two keys. `max-body-bytes` bounds the body a **signed-in** caller sends to a plugin route (JSON, uploads, raw text), read after security; a signed-in console form keeps the container's limit. Raise `max-form-bytes` only for a plugin whose anonymous forms or uploads really carry more than 256 KiB. (A multipart upload to a kernel path is the exception: it is parsed to temporary files before security under `spring.servlet.multipart.max-request-size`.) **`runway.health.*`** — the per-site `/__health` probe | Key | Type | Default | |---|---|---| | `enabled` | boolean | `true` | | `token` | string (secret) | _(blank — detail off)_ | | `content-check` | boolean | `true` | | `content-check-ttl-seconds` | int | `10` | **`runway.http-cache.*`** | Key | Type | Default | |---|---|---| | `public-pages` | string (`Cache-Control` value) | `public, max-age=300, stale-while-revalidate=60` | | `assets` | string | `public, max-age=86400` | | `immutable-assets` | string | `public, max-age=31536000, immutable` | | `immutable-extensions` | set of string | `woff2, woff, ttf, otf, eot` | There is no `no-store` key: the editor preview and error responses are always `no-store`. A file that sets it starts normally; the key is ignored. **`runway.i18n.*`** | Key | Type | Default | |---|---|---| | `cache-seconds` | int | `5` | **`runway.logs.*`** — per-site log capture | Key | Type | Default | |---|---|---| | `enabled` | boolean | `true` | | `access-log-user-agent` | boolean | `false` | | `max-retention-days` | int | `90` | | `queue-capacity` | int | `8192` | **`runway.metrics.*`** | Key | Type | Default | |---|---|---| | `scrape-token` | string (secret) | _(unset — off; a blank console field keeps a stored token)_ | **`runway.node.*`** (read from the environment) | Key | Type | Default | |---|---|---| | `name` | string | _(blank — the OS host name)_ | **`runway.operator.*`** | Key | Type | Default | |---|---|---| | `ui-languages` | list of BCP-47 codes | `[en, es]` | | `default-language` | string | `en` | **`runway.plugins.*`** | Key | Type | Default | |---|---|---| | `root` | path (read from the environment before startup) | _(blank — `/plugins`)_; the loader and the console's install/uninstall/enable/disable resolve it by one shared rule, so both always use the same folder | | `max-entry-bytes` | long (bytes, `@Value`) | `134217728` (128 MiB) | | `site-files.max-write-bytes` | long (bytes, `@Value`) | `16777216` (16 MiB): the largest single write (and whole-file read) a plugin makes in its per-site subtree through `PluginSiteFiles` | **`runway.protect.*`** — the kernel's edge-rejection logging | Key | Type | Default | |---|---|---| | `log-rejections` | boolean | `true` | | `log-rejection-window-seconds` | int | `60` | **`runway.proxy.*`** | Key | Type | Default | |---|---|---| | `forwarded-headers` | boolean | `true` | | `trusted-cidrs` | list of CIDR | empty (trust nothing); the shipped `application.yml` sets `127.0.0.1/32`, `::1/128` | **`runway.http.*`** | Key | Type | Default | |---|---|---| | `min-request-data-rate` | long, bytes per second | `4096` (`0` = off) | **`runway.reload.*`** — `/__reload/**` | Key | Type | Default | |---|---|---| | `enabled` | boolean | `true` | | `token` | string (secret) | _(blank — the endpoint is absent)_ | **`runway.security.*`** | Key | Type | Default | |---|---|---| | `app-master-id` | string | _(blank — WIZARD mode)_; written by the first-run wizard | | `password-strength` | enum `standard` \| `high` | `standard` | | `max-concurrent-hashes` | int | `8` | | `acquire-timeout-millis` | long (ms) | `2000` | | `secret-key` | string (secret) | _(blank)_; set by the installer as `RUNWAY_SECURITY_SECRET_KEY` | **`runway.storage.*`** | Key | Type | Default | |---|---|---| | `external` | path | `external` (relative to the working directory, which the launcher sets to the release dir) | | `sites` | path | `/sites` | | `backups` | path | `backups` (relative to the working directory) | `runway.storage.stats` (never read) and `runway.storage.logs` (display-only; the kernel writes nothing there) are not keys, so they never enter the promise. A configuration that sets one starts normally and logs one startup `WARN` naming the key; the metadata marks both as removed (deprecation level `error`). **`runway.tls.*`** | Key | Type | Default | |---|---|---| | `enabled` | boolean | `false` | | `keystore` | string (path) | _(blank)_ | | `keystore-password` | string (secret) | _(blank)_ | | `keystore-type` | string | `PKCS12` | | `key-alias` | string | `runway` | | `watch-keystore` | boolean | `true` | | `sni-host-check` | boolean | `true` | | `redirect-http.enabled` | boolean | `false` | | `redirect-http.port` | int | `80` | | `redirect-http.status` | int `301` \| `302` \| `307` \| `308` (any other value stops startup while the redirect is on) | `301` | | `redirect-http.acme-challenges-dir` | string (path) | `./external/acme-challenges` | **Plugin keys: `runway.plugin..*`.** Each plugin owns the prefix `runway.plugin..`; its app-level settings are stored as `external/plugin-settings/.yml` and bound by the plugin's own properties class. The kernel promises the **prefix and the file**; the keys under it are the plugin's contract with its operators and follow that plugin's own versioning. The bundled essential plugin documents its keys in [ADMINISTRATION.md](ADMINISTRATION.md) §12 (`runway.plugin.protection.*`: `rate-limit.*`, `allowlist` and `remember-device.*` on its settings form; `login.*` including `login.captcha.*`, which only seed a fresh install's Login protection panel), and its jar carries its own `META-INF/spring-configuration-metadata.json` for them (`ProtectionConfigurationMetadataTest` fails its build if the file is not generated). **Framework keys** (`server.*`, `spring.*`, `management.*`) belong to Spring Boot and are not covered here. The ones Runway pins on purpose are listed, with the reason for each, in [ADMINISTRATION.md](ADMINISTRATION.md) §8; a change to a pinned value is a changelog entry. ## 2. The data folder: `external/` and `sites//` **Covered:** the location and meaning of every file below. Its *contents* are covered as far as its owner's format goes: YAML stores keep their field names and meanings, properties files keep their keys, and templates are the site's own content. ### The layout marker — `external/layout.yml` ```yaml # Runway data-layout marker. Written by Runway on first start; do not edit or delete it. # ... version: 1 ``` Owner: `mx.quest.runway.storage.DataLayout`, checked by `DataLayoutInitializer` at the very start of every boot — before the plugin loader reads `external/`, before any store, seeder or plugin bean exists. | What is on disk | What Runway does | |---|---| | no `layout.yml` | Writes `version: 1`. Every folder that predates the marker is layout 1 by definition. On a first, WIZARD-mode start against a folder that does not exist yet, nothing is written (nothing to protect); the first start that has a folder writes it. | | `version` ≤ what the build supports | Starts normally; the file is not rewritten. | | `version` > what the build supports | **Refuses to start** ("APPLICATION FAILED TO START", naming the file and both versions). An older Runway must never write into a layout it does not understand. | | unreadable, not a mapping, no `version`, not a whole number, or below 1 | **Refuses to start** rather than guess. | A failure to *write* an absent marker (for example a read-only folder) is logged as a warning and retried on the next start; it never stops a start that worked before the marker existed. **What a layout bump means.** The layout version changes only when a release changes the folder in a way an older release would misread or damage: moving or renaming a file, changing what a field means, or adding data an older release would silently drop when it rewrites a store. That release migrates the folder forward on its first start, then writes the new version. The consequence for operators is the downgrade rule: **after a layout bump, the previous release refuses to start against the migrated folder.** To roll back past a layout bump, restore the copy of `external/` taken before the upgrade. Adding an optional field, file or folder is *not* a layout bump. ### How a YAML store tolerates change Every kernel store reads through `mx.quest.runway.storage.Yaml`, whose mapper has `FAIL_ON_UNKNOWN_PROPERTIES` and `FAIL_ON_NULL_FOR_PRIMITIVES` disabled; each record's compact constructor supplies the default for an absent field. So: - a **newer** file read by an **older** build loads (unknown keys are ignored); an **older** file read by a newer build loads (absent fields take defaults that reproduce the old behaviour); - **but an older build does not preserve keys it does not know when it rewrites a record.** That is exactly why a field whose loss would matter needs a layout bump, and why the layout marker refuses a downgrade instead of relying on tolerance. ### `external/` — platform state (never in a tenant backup) | Path | Owner | Holds | |---|---|---| | `application.yml` | operator; the first-run wizard (`WizardService`) merges the superadmin pin into it | The operator's configuration override (loaded by `spring.config.import`). Keep it mode `600`. | | `layout.yml` | `DataLayout` | The layout marker above. | | `platform.yml` | `PlatformSettingsStore` | Platform settings edited on **Settings → Platform settings**: the default site, platform mail (SMTP), node name, compression and password-strength overrides; and under `settings:` the kernel settings edited on **Settings → Server settings** and the policy cards (full property name → value; `ENC(...)` for a token), loaded at startup below `external/application.yml` (`KernelSettingsInitializer`), declared in the jar's `kernel-settings.yml`. Also `siteQuotas:` (each site's own bandwidth cap in bytes, set on **Sites**, read live), `siteStorageCeilings:` (each site's own storage limit for its files in bytes, set on **Sites**, read live), `embedHosts:` (the hosts approved on **Settings → Embed hosts**: `id`, `label`, `source`, `directives`, read live) and `logLevels:` (logger name → level, set on **Activity → Logs → Log levels**; applied at once on save and again at every start; a `logging.level.*` set in `application.yml` wins over it). | | `app-users.yml` | `AppUserStore` | Application-realm accounts (Argon2id hashes). | | `site-users.yml` | `TenantMasterStore` | Tenant superadmins, each assigned to one or more sites (application-managed, so kept outside every site folder). | | `app-roles.yml` | `RoleStore` | Application-realm custom roles. Validated at startup; an invalid file stops the start. | | `app-grants.yml` | `GrantStore` | Application-realm permission grants. | | `recovery-tokens.yml` | `RecoveryTokenStore` | Hashed, expiring password-recovery tokens (both realms). | | `blocklist.yml` | `StorageLayout.blocklistFile()`; written by the protection plugin's `IpBlocklist` | Manual IP/CIDR blocks. | | `activity/` | `AppActivityLog` | Application-realm activity day-files (`activity-.log`), one line per operator action in the audit journal format below. Pruned after `runway.app-activity.retention-days`. | | `csp-nonce.key` | `PublicPageNonce` | The secret that keys public-page CSP nonces (below). | | `plugins//` | operator / console install (`PluginAdminService`); read by `PluginLoader` | One folder per installed plugin: `plugin.yml`, jars, `static/`, `i18n/`. When `runway.plugins.root` is set, these folders live there instead — for the loader and the console alike. | | `plugin-settings/.yml` | `PluginSettingsService` | A plugin's app-level settings (`runway.plugin..*`), loaded as a property source above `application.yml` and below environment variables and command-line arguments. Only a file named for an installed plugin is loaded, and only its keys under `runway.plugin..`; any other key in the file is ignored, with a warning naming it. A save from the console rewrites the file with the keys the plugin declares, so an undeclared key is dropped. Another file in the folder (the protection plugin's `protection-app.yml`) is that plugin's own data, never configuration. | | `plugin-quarantine/.yml` | `PluginQuarantine` | The marker of a plugin that broke the platform's startup: its version, a checksum of its jars, the reason and the time. While it matches the installed plugin, the plugin stays Blocked; **Retry** on the Plugins screen removes it, and a different version or different jars make it stale, and it is deleted (ADMINISTRATION.md §11). | | `plugin-manifests/.sha256` | the installer (`scripts/install.sh`) | What the installer shipped for a bundled plugin, so an upgrade can tell an operator's edit from a stale copy. | | `seed/site-templates//` | `SeedTemplateStore` | The site-template catalog new sites are born from (`template.yml` plus the seed files). | | `seed/site/` | `SeedTemplateStore` (legacy) | The pre-catalog seed folder; migrated into `seed/site-templates/default` on first run. | | `i18n/operator-messages[_xx].properties` | `OperatorMessageSource` | Optional operator re-translation of the console, above the bundled messages. | | `tls/` | the installer | A copied PKCS12 keystore when Runway terminates TLS itself. | | `acme-challenges/` | operator / ACME client (`runway.tls.redirect-http.acme-challenges-dir`) | Files served at `/.well-known/acme-challenge/`. | | `sites/` | `StorageLayout.sites()` (`runway.storage.sites`) | One folder per site (below). `sites/.restore-work/` is restore scratch space, never a site. | ### The audit journal line format — `activity/*.log` and `sites//logs/audit-*.log` Both journals (the application activity log and each site's audit log) share one format, owned by `mx.quest.runway.log.AuditJournal`. It is **covered**: a monitoring or SIEM pipeline may parse it. - **Files.** One UTF-8 file per **server-local** calendar day: `activity-.log` and `audit-.log`. Lines are only ever appended. - **Line.** Four tab-separated fields, ending in `\n`: ```