**Motivations:** - Ensure all application directories have systemd services enabled at boot - Complete service installation for api-relay, filigrane-api, and clamav-api - Fix dependencies and import issues preventing clamav-api from starting **Root causes:** - Three services (api-relay, filigrane-api, clamav-api) had service files but were not installed in systemd - api-clamav had incorrect node-clamav version (0.12.1) that doesn't exist - api-clamav dependencies were not installed (node_modules missing) - ES module import syntax incompatible with CommonJS node-clamav package **Correctifs:** - Installed api-relay.service, filigrane-api.service, and clamav-api.service in /etc/systemd/system/ - Enabled all three services for automatic startup at boot - Updated api-clamav/package.json: changed node-clamav version from ^0.12.1 to ^1.0.11 - Installed npm dependencies for api-clamav - Fixed ES module import in api-clamav/src/routes/scan.js to use CommonJS-compatible syntax **Evolutions:** - All 7 application services now have systemd services enabled at boot - Complete service coverage: anchorage-api, faucet-api, signet-dashboard, userwallet, api-relay, filigrane-api, clamav-api - All services verified active and listening on their respective ports **Pages affectées:** - api-clamav/package.json - api-clamav/src/routes/scan.js - api-clamav/node_modules/ (new) - api-clamav/package-lock.json (new) - /etc/systemd/system/api-relay.service (new) - /etc/systemd/system/filigrane-api.service (new) - /etc/systemd/system/clamav-api.service (new)
38 lines
2.0 KiB
Markdown
38 lines
2.0 KiB
Markdown
# Configuration Nginx proxy pour relay.certificator.4nkweb.com (api-relay)
|
||
|
||
**Author:** Équipe 4NK
|
||
**Date:** 2026-01-26
|
||
|
||
## Objectif
|
||
|
||
Exposer l’API Relay (api-relay, port 3019) sur **relay.certificator.4nkweb.com** via le proxy Nginx sur 192.168.1.100, en faisant pointer le trafic vers l’hôte 192.168.1.105. Générer les certificats SSL (Let’s Encrypt) pour ce domaine.
|
||
|
||
## Impacts
|
||
|
||
- **Fonctionnels** : Accès à l’API Relay via `https://relay.certificator.4nkweb.com` (après Certbot). UserWallet peut l’ajouter comme relais dans « Réglages relais ».
|
||
- **Techniques** : Nouveau vhost Nginx sur le proxy ; `proxy_pass` vers `http://192.168.1.105:3019`. Certbot configure HTTPS et redirection HTTP → HTTPS.
|
||
|
||
## Modifications
|
||
|
||
- **Script** : `configure-nginx-proxy.sh`
|
||
- Ajout d’un bloc serveur `relay.certificator.4nkweb.com` (listen 80, proxy vers 192.168.1.105:3019).
|
||
- Fichier de config : `NGINX_SITES_AVAILABLE/relay.certificator.4nkweb.com`.
|
||
- Symlink dans `sites-enabled`.
|
||
- Ajout de `relay.certificator.4nkweb.com` dans la liste des domaines Certbot pour HTTPS et redirection.
|
||
|
||
## Prérequis
|
||
|
||
- DNS : `relay.certificator.4nkweb.com` doit résoudre vers l’IP du proxy (ex. DynDNS). Gestion DNS hors scope de ce script.
|
||
- **api-relay** en écoute sur **192.168.1.105:3019** (PORT par défaut ou `PORT=3019`).
|
||
|
||
## Modalités de déploiement
|
||
|
||
1. **Sur l’hôte .105** : Démarrer api-relay sur le port 3019 (ex. `cd api-relay && npm run build && npm start`, ou unité systemd dédiée).
|
||
2. **Sur le proxy (.100)** : Exécuter `./update-proxy-nginx.sh` (ou `configure-nginx-proxy.sh` via SSH). Le script configure Nginx, recharge le service, puis lance Certbot pour tous les domaines (dont `relay.certificator.4nkweb.com`).
|
||
3. Dans UserWallet : Réglages relais → ajouter `https://relay.certificator.4nkweb.com` et l’activer.
|
||
|
||
## Modalités d’analyse
|
||
|
||
- `curl -I https://relay.certificator.4nkweb.com/health` → 200.
|
||
- Logs Nginx : `access_log` et `error_log` du vhost `relay.certificator.4nkweb.com`.
|