From 3474b8207af46719ee99095f06345ba9bb4fccce Mon Sep 17 00:00:00 2001 From: bruno Date: Fri, 7 Aug 2026 09:57:32 -0400 Subject: [PATCH] =?UTF-8?q?docs:=20section=20installation=20compl=C3=A8te?= =?UTF-8?q?=20depuis=20Nexus=20=E2=80=94=20Linux,=20RPi,=20Windows=20(serv?= =?UTF-8?q?ice=20+=20Docker)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 217 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 157 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 63e090c..48ba63c 100644 --- a/README.md +++ b/README.md @@ -29,84 +29,181 @@ Dans un homelab avec 8+ hôtes Docker, Gitea, Uptime Kuma et des dizaines de ser ## Installation -### Docker (recommandé) +Les binaires pré-compilés sont disponibles sur le dépôt Nexus : + +``` +https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/{VERSION}/ +``` + +Remplacer `{VERSION}` par la version souhaitée (ex: `v0.7.0`). +Chaque release contient trois binaires statiques — **zéro dépendance** : + +| Fichier | Plateforme | +|---------|-----------| +| `ntfy-bridge-linux-x86_64` | Linux 64-bit (Intel/AMD) | +| `ntfy-bridge-linux-arm64` | Linux ARM64 (Raspberry Pi 3/4/5) | +| `ntfy-bridge-windows-x86_64.exe` | Windows 64-bit | + +> 💡 **Pas besoin de V, Git, ni compilateur.** Les binaires sont compilés statiquement — un seul fichier, prêt à exécuter. + +--- + +### Linux (x86_64) + +#### Option A : Service système (recommandé) ```bash -# 1. Cloner le repo -git clone https://git.dracodev.net/bruno/ntfy-bridge.git -cd ntfy-bridge +# 1. Télécharger le binaire (remplacer v0.7.0 par la version désirée) +sudo curl -fsSL -o /usr/local/bin/ntfy-bridge \ + https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/v0.7.0/ntfy-bridge-linux-x86_64 +sudo chmod +x /usr/local/bin/ntfy-bridge -# 2. Compiler le binaire Linux (cross-compilation depuis Windows/Mac) -v -os linux -prod -o ntfy-bridge . +# 2. Créer le répertoire de config et copier l'exemple +sudo mkdir -p /etc/ntfy-bridge +sudo curl -fsSL -o /etc/ntfy-bridge/ntfy-bridge.yaml \ + https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/v0.7.0/ntfy-bridge.example.yaml +sudo curl -fsSL -o /etc/ntfy-bridge/dashboard.html \ + https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/v0.7.0/dashboard.html -# Ou compiler directement sur Linux : -# v -prod -o ntfy-bridge . +# 3. Éditer la configuration +sudo vim /etc/ntfy-bridge/ntfy-bridge.yaml -# 3. Configurer -cp ntfy-bridge.example.yaml ntfy-bridge.yaml -vim ntfy-bridge.yaml - -# 4. Lancer avec docker compose -docker compose up -d +# 4. Installer comme service systemd (ou openrc si détecté) +sudo ntfy-bridge --install-service --config /etc/ntfy-bridge/ntfy-bridge.yaml # 5. Vérifier curl http://localhost:9090/health ``` -Le `docker-compose.yml` inclus monte : -- `ntfy-bridge.yaml` → `/etc/ntfy-bridge/ntfy-bridge.yaml` (read-only) -- `dashboard.html` → `/etc/ntfy-bridge/dashboard.html` (read-only) -- Port `9090` exposé sur localhost -- Variables d'environnement `NTFY_TOKEN` et `NTFY_HMAC_SECRET` -- Healthcheck intégré (`/health`) - -### Raspberry Pi / ARM64 - +**Commandes utiles :** ```bash -# Option A : Binaire pré-compilé (CI) — pas besoin de V -# Télécharge l'artifact "ntfy-bridge-linux-arm64" depuis Gitea Actions : -# https://git.dracodev.net/bruno/ntfy-bridge/actions -# ou via API : -curl -s -o ntfy-bridge "https://git.dracodev.net/api/v1/repos/bruno/ntfy-bridge/actions/artifacts/latest/zip?name=binaires" -unzip binaires.zip ntfy-bridge-linux-arm64 -mv ntfy-bridge-linux-arm64 ntfy-bridge -chmod +x ntfy-bridge - -# Option B : Compiler soi-même (nécessite V) -# Installer V sur Debian 12 / Raspberry Pi OS (aarch64) : -git clone --depth 1 https://github.com/vlang/v ~/v -cd ~/v && make -sudo ln -sf ~/v/v /usr/local/bin/v - -# Compiler ntfy-bridge -git clone https://git.dracodev.net/bruno/ntfy-bridge.git -cd ntfy-bridge -v -prod -o ntfy-bridge . - -# Lancer -cp ntfy-bridge.example.yaml ntfy-bridge.yaml -vim ntfy-bridge.yaml -./ntfy-bridge --config ntfy-bridge.yaml +systemctl status ntfy-bridge # État du service +systemctl restart ntfy-bridge # Redémarrer après modif de config +journalctl -u ntfy-bridge -f # Logs en temps réel +ntfy-bridge --uninstall-service # Désinstaller le service ``` -### Compilation manuelle +#### Option B : Docker ```bash -# Installer V sur Linux x86_64 (Debian/Ubuntu) -curl -s https://github.com/vlang/v/releases/latest/download/v_linux.zip -o /tmp/v.zip -unzip /tmp/v.zip -d /tmp && sudo /tmp/v/v symlink +# 1. Créer un dossier et générer la stack docker-compose +mkdir -p /opt/ntfy-bridge && cd /opt/ntfy-bridge +ntfy-bridge --install-docker . -# Compiler -git clone https://git.dracodev.net/bruno/ntfy-bridge.git -cd ntfy-bridge -v -prod . - -# Configurer -cp ntfy-bridge.example.yaml ntfy-bridge.yaml +# 2. Éditer la configuration vim ntfy-bridge.yaml -# Lancer -./ntfy-bridge --config ntfy-bridge.yaml +# 3. Démarrer +docker compose up -d + +# 4. Vérifier +curl http://localhost:9090/health +``` + +Ce que contient la stack Docker : +- Le binaire exposé sur `127.0.0.1:9090` +- `ntfy-bridge.yaml` monté en read-only dans `/etc/ntfy-bridge/` +- `dashboard.html` monté automatiquement +- Variables d'environnement `NTFY_TOKEN` et `NTFY_HMAC_SECRET` +- Healthcheck intégré (`/health` toutes les 30s) +- Redémarrage automatique (`restart: unless-stopped`) + +--- + +### Raspberry Pi (ARM64) + +Mêmes étapes que Linux, avec le binaire `linux-arm64` : + +```bash +# 1. Télécharger le binaire ARM64 +sudo curl -fsSL -o /usr/local/bin/ntfy-bridge \ + https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/v0.7.0/ntfy-bridge-linux-arm64 +sudo chmod +x /usr/local/bin/ntfy-bridge + +# 2. Récupérer la config et le dashboard +sudo mkdir -p /etc/ntfy-bridge +sudo curl -fsSL -o /etc/ntfy-bridge/ntfy-bridge.yaml \ + https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/v0.7.0/ntfy-bridge.example.yaml +sudo curl -fsSL -o /etc/ntfy-bridge/dashboard.html \ + https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/v0.7.0/dashboard.html + +# 3. Éditer la config +sudo vim /etc/ntfy-bridge/ntfy-bridge.yaml + +# 4. Installer le service +sudo ntfy-bridge --install-service --config /etc/ntfy-bridge/ntfy-bridge.yaml + +# 5. Vérifier +curl http://localhost:9090/health +``` + +**Docker sur Raspberry Pi :** identique à l'option B Linux — le binaire est déjà dans l'image Docker, pas besoin de le télécharger séparément. Utiliser `ntfy-bridge --install-docker .` pour générer la stack. + +--- + +### Windows + +```powershell +# 1. Créer le dossier d'installation (PowerShell administrateur) +New-Item -ItemType Directory -Force -Path "$env:ProgramFiles\ntfy-bridge" + +# 2. Télécharger le binaire Windows +Invoke-WebRequest -Uri "https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/v0.7.0/ntfy-bridge-windows-x86_64.exe" ` + -OutFile "$env:ProgramFiles\ntfy-bridge\ntfy-bridge.exe" + +# 3. Télécharger la config et le dashboard +Invoke-WebRequest -Uri "https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/v0.7.0/ntfy-bridge.example.yaml" ` + -OutFile "$env:ProgramFiles\ntfy-bridge\ntfy-bridge.yaml" +Invoke-WebRequest -Uri "https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/v0.7.0/dashboard.html" ` + -OutFile "$env:ProgramFiles\ntfy-bridge\dashboard.html" + +# 4. Éditer la configuration (dans le Bloc-notes) +notepad "$env:ProgramFiles\ntfy-bridge\ntfy-bridge.yaml" + +# 5. Installer NSSM (requis pour le service Windows) +# Télécharger depuis https://nssm.cc/download +# ou avec scoop : scoop install nssm +# Placer nssm.exe dans le PATH ou dans $env:ProgramFiles\ntfy-bridge\ + +# 6. Installer comme service Windows +& "$env:ProgramFiles\ntfy-bridge\ntfy-bridge.exe" --install-service ` + --config "$env:ProgramFiles\ntfy-bridge\ntfy-bridge.yaml" + +# 7. Vérifier +Invoke-WebRequest -Uri http://localhost:9090/health +``` + +**Commandes utiles (PowerShell) :** +```powershell +nssm status ntfy-bridge # État du service +nssm restart ntfy-bridge # Redémarrer +nssm stop ntfy-bridge # Arrêter +nssm start ntfy-bridge # Démarrer +nssm remove ntfy-bridge confirm # Désinstaller le service +``` + +Logs du service : `C:\ProgramData\ntfy-bridge\service.log` + +--- + +### Mise à jour + +Pour mettre à jour vers une nouvelle version, remplacer le binaire et redémarrer : + +```bash +# Linux / Raspberry Pi +sudo curl -fsSL -o /usr/local/bin/ntfy-bridge \ + https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/v0.8.0/ntfy-bridge-linux-x86_64 +sudo chmod +x /usr/local/bin/ntfy-bridge +sudo systemctl restart ntfy-bridge +``` + +```powershell +# Windows (PowerShell administrateur) +nssm stop ntfy-bridge +Invoke-WebRequest -Uri "https://nexus.dracodev.net/repository/raw-hosted/ntfy-bridge/v0.8.0/ntfy-bridge-windows-x86_64.exe" ` + -OutFile "$env:ProgramFiles\ntfy-bridge\ntfy-bridge.exe" +nssm start ntfy-bridge ``` ## Sources supportées