traefik: simplify http redirection
All checks were successful
flake check / check (push) Successful in 7m9s
fmt check / check (push) Successful in 39s

This commit is contained in:
notohh 2023-12-29 15:03:46 -05:00
parent b55cc65349
commit 2c41a17e23
Signed by: notohh
GPG key ID: BD47506D475EE86D

View file

@ -48,12 +48,6 @@
entrypoints = ["websecure"]; entrypoints = ["websecure"];
service = "api@internal"; service = "api@internal";
}; };
uptime-kuma-insecure = {
rule = "Host(`status.flake.sh`)";
entrypoints = ["web"];
service = "uptime-kuma";
middlewares = "redirect-to-https";
};
uptime-kuma = { uptime-kuma = {
rule = "Host(`status.flake.sh`)"; rule = "Host(`status.flake.sh`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -61,12 +55,6 @@
tls.domains = [{main = "*.flake.sh";}]; tls.domains = [{main = "*.flake.sh";}];
tls.certresolver = "production"; tls.certresolver = "production";
}; };
gotify-insecure = {
rule = "Host(`gotify.flake.sh`)";
entrypoints = ["web"];
service = "gotify";
middlewares = "redirect-to-https";
};
gotify = { gotify = {
rule = "Host(`gotify.flake.sh`)"; rule = "Host(`gotify.flake.sh`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -74,12 +62,6 @@
tls.domains = [{main = "*.flake.sh";}]; tls.domains = [{main = "*.flake.sh";}];
tls.certresolver = "production"; tls.certresolver = "production";
}; };
conduit-insecure = {
rule = "Host(`matrix.flake.sh`)";
entrypoints = ["web"];
service = "conduit";
middlewares = "redirect-to-https";
};
conduit = { conduit = {
rule = "Host(`matrix.flake.sh`)"; rule = "Host(`matrix.flake.sh`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -87,12 +69,6 @@
tls.domains = [{main = "*.flake.sh";}]; tls.domains = [{main = "*.flake.sh";}];
tls.certresolver = "production"; tls.certresolver = "production";
}; };
authelia-insecure = {
rule = "Host(`passport.notohh.dev`)";
entrypoints = ["web"];
service = "authelia";
middlewares = "redirect-to-https";
};
authelia = { authelia = {
rule = "Host(`passport.notohh.dev`)"; rule = "Host(`passport.notohh.dev`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -100,12 +76,6 @@
tls.domains = [{main = "*.notohh.dev";}]; tls.domains = [{main = "*.notohh.dev";}];
tls.certresolver = "production"; tls.certresolver = "production";
}; };
foundryvtt-insecure = {
rule = "Host(`foundry.flake.sh`)";
entrypoints = ["web"];
service = "authelia";
middlewares = "redirect-to-https";
};
foundryvtt = { foundryvtt = {
rule = "Host(`foundry.flake.sh`)"; rule = "Host(`foundry.flake.sh`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -113,12 +83,6 @@
tls.domains = [{main = "*.flake.sh";}]; tls.domains = [{main = "*.flake.sh";}];
tls.certresolver = "production"; tls.certresolver = "production";
}; };
forgejo-insecure = {
rule = "Host(`git.flake.sh`)";
entrypoints = ["web"];
service = "forgejo";
middlewares = "redirect-to-https";
};
forgejo = { forgejo = {
rule = "Host(`git.flake.sh`)"; rule = "Host(`git.flake.sh`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -127,12 +91,6 @@
tls.certresolver = "production"; tls.certresolver = "production";
middlewares = "cors"; middlewares = "cors";
}; };
rustypaste-insecure = {
rule = "Host(`i.flake.sh`)";
entrypoints = ["web"];
service = "rustypaste";
middlewares = "redirect-to-https";
};
rustypaste = { rustypaste = {
rule = "Host(`i.flake.sh`)"; rule = "Host(`i.flake.sh`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -140,12 +98,6 @@
tls.domains = [{main = "*.flake.sh";}]; tls.domains = [{main = "*.flake.sh";}];
tls.certresolver = "production"; tls.certresolver = "production";
}; };
grafana-insecure = {
rule = "Host(`metrics.flake.sh`)";
entrypoints = ["web"];
service = "grafana";
middlewares = "redirect-to-https";
};
grafana = { grafana = {
rule = "Host(`metrics.flake.sh`)"; rule = "Host(`metrics.flake.sh`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -153,12 +105,6 @@
tls.domains = [{main = "*.flake.sh";}]; tls.domains = [{main = "*.flake.sh";}];
tls.certresolver = "production"; tls.certresolver = "production";
}; };
hedgedoc-insecure = {
rule = "Host(`scratch.flake.sh`)";
entrypoints = ["web"];
service = "hedgedoc";
middlewares = "redirect-to-https";
};
hedgedoc = { hedgedoc = {
rule = "Host(`scratch.flake.sh`)"; rule = "Host(`scratch.flake.sh`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -166,12 +112,6 @@
tls.domains = [{main = "*.flake.sh";}]; tls.domains = [{main = "*.flake.sh";}];
tls.certresolver = "production"; tls.certresolver = "production";
}; };
vaultwarden-insecure = {
rule = "Host(`vault.flake.sh`)";
entrypoints = ["web"];
service = "vaultwarden";
middlewares = "redirect-to-https";
};
vaultwarden = { vaultwarden = {
rule = "Host(`vault.flake.sh`)"; rule = "Host(`vault.flake.sh`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -179,12 +119,6 @@
tls.domains = [{main = "*.flake.sh";}]; tls.domains = [{main = "*.flake.sh";}];
tls.certresolver = "production"; tls.certresolver = "production";
}; };
neko-insecure = {
rule = "Host(`neko.flake.sh`)";
entrypoints = ["web"];
service = "neko";
middlewares = "redirect-to-https";
};
neko = { neko = {
rule = "Host(`neko.flake.sh`)"; rule = "Host(`neko.flake.sh`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -192,12 +126,6 @@
tls.domains = [{main = "*.flake.sh";}]; tls.domains = [{main = "*.flake.sh";}];
tls.certresolver = "production"; tls.certresolver = "production";
}; };
justlog-insecure = {
rule = "Host(`logs.flake.sh`)";
entrypoints = ["web"];
service = "justlog";
middlewares = "redirect-to-https";
};
justlog = { justlog = {
rule = "Host(`logs.flake.sh`)"; rule = "Host(`logs.flake.sh`)";
entrypoints = ["websecure"]; entrypoints = ["websecure"];
@ -237,6 +165,10 @@
}; };
web = { web = {
address = ":80"; address = ":80";
http.redirections.entryPoint = {
to = "websecure";
scheme = "https";
};
}; };
ssh = { ssh = {
address = ":2222"; address = ":2222";