Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:web-01 [18/09/2025 00:12] – [Castopod] LibertAdmintech:web-01 [14/10/2025 08:15] (Version actuelle) – [Liberta (Site principal)] LibertAdmin
Ligne 1300: Ligne 1300:
 </code> </code>
  
 +Nous avons créé le fichier commun ''/etc/nginx/letsencrypt_security.conf'' afin de pouvoir générer et renouveler facilement des certificats TLS Let's Encrypt pour chacune de nos applications web. 
  
 +Le fichier est agrémenté de directives de sécurité recommandées pour la plupart des applications (certaines modifient ces directives via leur propre configuration évidemment) :
  
-=== Etherpad-Lite === +<code bash> 
-=== Funkwhale === +# cat /etc/nginx/letsencrypt_security.conf  
-=== Castopod === +# Security headers 
-=== Castopod === +add_header X-XSS-Protection          "1; mode=block" always; 
-=== Castopod ===+add_header X-Content-Type-Options    "nosniff" always; 
 +add_header Referrer-Policy           "no-referrer-when-downgrade" always; 
 +add_header Content-Security-Policy   "default-src 'self' http: https: ws: wss: data: blob: 'unsafe-inline'; frame-ancestors 'self';" always; 
 +add_header Permissions-Policy        "interest-cohort=()" always; 
 +add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; 
 + 
 +# Dotfiles 
 +location ~ /\.(?!well-known) { 
 + deny all; 
 +
 + 
 +# ACME-challenge 
 +location ^~ /.well-known/acme-challenge/
 + root /var/www/_letsencrypt; 
 +
 +</code> 
 + 
 + 
 +=== Liberta (Site principal)=== 
 + 
 +Le site de Liberta est en pur HTML et CSS. Il **était**, il est passé sur [[https://ghost.org/|Ghost]] en septembre 2025. Néanmoins nous laissons ici la doc originelle pour totu besoin pédagogique. 
 + 
 +Ce fichier contient la gestion globale du HTTP, lequel redirige tous les domaines vers HTTPS, notamment le site de Liberta qui est sur le sous-domaine ''www.''.  
 + 
 +Nous listons volontairement notre répertoire ''img/'' pour exposer nos images et pouvoir les utiliser facilement pour les includre sur nos pages ; c'est notamment utile pour insérer des images sur notre blog (WriteFreely ne le permet pas dans sa version communautaire malheureusement) : 
 + 
 +<code bash> 
 +# Configuration globale : 
 +# HTTP + redirect 
 +server { 
 + server_name _; 
 + listen      80; 
 + listen      [::]:80; 
 +  
 + include letsencrypt_security.conf; 
 +  
 + location / { 
 + return 301 https://$host$request_uri; 
 +
 +
 + 
 +# Domaine liberta.vip sans sous-domaine : 
 +# HTTP + redirect 
 +server { 
 + server_name liberta.vip; 
 + listen      80; 
 + listen      [::]:80; 
 +  
 + include letsencrypt_security.conf; 
 +  
 + location / { 
 + return 301 https://www.$host$request_uri; 
 +
 +
 +server { 
 +        server_name liberta.vip; 
 +        listen 443 ssl http2; 
 +        listen [::]:443 ssl http2; 
 +        ssl_certificate /etc/letsencrypt/live/liberta.vip-0001/fullchain.pem; 
 +        ssl_certificate_key /etc/letsencrypt/live/liberta.vip-0001/privkey.pem; 
 +        return 301 https://www.liberta.vip; 
 +
 +# Liberta (Pur HTML / CSS) 
 +# HTTP + redirect 
 +server { 
 +        server_name www.liberta.vip; 
 +        listen      80; 
 +        listen      [::]:80; 
 +  
 + include letsencrypt_security.conf; 
 + 
 +        location / { 
 +                return 301 https://$host$request_uri; 
 +        } 
 +
 +server { 
 +        server_name www.liberta.vip; 
 +        listen 443 ssl http2; 
 +        listen [::]:443 ssl http2; 
 +        ssl_certificate /etc/letsencrypt/live/liberta.vip-0001/fullchain.pem; 
 +        ssl_certificate_key /etc/letsencrypt/live/liberta.vip-0001/privkey.pem; 
 + 
 +        # Secure headers 
 +        add_header X-Frame-Options "SAMEORIGIN" always; 
 +        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; 
 +        add_header X-Xss-Protection "1; mode=block" always; 
 +        add_header Content-Security-Policy "default-src 'self' 'unsafe-inline'; script-src www.liberta.vip; img-src *;"; 
 +        add_header X-Content-Type-Options "nosniff" always; 
 + 
 + 
 +        root /var/www/www.liberta.vip; 
 +        access_log /var/log/nginx/www.liberta.vip_access.log; 
 +        error_log /var/log/nginx/www.liberta.vip_error.log warn; 
 +        index index.html; 
 + 
 +        location = /favicon.ico { 
 +                log_not_found off; 
 +                access_log off; 
 +        } 
 + 
 +        location = /robots.txt { 
 +                allow all; 
 +                log_not_found off; 
 +                access_log off; 
 +        } 
 +         
 + location = /img/ { 
 +                allow all; 
 +                log_not_found off; 
 +                access_log off; 
 + autoindex on; 
 +        } 
 + 
 +        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 
 +                expires max; 
 +                log_not_found off; 
 +        } 
 +
 +</code> 
 + 
 +Nous ne fournirons pas tous les détails des configurations pour chaque application, lesquelles sont souvent appelées à changer lors des mises à jour et rendraient la maintenance de cette documentation fort fastidieuse.  
 + 
 +À terme, nous prévoyons de publier notre configuration complète sur [[https://framagit.org/appzer0/liberta/|notre dépôt git]], d'autant plus que nous désirons l'industrialiser / l'automatiser via ''ansible''
 + 
 +EN COURS DE RÉDACTION... 
 +=== CryptPad (Liberta Docs)=== 
 +=== Etherpad-Lite (Liberta Pad) === 
 +=== Funkwhale (Liberta Audio) === 
 +=== Nextcloud (Liberta Cloud) === 
 +=== Peertube (Liberta Vidéo) === 
 +=== WriteFreely (Liberta Blogs) ===