feat(server): serve the pacman repository over HTTPS
Caddy now owns the certificate of repo.fws-linux.org: it obtains and renews it, redirects http:// to https:// and serves HTTP/3. The plain http://:30065 block stays for tests until the DNS record exists, and the pacman block, install output and both READMEs point at the HTTPS URL.
This commit is contained in:
1 parent
30cb9c9fc2
commit
337e9b305a
7 files changed
+176
-58
No files matched your search
+35
-6
@@ -1,18 +1,47 @@
|
||||
# archrepo : interface/API vers le service Python, paquets servis en statique.
|
||||
# ":30065" accepte n'importe quel Host (nom de domaine, IP, localhost).
|
||||
http://:30065 {
|
||||
# repo — dépôt pacman « fws » servi en HTTPS sur un domaine.
|
||||
#
|
||||
# Fichier complet pour /etc/caddy/Caddyfile : Caddy obtient et renouvelle seul
|
||||
# le certificat Let's Encrypt du domaine (ports 80 et 443 joignables, 443/udp
|
||||
# pour HTTP/3) et redirige http:// vers https://. Les paquets et les bases
|
||||
# sont servis en statique ; seules /admin* et /api/* passent par le service
|
||||
# Python (repo.service, 127.0.0.1:8099).
|
||||
#
|
||||
# sudo cp server/Caddyfile /etc/caddy/Caddyfile
|
||||
# sudo caddy validate --config /etc/caddy/Caddyfile
|
||||
# sudo systemctl reload caddy
|
||||
#
|
||||
# Le domaine et la racine servie se règlent dans l'environnement du service
|
||||
# Caddy, sans éditer ce fichier :
|
||||
# REPO_DOMAIN=repo.fws-linux.org (défaut)
|
||||
# REPO_WEBROOT=/var/www/fws (défaut, cf. install.sh)
|
||||
#
|
||||
# Tant que le DNS du domaine ne pointe pas ici, Caddy ne peut pas valider le
|
||||
# certificat et réessaie : le bloc « http://:30065 » reste servi et suffit
|
||||
# pour tester ; pour ne servir que lui, retirer le bloc du domaine.
|
||||
|
||||
(repo) {
|
||||
encode zstd gzip
|
||||
|
||||
handle /admin* {
|
||||
encode zstd gzip
|
||||
reverse_proxy 127.0.0.1:8099
|
||||
}
|
||||
|
||||
handle /api/* {
|
||||
encode zstd gzip
|
||||
reverse_proxy 127.0.0.1:8099
|
||||
}
|
||||
|
||||
handle {
|
||||
root * /var/www/fws
|
||||
root * {$REPO_WEBROOT:/var/www/fws}
|
||||
file_server browse
|
||||
}
|
||||
}
|
||||
|
||||
# Dépôt public : HTTPS automatique (redirection http:// → https:// comprise).
|
||||
{$REPO_DOMAIN:repo.fws-linux.org} {
|
||||
import repo
|
||||
}
|
||||
|
||||
# Test local et réseau interne : mêmes routes, sans TLS ni nom d'hôte.
|
||||
http://:30065 {
|
||||
import repo
|
||||
}
|
||||
Reference in new issue
Block a user