From 2d550fb4b557453444e7075bd23bef35c0a44420 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 25 Aug 2025 13:58:20 +0200 Subject: [PATCH] finalize --- ct/healthchecks.sh | 39 ++++++++++++++++++++++---- frontend/public/json/healthchecks.json | 23 +++++++++------ install/healthchecks-install.sh | 2 +- 3 files changed, 49 insertions(+), 15 deletions(-) diff --git a/ct/healthchecks.sh b/ct/healthchecks.sh index 44218b6c..f8e5e45f 100644 --- a/ct/healthchecks.sh +++ b/ct/healthchecks.sh @@ -7,9 +7,9 @@ source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxV APP="healthchecks" var_tags="${var_tags:-monitoring}" -var_cpu="${var_cpu:-4}" -var_ram="${var_ram:-4096}" -var_disk="${var_disk:-20}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-5}" var_os="${var_os:-debian}" var_version="${var_version:-12}" var_unprivileged="${var_unprivileged:-1}" @@ -23,11 +23,40 @@ function update_script() { header_info check_container_storage check_container_resources - if [[ ! -f /etc/systemd/system/healthchecks.service ]]; then + + if [[ ! -d /opt/healthchecks ]]; then msg_error "No ${APP} Installation Found!" exit fi - msg_error "No Update." + + RELEASE=$(curl -fsSL https://api.github.com/repos/healthchecks/healthchecks/releases/latest | jq '.tag_name' | sed 's/^"v//;s/"$//') + if [[ "${RELEASE}" != "$(cat ~/.healthchecks 2>/dev/null)" ]] || [[ ! -f ~/.healthchecks ]]; then + msg_info "Stopping $APP" + systemctl stop healthchecks + msg_ok "Stopped $APP" + + setup_uv + fetch_and_deploy_gh_release "healthchecks" "healthchecks/healthchecks" + + msg_info "Updating $APP to v${RELEASE}" + cd /opt/healthchecks + mkdir -p /opt/healthchecks/static-collected/ + $STD uv pip install wheel gunicorn -r requirements.txt --system + $STD uv run -- python manage.py makemigrations + $STD uv run -- python manage.py migrate --noinput + $STD uv run -- python manage.py collectstatic --noinput + $STD uv run -- python manage.py compress + msg_ok "Updated $APP to v${RELEASE}" + + msg_info "Starting $APP" + systemctl start healthchecks + systemctl restart caddy + msg_ok "Started $APP" + + msg_ok "Update Successful" + else + msg_ok "No update required. ${APP} is already at v${RELEASE}" + fi exit } diff --git a/frontend/public/json/healthchecks.json b/frontend/public/json/healthchecks.json index ac5f3fe2..a0187d17 100644 --- a/frontend/public/json/healthchecks.json +++ b/frontend/public/json/healthchecks.json @@ -4,24 +4,24 @@ "categories": [ 9 ], - "date_created": "2025-07-02", + "date_created": "2025-08-25", "type": "ct", "updateable": true, "privileged": false, - "config_path": "/opt/healthchecks/.env", + "config_path": "/opt/healthchecks/hc/local_settings.py", "interface_port": 3000, "documentation": "https://healthchecks.io/", "website": "https://healthchecks.io/", - "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/svg/healthchecks.svg", - "description": "Healthchecks is an open-source self-hosted application.", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/healthchecks.webp", + "description": "Healthchecks is a cron job monitoring service. It listens for HTTP requests and email messages (\"pings\") from your cron jobs and scheduled tasks (\"checks\"). When a ping does not arrive on time, Healthchecks sends out alerts. Healthchecks comes with a web dashboard, API, 25+ integrations for delivering notifications, monthly email reports, WebAuthn 2FA support, team management features: projects, team members, read-only access.", "install_methods": [ { "type": "default", "script": "ct/healthchecks.sh", "resources": { - "cpu": 1, - "ram": 1024, - "hdd": 2, + "cpu": 2, + "ram": 2048, + "hdd": 5, "os": "Debian", "version": "12" } @@ -31,5 +31,10 @@ "username": null, "password": null }, - "notes": [] -} \ No newline at end of file + "notes": [ + { + "text": "if you change your LXC-IP, you need to update /etc/caddy/Caddyfile & /opt/healthchecks/hc/local_settings.py", + "type": "info" + } + ] +} diff --git a/install/healthchecks-install.sh b/install/healthchecks-install.sh index 05111846..2507149d 100644 --- a/install/healthchecks-install.sh +++ b/install/healthchecks-install.sh @@ -48,7 +48,7 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" } >>~/healthchecks.creds msg_ok "Set up Database" -fetch_and_deploy_gh_release "healthchecks" "healthchecks/healthchecks" "source" +fetch_and_deploy_gh_release "healthchecks" "healthchecks/healthchecks" msg_info "Setup healthchecks" cd /opt/healthchecks