Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3e10a68d3 | ||
|
|
3474b8207a | ||
|
|
b27c0fd496 |
@@ -93,44 +93,4 @@ jobs:
|
|||||||
echo " OK"
|
echo " OK"
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Publish Release (tags only)
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
env:
|
|
||||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
VERSION=${GITHUB_REF#refs/tags/}
|
|
||||||
API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
|
||||||
echo "==> Creating release ${VERSION}..."
|
|
||||||
|
|
||||||
# Supprimer release existante (idempotent)
|
|
||||||
EXISTING=$(curl -sf -H "Authorization: token ${RELEASE_TOKEN}" "${API}/releases/tags/${VERSION}")
|
|
||||||
EXISTING_ID=$(echo "$EXISTING" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
|
||||||
if [ -n "$EXISTING_ID" ]; then
|
|
||||||
echo " Deleting existing release #${EXISTING_ID}..."
|
|
||||||
curl -sf -X DELETE -H "Authorization: token ${RELEASE_TOKEN}" "${API}/releases/${EXISTING_ID}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Creer la release
|
|
||||||
BODY="## ntfy-bridge ${VERSION}\n\nBinaires statiques — zero dependance.\n\n### Linux\n- \`ntfy-bridge-linux-x86_64\` (x86_64)\n- \`ntfy-bridge-linux-arm64\` (Raspberry Pi)\n\n### Windows\n- \`ntfy-bridge-windows-x86_64.exe\`"
|
|
||||||
RESP=$(curl -sf -X POST \
|
|
||||||
-H "Authorization: token ${RELEASE_TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "{\"tag_name\":\"${VERSION}\",\"name\":\"${VERSION}\",\"body\":\"${BODY}\",\"draft\":false,\"prerelease\":false}" \
|
|
||||||
"${API}/releases")
|
|
||||||
RELEASE_ID=$(echo "$RESP" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
|
||||||
echo "Release ID: ${RELEASE_ID}"
|
|
||||||
|
|
||||||
# Uploader chaque binaire
|
|
||||||
for FILE in build/ntfy-bridge-*; do
|
|
||||||
[ -f "$FILE" ] || continue
|
|
||||||
FNAME=$(basename "$FILE")
|
|
||||||
echo " Uploading ${FNAME}..."
|
|
||||||
curl -sf -X POST \
|
|
||||||
-H "Authorization: token ${RELEASE_TOKEN}" \
|
|
||||||
-H "Content-Type: application/octet-stream" \
|
|
||||||
--data-binary "@${FILE}" \
|
|
||||||
"${API}/releases/${RELEASE_ID}/assets?name=${FNAME}"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "==> Release ${VERSION} complete!"
|
|
||||||
|
|||||||
@@ -29,84 +29,181 @@ Dans un homelab avec 8+ hôtes Docker, Gitea, Uptime Kuma et des dizaines de ser
|
|||||||
|
|
||||||
## Installation
|
## 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
|
```bash
|
||||||
# 1. Cloner le repo
|
# 1. Télécharger le binaire (remplacer v0.7.0 par la version désirée)
|
||||||
git clone https://git.dracodev.net/bruno/ntfy-bridge.git
|
sudo curl -fsSL -o /usr/local/bin/ntfy-bridge \
|
||||||
cd 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)
|
# 2. Créer le répertoire de config et copier l'exemple
|
||||||
v -os linux -prod -o ntfy-bridge .
|
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 :
|
# 3. Éditer la configuration
|
||||||
# v -prod -o ntfy-bridge .
|
sudo vim /etc/ntfy-bridge/ntfy-bridge.yaml
|
||||||
|
|
||||||
# 3. Configurer
|
# 4. Installer comme service systemd (ou openrc si détecté)
|
||||||
cp ntfy-bridge.example.yaml ntfy-bridge.yaml
|
sudo ntfy-bridge --install-service --config /etc/ntfy-bridge/ntfy-bridge.yaml
|
||||||
vim ntfy-bridge.yaml
|
|
||||||
|
|
||||||
# 4. Lancer avec docker compose
|
|
||||||
docker compose up -d
|
|
||||||
|
|
||||||
# 5. Vérifier
|
# 5. Vérifier
|
||||||
curl http://localhost:9090/health
|
curl http://localhost:9090/health
|
||||||
```
|
```
|
||||||
|
|
||||||
Le `docker-compose.yml` inclus monte :
|
**Commandes utiles :**
|
||||||
- `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
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Option A : Binaire pré-compilé (CI) — pas besoin de V
|
systemctl status ntfy-bridge # État du service
|
||||||
# Télécharge l'artifact "ntfy-bridge-linux-arm64" depuis Gitea Actions :
|
systemctl restart ntfy-bridge # Redémarrer après modif de config
|
||||||
# https://git.dracodev.net/bruno/ntfy-bridge/actions
|
journalctl -u ntfy-bridge -f # Logs en temps réel
|
||||||
# ou via API :
|
ntfy-bridge --uninstall-service # Désinstaller le service
|
||||||
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
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Compilation manuelle
|
#### Option B : Docker
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Installer V sur Linux x86_64 (Debian/Ubuntu)
|
# 1. Créer un dossier et générer la stack docker-compose
|
||||||
curl -s https://github.com/vlang/v/releases/latest/download/v_linux.zip -o /tmp/v.zip
|
mkdir -p /opt/ntfy-bridge && cd /opt/ntfy-bridge
|
||||||
unzip /tmp/v.zip -d /tmp && sudo /tmp/v/v symlink
|
ntfy-bridge --install-docker .
|
||||||
|
|
||||||
# Compiler
|
# 2. Éditer la configuration
|
||||||
git clone https://git.dracodev.net/bruno/ntfy-bridge.git
|
|
||||||
cd ntfy-bridge
|
|
||||||
v -prod .
|
|
||||||
|
|
||||||
# Configurer
|
|
||||||
cp ntfy-bridge.example.yaml ntfy-bridge.yaml
|
|
||||||
vim ntfy-bridge.yaml
|
vim ntfy-bridge.yaml
|
||||||
|
|
||||||
# Lancer
|
# 3. Démarrer
|
||||||
./ntfy-bridge --config ntfy-bridge.yaml
|
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
|
## Sources supportées
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ ntfy-bridge/
|
|||||||
// v.mod
|
// v.mod
|
||||||
Module {
|
Module {
|
||||||
name: 'ntfy-bridge'
|
name: 'ntfy-bridge'
|
||||||
version: '0.6.0'
|
version: '0.7.0'
|
||||||
dependencies: ['https://github.com/vlang/yaml'] // parsing YAML
|
dependencies: ['https://github.com/vlang/yaml'] // parsing YAML
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
+2
-1
@@ -174,4 +174,5 @@ Ces features ont été ajoutées en cours de route :
|
|||||||
| v0.4.0 | ✅ Terminé | Templates, silence, grouping, HMAC global, CI/CD |
|
| v0.4.0 | ✅ Terminé | Templates, silence, grouping, HMAC global, CI/CD |
|
||||||
| v0.4.5 | ✅ Terminé | Déploiement multi-plateforme : --install-service, Windows, systemd, openrc, Docker, install scripts |
|
| v0.4.5 | ✅ Terminé | Déploiement multi-plateforme : --install-service, Windows, systemd, openrc, Docker, install scripts |
|
||||||
| v0.5.0 | ✅ Terminé | Dashboard, filtres, actions Ntfy, Prometheus, outgoing webhooks, state file |
|
| v0.5.0 | ✅ Terminé | Dashboard, filtres, actions Ntfy, Prometheus, outgoing webhooks, state file |
|
||||||
| v0.6.0 | ✅ Terminé | ACLs multi-utilisateurs, plugin system (scripts externes) |
|
| v0.6.0 | ✅ Terminé | ACLs multi-utilisateurs, plugin system (scripts externes) |
|
||||||
|
| v0.7.0 | ✅ Terminé | CI cross-compilation (Windows ARM64, MinGW), fixes compatibilité V latest |
|
||||||
|
|||||||
Reference in New Issue
Block a user