feat(ops/modules): Redirect machine base names to their config
With this change, entering just "whitby.tvl.fyi" or "sanduny.tvl.su" in a browser will redirect users to their machine configurations. Change-Id: Ibf076a469bcce073e1b1970aa568d6fe16a5c75a Reviewed-on: https://cl.tvl.fyi/c/depot/+/5304 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Autosubmit: tazjin <tazjin@tvl.su>
This commit is contained in:
parent
f4f1d97052
commit
b936843bb0
4 changed files with 35 additions and 0 deletions
|
@ -15,6 +15,7 @@ in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(mod "tvl-users.nix")
|
(mod "tvl-users.nix")
|
||||||
|
(mod "www/sanduny.tvl.su.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
|
|
|
@ -41,6 +41,7 @@ in
|
||||||
"${depot.path}/ops/modules/www/todo.tvl.fyi.nix"
|
"${depot.path}/ops/modules/www/todo.tvl.fyi.nix"
|
||||||
"${depot.path}/ops/modules/www/tvl.fyi.nix"
|
"${depot.path}/ops/modules/www/tvl.fyi.nix"
|
||||||
"${depot.path}/ops/modules/www/tvl.su.nix"
|
"${depot.path}/ops/modules/www/tvl.su.nix"
|
||||||
|
"${depot.path}/ops/modules/www/whitby.tvl.fyi.nix"
|
||||||
"${depot.path}/ops/modules/www/wigglydonke.rs.nix"
|
"${depot.path}/ops/modules/www/wigglydonke.rs.nix"
|
||||||
"${depot.third_party.agenix.src}/modules/age.nix"
|
"${depot.third_party.agenix.src}/modules/age.nix"
|
||||||
"${pkgs.path}/nixos/modules/services/web-apps/gerrit.nix"
|
"${pkgs.path}/nixos/modules/services/web-apps/gerrit.nix"
|
||||||
|
|
16
ops/modules/www/sanduny.tvl.su.nix
Normal file
16
ops/modules/www/sanduny.tvl.su.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# Redirect sanduny.tvl.su to the machine configuration.
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./base.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
config.services.nginx.virtualHosts."sanduny.tvl.su" = {
|
||||||
|
serverName = "sanduny.tvl.su";
|
||||||
|
enableACME = true;
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
return 302 https://at.tvl.fyi/?q=%2F%2Fops%2Fmachines%2Fsanduny;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
17
ops/modules/www/whitby.tvl.fyi.nix
Normal file
17
ops/modules/www/whitby.tvl.fyi.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Redirect whitby.tvl.fyi to the machine configuration.
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./base.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
config.services.nginx.virtualHosts."whitby.tvl.fyi" = {
|
||||||
|
serverName = "whitby.tvl.fyi";
|
||||||
|
serverAliases = [ "whitby.tvl.su" ];
|
||||||
|
enableACME = true;
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
return 302 https://at.tvl.fyi/?q=%2F%2Fops%2Fmachines%2Fwhitby;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue