tests - also edit root domain

This commit is contained in:
bunkerity 2022-07-15 09:46:50 +02:00
parent 6e47b29919
commit 4bd0129e46
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
4 changed files with 59 additions and 3 deletions

View File

@ -1 +1,54 @@
aa
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress
annotations:
bunkerweb.io/AUTO_LETS_ENCRYPT: "yes"
bunkerweb.io/app1.example.com_REVERSE_PROXY_AUTH_REQUEST: "/authelia"
bunkerweb.io/app1.example.com_REVERSE_PROXY_AUTH_REQUEST_SIGNIN_URL: "https://auth.example.com/?rd=$$scheme%3A%2F%2F$$host$$request_uri"
bunkerweb.io/app1.example.com_REVERSE_PROXY_AUTH_REQUEST_SET: "$$user $$upstream_http_remote_user;$$groups $$upstream_http_remote_groups;$$name $$upstream_http_remote_name;$$email $$upstream_http_remote_email"
bunkerweb.io/app1.example.com_REVERSE_PROXY_HEADERS: "Remote-User $$user;Remote-Groups $$groups;Remote-Name $$name;Remote-Email $$email"
bunkerweb.io/app1.example.com_REVERSE_PROXY_URL_999: "/authelia"
bunkerweb.io/app1.example.com_REVERSE_PROXY_HOST_999: "http://authelia:9091/api/verify"
bunkerweb.io/app1.example.com_REVERSE_PROXY_HEADERS_999: "X-Original-URL $$scheme://$$http_host$$request_uri;Content-Length ''"
bunkerweb.io/app2.example.com_REVERSE_PROXY_AUTH_REQUEST: "/authelia"
bunkerweb.io/app2.example.com_REVERSE_PROXY_AUTH_REQUEST_SIGNIN_URL: "https://auth.example.com/?rd=$$scheme%3A%2F%2F$$host$$request_uri"
bunkerweb.io/app2.example.com_REVERSE_PROXY_AUTH_REQUEST_SET: "$$user $$upstream_http_remote_user;$$groups $$upstream_http_remote_groups;$$name $$upstream_http_remote_name;$$email $$upstream_http_remote_email"
bunkerweb.io/app2.example.com_REVERSE_PROXY_HEADERS: "Remote-User $$user;Remote-Groups $$groups;Remote-Name $$name;Remote-Email $$email"
bunkerweb.io/app2.example.com_REVERSE_PROXY_URL_999: "/authelia"
bunkerweb.io/app2.example.com_REVERSE_PROXY_HOST_999: "http://authelia:9091/api/verify"
bunkerweb.io/app2.example.com_REVERSE_PROXY_HEADERS_999: "X-Original-URL $$scheme://$$http_host$$request_uri;Content-Length ''"
bunkerweb.io/auth.example.com_REVERSE_PROXY_INTERCEPT_ERRORS: "no"
spec:
rules:
- host: app1.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: svc-app1
port:
number: 80
- host: app2.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: svc-app2
port:
number: 80
- host: auth.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: svc-athelia
port:
number: 9091
---

View File

@ -83,6 +83,7 @@ class AutoconfTest(Test) :
for ex_domain, test_domain in self._domains.items() :
Test.replace_in_files(test, ex_domain, test_domain)
Test.rename(test, ex_domain, test_domain)
Test.replace_in_files(test, "example.com", getenv("ROOT_DOMAIN"))
setup = test + "/setup-autoconf.sh"
if isfile(setup) :
proc = run("sudo ./setup-autoconf.sh", cwd=test, shell=True)

View File

@ -42,6 +42,7 @@ class DockerTest(Test) :
for ex_domain, test_domain in self._domains.items() :
Test.replace_in_files(test, ex_domain, test_domain)
Test.rename(test, ex_domain, test_domain)
Test.replace_in_files(test, "example.com", getenv("ROOT_DOMAIN"))
setup = test + "/setup-docker.sh"
if isfile(setup) :
proc = run("sudo ./setup-docker.sh", cwd=test, shell=True)

View File

@ -13,8 +13,8 @@ class SwarmTest(Test) :
super().__init__(name, "swarm", timeout, tests)
self._domains = {
r"www\.example\.com": getenv("TEST_DOMAIN1"),
r"auth\.example\.com": getenv("TEST_DOMAIN2"),
r"app1\.example\.com": getenv("TEST_DOMAIN3"),
r"auth\.example\.com": getenv("TEST_DOMAIN1"),
r"app1\.example\.com": getenv("TEST_DOMAIN1"),
r"app2\.example\.com": getenv("TEST_DOMAIN2"),
r"app3\.example\.com": getenv("TEST_DOMAIN3")
}
@ -79,6 +79,7 @@ class SwarmTest(Test) :
for ex_domain, test_domain in self._domains.items() :
Test.replace_in_files(test, ex_domain, test_domain)
Test.rename(test, ex_domain, test_domain)
Test.replace_in_files(test, "example.com", getenv("ROOT_DOMAIN"))
setup = test + "/setup-swarm.sh"
if isfile(setup) :
proc = run("sudo ./setup-swarm.sh", cwd=test, shell=True)