- Ajout du workflow CI/CD avec configuration SSH automatique - Création des templates pour issues et pull requests - Script de configuration SSH automatique (scripts/setup-ssh-ci.sh) - Documentation SSH complète (docs/SSH_SETUP.md) - Mise à jour de la configuration d'intégration 4NK_node - Amélioration du script de démarrage et de la config Nginx La clé SSH est maintenant utilisée automatiquement dans tous les environnements : - CI/CD Gitea Actions avec variable SSH_PRIVATE_KEY - Environnement local avec détection automatique - Configuration Git pour utiliser SSH au lieu de HTTPS
97 lines
3.3 KiB
Plaintext
97 lines
3.3 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Gestion des fichiers statiques
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
# Headers de sécurité
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
}
|
|
|
|
# Proxy vers sdk_relay WebSocket
|
|
location /ws/ {
|
|
proxy_pass http://sdk_relay_1:8090;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_read_timeout 86400;
|
|
proxy_send_timeout 86400;
|
|
}
|
|
|
|
# Proxy vers sdk_relay HTTP API
|
|
location /api/ {
|
|
proxy_pass http://sdk_relay_1:8091/;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
# CORS headers
|
|
add_header Access-Control-Allow-Origin "*" always;
|
|
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE" always;
|
|
add_header Access-Control-Allow-Headers "Authorization,Content-Type,Accept,X-Requested-With" always;
|
|
|
|
# Gestion des requêtes OPTIONS
|
|
if ($request_method = 'OPTIONS') {
|
|
add_header Access-Control-Allow-Origin "*";
|
|
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE";
|
|
add_header Access-Control-Allow-Headers "Authorization,Content-Type,Accept,X-Requested-With";
|
|
add_header Content-Length 0;
|
|
add_header Content-Type text/plain;
|
|
return 204;
|
|
}
|
|
}
|
|
|
|
# Proxy vers Bitcoin Core RPC (si nécessaire)
|
|
location /bitcoin/ {
|
|
proxy_pass http://bitcoin:18443/;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
# Authentification basique pour Bitcoin RPC
|
|
auth_basic "Bitcoin RPC";
|
|
auth_basic_user_file /etc/nginx/.htpasswd;
|
|
}
|
|
|
|
# Proxy vers Blindbit (si nécessaire)
|
|
location /blindbit/ {
|
|
proxy_pass http://blindbit:8000/;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# Cache pour les assets statiques
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# Gestion des erreurs
|
|
error_page 404 /index.html;
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
|
|
# Logs
|
|
access_log /var/log/nginx/ihm_client_access.log;
|
|
error_log /var/log/nginx/ihm_client_error.log;
|
|
}
|