If the "restart_klipper_when_powered" option is set Moonraker will
always abort if Klippy's current state is "ready".
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Refactor the PowerDevice initialize() method so that it acquires the
request lock. Always register the "klippy_started" event if the
"restart_klipper" option is set, and always check if Klipper is is
the ready state before performing the restart. Remove stale
PowerDevice methods no longer used.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The "reboot_machine" and "shutdown_machine" remote methods may
be called from a Klipper gcode macro to accomplish their respective
tasks.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Advise users to use unique credentials, and warn them that unattended
clients can be configured to steal credentials.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This method can be used by other components to check if Moonraker has
access to a particular file or folder.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Don't raise an exeption if the config or log paths are invalid,
add warnings instead. This allows the user to see what is wrong
and resolve this issue.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Make sure that paths registered with full access do not overlap one
another, nor that they overlap sensitive folders such as the database,
Moonraker's source, or Klipper's source.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This option was intended for Moonraker developers to live test
changes to write protected namespaces. This can be accomplished
locally with other methods, thus this option has been removed to
prevent users from compromising sections of the database.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This component will be a bridge between moonraker and https://github.com/caronc/apprise. This way users can easily add all kind of notification services to their printer.
Signed-off-by: Pieter Willekens <me@pataar.nl>
Moonraker depends on "future" annotations and uses fstrings, so
versions of Python older than 3.7 will fail to load and never make
it to the version check.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Start tracking the Remote API version separately from the application
version. This allows the API to stick to semantic versioning while
and track the application version separately. This is necessary as
we prepare to release a beta.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Rename the "on_when_upload_queued" option to "on_when_job_queued",
deprecate the former. This option now applies to any queued job while
the device is off.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The "wait_connected" method would block indefinitely until a klippy
connection is established. This isn't the behavior we want, we only
want to wait "if" a connection has been established until Klippy
reports that its startup sequence is complete.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This tool may be used to backup and restore Moonraker's lmdb
database without depending on the "lmdb-utils" package. The
backup is done to a plain text file in cdb format, so a backup
may be restored on any platform.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Initialize the temporary directory in a "session_args" fixture that is session
scoped. Move the Klippy process to a session scope, restarting the process
only when necessary. This combination speeds up tests as it reduces disk
I/O and the overhead of starting the Klippy process for each test.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This makes the order in which they are reported consistent,
as the namespaces are stored in a set.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Correctly encode the query string. Use the query string for DELETE
requests in addition to GET requests.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
It is possible to reduce to a value that is not a dict in "insert_item()"
and "update_item()". Raise a ServerError with a clear description of
what went wrong in these situations.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
It is possible that Moonraker can be instantiated while the eventloop
is running during tests. To avoid errors allow synchronous calls until
the server starts.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>