From 3ea7336b69b659d467c875ef488953db4e07c241 Mon Sep 17 00:00:00 2001 From: Tobias Manske Date: Mon, 27 Mar 2023 11:04:31 +0200 Subject: [PATCH] Add proxy service for arch repository --- coreos-config/playbook.yaml | 2 ++ .../compose_project/templates/repo_proxy/.env | 1 + .../templates/repo_proxy/Caddyfile | 11 ++++++++++ .../templates/repo_proxy/docker-compose.yaml | 22 +++++++++++++++++++ .../templates/repo_proxy/www/index.html | 1 + 5 files changed, 37 insertions(+) create mode 100644 coreos-config/roles/compose_project/templates/repo_proxy/.env create mode 100644 coreos-config/roles/compose_project/templates/repo_proxy/Caddyfile create mode 100644 coreos-config/roles/compose_project/templates/repo_proxy/docker-compose.yaml create mode 100644 coreos-config/roles/compose_project/templates/repo_proxy/www/index.html diff --git a/coreos-config/playbook.yaml b/coreos-config/playbook.yaml index 16426c9..34bd82d 100644 --- a/coreos-config/playbook.yaml +++ b/coreos-config/playbook.yaml @@ -104,6 +104,7 @@ - { role: compose_project, service: traefik } - { role: compose_project, service: keycloak } - { role: compose_project, service: minio } + - { role: compose_project, service: repo_proxy } - { role: compose_project, service: registry } - { role: compose_project, service: pantalaimon } - { role: compose_project, service: gitea } @@ -117,6 +118,7 @@ - { role: compose_project, service: search } - { role: compose_project, service: syncthing } - { role: compose_project, service: blog } + - { role: compose_project, service: wkd } - { role: compose_project, service: linktree } - { role: compose_project, service: caddy } - { role: compose_project, service: diun } diff --git a/coreos-config/roles/compose_project/templates/repo_proxy/.env b/coreos-config/roles/compose_project/templates/repo_proxy/.env new file mode 100644 index 0000000..74c1746 --- /dev/null +++ b/coreos-config/roles/compose_project/templates/repo_proxy/.env @@ -0,0 +1 @@ +COMPOSE_PROJECT_NAME=repo_proxy diff --git a/coreos-config/roles/compose_project/templates/repo_proxy/Caddyfile b/coreos-config/roles/compose_project/templates/repo_proxy/Caddyfile new file mode 100644 index 0000000..91b540a --- /dev/null +++ b/coreos-config/roles/compose_project/templates/repo_proxy/Caddyfile @@ -0,0 +1,11 @@ +{ + auto_https off +} +http://repo.tobiasmanske.de { + uri /os/* replace /os/ /repo/ + reverse_proxy /repo/* https://s3.tobiasmanske.de { + header_up Host s3.tobiasmanske.de + } + root * /var/www + file_server +} diff --git a/coreos-config/roles/compose_project/templates/repo_proxy/docker-compose.yaml b/coreos-config/roles/compose_project/templates/repo_proxy/docker-compose.yaml new file mode 100644 index 0000000..caed1ee --- /dev/null +++ b/coreos-config/roles/compose_project/templates/repo_proxy/docker-compose.yaml @@ -0,0 +1,22 @@ +--- +version: "3.4" + +services: + redirect: + image: caddy:2 + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile:ro,z + - ./www:/var/www:ro,Z + labels: + - "traefik.enable=true" + - "traefik.http.routers.repoproxy.rule=Host(`repo.tobiasmanske.de`)" + - "traefik.http.routers.repoproxy.entryPoints=websecure" + - "traefik.http.services.repoproxy.loadbalancer.server.port=80" + restart: always + networks: + - gateway + +networks: + gateway: + external: true +... diff --git a/coreos-config/roles/compose_project/templates/repo_proxy/www/index.html b/coreos-config/roles/compose_project/templates/repo_proxy/www/index.html new file mode 100644 index 0000000..557db03 --- /dev/null +++ b/coreos-config/roles/compose_project/templates/repo_proxy/www/index.html @@ -0,0 +1 @@ +Hello World