Change umami url and add middleware

This commit is contained in:
Julius 2022-05-26 17:14:44 +02:00
parent 6ca563ea5a
commit 40e4e8b13e
Signed by: j00lz
GPG key ID: AF241B0AA237BBA2
4 changed files with 32 additions and 21 deletions

View file

@ -3,9 +3,11 @@ kind: Ingress
metadata: metadata:
name: umami-deployment-ingress name: umami-deployment-ingress
namespace: asraphiel namespace: asraphiel
annotations:
traefik.ingress.kubernetes.io/router.middlewares: asraphiel-umamijs@kubernetescrd
spec: spec:
rules: rules:
- host: "analytics.asraphiel.dev" - host: "ikaros.asraphiel.dev"
http: http:
paths: paths:
- path: / - path: /

View file

@ -5,3 +5,4 @@ resources:
- ingress.yaml - ingress.yaml
- service.yaml - service.yaml
- secret.yaml - secret.yaml
- middleware.yaml

View file

@ -0,0 +1,9 @@
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: umamijs
namespace: asraphiel
spec:
replacePathRegex:
regex: ^/script\.js
replacement: /umami.js

View file

@ -21,7 +21,12 @@ let
''; '';
}; };
}; };
redirect = dest: {
forceSSL = true;
enableACME = true;
http2 = true;
globalRedirect = dest;
};
k8sProxy = proxy "http://kubernetes.lxd:8080/"; k8sProxy = proxy "http://kubernetes.lxd:8080/";
in { in {
imports = [ ../../common ../../common/lxc.nix ]; imports = [ ../../common ../../common/lxc.nix ];
@ -52,20 +57,14 @@ in {
virtualHosts."s3.asraphiel.dev" = bigProxy "http://minio.lxd:9000/"; virtualHosts."s3.asraphiel.dev" = bigProxy "http://minio.lxd:9000/";
virtualHosts."shell.s3.asraphiel.dev" = proxy "http://minio.lxd:9001/"; virtualHosts."shell.s3.asraphiel.dev" = proxy "http://minio.lxd:9001/";
virtualHosts."cdn.voidcorp.nl" = { virtualHosts."cdn.voidcorp.nl" = redirect "s3.asraphiel.dev";
forceSSL = true;
enableACME = true;
http2 = true;
globalRedirect = "s3.asraphiel.dev";
};
virtualHosts."cdn.asraphiel.dev" = k8sProxy; virtualHosts."cdn.asraphiel.dev" = k8sProxy;
virtualHosts."registry.asraphiel.dev" = proxy "http://registry.lxd:5000/"; virtualHosts."registry.asraphiel.dev" = proxy "http://registry.lxd:5000/";
virtualHosts."registrydbg.asraphiel.dev" =
proxy "http://registry.lxd:5001/";
virtualHosts."vaultwarden.asraphiel.dev" = virtualHosts."vaultwarden.asraphiel.dev" =
proxy "http://vaultwarden.lxd:8000/"; proxy "http://vaultwarden.lxd:8000/";
virtualHosts."analytics.asraphiel.dev" = k8sProxy; virtualHosts."analytics.asraphiel.dev" = redirect "ikaros.asraphiel.dev";
virtualHosts."ikaros.asraphiel.dev" = k8sProxy;
virtualHosts."whoami.asraphiel.dev" = k8sProxy; virtualHosts."whoami.asraphiel.dev" = k8sProxy;
virtualHosts."groenehartansichtkaarten.nl" = k8sProxy; virtualHosts."groenehartansichtkaarten.nl" = k8sProxy;