Skip to content

Commit d60b852

Browse files
committed
docs: add documentation for latest changes to the update manager
Signed-off-by: Eric Callahan <[email protected]>
1 parent dacd9f7 commit d60b852

File tree

2 files changed

+97
-16
lines changed

2 files changed

+97
-16
lines changed

docs/configuration.md

+38-10
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,22 @@ enable_auto_refresh: False
394394
# When set to False Moonraker will only fetch update state on startup
395395
# and clients will need to request that Moonraker updates state. The
396396
# default is False.
397-
distro: debian
398-
# The disto in which moonraker has been installed. Currently the
399-
# update manager only supports "debian", which encompasses all of
400-
# its derivatives. The default is debain.
397+
enable_system_updates: True
398+
# A boolean value that can be used to toggle system package updates.
399+
# Currently Moonraker only supports updating packages via APT, so
400+
# this option is useful for users that wish to experiment with linux
401+
# distros that use other package management applications, or users
402+
# that prefer to manage their packages directly. Note that if this
403+
# is set to False users will be need to make sure that all system
404+
# dependencies are up to date. The default is True.
405+
channel: dev
406+
# The update channel applied to Klipper and Moonraker. May be 'dev'
407+
# which will fetch updates using git, or 'beta' which will fetch
408+
# zipped beta releases. Note that this channel does not apply to
409+
# client updates, a client's update channel is determined by its
410+
# 'type' option. When this option is changed the next "update" will
411+
# swap channels, any untracked files in the application's path will be
412+
# removed during this process. The default is dev.
401413
```
402414

403415
### Client Configuration
@@ -412,8 +424,9 @@ service restart such as Fluidd/Mainsail.
412424
```ini
413425
# moonraker.conf
414426

415-
[update_manager client client_name]
427+
[update_manager client_name]
416428
type: web
429+
# Indicates that this is a web client.
417430
repo:
418431
# This is the GitHub repo of the client, in the format of user/client.
419432
# For example, this could be set to cadriel/fluidd to update Fluidd or
@@ -426,22 +439,29 @@ persistent_files:
426439
# themes. The default is no persistent files.
427440
```
428441

429-
This second example is for git repositories that have a service that need
430-
updating. Note that git repos must have at least one tag for Moonraker
442+
This second example is for "applications". These may be git repositories
443+
or zipped distributions.
444+
445+
Note that git repos must have at least one tag for Moonraker
431446
to identify its version.
432447

433448
```ini
434449
# moonraker.conf
435450

436451
# service_name must be the name of the systemd service
437-
[update_manager client service_name]
452+
[update_manager service_name]
438453
type: git_repo
454+
# Can be git_repo, zip, or zip_beta. See your the client's documentation
455+
# for recommendations on which value to use. Generally a git_repo is
456+
# an applications "dev" channel, zip_beta is its "beta" channel, and zip
457+
# is its "stable" channel. This parameter must be provided.
439458
path:
440-
# The absolute path to the client's files on disk. This parameter must be provided.
459+
# The absolute path to the client's files on disk. This parameter must be
460+
# provided.
441461
# Example:
442462
# path: ~/service_name
443463
origin:
444-
# The full GitHub URL of the "origin" remote for the repository. This can
464+
# The full git URL of the "origin" remote for the repository. This can
445465
# be be viewed by navigating to your repository and running:
446466
# git remote -v
447467
# This parameter must be provided.
@@ -468,6 +488,14 @@ enable_node_updates:
468488
# to package-lock.json. Note that if your project does not have a
469489
# package-lock.json in its root directory then the plugin will fail to load.
470490
# Default is False.
491+
host_repo:
492+
# The GitHub repo in which zipped releases are hosted. Note that this does
493+
# not need to match the repository in the "origin" option, as it is possible
494+
# to use a central GitHub repository to host multiple client builds. As
495+
# an example, Moonraker's repo hosts builds for both Moonraker and Klipper.
496+
# This option defaults to the repo extracted from the "origin" option,
497+
# however if the origin is not hosted on GitHub then this parameter must
498+
# be provided.
471499
```
472500

473501
## `[mqtt]`

docs/web_api.md

+59-6
Original file line numberDiff line numberDiff line change
@@ -2057,6 +2057,10 @@ and `fluidd` are present as clients configured in `moonraker.conf`
20572057
]
20582058
},
20592059
"moonraker": {
2060+
"type": "zip_beta",
2061+
"channel": "beta",
2062+
"need_channel_update": false,
2063+
"pristine": true,
20602064
"remote_alias": "origin",
20612065
"branch": "master",
20622066
"owner": "Arksine",
@@ -2084,6 +2088,10 @@ and `fluidd` are present as clients configured in `moonraker.conf`
20842088
"remote_version": "v1.10.0"
20852089
},
20862090
"klipper": {
2091+
"type": "zip_beta",
2092+
"channel": "beta",
2093+
"need_channel_update": false,
2094+
"pristine": true,
20872095
"remote_alias": "origin",
20882096
"branch": "master",
20892097
"owner": "KevinOConnor",
@@ -2133,9 +2141,23 @@ Below is an explanation for each field:
21332141
reported as seconds since the epoch (aka Unix Time).
21342142

21352143
The `moonraker`, `klipper` packages, along with and clients configured
2136-
as git repos have the following fields:
2137-
2138-
- `owner`: the owner of the repo
2144+
as applications have the following fields:
2145+
2146+
- `configured_type`: the application type configured by the user
2147+
- `detected_type`: the applicaiton type as detected by Moonraker.
2148+
- `channel`: the currently configured update channel. For Moonraker
2149+
and Klipper this is set in the `[update_manager]` configuration.
2150+
For clients the channel is determined by the configured type
2151+
- `need_channel_update`: This will be set to `true` if Moonraker has
2152+
detected that a channel swap is necessary (ie: the configured type does
2153+
not match the detected type). The channel swap will be performed on the
2154+
next update.
2155+
- `pristine`: For `zip` and `zip_beta` types this is set to `true` if an
2156+
applications source checksum matches the one generated when the app was
2157+
built. This value will be set to the opposite of "dirty" for git repos.
2158+
Note that a zip application can still be updated if the repo is not
2159+
pristine.
2160+
- `owner`: the owner of the repo / application
21392161
- `branch`: the name of the current git branch. This should typically
21402162
be "master".
21412163
- `remote_alias`: the alias for the remote. This should typically be
@@ -2146,9 +2168,14 @@ as git repos have the following fields:
21462168
- `current_hash`: hash of the most recent commit on disk
21472169
- `remote_hash`: hash of the most recent commit pushed to the remote
21482170
- `is_valid`: true if installation is a valid git repo on the master branch
2149-
and an "origin" set to the official remote
2150-
- `is_dirty`: true if the repo has been modified
2151-
- `detached`: true if the repo is currently in a detached state
2171+
and an "origin" set to the official remote. For `zip` and `zip_beta`
2172+
types this will report false if Moonraker is unable to fetch the
2173+
current repo state from GitHub.
2174+
- `is_dirty`: true if the repo has been modified. This will always be false
2175+
for `zip` and `zip_beta` types.
2176+
- `detached`: true if the repo is currently in a detached state. For `zip`
2177+
and `zip_beta` types it is considered detached if the local release info
2178+
does not match what is present on the remote.
21522179
- `debug_enabled`: True when `enable_repo_debug` has been configured. This
21532180
will bypass repo validation allowing detached updates, and updates from
21542181
a remote/branch other than than the primary (typically origin/master).
@@ -2175,6 +2202,32 @@ The `system` package has the following fields:
21752202
- `package_list`: an array containing the names of packages available
21762203
for update
21772204

2205+
### Perform a full update
2206+
Attempts to update all configured items in Moonraker. Updates are
2207+
performed in the following order:
2208+
2209+
- `system` if enabled
2210+
- All configured clients
2211+
- Klipper
2212+
- Moonraker
2213+
2214+
HTTP request:
2215+
```http
2216+
POST /machine/update/full
2217+
```
2218+
JSON-RPC request:
2219+
```json
2220+
{
2221+
"jsonrpc": "2.0",
2222+
"method": "machine.update.full",
2223+
"id": 4645
2224+
}
2225+
```
2226+
Returns:
2227+
2228+
`ok` when complete
2229+
2230+
21782231
#### Update Moonraker
21792232
Pulls the most recent version of Moonraker from GitHub and restarts
21802233
the service. If an update is requested while a print is in progress then

0 commit comments

Comments
 (0)