Implement management API #26

Merged
albert merged 15 commits from u/albert/24/api into main 2026-05-01 03:49:56 +00:00
Owner

This change implements a management API and Web interface with the following features:

  • Show the current running activity
  • Adjust the amount of time remaining for the current activity, or stop it altogether
  • List all configured activities
  • Explicitly enable or disable a given activity today, overriding any rule-based conditions
  • Adjust the volume
  • View per-activity daily usage statistics

This is accessible from the local network only.

Configuration rewriting is not implemented in this PR as the API is only optionally authenticated. This compromise was needed to avoid an out-of-the-box RCE vulnerability (even if it's limited to the local network).

Fixes #24

This change implements a management API and Web interface with the following features: * Show the current running activity * Adjust the amount of time remaining for the current activity, or stop it altogether * List all configured activities * Explicitly enable or disable a given activity today, overriding any rule-based conditions * Adjust the volume * View per-activity daily usage statistics This is accessible from the local network only. Configuration rewriting is not implemented in this PR as the API is only optionally authenticated. This compromise was needed to avoid an out-of-the-box RCE vulnerability (even if it's limited to the local network). Fixes #24
This allows the HUD to receive events from the API. Tested with session
adjustments and volume.
Delete maintenance mode
Some checks failed
CI / Clippy (pull_request) Failing after 4m10s
CI / Test (pull_request) Failing after 4m48s
CI / ShellCheck (pull_request) Failing after 7s
CI / Build (pull_request) Successful in 6m53s
CI / Rustfmt (pull_request) Successful in 3m50s
46e8736c99
It was never specified or implemented
Fix CI
All checks were successful
CI / Build (pull_request) Successful in 3m44s
CI / Test (pull_request) Successful in 4m7s
CI / ShellCheck (pull_request) Successful in 8s
CI / Clippy (pull_request) Successful in 5m16s
CI / Rustfmt (pull_request) Successful in 3m17s
93d6d0373a
Author
Owner

This is probably worth a mention in the README along with screenshots prior to merge

This is probably worth a mention in the README along with screenshots prior to merge
Author
Owner

The bind option doesn't seem to be working with anything other than 0.0.0.0...

The `bind` option doesn't seem to be working with anything other than 0.0.0.0...
Don't delete the .gitkeep when building the frontend
All checks were successful
CI / Build (pull_request) Successful in 3m53s
CI / Test (pull_request) Successful in 4m20s
CI / ShellCheck (pull_request) Successful in 7s
CI / Clippy (pull_request) Successful in 4m49s
CI / Rustfmt (pull_request) Successful in 3m16s
27c636d3f2
Author
Owner

The warnings always seem to obey the original limit from when the activity was started. If the remaining time is changed, they do not update to reflect the new value.

The warnings always seem to obey the original limit from when the activity was started. If the remaining time is changed, they do not update to reflect the new value.
pngcrush the rest of the README images
All checks were successful
CI / Build (pull_request) Successful in 4m33s
CI / Test (pull_request) Successful in 6m25s
CI / ShellCheck (pull_request) Successful in 7s
CI / Clippy (pull_request) Successful in 6m39s
CI / Rustfmt (pull_request) Successful in 5m48s
e2f7e37fc0
Fix warnings after deadline changes via API
All checks were successful
CI / Build (pull_request) Successful in 4m48s
CI / Test (pull_request) Successful in 5m3s
CI / ShellCheck (pull_request) Successful in 7s
CI / Clippy (pull_request) Successful in 5m11s
CI / Rustfmt (pull_request) Successful in 4m14s
1f7bfe567d
Fix incorrect UTC date usage
All checks were successful
CI / Test (pull_request) Successful in 4m31s
CI / Clippy (pull_request) Successful in 4m30s
CI / Build (pull_request) Successful in 4m38s
CI / ShellCheck (pull_request) Successful in 8s
CI / Rustfmt (pull_request) Successful in 2m51s
f00b3ea344
For overrides and usage time statistics, we care about today in the
local time zone, not UTC.
albert merged commit 517611a69e into main 2026-05-01 03:49:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
albert/shepherd-launcher!26
No description provided.