Log the current user for each request. Dont' log requests that return with 200, 204, 206, or 304 in release mode.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
A Moonraker component may now register a namespace as "forbidden". API requests have no read/write access to forbidden namespaces and this cannot be overridden by the database debug option.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
CONFIG CHANGE: This deprecates the "enabled" option in the [authorization] section. Authorization will be enabled if the section is included in moonraker.conf, otherwise it will be disabled.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Force an update to cached file hashes should the modified time change. Re-enable the "should_return_304" check so clients can re-implement caching.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Adds a simple implementation for parsing filament weight from Cura g-code with help of a custom start-g-code comment.
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This will parse the total used filament weight of g-code files created by Simplify3D, PrusaSlicer, SuperSlicer and ideaMaker
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
Some static files, such as logs, can change size during a request. This results in a content length mismatch and error. Cap the amount read based on the original content length.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This fix will now correctly parse the used filament from g-code generated by ideaMaker. The used filament is located in the footer of the g-code file.
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
Add a timer parameter to shelly and tasmota integration.
Use case: 3D printer mains power is connected to one of these devices. Just turning off the smart switch will just kill power to the RaspberryPI. Adding a timer will allow the PI to shutdown cleanly before killing the power
Signed-off-by: Dominik Weis fsironman@gmail.com
This allows protected namespaces to be modified externally. This is for dev use only, modifying protected namespaces can potentially corrupt the database.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This fixes a bug where it is protected namespace can be modified in an optional component if that component is disabled.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
add a check and handle consequently in case tasmota device is only one relay and would return a power value when asked a power1 value
Signed-off-by: Arnaud Schaer <arnaud.schaer@wanadoo.fr>
The Klipper repo always initializes last. Send a notification at this time, so if any clients are connected they can receive the full update status after init.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
During normal updates dependencies will always been updated when necessary. It is possible to force a dependency updating using the new "/machine/update/recover" endpoint.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Gives callers flexibility as to which signal is used to cancel a command first. By default shell_command will start with SIGTERM, then proceed to SIGKILL.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Rather than attempt to automate recovery, provide an endpoint for clients
to initiate. Clients can choose between a "hard" recovery, which removes
a corrupt repo and restores from a backup, or a "soft" recover which attempts
a git clean followed by a git reset.
Backups are now only taken when a valid repo is detected.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>