fix: corrigir caminhos, renomear health-monitor para health-check e bump v1.0.2

- 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
This commit is contained in:
SantosFC 2026-06-08 07:31:56 -03:00 committed by GitHub
parent 6239b0988f
commit b27403dd60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 11 deletions

View file

@ -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/<your-uuid>

View file

@ -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:

View file

@ -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

View file

@ -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