This switches Moonraker from calling `CANCEL_PRINT` and alikes
to rather use `pause_resume/` API that underneath calls
the relevant G-Codes.
This done, this way, allows Klipper to be able to interrupt
blocking operations gracefully.
Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
Keep track of the number of unsafe shutdowns a machine experiences. This data is useful in diagnosing potential file system issues and issues with the datbase itself.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
It is invalid for a namespace to contain a top level key represented as an empty bytestring. If this is detected, log the result and drop the invalid key.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Some slicers create a temporary file during export, then rename the file with gcode extension after completion. If file metadata does not exist during an attempt to move metadata, scan the file.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Shutdown the websocket and http server before doing final component cleanup. This prevents clients from making a request after components have been closed.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This removes the cryptography dependency in favor of libsodium. Also removed is python-jose, as we must generate our own JWTs for use with EdDSA.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
use libnacl instead of pynacl
Systemd units are case sensitive, do not convert the "name" argument for service requests to lower case.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
MoonCord and KlipperScreen have been added to supported services. The "/machine/system_info" endpoint now returns a list of available services that moonraker may control.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Home Assistant returns an empty response when switching a switch
on or off. Will now requery the switch status and return it's result
Signed-off-by: Alan Harper <alan@aussiegeek.net>
Clients can use this in situations where a browser may
prompt the user to take action prior to sending the
request. After the user accepts, Moonraker will redirect the user to the url provided in the request.
SIgned-off-by: Eric Callahan <arksine.code@gmail.com>
The addition of inotify can introduce scenarios where file transfers complete abruptly, resulting in a corrupt/incomplete file.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The logic used to sync requests to modify contents in hidden directories is no longer necessary, thus removed.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The metadata won't always depict an actual change to the content of a file. Compare a hash of the file content rather than retrieve modified times to determine if it is necessary to install dependencies.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Re-entrant calls to "run" and "run_with_response" would poison the process state resulting in unexpected behavior. Use a lock to prevent this.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Reset the command tracking data before each retry. If the command is cancelled by the user immediately break.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Attempt to recover from "loose object" error in git status and git fetch commands. It is no longer necessary to run git fsck on every refresh attempt, only run it after a recovery attempt.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
When no callback is set for stderr, the outputfrom stderr is piped to stdout. This makes setting the callback redundant.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Image files (.png) are still granted unauthorized access, however all other files require that the request be authorized.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>