Commit Graph

1267 Commits

Author SHA1 Message Date
Eric Callahan 384ab71d72
docs: update announcement APIs
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-25 17:26:58 -04:00
Eric Callahan 242fabe7ad
announcements: don't capitalize the feed
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-25 15:48:15 -04:00
Eric Callahan d74d1e7612
moonraker: bump the API version
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-25 15:41:49 -04:00
Eric Callahan 829b3b5c98
announcements: refactor RssFeed class
Don't require a config object to instantiate and don't attempt
to wrap database namespace.  These changes allow instantation
after the server has started.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-25 15:08:54 -04:00
Eric Callahan 5757347994
http_client: use the simple client
While the curl based client is better in most respects, it requires
that libcurl be against with an asynchronous DNS resolver, such
as c-ares, in order to prevent blocking.  As of now it Debian does
not ship with a version of curl with ares enabled.  Fall back to the
simple client until this can be resolved.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-25 12:45:46 -04:00
Eric Callahan 81a482f83d
announcements: add support for temporary dismissals
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-25 12:45:46 -04:00
Eric Callahan 64b6029559
announcements: remove warnings on failure
Its possible for users to have an unstable internet connection.  Log
connection errors rather than warn.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-25 12:45:46 -04:00
Eric Callahan cd03b91f87
announcements: add support for dynamic feed registration
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-25 12:45:42 -04:00
Eric Callahan 88b0282900
announcements: dont cache feeds
The parsed feeds are stored in the DB, so there is no
need to cache the result when 304 is returned.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-24 19:15:13 -04:00
Eric Callahan 561f5f4230
http client: minor logging fix
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-24 18:21:48 -04:00
Eric Callahan 4b0685852e
announcements: remove stale code
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-24 17:40:15 -04:00
Eric Callahan 1bdedd009f
power: fix tasmota command encoding
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-24 14:46:46 -04:00
Eric Callahan ac8c44095a
docs: add announcement documentation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-24 12:08:24 -04:00
Eric Callahan 209ace4728
gitignore: ignore .devel and .venv folders
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-23 10:37:13 -04:00
Eric Callahan 3b208c6889
moonraker: add announcements to core components
Bump Moonraker's the API version to 1.0.2 with the addition of new
endpoints.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-23 10:37:13 -04:00
Eric Callahan b1cc766576
announcements: initial implementation
This adds support for announcements retreived via RSS feed from
the "moonlight" GitHub repo.  Announcements may also be procedurally
generated internally.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-23 10:37:12 -04:00
Eric Callahan 4a6732f13a
confighelper: implement method to read a dictionary
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-23 10:37:12 -04:00
Eric Callahan 790d77756e
app: fix blocking I/O
Open and close static files to be read using the default
thread pool executor.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-23 10:37:11 -04:00
Eric Callahan 27466984df
update_manager: fix blocking I/O
When using tempfile.TemporaryDirectory it is possible that
exiting the context will block when attempting to delete
the temporary directory.  Don't use the context manager,
instead create and cleanup the temp dir using the default
threadpoolexecutor.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-23 10:37:11 -04:00
Eric Callahan faf956c65d
update_manager: use the http_client component
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-23 10:37:11 -04:00
Eric Callahan 5bf112bcbc
power: use the http_client component
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-23 10:37:10 -04:00
Eric Callahan 0abb831ea0
moonraker: remove references to Tornado's http client
Add the http client wrapper to core components.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-23 07:07:11 -04:00
Eric Callahan 43b19d8a83
http_client: shared client implementation
This abstracts the tornado http client from the rest of Moonraker,
allowing all components to access the client's most used functionality
without importing tornado modules.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-23 07:07:10 -04:00
Eric Callahan 4b27e5e41d
scripts: pin pyserial to version 3.4
The pyserial-asyncio dependency pins pyserial to any version
greater than 3.4.  Currently pip is distributing version 3.5,
which is not an official stable release.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-23 07:06:15 -04:00
dependabot[bot] d20d2fd07e build(deps): bump pillow from 9.0.0 to 9.0.1 in /scripts
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.0.0 to 9.0.1.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.0.0...9.0.1)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-23 06:48:07 -04:00
Mathis Mensing ee312ee9c6 docs: fix incorrect identify method
Signed-off-by: Mathis Mensing <matmen@dreadful.tech>
2022-03-10 13:57:43 -05:00
pataar a700725681 docs: fix an incorrection in the notifier example
Signed-off-by: Pieter Willekens <me@pataar.nl>
2022-03-08 10:45:25 -05:00
Eric Callahan efeea0d8e1
docs: document connection identify endpoint
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-04 19:56:13 -05:00
Eric Callahan 052dd5e338
moonraker: bump API Version
Addition of a  the "server.connection.identify" API warrants a bump in th
micro version.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-04 19:42:27 -05:00
Eric Callahan 3667e0d41f
websockets: implement server.connection.identify method
Provide a remote method by which clients may identify their
name, version, and type.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>

fix

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-04 19:42:27 -05:00
Eric Callahan b86e86aff2
websockets: report hostname and connected time
By retreiving and storing the hostname in the websocket
header, it is possible to determine a fully qualified domain
used to reach the instance.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-04 14:20:06 -05:00
Eric Callahan 221df0937d
machine: fix typo in cpu description parser
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-02 19:25:53 -05:00
vertigo235 26d6ca009a notifier: Add paused and resumed events to notifier
So we can tell when our printers need our attention. 

Signed-off-by: Josh Jones (vertigo235) <jbjonesclt@gmail.com>
2022-03-02 16:48:06 -05:00
Eric Callahan 94c51c9412
scripts: bump preprocess-cancellation to 0.2.0
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-01 15:45:28 -05:00
pataar 9d49659884 notifier: add support for 'attach' property
Signed-off-by: Pieter Willekens <me@pataar.nl>
2022-03-01 11:13:32 -05:00
Gregor Majcen 553f8862b5 notifier: typo at `job_state:completed`
Signed-off-by: Gregor Majcen <majcn.m@gmail.com>
2022-03-01 08:56:47 -05:00
Eric Callahan b6fc692500
dbus_manager: clarify warnings
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-28 06:57:38 -05:00
Eric Callahan 6065e9a0fe
docs: add tip to resolve additional polkit warnings
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-28 06:32:04 -05:00
Eric Callahan c87d8d2e51
docs: fix reference to the test client
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-27 20:55:03 -05:00
Eric Callahan f93fed62ae
docs: update power documentation
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>
2022-02-27 08:39:28 -05:00
Eric Callahan c165c40146
power: improve device initialization
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>
2022-02-27 07:47:12 -05:00
Eric Callahan 970c8a4181
power: move process_request to the device class
Perform the entire request within a lock to prevent rentry until
the request completes.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-26 20:10:27 -05:00
Eric Callahan 0d93cf2c39
docs: respect OctoPrint's case
Make sure that all references capitalize the "P" in OctoPrint.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-26 10:48:53 -05:00
Eric Callahan 8f7f824a47
octoprint_compat: respect OctoPrint's case
Make sure that the "P" in Print is capitalized when referencing
OctoPrint.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-26 10:48:52 -05:00
Eric Callahan 65e76aeec8
docs: document remote methods registered by machine
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>
2022-02-26 10:48:52 -05:00
Eric Callahan ab09364a98
docs: provide additional context for the secrets module
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>
2022-02-26 10:48:51 -05:00
Eric Callahan 2bc43ec3df
docs: warn users about overlapping folders
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-26 10:48:51 -05:00
Eric Callahan fd8bde7185
file_manager: implement access check method
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>
2022-02-26 10:48:51 -05:00
Eric Callahan a32bf4a47a
file_manager: allow server to start with invalid paths
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>
2022-02-26 10:48:50 -05:00
Eric Callahan 3a384e62dd
file_manager: add registered directory validation
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>
2022-02-26 10:48:48 -05:00