Commit Graph

1931 Commits

Author SHA1 Message Date
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
Eric Callahan 26975e055b
update_manager: fix klipper instantiation on path switch
Signed-off-by:  Eric  Callahan <arksine.code@gmail.com>
2023-07-12 13:50:47 -04:00
Eric Callahan 504a3a76f5
common: reduce jrpc exception spam
When a client repeatedly makes a request that results in an error
the log is spammed with tracebacks that don't provide significant
value.  The method name, code, and error message should be
enough for basic troubleshooting.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-09 13:48:01 -04:00
Eric Callahan d51820f48c
metadata; use python's logging module
Replace calls to `log_to_stderr` with standard logging.<level> calls.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-09 12:01:27 -04:00
Eric Callahan 5691a4f162
shell_command: don't log the program name
When logging stderr in realtime omit the program name.  It often
does not provide useful context.  The program itself can provide
context through its own logging facilities.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-09 11:31:29 -04:00
Eric Callahan c3c3170451
file_manager: log metadata response in real time
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-09 11:31:19 -04:00
Eric Callahan e6b32cabbe
app: log incoming upload requests
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-09 08:19:13 -04:00
Eric Callahan 8eddec88cb
dbus_manager: handle all PolKit interface errors
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-06 16:56:11 -04:00
Eric Callahan a7e154fbe4
changelog: note job_queue bugfix
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-29 12:30:59 -04:00
Eric Callahan b36f5a4eee
common: log method name for JSON RPC Errors
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-29 12:20:52 -04:00
Eric Callahan 499d9adbe0
job_queue: don't run transition gcode on start
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-29 11:28:10 -04:00
Eric Callahan 5d8422ec52
docs: correct spoolman API documentation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-27 16:25:51 -04:00
Eric Callahan 93f473f629
spoolman: correct API registration
Internal Moonraker APIs must be registered with a top level path of
"server" or "machine".

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-27 16:23:56 -04:00
Eric Callahan 2ef4dc4d8e
update_manager: fix initial name parsing
This fixes an issue where a configuration name with spaces
may not match the reported name.

Signed-off-by:  Eric Callahan <arksine.code>
2023-06-27 12:26:58 -04:00
Eric Callahan 5f43536612
update_manager: update base channel config
Allow independent channel configuration for Moonraker and
Klipper.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-27 12:16:57 -04:00
Eric Callahan a1e786fd73
update_manager: fix defaults for base configuration
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-27 12:10:19 -04:00
Eric Callahan 07544718fa
docs: note the 'spoolman_set_active_spool' remote method
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-26 18:10:33 -04:00
Eric Callahan a237ba3735
spoolman: add remote method to set active spool
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-26 16:52:13 -04:00
Eric Callahan 56499f9269
docs: note update_manager config changes
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-26 16:48:48 -04:00
Eric Callahan f6770e2865
server: improve event exception handling
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-26 16:48:48 -04:00