update.yaml
Added in 2.3
This page lists every field in update.yaml, the file that says when Kraft installs a release and restarts itself without being asked to.
auto_update: true
restart_when_free: true
channel: null
allowed_hours: ["01:00-06:00"]
Settings › About writes this file. How the updates work, and what "free" means, is in Update Kraft when it is free.
| Field | Type | Default | Meaning |
|---|---|---|---|
auto_update | boolean | false | Marks each new minor or patch release on the channel for installation when Kraft is free. See Auto-update. |
restart_when_free | boolean | false | Restarts the server on its own when a restart is pending that Kraft did not cause. See Restart when free. |
channel | stable, rc, beta, alpha or unset | unset | The release channel to look for updates on. Unset means the channel of the installed version. The About page's channel choice is saved here. |
allowed_hours | list of HH:MM-HH:MM | [] | When Kraft may install or restart on its own, in the server's local time. Empty means any hour. A range may cross midnight, 22:00-02:00 allowing 23:30 and 01:00. The end is not included. |
Both switches are off until you turn them on. A release you mark on the About page, or with kraft admin update --when-free, installs whatever the switches say, and waits for a free moment and the allowed hours like everything else.
Auto-update
With auto_update on, Kraft looks for a release once a day and marks the newest one of the installed major version. A new major version is never taken this way: it shows on About as available, and installs only when you mark it. It does nothing on a dev install, or on an install that is not a uv tool.
Restart when free
restart_when_free covers the restarts Kraft did not cause: a dev install's after just install, and a settings change that needs one. A release that was marked always restarts when free, whatever this says, because an install left waiting for a manual restart is half done.
How Kraft reads the file
- The file does not exist until the first save in Settings. Without it, every field has its default and Kraft updates and restarts only when you ask.
- Kraft reads the file again on every look, once a minute, so a hand edit takes effect at once. No restart is needed.
- A save in Settings refuses a range that is not
HH:MM-HH:MM, a range that starts and ends at the same time, and a channel that does not exist. - A file that is not valid YAML, holds a key this page does not list, or has a bad range or channel is not used: Kraft logs a warning, once, and installs and restarts nothing until the file is fixed, not even a release you marked or a restart you asked for. About names the file as what it waits on.
- Settings cannot repair a file that does not load: its page and a save read the file first and answer
422, so edit the file by hand. KRAFT_NO_UPDATE_CHECKstops Kraft from looking for releases on its own, and with itauto_update. See Environment variables.
Related
- Update Kraft when it is free: what free means, what a failed update does, and how to mark a release.
- Admin verbs:
--when-freeand--cancel-when-free. - Configuration: the other files in the config directory, and how Kraft rereads them.
Repo libraries
A connected repository's .kraft/ folder as a library: its layout, names, where Kraft reads it from, how a person accepts it, automatic updates, the default chain, and repo-libraries.lock.
Overview
Every key a chain file accepts, from the chain down to each kind of task, plus read_only, extends, icons and canonical paths.