From 67202a4a4bbb46882ab9f406ddceb9d499cbf568 Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Fri, 5 Feb 2021 18:32:10 +0100 Subject: [PATCH] Remove haproxy Replaced by Caddy --- haproxy/Dockerfile | 5 ----- haproxy/Dockerfile.dev | 5 ----- haproxy/Makefile | 3 --- haproxy/build.sh | 6 ------ haproxy/prepare-cert.sh | 27 --------------------------- haproxy/src/haproxy.common.cfg | 31 ------------------------------- haproxy/src/haproxy.dev.cfg | 20 -------------------- haproxy/src/haproxy.prod.cfg | 26 -------------------------- 8 files changed, 123 deletions(-) delete mode 100644 haproxy/Dockerfile delete mode 100644 haproxy/Dockerfile.dev delete mode 100644 haproxy/Makefile delete mode 100755 haproxy/build.sh delete mode 100755 haproxy/prepare-cert.sh delete mode 100644 haproxy/src/haproxy.common.cfg delete mode 100644 haproxy/src/haproxy.dev.cfg delete mode 100644 haproxy/src/haproxy.prod.cfg diff --git a/haproxy/Dockerfile b/haproxy/Dockerfile deleted file mode 100644 index 2505e8fb5..000000000 --- a/haproxy/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM haproxy:2.0-alpine -COPY src/haproxy.common.cfg /usr/local/etc/haproxy/haproxy.common.cfg -COPY src/haproxy.prod.cfg /usr/local/etc/haproxy/haproxy.prod.cfg -COPY src/combined.pem /usr/local/etc/haproxy/combined.pem -CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.common.cfg", "-f", "/usr/local/etc/haproxy/haproxy.prod.cfg"] \ No newline at end of file diff --git a/haproxy/Dockerfile.dev b/haproxy/Dockerfile.dev deleted file mode 100644 index bdd6e35b2..000000000 --- a/haproxy/Dockerfile.dev +++ /dev/null @@ -1,5 +0,0 @@ -FROM haproxy:2.0-alpine -COPY src/haproxy.common.cfg /usr/local/etc/haproxy/haproxy.common.cfg -COPY src/haproxy.dev.cfg /usr/local/etc/haproxy/haproxy.dev.cfg -COPY src/combined.pem /usr/local/etc/haproxy/combined.pem -CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.common.cfg", "-f", "/usr/local/etc/haproxy/haproxy.dev.cfg"] \ No newline at end of file diff --git a/haproxy/Makefile b/haproxy/Makefile deleted file mode 100644 index 08107a1a5..000000000 --- a/haproxy/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -build-dev: - ./prepare-cert.sh - docker build -t os3-haproxy-dev -f Dockerfile.dev . diff --git a/haproxy/build.sh b/haproxy/build.sh deleted file mode 100755 index 1a73eb1dc..000000000 --- a/haproxy/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" -./prepare-cert.sh -docker build --tag "${img:-openslides/openslides-${service_name}:latest}" \ - --pull "${OPTIONS[@]}" . diff --git a/haproxy/prepare-cert.sh b/haproxy/prepare-cert.sh deleted file mode 100755 index 62d6f2037..000000000 --- a/haproxy/prepare-cert.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -e -cd "$(dirname "$0")" - -# check, if we already generated a cert -combined="src/combined.pem" - -if [[ ! -f $combined ]]; then - echo "Creating certificates..." - cd src - if type 2>&1 >/dev/null openssl ; then - echo "Using openssl to generate a certificate." - echo "You will need to accept an security exception for the" - echo "generated certificate in your browser manually." - openssl req -x509 -newkey rsa:4096 -nodes -days 3650 \ - -subj "/C=DE/O=Selfsigned Test/CN=localhost" \ - -keyout localhost-key.pem -out localhost.pem - else - echo >&2 "FATAL: No valid certificate generation tool found!" - exit -1 - fi - cat localhost.pem localhost-key.pem > combined.pem - echo "done" -else - echo "Certificate exists." -fi \ No newline at end of file diff --git a/haproxy/src/haproxy.common.cfg b/haproxy/src/haproxy.common.cfg deleted file mode 100644 index 6e764bd5f..000000000 --- a/haproxy/src/haproxy.common.cfg +++ /dev/null @@ -1,31 +0,0 @@ -global - log stdout format raw local0 debug - -defaults - option http-use-htx - option dontlognull - timeout connect 3s - timeout client 10s - timeout client-fin 10s - timeout server 10s - timeout server-fin 10s - timeout check 2s - timeout tunnel 10s - timeout queue 2s - log global - option httplog - -resolvers docker_resolver - nameserver dns 127.0.0.11:53 - -backend backend_server - mode http - # Do not pass the auth-header from /stats to OS. It confuses the server... - http-request del-header authorization - timeout server 4m - server server server:8000 resolvers docker_resolver check alpn http/1.1 - -backend backend_autoupdate - mode http - timeout server 1h - server autoupdate autoupdate:8002 resolvers docker_resolver check ssl verify none alpn h2 diff --git a/haproxy/src/haproxy.dev.cfg b/haproxy/src/haproxy.dev.cfg deleted file mode 100644 index f8c2e19d4..000000000 --- a/haproxy/src/haproxy.dev.cfg +++ /dev/null @@ -1,20 +0,0 @@ -frontend https - mode http - bind *:8000 ssl crt /usr/local/etc/haproxy/combined.pem alpn h2,http/1.1 - default_backend backend_client - - acl autoupdate path_beg -i /system - use_backend backend_autoupdate if autoupdate - - acl server path_beg -i /apps /media/ /rest /server-version.txt - use_backend backend_server if server - - stats enable - stats uri /stats - stats refresh 10s - stats auth admin:admin - -backend backend_client - mode http - timeout tunnel 1h - server client client:4200 resolvers docker_resolver no-check diff --git a/haproxy/src/haproxy.prod.cfg b/haproxy/src/haproxy.prod.cfg deleted file mode 100644 index 599c800f7..000000000 --- a/haproxy/src/haproxy.prod.cfg +++ /dev/null @@ -1,26 +0,0 @@ -frontend https - mode http - bind *:8000 ssl crt /usr/local/etc/haproxy/combined.pem alpn h2,http/1.1 - default_backend backend_client - - acl autoupdate path_beg -i /system - use_backend backend_autoupdate if autoupdate - - acl server path_beg -i /apps /rest /server-version.txt - use_backend backend_server if server - - acl media path_beg -i /media/ - use_backend backend_media if media - - stats enable - stats uri /stats - stats refresh 10s - stats auth admin:admin - -backend backend_client - mode http - server client client:80 resolvers docker_resolver check - -backend backend_media - mode http - server media media:8000 resolvers docker_resolver check