Files
ntfy-bridge/CONTRIBUTING.md
T
bruno 3f48912ad7 docs: initial architecture, roadmap, readme for ntfy-bridge
- README.md: project overview, quickstart, sources summary
- ARCHITECTURE.md: complete architecture, data flow, project structure
- ROADMAP.md: 5-phase development plan (v0.1.0 → v0.5.0+)
- CONTRIBUTING.md: dev setup, conventions, how to add a source
- ntfy-bridge.example.yaml: fully documented configuration template
- scripts/example-cron-disk.sh: example cron script → ntfy-bridge
2026-08-01 10:56:32 -04:00

2.3 KiB

Contributing to ntfy-bridge

Stack

  • Langage : V — compilé, rapide, syntaxe proche de Go
  • Dépendances : Zéro dépendance externe (stdlib V uniquement)
  • Build : v . → binaire natif statique

Setup développement

# Installer V
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

# Cloner
git clone https://git.dracodev.net/bruno/ntfy-bridge.git
cd ntfy-bridge

# Compiler (mode dev avec hot reload)
v watch run .

# Tests
v test .

# Build production
v -prod .

Structure du code

src/
├── main.v       # Entrypoint, flag parsing, orchestration
├── config.v     # Config loading + validation
├── server.v     # HTTP server, webhook routing
├── event.v      # Event types, pipeline
├── ntfy.v       # Ntfy HTTP client
├── dedup.v      # Deduplication + rate limiting
├── template.v   # Mini template engine
├── log.v        # Structured logging
└── sources/     # Source-specific transformers
    ├── gitea.v
    ├── uptime_kuma.v
    ├── docker.v
    ├── http_poll.v
    └── generic.v

Ajouter une nouvelle source

  1. Créer src/sources/ma_source.v
  2. Implémenter la fonction transform(raw string, source &Source) ?Event
  3. Déclarer le type dans sources du config.v
  4. Router l'endpoint dans server.v
  5. Ajouter un test dans tests/ma_source_test.v

Conventions de code

  • Nommage : snake_case pour les fonctions/variables, PascalCase pour les structs
  • Gestion d'erreurs : utiliser le type ? (Option/Result) de V
  • Logging : log.info(), log.warn(), log.error() avec contexte
  • Messages de commit : Conventional Commits
    • feat: add Gitea webhook transformer
    • fix: handle Docker socket disconnect
    • docs: update ARCHITECTURE.md

Tests

# Tous les tests
v test .

# Test spécifique
v test tests/gitea_test.v

# Avec verbose
v test . -stats

CI/CD

Le repo utilise Gitea Actions. Le workflow dans .gitea/workflows/ci.yml :

  • Compile en mode -prod
  • Lance v test .
  • Vérifie le formatting (v fmt -verify)

Questions ?

Ouvrir une issue sur https://git.dracodev.net/bruno/ntfy-bridge/issues