summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--katrin.d/kaas-auto-bora.template16
-rwxr-xr-xkatrin.d/kaas-auto-gen.sh14
-rw-r--r--katrin.d/kaas.conf16
4 files changed, 45 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index d843380..3cb8706 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
/koi*
/win-utf
/*.default
+kaas-auto*.conf
diff --git a/katrin.d/kaas-auto-bora.template b/katrin.d/kaas-auto-bora.template
new file mode 100644
index 0000000..b6560a9
--- /dev/null
+++ b/katrin.d/kaas-auto-bora.template
@@ -0,0 +1,16 @@
+location /@name@/ {
+ proxy_set_header Host @name@.kaas.kit.edu;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header Accept-Encoding "";
+
+ proxy_pass http://@name@.kaas.kit.edu/;
+ sub_filter @name@.kaas.kit.edu $host/@name@;
+ sub_filter "'/getdata/" "'/@name@/getdata/";
+ sub_filter '"/getdata/' '"/@name@/getdata/';
+ sub_filter "'/static/" "'/@name@/static/";
+ sub_filter '"/static/' '"/@name@/static/';
+ proxy_redirect default;
+# proxy_redirect http://@name@.kaas.kit.edu http://$host/@name@;
+}
diff --git a/katrin.d/kaas-auto-gen.sh b/katrin.d/kaas-auto-gen.sh
index 2f3e635..fddb0e0 100755
--- a/katrin.d/kaas-auto-gen.sh
+++ b/katrin.d/kaas-auto-gen.sh
@@ -19,6 +19,18 @@ function gen {
done
}
-gen > kaas-auto.conf
+function bora {
+ sites=$(oc get route --all-namespaces | grep -P "^(bora) | grep kaas.kit.edu" | awk '{ print $3 }' | cut -d '.' -f 1) # "
+ for site in $sites; do
+ adei=$(echo $site | grep -P "^adei-")
+
+ url=""
+ [ -n "$adei" ] && url="/adei"
+
+ cat kaas-auto-bora.template | sed -re "s|@name@|$site|g; s|@url@|$url|g"
+ done
+}
+gen > kaas-auto.conf
+bora > kaas-auto-bora.conf
diff --git a/katrin.d/kaas.conf b/katrin.d/kaas.conf
index fd05ef5..81fa241 100644
--- a/katrin.d/kaas.conf
+++ b/katrin.d/kaas.conf
@@ -1,4 +1,18 @@
location /adei/ {
proxy_pass http://adei-katrin.kaas.kit.edu;
-
}
+
+#Too complex...
+#location /rocketchat/ {
+# proxy_set_header Host rocketchat.kaas.kit.edu;
+# proxy_set_header X-Real-IP $remote_addr;
+# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+# proxy_set_header X-Forwarded-Proto $scheme;
+# proxy_set_header Accept-Encoding "";
+#
+# proxy_pass https://rocketchat.kaas.kit.edu/;
+# sub_filter rocketchat.kaas.kit.edu $host/rocketchat;
+# sub_filter 'src="/' 'src="/rocketchat/';
+# proxy_redirect http://rocketchat.kaas.kit.edu http://$host/rocketchat;
+# proxy_redirect https://rocketchat.kaas.kit.edu https://$host/rocketchat;
+#}