0 Votes

Code source wiki de Serveur principal

Version 21.1 par john le 2026/09/20 14:16

Masquer les derniers auteurs
john 1.1 1 = Serveur principal =
john 4.1 2
john 3.1 3 {{info}}
john 16.1 4 **Pages détaillées**
5
john 18.1 6 Infrastructure : [[Reverse proxy>>Wiki Batcave John.Infrastructure.ServeurPrincipal.ReverseProxy.WebHome]] · [[SWAG>>Wiki Batcave John.Infrastructure.ServeurPrincipal.SWAG.WebHome]] · [[Authelia>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Authelia.WebHome]] · [[CrowdSec>>Wiki Batcave John.Infrastructure.ServeurPrincipal.CrowdSec.WebHome]] · [[docker-socket-proxy>>Wiki Batcave John.Infrastructure.ServeurPrincipal.DockerSocketProxy.WebHome]] · [[DuckDNS>>Wiki Batcave John.Infrastructure.ServeurPrincipal.DuckDNS.WebHome]] · [[Glances>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Glances.WebHome]] · [[Dépannage>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Depannage.WebHome]]
john 16.1 7
john 20.1 8 Système : [[Noyau Zabbly>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Noyau Zabbly.WebHome]] · [[Reconstruction>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Reconstruction.WebHome]]
john 19.1 9
john 17.1 10 Productivité : [[Nextcloud>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Nextcloud.WebHome]] · [[XWiki>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Xwiki.WebHome]] · [[Passbolt>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Passbolt.WebHome]] · [[Joplin>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Joplin.WebHome]] · [[Vikunja>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Vikunja.WebHome]] · [[n8n>>Wiki Batcave John.Infrastructure.ServeurPrincipal.n8n.WebHome]] · [[code-server>>Wiki Batcave John.Infrastructure.ServeurPrincipal.code-server.WebHome]] · [[Wallos>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Wallos.WebHome]]
john 16.1 11
12 Veille et lecture : [[SearXNG>>Wiki Batcave John.Infrastructure.ServeurPrincipal.SearXNG.WebHome]] · [[Flus>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Flus.WebHome]] · [[Wallabag>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Wallabag.WebHome]]
13
john 17.1 14 Médias et localisation : [[Immich>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Immich.WebHome]] · [[Jellystat>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Jellystat.WebHome]] · [[Castopod>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Castopod.WebHome]] · [[aax2mp3>>Wiki Batcave John.Infrastructure.ServeurPrincipal.aax2mp3.WebHome]] · [[Dawarich>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Dawarich.WebHome]]
john 16.1 15
16 Réseau et outils : [[Dashy>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Dashy.WebHome]] · [[web-check>>Wiki Batcave John.Infrastructure.ServeurPrincipal.web-check.WebHome]] · [[networking-toolbox>>Wiki Batcave John.Infrastructure.ServeurPrincipal.networking-toolbox.WebHome]] · [[Sshwifty>>Wiki Batcave John.Infrastructure.ServeurPrincipal.Sshwifty.WebHome]] · [[copyparty>>Wiki Batcave John.Infrastructure.ServeurPrincipal.copyparty.WebHome]]
john 3.1 17 {{/info}}
john 4.1 18
john 1.1 19 == Système ==
20
21 |=Élément|=Valeur
22 |OS|Debian 13
23 |Noyau|Mainline (dépôt Zabbly)
24 |Disque système|NVMe
25 |Exposition|Internet, via SWAG
26
27 == Services ==
28
29 === Infrastructure ===
30
31 |=Service|=Rôle
32 |SWAG|Reverse proxy, certificat wildcard Let's Encrypt
33 |Authelia|Authentification unique
34 |CrowdSec|Détection d'attaques, bouncer nginx, captcha Turnstile
35 |DuckDNS|Mise à jour du DNS dynamique
36 |Portainer CE (LTS)|Gestion des stacks
37 |docker-socket-proxy|Accès filtré à l'API Docker
38 |Watchtower|Mise à jour automatique des images
39 |Glances|Supervision
40
41 === Productivité ===
42
43 |=Service|=Rôle
44 |Nextcloud|Notes, veille
45 |XWiki|Wiki
46 |Joplin Server + client web|Notes
47 |Passbolt|Mots de passe
48 |Vikunja|Tâches
49 |n8n|Automatisation
50 |code-server|Éditeur dans le navigateur
51 |Wallos|Suivi des abonnements
52
53 === Veille et lecture ===
54
55 |=Service|=Rôle
56 |SearXNG|Métamoteur
57 |Flus|Veille RSS
58 |Wallabag|Lecture différée
59 |changedetection.io|Surveillance de pages
60
61 === Médias ===
62
63 |=Service|=Rôle
64 |Immich|Photos et vidéos, sans machine-learning
65 |Jellystat|Statistiques Jellyfin
66 |Castopod|Podcast (test)
67 |aax2mp3|Conversion de livres audio
68
69 === Localisation ===
70
71 |=Service|=Rôle
72 |Dawarich|Historique de localisation
73 |Photon|Géocodage inverse local pour Dawarich
74
75 === Réseau et outils ===
76
77 |=Service|=Rôle
78 |web-check|Analyse de sites
79 |networking-toolbox|Outils réseau
80 |Sshwifty|Client SSH web
81 |copyparty|Partage de fichiers
82 |Dashy|Tableau de bord
83 |github-readme-stats|Statistiques GitHub pour Dashy
84
85 == Outils système ==
86
87 Plakar, Lynis, tmux, htop, fzf, zoxide, yazi, ripgrep, fd-find, jq, glow, ffmpeg, 7zip, poppler-utils, ImageMagick, mkcert.
88
89 == Configuration ==
90
91 === Réseau Docker partagé ===
92
93 Tous les services publiés sont sur un réseau externe commun avec SWAG :
94
95 {{code language="bash"}}
96 docker network create proxy
97 {{/code}}
98
99 Dans chaque stack :
100
101 {{code language="yaml"}}
102 networks:
103 proxy:
104 external: true
105 {{/code}}
106
107 === SWAG ===
108
109 * Le ##proxy.conf## inclus déclare déjà ##proxy_http_version##, ##Upgrade##, ##Connection## et ##proxy_read_timeout##. Les redéclarer dans un proxy-conf provoque l'erreur nginx « directive is duplicate ».
110 * Pour une API appelée par une application mobile, séparer un bloc ##location /api## sans l'include Authelia.
111
112 === CrowdSec : captcha Turnstile ===
113
114 Les variables se placent sur le service **swag** (le bouncer est un mod de SWAG), pas sur le service crowdsec :
115
116 {{code language="yaml"}}
117 environment:
118 - CROWDSEC_CAPTCHA_PROVIDER=turnstile
119 - CROWDSEC_SITE_KEY=<SITE_KEY>
120 - CROWDSEC_SECRET_KEY=<SECRET_KEY>
121 {{/code}}
122
123 === Authelia ===
124
125 Authelia ne recharge pas sa configuration à chaud :
126
127 {{code language="bash"}}
128 docker restart authelia
129 {{/code}}
130
131 === Watchtower ===
132
john 4.1 133 === Watchtower ===
john 1.1 134
john 4.1 135 Fork maintenu ##nickfedor/watchtower## : le projet d'origine est archivé depuis décembre 2025. Même stack sur les deux machines :
136
john 1.1 137 {{code language="yaml"}}
john 4.1 138 services:
139 watchtower:
140 image: nickfedor/watchtower:latest
141 container_name: watchtower
142 restart: always
143 volumes:
144 - /var/run/docker.sock:/var/run/docker.sock
145 command:
146 - --cleanup
147 - --schedule=0 0 5 * * *
148 environment:
149 - TZ=Europe/Paris
john 1.1 150 {{/code}}
151
john 4.1 152 * Passage chaque nuit à 5 h, après la sauvegarde de 3 h 30.
153 * Pas de ##~-~-rolling-restart## : ce fork refuse de démarrer avec cette option dès qu'un conteneur a un ##depends_on##.
154 * Pas d'API HTTP : les notifications de mise à jour viennent d'un workflow n8n qui interroge docker-socket-proxy toutes les 10 minutes et envoie un message Telegram.
155
john 1.1 156 Exclure un conteneur de la mise à jour automatique :
157
158 {{code language="yaml"}}
159 labels:
160 - com.centurylinklabs.watchtower.enable=false
161 {{/code}}
162
john 4.1 163 Conteneurs exclus : SWAG, Authelia, CrowdSec et la base de Nextcloud (image en ##latest##). Ils se mettent à jour à la main, après lecture des notes de version : Portainer > Update the stack, avec « Re-pull image ».
john 1.1 164
john 4.1 165 Les bases épinglées sur une version majeure restent en mise à jour automatique : elles ne reçoivent que des correctifs mineurs.
166
john 1.1 167 === Portainer ===
168
169 * Portainer ne gère pas ##build: .## dans une stack (le contexte pointe vers un dossier temporaire). Construire l'image sur l'hôte, puis la référencer par son nom.
170 * Derrière le reverse proxy, un redéploiement long renvoie un 504 alors qu'il aboutit. Utiliser l'accès direct en local : ##https:~/~/<IP_SERVEUR>:9443##.
john 13.1 171
john 12.1 172 ==== Modèles d'applications ====
john 1.1 173
john 12.1 174 Portainer utilise la liste de modèles de Lissy93, plus fournie que celle d'origine. Réglage : Settings > General > App Templates, URL :
175
176 {{code}}
177 https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
178 {{/code}}
179
180 Un conteneur déployé depuis un modèle n'est pas une stack : Portainer ne conserve pas de fichier compose. Sa configuration se relit avec :
181
182 {{code language="bash"}}
183 docker inspect <CONTENEUR>
184 {{/code}}
185
john 13.1 186 Conteneurs déployés ainsi : SearXNG, Glances, DuckDNS, Wallos, aax2mp3. Leur page de documentation reprend leur configuration relevée avec ##docker inspect##.
john 12.1 187
john 1.1 188 === Services système inutiles ===
189
190 Sur un serveur sans NFS, iSCSI ni bureau :
191
192 {{code language="bash"}}
193 sudo systemctl disable --now rpcbind open-iscsi nvmf-autoconnect cups bluetooth ModemManager
194 {{/code}}
195
196 Ne garder qu'un seul gestionnaire de profils d'énergie : ##tuned## ou ##power-profiles-daemon##.
john 21.1 197 À l'inverse, ##rsyslog## est nécessaire : sans lui, Debian 13 n'écrit pas ##/var/log/auth.log## et CrowdSec ne surveille pas les connexions SSH.