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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>