# Console d'administration (docs/admin.md) : https://admin.bobinoo.org. Incluse par site.conf, livrée avec chaque release. # Le HTTPS est assuré par le proxy en façade du VPS, comme pour bobinoo.org (il doit transmettre l'en-tête Host). # Protections : mot de passe + code de double authentification obligatoire, liste des admins, secret entre ce # serveur et la fonction Edge, nombre d'appels limité, journal et e-mail d'alerte à chaque connexion. # Limite globale des appels à la console (tous visiteurs confondus) : 60 par minute, rafale de 30 limit_req_zone $server_name zone=bobinoo_admin:1m rate=60r/m; server { listen 80; server_name admin.bobinoo.org; server_tokens off; root /srv/bobinoo/current/admin; index index.html; include /etc/nginx/mime.types; types { application/manifest+json webmanifest; } add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self'; font-src 'self'; img-src 'self' data: https://qfgnxonqwldcfdjqhhjz.supabase.co; connect-src 'self' https://qfgnxonqwldcfdjqhhjz.supabase.co; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; manifest-src 'self'" always; add_header Strict-Transport-Security "max-age=63072000" always; add_header X-Frame-Options "DENY" always; add_header X-Content-Type-Options "nosniff" always; add_header Referrer-Policy "no-referrer" always; add_header X-Robots-Tag "noindex, nofollow" always; add_header Cache-Control "no-store" always; add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()" always; # Relais vers la fonction serveur « admin » : nginx ajoute le secret partagé (en-tête X-Admin-Gate). # Le secret est dans /etc/nginx/bobinoo-admin-gate.conf, créé une fois sur le VPS, JAMAIS dans le dépôt : # proxy_set_header X-Admin-Gate ""; # Fichier absent : la fonction répond 404 (la console affiche « pas reliée au serveur »), le site n'est pas touché. location = /api/admin { limit_except POST { deny all; } limit_req zone=bobinoo_admin burst=30 nodelay; limit_req_status 429; client_max_body_size 16k; resolver 1.1.1.1 9.9.9.9 valid=300s ipv6=off; resolver_timeout 5s; set $supabase qfgnxonqwldcfdjqhhjz.supabase.co; proxy_pass https://$supabase/functions/v1/admin; proxy_http_version 1.1; proxy_set_header Connection ""; proxy_ssl_server_name on; proxy_ssl_name $supabase; proxy_set_header Host $supabase; proxy_set_header Cookie ""; proxy_set_header X-Forwarded-For ""; include /etc/nginx/bobinoo-admin-gate*.conf; proxy_read_timeout 30s; } location = /robots.txt { default_type text/plain; return 200 "User-agent: *\nDisallow: /\n"; } location /assets/ { try_files $uri =404; } location / { try_files $uri /index.html; } }