anchorage_layer_simple/features/nginx-proxy-relay-certificator.md
ncantu 46bf9676a0 Install and enable all missing systemd services
**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)
2026-01-26 12:56:11 +01:00

38 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Configuration Nginx proxy pour relay.certificator.4nkweb.com (api-relay)
**Author:** Équipe 4NK
**Date:** 2026-01-26
## Objectif
Exposer lAPI 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 lhôte 192.168.1.105. Générer les certificats SSL (Lets Encrypt) pour ce domaine.
## Impacts
- **Fonctionnels** : Accès à lAPI Relay via `https://relay.certificator.4nkweb.com` (après Certbot). UserWallet peut lajouter 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 dun 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 lIP 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 lhô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 lactiver.
## Modalités danalyse
- `curl -I https://relay.certificator.4nkweb.com/health` → 200.
- Logs Nginx : `access_log` et `error_log` du vhost `relay.certificator.4nkweb.com`.