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:
parent
6239b0988f
commit
b27403dd60
4 changed files with 11 additions and 11 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
4
setup.sh
4
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue