This is a workaround for an issue where the http client fails to propogate an exception back to the caller, hanging the update process.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Attach "is_complete" to the response so clients know that the transaction is done, even though it resulted in an error.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The entire configuration should be validated prior to device initialization. In the event of an error, the GPIO Chip factory must be closed.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
We need to be sure that the entire update_manager is correctly configured prior to queueing the callbacks for the initial refresh. Rather than have each updater spawn a "refesh" callback, move them all into a single init method spawned after the module has been fully configured.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The server can still operate and be used to fetch the logs if a plugin fails to load. Add a 'failed_plugins' field to the /server/info response so clients can notify users that this plugin failed to load.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Previously this check was only on done when a directory was requested by the API. Moving this check to _list_directory ()updates metadata for internal calls as well.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The slower system package update will now only executed by the auto-refresh routine. Moonraker will check for updates roughly every 2 hours, however system packages updates will only occur between 1am and 4am local time.
If a print is in progress any attempt to refresh or update will be aborted.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This should reduce the load on low perfomance devices. This also makes it possible to queue update requests.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Calls to "refresh" should not be allowed to occur while a client a current refresh is in progress. Updates will wait for a pending refresh to complete before beginning the update procedure.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
It is possible for the log files to be registered after a rollover, which can result in the file not existing. Force the log endpoints to register, bypassing the existance check.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Instead make sure that the supplied path is not the system root and check that moonraker has the appropriate privileges to access the directory.
Also track visited directories when retreiving a full file list to prevent infinite recursion.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This provides the update manager flexibility, such as the ability to define disto specific dependencies. This also fixes an issue where two updates are necessary to install additional dependencies.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This allows the config object to read additional config files as requred. Also implement a "get_options" method that can be used to retrive a dictionary of all options in the current section.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
After a repo has been updated fetching the remote is not needed, as it was just done in the prior update step.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Track rate limit attributes and reject requests when the user IP has reached their limit. Use conditional API requests to reduce the number of requests that count against the limit.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
It shouldn't be necessary to use gen.with_timeout during the fetch with tornado 6.1. Also fix some potential issues with unbound timeouts variables.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The remote version info can be retrieved by simply doing a git fetch, then running "git rev-parse" and "git describe" on the desired remote branch.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Allow developers to update a detached git repo. Note that this option should not be used on production machines.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Clear partial output and cancelled attributes prior to each call of run(). This allows a command to be cleanly run again after a failure.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This allows Moonraker to update its paths to Klippy immediately upon a successful response from the info endpoint.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This will make klippy.log available in the event that Klippy has not successfully connected, assuming the log is available at the default location.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>