Commit Graph

1096 Commits

Author SHA1 Message Date
Eric Callahan c8042a5700
update_manager: add support for extensions
While use of "unofficial" klippy extras an moonraker components
is not officially supported, there is no harm in facilitating
updates for these extensions in the update manager.  This adds
configuration which will restart either moonraker or klipper
after an extension is updated.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-04 11:46:20 -04:00
Eric Callahan 16737d086d
update_manager: add full update tracking
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-04 11:46:20 -04:00
Eric Callahan a4019bce8e
confighelper: add support for optional separators
If "None" is specified as a separator for getdict and the getlist
variants then strings will split along any whitespace character.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-04 11:46:20 -04:00
Eric Callahan 5643c0ffbe
assets: show announcements on welcome page
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-03 12:17:08 -04:00
Eric Callahan 13bb624bd7
app: include announcements in welcome page context
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-03 08:58:31 -04:00
Eric Callahan 156e9652e1
announcements: add internal access methods
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-03 08:37:42 -04:00
Eric Callahan 2edbba3b53
assets: improve welcome page style
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-03 08:37:42 -04:00
Eric Callahan 9b5b3cc506
proc_stats: report system uptime in API request
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-31 16:44:39 -04:00
Eric Callahan 1968beaa0d
app: add a welcome handler
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-30 19:59:27 -04:00
Eric Callahan d11357e5f2
authorization: add status methods
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-30 14:35:39 -04:00
Eric Callahan 8bb020edc6
moonraker: add method to retreive warnings
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-30 14:35:07 -04:00
Eric Callahan b85f3081ab
power: add retries to custom http requests
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-29 15:39:04 -04:00
Eric Callahan 8c7247acbb
announcements: add retries to http request
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-03-29 15:37:24 -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 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 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
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 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 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 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
Eric Callahan 79f867ba83
database: remove debug option
This option was intended for Moonraker developers to live test
changes to write protected namespaces.   This can be accomplished
locally with other methods, thus this option has been removed to
prevent users from compromising sections of the database.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-25 12:38:36 -05:00
pataar 71de8def8e notifier: create the new notifier module
This component will be a bridge between moonraker and https://github.com/caronc/apprise. This way users can easily add all kind of notification services to their printer.

Signed-off-by: Pieter Willekens <me@pataar.nl>
2022-02-23 17:05:55 -05:00
Eric Callahan 54f2ee61d0 machine: report the python version in system_info
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-23 12:01:50 -05:00
Eric Callahan 7679f8063f moonraker: remove the python version check
Moonraker depends on "future" annotations and uses fstrings, so
 versions of Python older than 3.7 will fail to load and never make
 it to the version check.

 Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-23 12:01:10 -05:00
Eric Callahan f83f476f81 moonraker: report the api version
Start tracking the Remote API version separately from the application
version.  This allows the API to stick to semantic versioning while
and track the application version separately.  This is necessary as
we prepare to release a beta.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-23 12:01:07 -05:00
Eric Callahan 7ab1dda772 power: change behavior of "on when queued"
Rename the "on_when_upload_queued" option to "on_when_job_queued",
deprecate the former.  This option now applies to any queued job while
the device is off.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 14:36:46 -05:00
Eric Callahan 2b1a3e5603 klippy_apis: fix blocking issue in start_print and do_restart
The "wait_connected" method would block indefinitely until a klippy
connection is established.  This isn't the behavior we want, we only
want to wait "if" a connection has been established until Klippy
reports that its startup sequence is complete.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 14:34:14 -05:00
Eric Callahan f7f487ac18 database: sort protected namespaces before storing them
This makes the order in which they are reported consistent,
as the namespaces are stored in a set.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan 888fb58c4f database: sync namespace bugfix
Use the transaction object to overwrite keys so that we don't
move the cursor.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan 5f96822c90 database: don't overwrite "get" server errors
Make sure the correct exception is raised when "get_item" fails.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan 2d28a3eeff database: fix typo in http exception
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan 96b00549cf database: validate that namespace exists in ns_contains
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan 0bd12c8dec database: don't allow sync against an empty dict
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan f3cd177a02 database: move_batch() fix
Raise an exception if the key lengths for the source and destination
keys do not match.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan 11e299558d database: fix insert_batch()
If a namespace does not exist insert batch must create a new one rather
than raise an exception.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan bb39a3c1b2 database: handle invalid reduce results
It is possible to reduce to a value that is not a dict in "insert_item()"
and "update_item()".  Raise a ServerError with a clear description of
what went wrong in these situations.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan 89e78b9a00 database: fix type reported in overwrite warning
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan c1104617b6 database: fix typo in sync implementation
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan 3c92f42d49 database: allow synchronous calls before the server starts
It is possible that Moonraker can be instantiated while the eventloop
is running during tests.  To avoid errors allow synchronous calls until
the server starts.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:38 -05:00
Eric Callahan 9ab6d0e83d update_manager: support database changes
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-22 07:47:34 -05:00
Eric Callahan c081fa49a1 history: update for database changes
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan 9e57db0611 file_manager: add method to retreive the metadata storage object
This allows other components to synchronously access and update
metadata if necessary.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan 0dd10ce116 file_manager: update for changes in the database
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan b43f4623fc authorization: update for changes in the database
Since the User DB is not going to be large cache the users
in local memory and sync with the DB when changes are
made to the local user store.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan 46f74329d3 database: reduce duplicate code
Add a _get_db() method that perform the check for existance.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan e2a62f80d4 database: introduce record based operations
Now that all transactions run in a thread it is possible for them to
interleave.  The record based operations allow for batch operations
within a single transaction.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan e029b6c582 database: refactor to remove duplicate code
Wrap command implementations in with a _run_command() method.  All
database commands now return a Future object.  If the command was
run before the eventloop starts its possible to immediately query
the Future's result.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan 65d1f23352 database: add a sync method
Similar to the update method, however sync will remove any
keys in the database not in the new value.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan 781e3e6250 database: combine namespace wrappers
Rather than creating two wrappers, use a single wrapper whose methods
always return a future or awaitable.  If the operation occurs during
the __init__() method of a component it will be syncrhonous, and the
result from the future can be immediately queried.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan 4d0a43cb25 database: refactor initial check for empty keys
Rather than reading out the entire database, attempt to pop off
empty keys in each database.  This should should speed up
init on platforms with slow disk I/O and prevents reading
large namespaces in memory.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan e754d123dd database: improve ns_contains method
It isn't necessary to read out the entire namespace, just attempt
to fetch the record and reduce the key list.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan 43c1b998b0 database: add methods to clear and update a namespace
Since transactions are now threaded we need updating
and clearing a namespace needs to be performed within
one transaction.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan e895b10ac3 database: run transactions in a thread after the eventloop starts
Database transactions can perform disk I/O tasks, which at times will
block the eventloop.  Run all transactions in threads to prevent this
from occuring.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan 1be639b99a eventloop: use the default executor for run_in_thread()
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Eric Callahan ac55b95c1d database: Add unsafe shutdowns to the log rollover
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-17 11:19:57 -05:00
Simon Germain 11f4ae75cc
octoprint_compat: add webcam settings
Signed-off-by: Simon Germain <sgermain06@gmail.com>
2022-02-17 10:46:05 -05:00
Eric Callahan c2861a1391 app: correct location header encoding
SIgned-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-15 14:39:33 -05:00
Eric Callahan e2d92b5575 confighelper: use read_file() rather than read()
The read() method will return an empty list if the file specified
does not exist or if the read failed in some fashion.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-15 11:42:50 -05:00
Eric Callahan 10703321b0 power: fetch the Smart Things token option as a template
This allows users to store their token in a "secrets" file

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-14 06:19:37 -05:00
Mitch Gallman d01b8a9763 power: add support for smartthings switch
power: add support for smartthings switch

Signed-off-by: Mitch Gallman <mitchell.gallman@gmail.com>
2022-02-14 06:12:52 -05:00
Eric Callahan ee11ed2a15 confighelper: fix the get_hash() method
Include the option's values in the hash.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-13 20:48:27 -05:00
Eric Callahan ecfad5cff1 update_manager: add support for application tags
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-13 10:50:28 -05:00
Pedro Lamas cb5ac86af7 metadata: add support for parsing layer count in Cura
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2022-02-10 12:11:20 -05:00
Eric Callahan 94a2949c00 moonraker: report missing klippy requirements
Moonraker requires that some Klipper objects be configured
and loaded.  This check has always been performed and logged,
now track and report missing requirements.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-02-10 08:28:51 -05:00
Eric Callahan b4ddffd5d1 moonraker: refactor KlippyConnection
Move the KlippyConnection class into its own module.  Refactor
init to use loops rather than callbacks, this reduces complexity
of tracking and cancelling callback handles.

All Klippy state previously tracked by the Server is now in the
KlippyConnection.  This improves testing and makes the code
less ambiguous, ie: the `server.make_request()` method is not
as clear as `klippy.request()`.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-09 19:15:11 -05:00
Eric Callahan 737cf8a2cb mooraker: refactor main entry point
Move the version check to the top of the module.   An older version
of python is unlikely to make it beyond the initial import statements,
so print a message to stdout and stderr.

Move argument parsing out of the main method.  This makes it possible
to invoke main without parsing command line arguments, which is useful
for tests.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-02-09 07:35:01 -05:00
Eric Callahan 6efcffa028 moonraker: perform error checking when registering remote methods
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-09 06:48:23 -05:00
Eric Callahan a04e91c046 proc_stats: track the loop blocked count
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-05 20:24:00 -05:00
Eric Callahan 9e9f9ee0fd moonraker: add the SIGTERM handler in server_init()
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-05 06:56:29 -05:00
Eric Callahan 1072958534 authorization: start the prune timer in component_init()
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-05 06:56:29 -05:00
Eric Callahan a5eff12131 proc_stats: start timers in component init
Avoid adding  event loop callbacks in a component's "__init__()" method.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-05 06:56:29 -05:00
Eric Callahan 0f7af929f1 file_manager: suppress "root_update" notifications during init
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-05 06:56:29 -05:00
Eric Callahan 47f0437973 eventloop: add a reset method
Rather than instantiate a new version of the event loop wrapper
we can simply reset the internal event loop.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-04 18:14:46 -05:00
Eric Callahan a5c49e8742 moonraker: refactor init sequence
Don't load components and start the server from within the
__init__() method.  Break those out and call them in __main__().
This makes unit testing individual components possible.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-04 11:54:39 -05:00
Eric Callahan 35d8d88855 confighelper: remove direct component imports
Dont directly import components for instance checks.  Instead
check to see if the type is serializable, if not store the string
representation.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-04 11:20:31 -05:00
Eric Callahan f6d8de2cee utils: move config backup methods to confighelper
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-04 10:58:00 -05:00
Eric Callahan 509759ba0d secrets: fix ConfigParser to Dict conversion
The result should be a dictionary of dictionaries rather than a
dictionary of SectionProxy objects.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-03 17:57:50 -05:00
Eric Callahan 5a966836b5 moonraker: backup the most recent working config
Attempt to take a backup of the configuration file if Moonraker
loads successfully and has not seen a config change.

If Moonraker fails to load due to a config error, attempt to fallback
to the backup configuration.  If that fails, exit the server.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-03 17:19:17 -05:00
Eric Callahan 4ec781d66b confighelper: minor cleanup in get_configuration
Its safer to let the attempt to read fail before additional error
checking.  Also there is no need to remove DEFAULT from
config.sections(), as it can't be there per the Python docs.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-03 12:19:29 -05:00
Eric Callahan ae8cab356b moonraker: gracefully handle invalid log paths
Don't exit the server if the log path is invalid.  Instead start
logging to stdout and add a warning for the user to
resolve.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-03 11:21:34 -05:00
Eric Callahan 0b13e2da44 power: add support for gcode_macro Klipper devices
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-02-03 08:14:48 -05:00
Matthew Humphrey aca7cb78b9 module: power
Add separate output_id configuration attribute for TPLink Smartplug device.

Signed-off-by:  Matthew Humphrey <mhumphrey@gmail.com>
2022-02-02 17:35:18 -05:00
Eric Callahan de796a9ec7 app_deploy: don't update pip
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-30 12:14:09 -05:00
Eric Callahan b4ad6692e3 update_manager: fix klipper path regression
Commit 7401192 introduced a regression where the saved klipper
paths were not loaded into the Update object.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-29 11:03:08 -05:00
Pedro Lamas 287982acdd
power: initial support for Klipper Devices
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2022-01-29 07:53:30 -05:00
Eric Callahan d396dbd2cb utils: add support for versioning shallow clones
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 471885c3a2 git_deploy: add support for shallow clone tags
Shallow clones don't report the tag in git describe, so use
git rev-list to extract the tag and prepend it to the version
string.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 7401192478 update_manager: store klipper paths in the database
If Klipper or its python executable is located at a custom path
this allows moonraker to instantiate its update on startup
rather than wait for Klipper to connect.  This also resolves an
issue where Klipper's update state is always refreshed on startup
when its located in a non-default path.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan ede671f0df app_deploy: handle exceptions in same path check
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 6aecd7b26d machine: add "none" provider
When the "none"  provider is set service action APIs will be disabled
and return an error when called.  Service state tracking is also
disabled.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan b1a232efce update_manager: remove redundant locks
All requests to update, refresh, recover, or reinstall must acquire
the command lock. Given that the individual Deployment implementations
are not (and should not be) called from outside of a request the locks they
use to prevent unwanted re-entry are redundant, confusing, and could
potential result in a deadlock if used improperly.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 0e6fbb12b0 update_manager: add support for PackageKit updates
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 0dbb6d51a8 moonraker: introduce thirdparty package
This allows for the inclusion of 3rd party Python Source
within the Moonraker package.  Initially this includes
a python source file containing PackageKit enumerations.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 4ddd77430a update_manager: move low level package methods to a provider class
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 3b27ab49f1 update_manager: use the machine component to restart services
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan be338ad039 machine: add systemd dbus provider implmentation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 73f0d5503d dbus_manager: add initial implementation
The DBus manager is a core component that connects to the
system bus, providing resources used to communicate with other
processes on the the system through the DBus interface.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 0d6791a320 machine: refactor systemd cli implementation
Move all systemd cli calls to its own provider class, inherted from
a base provider class.  This is in preparation for multiple provider
implementations.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 9b6161a6b0 proc_stats: add stat callback registration
This allows other components to be register callbacks that will
be executed in the stat update timer. This is useful for methods
that wish to poll subprocess commands, as its desireable to
prevent multiple subprocesses from running simultaneously.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan f4c5e808c3 shell_command: add exec_cmd method to factory
This allows for users to execute a method directly rather than
create a command.  This is useful for fire once commands that
do not need to inspect the return code unless there is an error.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 89d0bbdb63 shell_command: add support for sending data to a process
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 8546cd6ac5 shell_command: use a custom protocol for callbacks
Rather than override the Process class instead create a custom
protocol that forwards data over callbacks.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 18:00:21 -05:00
Eric Callahan 9911b5c7dd app: don't allow open redirects in '/server/redirect'
Validate that the URL argument against the `cors_domains` option.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 14:05:48 -05:00
Eric Callahan 0c5a0fd979 wled: add retries to http request
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-28 06:16:54 -05:00
Eric Callahan 209bdc18da power: sleep for 1 second between failed retries
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-01-28 06:12:56 -05:00
Eric Callahan 04477705b0 app: content disposition fix for file names containing commas
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-27 19:21:25 -05:00
Eric Callahan 7fcd84bbe4 power: add retries to http requests
This is an attempt to mitigate 599 errors raised by tornado's
curl based http client.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-27 17:00:08 -05:00
Richard Mitchell 1cac7399f9
wled: deprecate color_order option
Support more synonym strings for colors
Case insensitive string type checks
Show errors in UI if e.g. wrong color was selected
Public color_config not color_order as it has confused users
Fix documentation for white stealthburner example

Signed-off-by:  Richard Mitchell <richardjm+moonraker@gmail.com>
2022-01-25 06:02:36 -05:00
Eric Callahan f5ceefbb8d websockets: log if the connection is proxied
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-21 06:57:52 -05:00
Eric Callahan e103accdfb websockets: refactor open/close logging
Log the User Agent when a websocket is opened.
When a websocket is closed log the close code, close Reason, and
time elapsed since the last pong was recieved from the client.
When Moonraker shuts down send a 1001 Code with Server Shutdown
as the reason.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-20 14:20:23 -05:00
Eric Callahan 09689143b5 shell_command: python 3.10 fix
Remove the deprecated "loop" parameter in asyncio.gather().

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-19 15:18:36 -05:00
Richard Mitchell 5f54a23f3e
Richardjm/wled serial asyncio (#332)
wled: Use pyserial-asyncio for wled

Signed-off-by:  Richard Mitchell <richardjm+moonraker@gmail.com>
2022-01-15 14:22:49 -05:00
Eric Callahan 4c99f99cf0 proc_stats: report system cpu usage
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-12 19:58:49 -05:00
Lukas Fink 3cbc2c2ca8 power: add 'off_when_shutdown_delay' option
This option allows to delay switching off a power source after klippy
shuts down.

Signed-off-by: Lukas Fink <lukas.fink1@gmail.com>
2022-01-12 19:58:25 -05:00
Richard Mitchell cfd3d63a0d
wled: Add serial support for direct communication (#325)
wled: Add serial support for direct communication

Signed-off-by:  Richard Mitchell <richardjm+moonraker@gmail.com>
2022-01-12 19:56:14 -05:00
Eric Callahan 4c087612d8 mqtt: allow internal access to API endpoints
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-12 08:05:17 -05:00
Eric Callahan 2025332e6f button: initial implementation
Adds support for GPIO buttons.  Each button is configured to render
a template when pressed and/or released.  The button event
templates recieve a context with  a "call_method" field, allowing
them to call nearly all Moonraker APIs.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-12 08:05:17 -05:00
Eric Callahan a652845843 moonraker: add register_component() method
Allow base modules to register themselves as components during
initialization.  This makes them accessible via lookup_component()
across the entire application.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-12 08:05:17 -05:00
Eric Callahan 27c65e0a64 application: support internal API consumption
Track registered endpoints and allow internal APIs calls through
their JSON-RPC method names.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-01-12 08:05:17 -05:00
Eric Callahan 3bd5f7edbd template: add support for async rendering
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-12 08:05:17 -05:00
Eric Callahan fc5e34096a gpio: add support for line events
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2022-01-12 08:05:17 -05:00
Eric Callahan 9346186337 gpio: refactor pin parsing
Return a dictionary of pin params rather than a tuple

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-01-06 11:56:41 -05:00
th33xitus 505c1bfdba metadata.py: fix parsing of IdeaMaker nozzle_diameter
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
2022-01-06 11:55:52 -05:00
th33xitus 6c8e3690a7 chore: remove unused import
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
2022-01-05 06:32:09 -05:00
th33xitus 2c732b7afa metadata.py: add parsing of filament name
This commit will add parsing of optional filament name metadata for:
- PrusaSlicer and it's derivatives
- Simplify3D
- Cura
- IdeaMaker

For Cura and IdeaMaker it is necessary to add a custom start g-code comment.
Cura:
;Filament name = {material_name}
IdeaMaker:
;Filament name = {filament_name1}

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
2022-01-05 06:32:09 -05:00
th33xitus d145442d4b metadata.py: add parsing of filament type
This commit will add parsing of optional filament type metadata for:
- PrusaSlicer and it's derivatives
- Cura
- IdeaMaker

For Cura and IdeaMaker it is necessary to add a custom start g-code comment.
Cura:
;Filament type = {material_type}
IdeaMaker:
;Filament type = {filament_name_abbreviation1}

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
2022-01-05 06:32:09 -05:00
th33xitus 20d3c9961d metadata.py: add parsing of nozzle diameter
This commit will add parsing of optional nozzle diameter metadata for:
- PrusaSlicer and it's derivatives
- Simplify3D
- Cura
- IdeaMaker

For Cura and IdeaMaker it is necessary to add a custom start g-code comment.
Cura:
;Nozzle diameter = {machine_nozzle_size}
IdeaMaker:
;Nozzle diameter = {machine_nozzle_diameter1}

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
2022-01-05 06:32:09 -05:00
Pedro Lamas 9d7baa1eb6 utils: fixes minor typo
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2021-12-28 14:13:27 -05:00
Pedro Lamas d997fd637a moonraker: fixes minor typo
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2021-12-28 14:13:27 -05:00
Pedro Lamas 05af4babb9 mqtt: fixes minor typo
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2021-12-28 14:13:27 -05:00
Pedro Lamas 7c5d840c1b zip_deploy: fixes minor typo
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2021-12-28 14:13:27 -05:00
Eric Callahan 1e440741da mqtt: add support for "secret" credentials
Deprecate the "password_file" option in favor of "password".

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-24 14:23:05 -05:00
Eric Callahan c5fd863bb7 power: add support for secrets
The "user", "password", and "token" options are templates
that can resolve items stored in the secrets file.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2021-12-24 14:23:05 -05:00
Eric Callahan a269de5dc0 confighelper: add load_template method
This is an alternative to gettemplate that always returns a
template.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-24 14:23:05 -05:00
Eric Callahan a4f960d40c confighelper: implement deprecation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-24 14:23:05 -05:00
Eric Callahan 9dadf50ac6 templates: add support for secrets
Add the secrets module as a Jinja2 Environment global.
All templates will be able to access secrets as if it were
a dictionary.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-24 12:41:28 -05:00
Eric Callahan d498eefd13 secrets: initial implmentation
Add support for an external "secrets" file that may contain
usernames, passwords, and tokens.  This file may be in
"ini" or "json" format.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-24 12:41:28 -05:00
Eric Callahan f4e3803647 metadata: refactor thumbnail parsing
Check for "Prusa" style embedded thumbnails by default for
all slicers.  This is becoming a standard, as it is now available
in Cura, Ideamaker, and Simplify3D via plugins.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-23 06:38:13 -05:00
Eric Callahan 92954245fa mqtt: implement a "publish_mqtt_topic" remote method
Allow Klipper to publish MQTT topics from gcode macros.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2021-12-22 19:31:00 -05:00
Eric Callahan cc1a55a871 metadata: always create a miniature thumbnail
Don't require that gcode files embed two thumbnails.  When
a single large thumbnail is parsed use pillow to create a
small one.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-22 07:29:16 -05:00
Eric Callahan 5766d16edc octoprint_compat: default printer profile fix
Cura's Octoprint plugin expects an "axes" field for each profile.
Report these values to match the default values used by the
plugin.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-22 05:41:00 -05:00
Eric Callahan ec43f5e9b6 octoprint_compat: make UFP uploads optional
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-22 05:41:00 -05:00
Eric Callahan e2fb1cc931 octoprint_compat: add support for "print on start"
Cura's Octoprint plugin does not set the 'start' flag on uploads
when UFP is enabled.  Instead it waits for the upload to
finish then issues Octoprint's "file command" request.  Add
limited support for this API, mimicing how uploads are normally
handled.

Singed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-22 05:41:00 -05:00
Eric Callahan e46b4994d4 app: add support for empty responses
If a dynamic request handler returns None with "wrap_result"
disabled, set the return status to 204.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-21 18:12:27 -05:00
Eric Callahan b369173f94 app: refactor upload handler registration
Move upload handler registration out of the file manager.
Register the primary hander in the app module, and the
Octoprint Comptaiblity handler in octoprint_compat.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-21 16:53:33 -05:00
Eric Callahan ac9eaa7681 app: set the status to 201 for uploads
Set the location header when the upload returns a valid result.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-21 15:32:28 -05:00
Eric Callahan 3e70e4b4ce machine: report additional release info
Report information contained within a linux distribution's
release file if it exists.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-20 16:58:21 -05:00
Eric Callahan 1333413db7 update_manager: fix pip location resolution
When creating a virtualenv, some operating systems provide
symbolic links back to /usr/bin/python3 rather than copy
the python exectuable over.  Previously Moonraker resolved
this symbolic link, resulting in a failure  to locate pip.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-20 12:30:26 -05:00
Eric Callahan 7d1cf435f7 authorization: report invalid "trusted_clients"
Add warnings that are reported to clients and logged if an
invalid trusted client is detected.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-20 08:37:54 -05:00
Eric Callahan d0b1621bd5 power: add mqtt device support
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-19 08:00:13 -05:00
Eric Callahan f57bddfe4a mqtt: send connect and disconnect events
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-14 17:51:12 -05:00
Eric Callahan 3ac8f8cd81 mqtt: add method to report instance name
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-14 17:51:12 -05:00
Eric Callahan e2b821e90c confighelper: add gettemplate method
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-14 17:51:12 -05:00
Eric Callahan 2142d344dd template: add support for Jinja2 template evaluation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-14 17:51:12 -05:00
Eric Callahan 3f7cc53baa moonraker: don't allow a unix socket to open while closing
Hold the closed mutex in the "connect()" method.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-12 10:24:19 -05:00
Eric Callahan 31dd758d52 moonraker: unix socket fix
Handle connection errors in the read loop.  Set a maximum number
of consecutive errors encountered during a read before aborting.
Resolves #309.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2021-12-12 06:40:53 -05:00
Eric Callahan a4abec43d5 mqtt: fix non-threadsafe on_socket_open callback
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-11 14:31:10 -05:00
Eric Callahan c6cddf4b05 moonraker: logging improvements
Move logging setup to the Server class and enable asyncio debugging.
Sanitize debug logging for all "/access" endpoints so tokens and
passwords are not logged.

SIgned-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-11 14:16:15 -05:00
Eric Callahan c69ded21b0 job_state: initialize in "klippy_started" event
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-11 08:44:55 -05:00
Eric Callahan 08111415be update_manager: auto-refresh fix
Only refresh a provider when the update interval has expired.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-10 11:37:51 -05:00
Eric Callahan 56a98aa8ed update_manager: replace PeriodicCallback
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-10 11:37:51 -05:00
Eric Callahan 511c91829a power: use native asyncio socket streams
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-10 11:37:51 -05:00
Eric Callahan ae4c4ad678 moonraker: use native asyncio unix streams
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-10 11:37:51 -05:00
Eric Callahan df674ae476 proc_stats: replace PeriodicCallback
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2021-12-10 11:37:51 -05:00
Eric Callahan 5dadc2067d data_store: replace PeriodicCallback
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-10 11:32:52 -05:00
Eric Callahan 4e625aef37 authorization: replace PeriodicCallback
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-10 11:32:52 -05:00
Eric Callahan 69a06dd12a eventloop: add a timer class
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-09 14:38:32 -05:00
Eric Callahan 54abd27486 paneldue: multi-extruder fixes
Sort heater response so that the bed is displayed first, followed
by extruders in ascending order.  Set inactive extruders to
"standby" if they are on rather than "active".

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-08 19:31:41 -05:00
Eric Callahan f5f87bf08c file_manager: metadata move fix
If the destination exits in the metadata database it is necessary
to either overwrite it with the source metadata or delete it
so that the new metadata can be rescanned.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-08 15:26:45 -05:00
Eric Callahan 18b84b8d9f file_manager: don't request metadata from non-gcode files
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-08 15:26:45 -05:00
Eric Callahan ec29787edd file_manager: inotify timing fix
Flush pending delete events when move and create events are detected.  This resolves timing issues with rapidfire create/delete events.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-08 15:26:45 -05:00
Eric Callahan 1ad83cec97 mqtt: fix connect/reconnect issues
Handle all potential exceptions.  Run the connect/disconnect
in another thread, as its possible for some calls to block
the event loop.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-06 08:38:27 -05:00
Eric Callahan ac73036857 machine: fix issues with network interface parsing
Don't parse non "ether" types.  Don't add interfaces that don't
have mac addresses and at least one IP address.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-12-05 17:12:21 -05:00