From b27403dd606a85fbd7f8efaf916520a2bd182a1e Mon Sep 17 00:00:00 2001 From: SantosFC <33733406+SantosFC@users.noreply.github.com> Date: Mon, 8 Jun 2026 07:31:56 -0300 Subject: [PATCH] fix: corrigir caminhos, renomear health-monitor para health-check e bump v1.0.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - README atualizado com guia de instalação completo do zero - EnvironmentFile e ExecStart no .service corrigidos - health-monitor renomeado para health-check em todos os arquivos - User-Agent e config_file atualizados no healthcheck.py - Versão bumped para 1.0.2 --- README.md | 8 ++++---- healthcheck.py | 6 +++--- setup.fish | 4 ++-- setup.sh | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5c6afd1..23c8086 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ git config --global user.email "you@example.com" ```bash mkdir -p ~/src -git clone https://github.com/SantosFC/health-check.git ~/src/health-monitor -cd ~/src/health-monitor +git clone https://github.com/SantosFC/health-check.git ~/src/health-check +cd ~/src/health-check ``` ### 4. Run the setup script @@ -38,7 +38,7 @@ bash setup.sh The script will: 1. Ask for your `HEALTHCHECK_URL` (Healthchecks.io ping endpoint) and validate it. 2. Ask for a `DEVICE_NAME` to identify this machine. -3. Save the configuration to `~/.config/health-monitor`. +3. Save the configuration to `~/.config/health-check`. 4. Install and enable the systemd timer. 5. Run a test ping to confirm everything works. @@ -49,7 +49,7 @@ The script will: ## Configuration -The configuration file is `~/.config/health-monitor`: +The configuration file is `~/.config/health-check`: ``` HEALTHCHECK_URL=https://hc-ping.com/ diff --git a/healthcheck.py b/healthcheck.py index c8b7b77..5bfbfda 100644 --- a/healthcheck.py +++ b/healthcheck.py @@ -12,7 +12,7 @@ USER_NAME = "Ronaldo Freitas Dias" def load_config(): - config_file = Path.home() / ".config" / "health-monitor" + config_file = Path.home() / ".config" / "health-check" config = {} if config_file.exists(): for line in config_file.read_text().splitlines(): @@ -25,7 +25,7 @@ def load_config(): def ping(url: str, body: bytes, timeout: int) -> int: req = urllib.request.Request( url, data=body, method="POST", - headers={"User-Agent": "health-monitor/1.0.1", "Content-Type": "application/json"} + headers={"User-Agent": "health-check/1.0.2", "Content-Type": "application/json"} ) with urllib.request.urlopen(req, timeout=timeout) as response: return response.getcode() @@ -36,7 +36,7 @@ def ping_fail(url: str, body: bytes, timeout: int) -> None: try: req = urllib.request.Request( fail_url, data=body, method="POST", - headers={"User-Agent": "health-monitor/1.0.1", "Content-Type": "application/json"} + headers={"User-Agent": "health-check/1.0.2", "Content-Type": "application/json"} ) urllib.request.urlopen(req, timeout=timeout) except Exception: diff --git a/setup.fish b/setup.fish index b671294..fe6b9bf 100644 --- a/setup.fish +++ b/setup.fish @@ -1,8 +1,8 @@ #!/usr/bin/env fish set REPO_URL "https://github.com/SantosFC/health-check.git" -set INSTALL_DIR "$HOME/src/health-monitor" -set CONFIG_FILE "$HOME/.config/health-monitor" +set INSTALL_DIR "$HOME/src/health-check" +set CONFIG_FILE "$HOME/.config/health-check" # 1. Verificar pré-requisitos for cmd in git python3 systemctl loginctl diff --git a/setup.sh b/setup.sh index e493f43..3e34814 100644 --- a/setup.sh +++ b/setup.sh @@ -2,8 +2,8 @@ set -euo pipefail REPO_URL="https://github.com/SantosFC/health-check.git" -INSTALL_DIR="${HOME}/src/health-monitor" -CONFIG_FILE="${HOME}/.config/health-monitor" +INSTALL_DIR="${HOME}/src/health-check" +CONFIG_FILE="${HOME}/.config/health-check" # 1. Verificar pré-requisitos for cmd in git python3 systemctl loginctl; do