647 Commits

Author SHA1 Message Date
Eric Callahan
c1e4142a40
update_manager: add arch filter
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-31 14:00:54 -05:00
Eric Callahan
b02e766a4d
update_manager: log detected packages
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-31 14:00:54 -05:00
Eric Callahan
fb618a46fd
file_manager: fix thumbnails endpoint registration
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-31 14:00:33 -05:00
Eric Callahan
55e852cd87
file_manager: add thumbnail request endpoint
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-31 06:13:44 -05:00
Eric Callahan
12b1befcbc
authorizaton: type checking fix
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-24 07:08:23 -05:00
Eric Callahan
d8941b3fb2
websockets: sanitize verbose logging
When verbose logging is enabled sanitize credentials from JSON-RPC
requests and responses.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-24 06:13:54 -05:00
Eric Callahan
80862799ed
websockets: require re-auth on user logout
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>
2023-01-24 06:13:53 -05:00
Eric Callahan
06ec5541e3
websockets: add support for API Key authentication
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-24 06:13:53 -05:00
Eric Callahan
eca4c7e438
authorization: limit failed login attempts
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-24 06:13:52 -05:00
Eric Callahan
5a22b21a40
authorization: relax auth header requirements
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>
2023-01-24 06:13:52 -05:00
Eric Callahan
4ca39bec0a
authorization: authenticate over websocket
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>
2023-01-24 06:13:51 -05:00
Eric Callahan
c83714bfe8
authorization: make api key authentication optional
Signed-off-by;  Eric Callahan <arksine.code@gmail.com>
2023-01-24 06:13:51 -05:00
Eric Callahan
2ad7a6a087
power: log the traceback on device init errors
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-18 19:31:47 -05:00
Eric Callahan
db81607370
machine: use direct systemctl commands for reboot/shutdown
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-16 12:42:21 -05:00
Eric Callahan
a154c5fa51
machine: add moonraker-obico to default services
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-12 18:10:30 -05:00
Eric Callahan
bf63798bb1
simplyprint: fix queue handler import
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-09 07:12:08 -05:00
Eric Callahan
a4b496d135
file_manager: fix internal access check
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>
2023-01-08 13:50:08 -05:00
Eric Callahan
fe9a9899e3
file_manager: reserved path fix
Raise an exception if an attempt is made to access .git folders.

Signed-off-by:  Eric Callahan <arksine.cde@gmail.com>
2023-01-08 13:50:08 -05:00
Eric Callahan
6021b39234
file_manager: implement zip endpoint
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>
2023-01-08 13:49:32 -05:00
Eric Callahan
ecf7fb9267
klippy_connection: add is_printing() and is_ready() methods
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>
2023-01-06 12:20:52 -05:00
Eric Callahan
690f841768
machine: introduce custom allow list for service control
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-02 07:46:43 -05:00
Eric Callahan
b3a9447392
power: add support for multiple bound services
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-02 06:30:18 -05:00
Matt White
e3bcfb5ea0
mqtt: add option to publish states to individual mqtt topics
This change allows the user to choose the strategy for publishing
klipper states to MQTT.  The original strategy where all state
updates are published to a common topic is still the default, but
can be turned off using the "publish_combined_status" config option.

The newly added strategy is publishing individual state updates to
separate mqtt topics.  It is disabled by default, and can be enabled
with the "publish_split_status" config option.

Signed-off-by: Matt White <m.w.white@gmail.com>
2022-12-30 06:13:25 -05:00
Eric Callahan
aeea9a2efd
power: introduce "force" argument for remote method calls
The "force" argument may be used turn on a device during a print
that is otherwise locked for normal requests.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-12-23 19:13:11 -05:00
Pedro Lamas
51fee3e7a1 job_queue: add "reset" parameter to post endpoint
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2022-12-23 08:07:04 -05:00
Eric Callahan
129b0feb81
job_queue: add "jump" endpoint
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-12-22 12:48:23 -05:00
Eric Callahan
f296c6fadd
update_manager: allow old application naming convention
While the [update_manager client ...] naming convention is
deprecated it should not be disallowed.  This fixes service restart
issues using the old naming convention.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-12-12 16:59:22 -05:00
Eric Callahan
dde9bcc752
metadata: add object detection logging
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-30 16:40:36 -05:00
Eric Callahan
1cb46a8f8f
metadata: fix check for existing objects
Don't process files with EXCLUDE_OBJECT_DEFINE gcode
commands.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-30 13:43:39 -05:00
Eric Callahan
f3f39b7ab0
metadata: handle object processing identity
This allows object processing for slicers with aliases.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-28 10:50:40 -05:00
Eric Callahan
f3e13faf19
file_manager: validate Klipper config path
Warn when Klipper's configuration file is not located in
the "config" subfolder of the datapath.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-26 19:30:59 -05:00
Eric Callahan
7b8c2c3409
metadata: add support for A3dp Slicer
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-26 06:22:27 -05:00
Pedro Lamas
b67a08a65b machine: use virtualization.virt_identifier property
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2022-11-22 05:59:18 -05:00
Albert Møller Nielsen
c61ff8b252
simplyprint: preprare for release
Signed-off-by: Albert Møller Nielsen <albert@simplyprint.io>
2022-11-20 19:16:08 -05:00
Eric Callahan
362bc1a3d3
machine: fix typos and clarify supervisord docs
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-18 10:42:44 -05:00
mirokymac
48f3bb2189
machine.py: add support for supervisord service management
Signed-off-by: mirokymac <toufubomb@gmail.com>
2022-11-18 10:37:33 -05:00
Eric Callahan
68f5de6d2d
machine: report canbus info
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-16 14:20:07 -05:00
Eric Callahan
bfe20433f9
mqtt: update compatibility with latest client
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-16 10:11:59 -05:00
Eric Callahan
490d27b7de
extensions; type checking fix take two
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-13 14:30:24 -05:00
Eric Callahan
0c6e860534
extensions: fix type checking for Python 3.7
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-13 14:16:59 -05:00
Eric Callahan
b2d109a840
extensions: serve JSON-RPC API over a unix socket
Support unix connections with full access to all JSON-RPC APIs.
Internally these connections are treated as websocket connections,
however the underlying transport protocol is simplfied.  Packets
are JSON encoded objects terminated with an ETX character.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-10 11:57:21 -05:00
Eric Callahan
f089794adc
websockets: create a client base class
Separate out code that applies to both standard websockets and the
future unix socket implementation.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-09 07:15:33 -05:00
Eric Callahan
bb7cd27be5
machine: fix typo in sudo access request
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-06 11:43:52 -05:00
Eric Callahan
a8018afd46
file_manager: always deny access to .git folders
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-06 10:51:32 -05:00
Eric Callahan
d490796da9
file_manager: fix permission reporting
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-06 10:51:32 -05:00
Eric Callahan
b291d94596
file_manager: implement additional reserved path filters
Do not add inotify watches for reserved paths that exclude
write acccess.  Do not return include reserved paths in
file list requests without read access.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-06 10:51:31 -05:00
Eric Callahan
e8dad1c8c0
file_manager: add list roots endpoint
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-06 10:51:30 -05:00
Misterke
130c2a48f0 file_manager: disallow drilling down protected folders
Signed-off-by:  Kurt Haenen <kurt.haenen@gmail.com>
2022-11-05 10:45:46 -04:00
Eric Callahan
779997c2b8
git_deploy: refresh previously corrupt repos
It is possible that the user manually corrected a corrupt repo.
If a repo makes it past initialization reset the corrupt flag.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-10-22 19:03:48 -04:00
Eric Callahan
1ef34b8b60
machine: improve default database handling
Don't force a symlink to the default database if
the subfolder exits.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-10-22 16:44:51 -04:00