Provide a new websocket implementation that creates a near one to one
bridge with a Unix Socket connection to Klippy. This may be used to
access Klippy APIs not otherwise available over the primary websocket,
such as the various "dump" commands.
Unlike the primary websocket Moonraker does not decode or inspect
data that passes through the bridge.
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>
Re-implement pip updates using a pinned version. A version
check is now always done prior to installing python requirements,
updating when necessary.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Parse system packages and python requirements prior to and after each
updating, using the difference to determine if an update is necessary.
Only the new detected packages are installed unless the "force" variable
is set.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Handle a race condition where a shutdown event could be received
from the webhooks subscription during initialization.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
module: Adding OctoEverywhere to the default service list.
Adding OctoEverywhere to the default service list in machine.py so future installs of moonraker will allow the octoeverywhere service to be managed from frontends.
Signed-off-by: Quinn Damerell <quinnd@outlook.com>
Unix sockets never require authentication and it is possible for
Websocket connections to authenticate with the request itself.
In these cases the `identify` endpoint must still process an
access_token if provided, as it allows the front end to assign
the desired user to the connection.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Propagate user state changes to open websockets and unix sockets.
If a websocket's user is logged out require re-authentication.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Don't raise an exception if the authorization header contains an
invalid value, such as Basic auth. Ignore it and move on to the
next step in authentication.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Register all of the "access" endpoints with the websocket. Front
ends may now connect to the websocket without an oneshot token
and login. If the front end already has a JWT for the user it
can be passed to the "identify" endpoint to authenticate directly.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Include the reserved file check in the `can_access_path()` method. This
fixes a potential vulnerability in the notifier where it may be possible
to attach a reserved file to a notification.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Provides an API for front ends to archive a list of files and/or
folders into a single zipped file.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Move logger initialization out of the utils module into its own
module, loghelper.py. This manager class simplifies access to the
underlying logger implementation and the queue listener. Additionally
it allows for endpoint registration.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
On systems where Klipper is installed as a service allow a
manual log rollover. The rollover cannot be called while printing.
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>