2129 Commits

Author SHA1 Message Date
Eric Callahan
98bb40bd80
utils: add kernel version
Move the kernel version tuple calculation out of gpio.py into
the utils package so its available for any module that requires
it.  In addition, report the kernel version string with the distribution
info and log the platform in the rollover header.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-03-11 06:26:18 -04:00
Eric Callahan
10dfb0d477
update_manager: improve instance detection
Implement instance package wide for the update_manager.  This
only requires detecting multiple instances once and eliminates
costly calls to git.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-03-11 06:26:17 -04:00
bakatrouble
6b1b8c5102
metadata: support multiple filament lengths for prusaslicer
Signed-off-by: Aleksey Frolov <bakatrouble@gmail.com>
2024-03-05 19:42:59 -05:00
Eric Callahan
f0ae51792f
power: add support for custom Homeseer ports
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-03-01 05:50:03 -05:00
Eric Callahan
9813011db2
build: pin smart_open to 6.4.0 or lower
This is a temporary workaround to resolve a bug in smart_open 7.0.
Moonraker does not depend on smart_open directly or use its
functionality, however `streaming_form_data` pulls in in.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-26 05:54:41 -05:00
Eric Callahan
0850c16b00
sensor: require the 'state_response_template'
The sensor configuration isn't useful unless the user configures a
template that calls "set_result" to update fields for the desired
template.  Remove the default payload template and require
that it be configured.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-24 06:05:07 -05:00
Eric Callahan
90e13c07f7
git_deploy: fix initialization regression
New repos have not yet saved the valid state, so it is necessary to
provide a default value when attempting to access the "is_valid"
field.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-24 05:40:33 -05:00
Eric Callahan
119f579a44
git_deploy: improve refresh error handling
Save repo state if an exception is raised during a refresh
attempt.   Add additional repo warnings with for better
descriptions regarding repo issues.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-23 18:22:38 -05:00
Thijs Triemstra
aadff0d54e
docs: fix fluidd link
Signed-off-by: Thijs Triemstra <info@collab.nl>
2024-02-19 19:54:29 -05:00
Eric Callahan
e87ab4a895
build: remove pdm.lock
Currently Moonraker's dependencies aren't managed by PDM.
Remove the lockfile and badge.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2024-02-17 14:00:16 -05:00
Kamil Domański
04b1103778 Allow configuring the update refresh window
This enables customizing the time of day within which periodic refresh occurs.

Previously docs said it happens between 12am-4am which is misleading,
because the code effectively allowed refresh until 4:59:59 AM.
The default window is now '0-5', which is practically the same as before.

The comment about checking every 24h hours has been fixed as well.
This hasn't been true since commit c4fa76f21792943ea512d24326259f01d2fa7e89

Signed-off-by: Kamil Domański <kamil@domanski.co>
2024-02-17 12:41:51 -05:00
Eric Callahan
65a8271925
spoolman: fix exception handling
Make sure the connection delay isn't skipped if the
error list is full.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-14 20:34:33 -05:00
Eric Callahan
67c98f6a76
announcements: push notification for internal announcements
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-07 10:55:41 -05:00
Eric Callahan
f946e6a28d
sysfs_devs: implement mode query
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-03 11:47:23 -05:00
Eric Callahan
71b46cc768
build: bump preprocess-cancellation in pyproject
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:35:01 -05:00
Frank Tackitt
d18021950d
build: bump preprocess_cancellation to 0.2.1
0.2.1 ensures that the exclude_object markers are the first
 non-comment g-code in the files, fixing issues with klipper adaptive
 meshing

Signed-off-by: Franklyn Tackitt <git@frank.af>
2024-02-01 10:34:08 -05:00
Eric Callahan
71517b255d
machine: dont allow usb id request to block initialization
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:28:20 -05:00
Eric Callahan
6ec37fdacc
docs: add new doc structure for peripheral requests
This adds a new structure for API documentation, making each
aspect visible and uniform.  The parameters, response, and
schema are collapsible, allowing for easier navigation.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:28:20 -05:00
Eric Callahan
931e88b9f0
docs: move to material theme
The material theme is more feature complete and flexibile,
providing better documentation for APIs and such.  This
commit is just the initial move.  The documents are functional,
but the layout and color schemes are subject to change.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:28:19 -05:00
Eric Callahan
948b842351
docs: add peripheral API documentation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:28:14 -05:00
Eric Callahan
145968af0f
sysdevs: report paths for all devices
While a hardware UART generally won't have symlinks in the "by-path"
and "by-id" folders, it is possible to configure udev to add them.
In addition, adding these fields makes the schema consistent.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:27:22 -05:00
Eric Callahan
6f4a0480f3
machine: add video peripheral API request
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:27:22 -05:00
Eric Callahan
522b4df989
sysfs_devs: add v4l2 video campture device detection
Signed-off-by:  Eric Callahan  <arksine.code@gmail.com>
2024-02-01 10:27:21 -05:00
Eric Callahan
eb1599fa07
machine: add support for peripheral queries
Implement endpoints to query the following:
- Serial Devices (including Hardware UART)
- USB Devices using lsusb
- Klipper CAN Node UUIDs

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:27:21 -05:00
Eric Callahan
0fb997285b
sysfs_devs: hardware discovery utils using sysfs
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:27:21 -05:00
Eric Callahan
d6c8d6d3a6
server: add method to get individual app args
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:27:20 -05:00
Eric Callahan
088a7e4e70
server: create a misc folder in the datapath
This folder contains miscellaneous files used by Moonraker
or other applications in the Klipper ecosystem.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:27:20 -05:00
Eric Callahan
2cebf5cc03
cansocket: utility for querying klipper can nodes
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:27:19 -05:00
Eric Callahan
61ea86033a
docs: update changelog and configuration docs
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-28 06:12:13 -05:00
Eric Callahan
896cd8c41e
klippy_connection: exclude configfile attrs from subscription cache
The configfile "config" and "settings" attributes never change, and
therefore do not need to be stored in the subscription cache.  They
can be significantly large, so this change can free up some memory
on low resource systems.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-28 05:55:50 -05:00
Eric Callahan
4b9973826e
file_manager: add "enable_config_write_access" option
Some installations, such as those in public areas, may wish disallow
changes to the configuration.

This option defaults to True, so no change in behavior is introduced.

Signed-off-by:  Eric  Callahan <arksine.code@gmail.com>
2024-01-28 05:55:29 -05:00
Eric Callahan
bc18e3174a
server: load "authorization" as a core component
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-28 05:42:22 -05:00
Eric Callahan
c756a9029a
authorization: don't raise config errors
Don't raise an exception if the default source is incorrect as this
disables authorization.  Fallback to moonraker.  When supplied an
invalid CORS domain warn the user and skip adding it to the list.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-27 19:51:34 -05:00
Eric Callahan
43efe40cd8
authorization: report more details in /access/info
Add "login_required" and "trusted" fields.  The "login_required"
field indicates that force_logins is enabled and at least one
user has been created.  The "trusted" field indicates that the
connection is configured as trusted.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-27 19:42:59 -05:00
Eric Callahan
3f7cae09bb
git_deploy: specify branch in clone command
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-27 17:31:27 -05:00
Eric Callahan
52ebc2b404
application: fix cors check
It is necessary to perform a cors check before authenticating
the user to make sure that the headers are set if authentication
fails.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-27 17:04:39 -05:00
Eric Callahan
f44fc4b85b
docs: update changelog and add note about trusted domains
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-22 12:42:25 -05:00
Eric Callahan
d1f97f2658
authorization: fix blocking call to socket.getfqdn()
If the upstream DNS server is not available the call to socket.getfqdn()
will block until a timeout occurs.  This blocks Moonraker's event loop,
resulting in carnage.

Call getfqdn() in a thread with a timeout of 5 seconds.  In addition,
only request the fqdn if the user has one or more trusted domains
configured.  Finally, cache resolved  FQDNs for 24 hours to limit
repeated DNS queries.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-22 12:03:01 -05:00
Eric Callahan
3d44c51613
docs: minor spelling fixes
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 13:50:30 -05:00
Eric Callahan
d10ce8772d
docs: add zip type documentation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:06 -05:00
Eric Callahan
652bb46f60
spoolman: improve connection error reporting
Reduce verbosity in release mode and add connection status to the log rollover.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:05 -05:00
Eric Callahan
994123e92e
update_manager: use ZipDeploy to instantate web types
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:05 -05:00
Eric Callahan
8010c51521
app_deploy: add support for web types
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:05 -05:00
Eric Callahan
55454a300e
zip_deploy: bring up for usage
This performs a significant refactor to the ZipDeploy class, making it near identiical to WebClientDeploy.  Zipped applications have the same
"release_info" requirement as web clients.  Unlike web clients, they may also
configure the dependency and service options available to git repos.

The ZipDeploy class can also support we clients, eliminating duplicate code
and the need to keep web_deploy.py.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:04 -05:00
Eric Callahan
daad786072
git_deploy: move generic dependency methods to app_deploy
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:04 -05:00
Eric Callahan
b620ebbc29
docs: document status endpoint and notification
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:03 -05:00
Eric Callahan
d410731faa
spoolman: add a status notification
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:03 -05:00
Eric Callahan
a5128f06ad
spoolman: add a status endpoint
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:02 -05:00
Eric Callahan
bf9223225c
eventloop: fix timer reentrancy
Avoid running multiple callbacks if a timer is stopped and restarted
in quick succession.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:02 -05:00
Eric Callahan
d4316d9878
spoolman: refactor tracking
Use a python dict to act as a queue for reporting used filament
per spool.  This eliminates the need for locks and resolves
potential issues with spool changes when the Spoolman
service is not available.

In addition, add support for tracking multiple tools

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-21 08:24:02 -05:00