Add an exc_info parameter that optionally takes an
exception that is passed to the logging function. This
will log the traceback without an additional logging call.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The default behavior of systemd is to remove shared memory
files when the user that created them logs out. This breaks
instance ID tracking for most installations. While its possible
to overcome this by changing the user type or the logind
configuration, these solutions required elevated privileges.
The simple solution is to store iids in a temporary file, with
access protected by a flock.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Implement instance package wide for the update_manager. This
only requires detecting multiple instances once and eliminates
costly calls to git.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This enables customizing the time of day within which periodic refresh occurs.
Previously docs said it happens between 12am-4am which is misleading,
because the code effectively allowed refresh until 4:59:59 AM.
The default window is now '0-5', which is practically the same as before.
The comment about checking every 24h hours has been fixed as well.
This hasn't been true since commit c4fa76f21792943ea512d24326259f01d2fa7e89
Signed-off-by: Kamil Domański <kamil@domanski.co>
This is consistent with the http_client. The argument "attempts" is more
accurate than retries, as the first attempt is not a retry.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Previously the Klipper repo location can be changed outside of
the lock. If the location of the Klipper path is moved while an autorefresh is occurring it is possible for Moonraker to call refresh
and/or notify_update_refreshed before the repo has been initialized.
This commit moves the re-assignment of the "klipper" updated inside
the lock. In addition AppDeploy._is_valid is now defined in the
__init__() method.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
If the Klipper installation is not updatable (ie not a git repo)
abort reinstantion of the deployer.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
When the parent folder of a web client is a git repo note the specific
directory that contians a .git subdirectory.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Use git-config to set track the current Moonraker instance managing a
a git repo. If multiple instances are detected log and create a repo
warning.
Singed-off-by: Eric Callahan <arksine.code@gmail.com>
This functionality was intended to allow for an automated
reinstallation between "git_repo" and "zip" types. The
"zip" type remains unused, and attempting to automate
this would likely be unreliable.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Require that "web" installations provide release info to validate
existing installations. For known web clients provide a fallback
that uses the manifest to validate the installation.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This endpoint allows clients to refresh items on an individual basis
when the "name" parameter is specified. This endpoint replaces
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Several components throughout Moonraker determine whether or not
Klipper is printing or is ready before taking action. This centralizes
queries in one area. The checks do not query Klipper directly but
rather rely on subscriptions to push state to Moonraker.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
It that "git status" will not detect some repo issues, these are only
found after a fetch. When this condition is detected save the repo
state and report that the repo is corrupt and invalid.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Allow components to register reserved paths, then perform reserved
path validation it upon request. Reserved paths may be registered as
read-only or no access. Any request to modify an file/folder that is
either reserved or a child of a reserved path is rejected.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Check for updates every 7 days rather than every 28 days. This
is in preparation of an upcoming beta release.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Don't require the `app_params` argument, instead dynamically
generate the configuration from a dict. This simiplifies AppDeploy
initialization as the internally generated configurations can be
read in the same way as those supplied in moonraker.conf.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>