From 0d013a24968dd075cd882521f412d95675064f85 Mon Sep 17 00:00:00 2001 From: groot Date: Mon, 8 Sep 2025 21:11:24 +0000 Subject: [PATCH 1/4] compose.yml aktualisiert --- compose.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/compose.yml b/compose.yml index cf52f21..4405576 100644 --- a/compose.yml +++ b/compose.yml @@ -1,13 +1,12 @@ -version: "3.9" services: updater: container_name: ubuntu-mirror-updater restart: unless-stopped + image: git.send.nrw/sendnrw/ubuntu-mirror-sync:latest volumes: - /docker/ubuntu-apt-mirror/data:/var/spool/apt-mirror networks: - traefik-net - image: compose-updater web: image: git.send.nrw/sendnrw/go-ubuntu-mirror:latest container_name: ubuntu-mirror-web @@ -15,24 +14,34 @@ services: depends_on: - updater volumes: - - /docker/ubuntu-apt-mirror/data:/data - command: -archive=/data/mirror/archive.ubuntu.com/ubuntu -security=/data/mirror/security.ubuntu.com/ubuntu -old=/data/mirror/old-releases.ubuntu.com/ubuntu -autoindex=true -cache=600 -addr=:8080 -trust-proxy=true -log-json=false + - /docker/ubuntu-apt-mirror/data:/data:ro + command: + - -archive=/data/mirror/archive.ubuntu.com/ubuntu + - -security=/data/mirror/security.ubuntu.com/ubuntu + - -old=/data/mirror/old-releases.ubuntu.com/ubuntu + - -autoindex=true + - -cache=600 + - -addr=:8080 + - -trust-proxy=true + - -log-json=false labels: - traefik.enable=true + - traefik.docker.network=traefik-net - traefik.http.routers.ubuntu_mirror.rule=Host(`ubuntu-24-04.send.nrw`) - traefik.http.routers.ubuntu_mirror.entrypoints=websecure - traefik.http.routers.ubuntu_mirror.tls=true - traefik.http.routers.ubuntu_mirror.tls.certresolver=letsencrypt - traefik.http.routers.ubuntu_mirror.service=ubuntu_mirror_svc - - traefik.http.services.ubuntu_mirror_svc.loadbalancer.server.port=8080 - - traefik.http.services.ubuntu_mirror_svc.loadbalancer.server.scheme=http - traefik.http.routers.ubuntu_mirror_http.rule=Host(`ubuntu-24-04.send.nrw`) - traefik.http.routers.ubuntu_mirror_http.entrypoints=web - traefik.http.routers.ubuntu_mirror_http.service=ubuntu_mirror_svc + - traefik.http.routers.ubuntu_mirror_http.middlewares=to-https@docker + - traefik.http.services.ubuntu_mirror_svc.loadbalancer.server.port=8080 + - traefik.http.services.ubuntu_mirror_svc.loadbalancer.server.scheme=http - traefik.http.middlewares.to-https.redirectscheme.scheme=https - traefik.http.middlewares.to-https.redirectscheme.permanent=true networks: - traefik-net networks: traefik-net: - external: true \ No newline at end of file + external: true From b8fcca459d7e28f08cac3cda93ab3f588201fbfb Mon Sep 17 00:00:00 2001 From: groot Date: Thu, 9 Oct 2025 21:24:51 +0000 Subject: [PATCH 2/4] main.go aktualisiert --- main.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.go b/main.go index d58c53b..edb86d7 100644 --- a/main.go +++ b/main.go @@ -247,6 +247,17 @@ func main() { mux := http.NewServeMux() mux.Handle("/ubuntu/", http.StripPrefix("/ubuntu", handler)) + // Microsoft-Repos unter /ms/ (nur wenn vorhanden) + if st, err := os.Stat(*msRoot); err == nil && st.IsDir() { + mux.Handle("/ms/", http.StripPrefix("/ms", fileHandler{ + fs: http.Dir(*msRoot), + autoIndex: *autoIndex, + cacheMaxAge: time.Duration(*cacheSeconds) * time.Second, + })) + log.Printf("serving Microsoft repos at /ms from %s", *msRoot) + } else { + log.Printf("warn: microsoft root not found (%s) — /ms disabled", *msRoot) + } mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte("ok")) From f35f8f91c3de9434a976ca7de63f76e8577e8ea3 Mon Sep 17 00:00:00 2001 From: groot Date: Thu, 9 Oct 2025 21:25:34 +0000 Subject: [PATCH 3/4] compose.yml aktualisiert --- compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/compose.yml b/compose.yml index 4405576..d33350a 100644 --- a/compose.yml +++ b/compose.yml @@ -19,6 +19,7 @@ services: - -archive=/data/mirror/archive.ubuntu.com/ubuntu - -security=/data/mirror/security.ubuntu.com/ubuntu - -old=/data/mirror/old-releases.ubuntu.com/ubuntu + - -ms=/data/mirror/packages.microsoft.com/repos - -autoindex=true - -cache=600 - -addr=:8080 From c5a0936990cc4c9261b4a9fc993a5782ef932007 Mon Sep 17 00:00:00 2001 From: groot Date: Thu, 9 Oct 2025 21:26:39 +0000 Subject: [PATCH 4/4] main.go aktualisiert --- main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/main.go b/main.go index edb86d7..89b739d 100644 --- a/main.go +++ b/main.go @@ -211,6 +211,7 @@ func main() { archiveRoot = flag.String("archive", "/data/mirror/archive.ubuntu.com/ubuntu", "archive ubuntu root") securityRoot = flag.String("security", "/data/mirror/security.ubuntu.com/ubuntu", "security ubuntu root") oldReleases = flag.String("old", "/data/mirror/old-releases.ubuntu.com/ubuntu", "old-releases ubuntu root") + msRoot = flag.String("ms", "/data/mirror/packages.microsoft.com/repos", "microsoft repos root") autoIndex = flag.Bool("autoindex", true, "enable directory listings") cacheSeconds = flag.Int("cache", 600, "Cache-Control max-age seconds (0 to disable)") trustProxy = flag.Bool("trust-proxy", true, "trust X-Forwarded-For / X-Real-IP")