diff --git a/BACKLOG.md b/BACKLOG.md index af180f0..a186ffc 100644 --- a/BACKLOG.md +++ b/BACKLOG.md @@ -1,4 +1,4 @@ -# Backlog: check-for-updates +# Backlog: service-update-alerts ## US-01 - Curated Webservice Dataset diff --git a/README.md b/README.md index 06fb787..aed1677 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# check-for-updates +# service-update-alerts Small Python script to compare running service versions against upstream releases. @@ -57,14 +57,14 @@ Copy the unit files and enable the timer: ```bash mkdir -p ~/.config/systemd/user -cp systemd/check-for-updates.service ~/.config/systemd/user/ -cp systemd/check-for-updates.timer ~/.config/systemd/user/ +cp systemd/service-update-alerts.service ~/.config/systemd/user/ +cp systemd/service-update-alerts.timer ~/.config/systemd/user/ systemctl --user daemon-reload -systemctl --user enable --now check-for-updates.timer +systemctl --user enable --now service-update-alerts.timer ``` View logs: ```bash -journalctl --user -u check-for-updates.service +journalctl --user -u service-update-alerts.service ``` diff --git a/check_updates.py b/check_updates.py index 58136d8..b759382 100644 --- a/check_updates.py +++ b/check_updates.py @@ -536,7 +536,7 @@ def send_matrix_message(message: str, timeout: float) -> None: fetch_response( url, timeout=timeout, - user_agent="check-for-updates", + user_agent="service-update-alerts", extra_headers=headers, data=payload, method="PUT", @@ -556,7 +556,7 @@ def join_matrix_room(homeserver: str, room_id: str, token: str, timeout: float) fetch_response( url, timeout=timeout, - user_agent="check-for-updates", + user_agent="service-update-alerts", extra_headers=headers, data=b"{}", method="POST", @@ -570,7 +570,7 @@ def send_uptime_kuma_ping(timeout: float) -> None: if not push_url: return try: - fetch_response(push_url, timeout=timeout, user_agent="check-for-updates") + fetch_response(push_url, timeout=timeout, user_agent="service-update-alerts") except Exception as exc: print(f"Uptime Kuma push failed: {exc}", file=sys.stderr) @@ -580,7 +580,7 @@ def main() -> int: parser.add_argument("--config", default="services.yaml", help="Path to services YAML") parser.add_argument("--all", action="store_true", help="Show all services") parser.add_argument("--timeout", type=float, default=10.0, help="HTTP timeout in seconds") - parser.add_argument("--user-agent", default="check-for-updates/1.0", help="HTTP user agent") + parser.add_argument("--user-agent", default="service-update-alerts/1.0", help="HTTP user agent") args = parser.parse_args() load_dotenv() diff --git a/pyproject.toml b/pyproject.toml index ec53cc2..b4fa0a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=68", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "check-for-updates" +name = "service-update-alerts" version = "0.1.0" description = "Check running service versions against upstream releases" requires-python = ">=3.10" diff --git a/systemd/check-for-updates.service b/systemd/check-for-updates.service deleted file mode 100644 index dace9f4..0000000 --- a/systemd/check-for-updates.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Check hosted services for updates - -[Service] -Type=oneshot -WorkingDirectory=%h/Projects/check-for-updates -ExecStart=%h/Projects/check-for-updates/.venv/bin/python %h/Projects/check-for-updates/check_updates.py --config %h/Projects/check-for-updates/services.yaml diff --git a/systemd/service-update-alerts.service b/systemd/service-update-alerts.service new file mode 100644 index 0000000..75607b9 --- /dev/null +++ b/systemd/service-update-alerts.service @@ -0,0 +1,7 @@ +[Unit] +Description=Check hosted services for updates + +[Service] +Type=oneshot +WorkingDirectory=%h/Projects/service-update-alerts +ExecStart=%h/Projects/service-update-alerts/.venv/bin/python %h/Projects/service-update-alerts/check_updates.py --config %h/Projects/service-update-alerts/services.yaml diff --git a/systemd/check-for-updates.timer b/systemd/service-update-alerts.timer similarity index 100% rename from systemd/check-for-updates.timer rename to systemd/service-update-alerts.timer diff --git a/tests/test_live_services.py b/tests/test_live_services.py index 0a166e9..3bd09d9 100644 --- a/tests/test_live_services.py +++ b/tests/test_live_services.py @@ -16,7 +16,7 @@ def test_live_service_versions(): failures = [] for service in services.values(): - result = check_service(service, timeout=20, user_agent="check-for-updates-test") + result = check_service(service, timeout=20, user_agent="service-update-alerts-test") if service.upstream_latest_version_url and not result["latest"]: failures.append(f"{service.name}: latest version missing ({result['latest_error']})") if service.current_version_url and not result["current"]: