Commit Graph

1850 Commits

Author SHA1 Message Date
Eric Callahan a232260713
webcam: support lookup by UID
Expose the UID assigned to webcams and allow clients to fetch, modify,
and delete items based on the UID.  New additions must not specify a
UID.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-09-28 08:08:37 -04:00
Eric Callahan ee62d07c68
zeroconf: use route prefix for zeroconf/ssdp servers
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-09-22 07:55:10 -04:00
Eric Callahan d98f11b98e
docs: note route_prefix option
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-09-20 12:42:30 -04:00
Eric Callahan ae1d3b0393
app: implement route prefix option
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-09-15 16:33:05 -04:00
Eric Callahan 3d9052d711
git_deploy: detached head verification fix
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-08-14 08:13:51 -04:00
Eric Callahan fe120952ee
docs: note "include_monitors" arg for the temperature store
Signed-off-by:   Eric Callahan <arksine.code@gmail.com>
2023-08-03 07:57:36 -04:00
Eric Callahan 47f0f0c21e
data_store: add support for temp monitors
Temperature Monitors may report null values as temperatures,
thus special handling is needed.  This commit also reworks
temperature store updates to use the subscription cache
rather than perform its own caching of "last temps".

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-08-03 06:13:21 -04:00
Eric Callahan 797c62389d
docs: add links to Klipper's status reference
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-31 16:44:23 -04:00
Eric Callahan 8adda52df1
docs: update changelog
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-31 16:42:46 -04:00
Eric Callahan e433252934
paneldue: use cached subscription data
Now that all subscriptions are cached it is no longer required for
the paneldue component to cache its own printer state.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-31 11:19:04 -04:00
Eric Callahan d3bab5de94
klippy_apis: support subscription callbacks
This callback will only fire after a component has requested
a subscription, preventing early updates while the component
is waiting for the subscription request to complete.  It is still
valid for components to register the "server:status_update"
event handler if this behavior is not a concern.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-30 16:30:00 -04:00
Eric Callahan 7e85ac97c9
klippy_connection: cache subscription data
It is possible that a subscripition request can occur between
after Klipper updates a field's status, but before it pushes
a status update to the connection.  The result is a race
condiiton where the response to the subscription request
contains the lastest state but it is not propagated to
currently connected clients.

This is resolved by caching subscripiton data, diffing it
with the response to the subscription request, and
manually pushing the diff.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-30 15:35:13 -04:00
Eric Callahan 8ad19e6054
web_deploy: return repo name in status response
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-30 15:35:13 -04:00
Eric Callahan 6467cc6b89
klippy_connection: refactor KlippyRequest class
Wrap a Future instead of an Event, as we don't need to notify multiple
waiters. Additionally the future can return responses and raise exceptions
directly.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-30 15:35:13 -04:00
Eric Callahan c3697d0656
klippy_connection: apply a mutex to the subscription request
The subscripition request is reentrant in Klippy.  Sending multiple
requests from the same connection may create a race condition,
so use a lock to prevent reentry.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-30 15:35:12 -04:00
Eric Callahan 7c8d68c0a1
components: fix pycodestyle E721 warnings
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-30 15:34:56 -04:00
Eric Callahan f487de77bc
webcam: make sure db values are type correct
A previous bug in the webcam module could have set boolean
values as integers.  Make sure they are type correct when
reading webcams from the db.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-28 16:28:04 -04:00
Eric Callahan a22033ac49
webcam: fix boolean updates
In Python a "bool" is a subclass of int.  When introspecting
a webcam's attributes it is necessary to check for booleans
before integers.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-28 15:24:38 -04:00
Eric Callahan 937c766ded
docs: add environment variable documentation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-26 07:29:41 -04:00
Eric Callahan 1857eecb36
install: use environment vars for service env file
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-25 19:36:18 -04:00
Eric Callahan 22d1fda655
machine: use env vars for service validation
Use Moonraker's environment variables when generating the
env file for service validation updates.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-25 19:35:43 -04:00
Eric Callahan a0a50442f7
server: add support for enironment variables
Allow all command line arguments to be specificed as an
environment variable.  If both the command line argument
and environment variable is present the command line argument
takes precedence.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-25 16:27:11 -04:00
Eric Callahan aebcd00f61
docs: note the anomalies field for update status
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-24 18:12:12 -04:00
Eric Callahan 5a0dde2017
update_manager: introduce anomalies field
This allows Moonraker to report anomalies detected in an updater
that won't prevent an update.  Front ends may decide to present
these to users in a more subtle fashion so they know the state of
the repo without being concerned of an issue.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-24 16:57:44 -04:00
Eric Callahan 871c551134
git_deploy: remove untracked file warnings
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-24 15:30:25 -04:00
mista-funky fe52bc5b6d
power: tplink smartstrip fix
Correct the procedure for setting the child id for devices that control more than one outlet.

Signed-off-by: Rick Marino <rcmarino@gmail.com>
2023-07-22 06:34:29 -04:00
Eric Callahan 821f3c5161
docs: note unixsocket commandline option
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-22 06:17:57 -04:00
Eric Callahan 1fadae885e
server: allow commandline unix socket configuration
Add a command line option that allows the installation to specify
the exact path to Moonraker's unix domain server socket.  The
default location remains at:

<data_path>/comms/moonraker.sock

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-22 06:17:56 -04:00
Eric Callahan fdc3e0eb0b
docs: document changes to update_manager
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-21 06:11:00 -04:00
Eric Callahan 3e1919b46e
git_deploy: improve pristine detection
Detect untracked source files and modified files for each
configured repo.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-21 06:11:00 -04:00
Eric Callahan ac876b9271
server: bump API version to 1.3.0
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-15 16:15:45 -04:00
Eric Callahan 9b1eed534b
update_manage: move web update deployer to its own module
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-14 12:43:57 -04:00
Eric Callahan f46cc32be3
update_manager: move package management to its own module
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-14 12:40:18 -04:00
Eric Callahan 4f785cfca0
update_manager: clarify web client git warning
When the parent folder of a web client is a git repo note the specific
directory that contians a .git subdirectory.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-14 12:40:17 -04:00
Eric Callahan db27fef6f2
git_deploy: only return tags merged in the remote branch
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-13 10:31:39 -04:00
Eric Callahan 0437d1623e
git_deploy: improve recovery implementation
After performing a recovery attempt to reset to the commit the
repo was at prior to the repo failure.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-13 08:22:29 -04:00
Eric Callahan 4443bfbd41
update_manager: improve package manager logging
Assign a custom prefix for the configured provider.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-13 07:58:41 -04:00
Eric Callahan 01141fa10e
git_deploy: validation improvements
Add a check for shallow repos and move validation logic to the
GitRepo class.  Additionally report the real number of commits behind.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-13 07:58:41 -04:00
Eric Callahan 51e3568aac
update_manager: add git repo instance detection
Use git-config to set track the current Moonraker instance managing a
a git repo.  If multiple  instances are detected log and create a repo
warning.

Singed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-13 07:58:40 -04:00
Eric Callahan 011179ca6d
git_deploy: improve submodule validation
Submodules contain a .git file that includes the path to the
actual repository folder.  Extract that path and use it for
lock file detection.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-13 07:58:40 -04:00
Eric Callahan 270c78d8af
git_deploy: refactor initialization
Use git-branch to determine current the current branch and
head state instead of git-status.  The former is a porcelain
command with guaranteed output.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-13 07:58:40 -04:00
Eric Callahan 3f1e9e397e
update_manger: log remaining refresh time on init
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-12 13:57:27 -04:00
Eric Callahan 1c16233da0
git_deploy: rollback improvements
Streamline the rollback defaults so only one dict object
is explicitly defined in "capture_state_for_rollback()".
Validate the rollback branch on detached heads before
setting it.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-12 13:57:26 -04:00
Eric Callahan 9651923f8e
git_deploy: fetch partial clones for hard recovery
It isn't necessary to download and decompress all blobs.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-12 13:57:26 -04:00
Eric Callahan 3e875b583c
git_deploy: add support for stable updates
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-12 13:57:25 -04:00
Eric Callahan 1a4480e74c
git_deploy: use versions utility
Use the newly implemented versions utility for git version parsing.
This allows for simple access to version information and
version comparison.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-12 13:57:25 -04:00
Eric Callahan bdd1d93708
versions: software version parsing utility
The versions module contains classes that can parse
Python and Git versions, providing methods to access
the version details.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2023-07-12 13:57:25 -04:00
Eric Callahan 69710e10e0
update_manager: reset to correct commit after recovery
If a git repo not configured on the dev channel it is necessary
to move the HEAD to the commit for the correct tag.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-12 13:57:24 -04:00
Eric Callahan 41d945803f
update_manager: replace string choices with enums
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-12 13:57:24 -04:00
Eric Callahan c903dd6af4
update_manager: implement update rollback support
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-12 13:55:47 -04:00