This commit is contained in:
+21
-8
@@ -252,15 +252,15 @@ ntfy-bridge/
|
||||
// v.mod
|
||||
Module {
|
||||
name: 'ntfy-bridge'
|
||||
version: '0.1.0'
|
||||
dependencies: [] // zéro dépendance externe
|
||||
version: '0.6.0'
|
||||
dependencies: ['https://github.com/vlang/yaml'] // parsing YAML
|
||||
}
|
||||
```
|
||||
|
||||
Le projet utilise **uniquement la stdlib V** :
|
||||
Le projet utilise la stdlib V + le module `yaml` :
|
||||
- `net.http` — serveur HTTP + client Ntfy
|
||||
- `x.json2` — parsing JSON
|
||||
- `yaml` — parsing YAML
|
||||
- `yaml` — parsing YAML (module externe vlang/yaml)
|
||||
- `crypto.hmac`, `crypto.sha256`, `encoding.hex` — validation HMAC
|
||||
- `time`, `os`, `flag` — utilitaires
|
||||
- `net.unix` — socket Docker (Linux/macOS seulement, via `$if`)
|
||||
@@ -300,13 +300,26 @@ WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
### Option B : Conteneur Docker
|
||||
|
||||
```bash
|
||||
# Quick start avec docker compose
|
||||
cp ntfy-bridge.example.yaml ntfy-bridge.yaml
|
||||
vim ntfy-bridge.yaml
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
```dockerfile
|
||||
FROM alpine:latest
|
||||
COPY ntfy-bridge /usr/local/bin/
|
||||
COPY ntfy-bridge.yaml dashboard.html /etc/ntfy-bridge/
|
||||
# Dockerfile (build hôte + runtime Alpine minimal)
|
||||
FROM alpine:3.20
|
||||
RUN apk add --no-cache ca-certificates tzdata curl
|
||||
COPY ntfy-bridge /usr/local/bin/ntfy-bridge
|
||||
RUN chmod +x /usr/local/bin/ntfy-bridge
|
||||
WORKDIR /etc/ntfy-bridge
|
||||
EXPOSE 9090
|
||||
CMD ["/usr/local/bin/ntfy-bridge", "--quiet", "--config", "/etc/ntfy-bridge/ntfy-bridge.yaml"]
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:9090/health || exit 1
|
||||
ENTRYPOINT ["/usr/local/bin/ntfy-bridge"]
|
||||
CMD ["--quiet", "--config", "/etc/ntfy-bridge/ntfy-bridge.yaml"]
|
||||
```
|
||||
|
||||
### Option C : Compilation croisée
|
||||
|
||||
Reference in New Issue
Block a user