Commit Graph

1640 Commits

Author SHA1 Message Date
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 53eda78b11
loghelper: moonraker log management
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>
2023-01-06 12:20:54 -05:00
Eric Callahan 24dc8914d0
klippy_connection: implement manual log rollover
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>
2023-01-06 12:20:53 -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 019c5fc416
app: move reserved endpoints to klippy_connection
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-06 06:14:45 -05:00
Eric Callahan 225ec588eb
docs: document allowed services
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-02 07:46:44 -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 358aee956b
docs: clarify power on start usage
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-12-27 10:37:10 -05:00
Eric Callahan 1999b82a86
docs: update power documentation
Note how to override SDCARD_PRINT_FILE to power on
a device before a print starts.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-12-26 08:29:24 -05:00
Eric Callahan d6b1a724a8
eventloop: improve callback handling
Wrap all callbacks in a coroutine that handles exceptions.  This
should eliminate "task not retreived" errors.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-12-24 08:07:45 -05:00
Eric Callahan 3d3911d4fd
docs: document the "force" power option
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-12-24 06:37:18 -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 a6b8a8a3e9 docs: add "reset" parameter to post endpoint
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2022-12-23 08:07:04 -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 f7d8af6e12
docs: add the "jump queue" API
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-12-22 14:09:15 -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 e628b243c2
docs: add canbus to /machine/system_info result
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-16 16:52:20 -05:00
Eric Callahan 88ebc21318
requirements: update distro 1.8.0
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-16 14:33:47 -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 bd1fd63b14
requirements: update python dependencies
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-16 10:11:59 -05:00
pataar 7afd556c21 notify: upgrade apprise to version 1.2.0
Signed-off-by: Pieter Willekens <me@pataar.nl>
2022-11-16 10:10:50 -05:00
Markus Küffner 8b2e8c2a4e scripts: update streaming-form-data dependency
Updates streaming-form-data to Version 1.11.0 to be compatible with Python 3.11.0

Signed-off-by: Markus Küffner <kueffner.markus@gmail.com>
2022-11-16 10:09:23 -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 7f58f2274e
docs: add unix socket documentation 2022-11-13 12:32:07 -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 53129bef7e
utils: add method for retrieving unix socket peercred
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-09 07:15:33 -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 5a3b1b6e5c
docs: fix list roots endpoint
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-11-07 07:54:43 -05:00
Eric Callahan ddf3325dae
docs: document list roots
Update documentation to note that the uds now supports
templates.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-06 11:48:00 -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 36536535bc
klippy_connection: update configuration
Use the ConfigHelper's getpath() method to configure the
unix socket.  The option may now be a template where the
datapath is passed into the context.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-06 10:51:31 -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