feat: Add scheduled runs and Kuma ping
Add systemd user units for daily execution and send an Uptime Kuma push on each run.
This commit is contained in:
parent
4ab799c156
commit
413766ed2b
6 changed files with 67 additions and 0 deletions
|
|
@ -565,6 +565,16 @@ def join_matrix_room(homeserver: str, room_id: str, token: str, timeout: float)
|
|||
return
|
||||
|
||||
|
||||
def send_uptime_kuma_ping(timeout: float) -> None:
|
||||
push_url = os.getenv("UPTIME_KUMA_PUSH_URL")
|
||||
if not push_url:
|
||||
return
|
||||
try:
|
||||
fetch_response(push_url, timeout=timeout, user_agent="check-for-updates")
|
||||
except Exception as exc:
|
||||
print(f"Uptime Kuma push failed: {exc}", file=sys.stderr)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description="Check for webservice updates")
|
||||
parser.add_argument("--config", default="services.yaml", help="Path to services YAML")
|
||||
|
|
@ -622,6 +632,7 @@ def main() -> int:
|
|||
summary, should_notify = build_summary(results)
|
||||
if should_notify:
|
||||
send_matrix_message(summary, args.timeout)
|
||||
send_uptime_kuma_ping(args.timeout)
|
||||
return 0
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue