hswaw/machines/customs: expose printmaster cups behind beyondspace

Change-Id: I017d239aa891ebd63a097fdc476f33d506a99f60
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1893
Reviewed-by: q3k <q3k@hackerspace.pl>
changes/93/1893/3
informatic 2024-02-01 23:00:30 +01:00 committed by informatic
parent 9abf3e7623
commit 4628133cb0
1 changed files with 7 additions and 6 deletions

View File

@ -2,8 +2,9 @@
let
beyondspaceDomains = {
"vending.waw.hackerspace.pl" = "https";
"label.waw.hackerspace.pl" = "http";
"vending.waw.hackerspace.pl" = { proto = "https"; port = 443; };
"label.waw.hackerspace.pl" = { proto = "http"; port = 80; };
"printmaster.waw.hackerspace.pl" = { proto = "http"; port = 631; };
};
in with lib; {
@ -28,12 +29,12 @@ in with lib; {
services.nginx.commonHttpConfig = ''
map $http_host $beyondspace_upstream_proto {
map $http_host $beyondspace_upstream_url {
hostnames;
default http;
default "https://customs.hackerspace.pl";
${concatStringsSep "\n" (mapAttrsToList (key: value: "${key} ${value};") beyondspaceDomains)}
${concatStringsSep "\n" (mapAttrsToList (key: value: ''${key} "${value.proto}://${key}:${toString value.port}";'') beyondspaceDomains)}
}
'';
@ -89,7 +90,7 @@ in with lib; {
auth_request_set $auth_cookie $upstream_http_set_cookie;
add_header Set-Cookie $auth_cookie;
proxy_pass $beyondspace_upstream_proto://$host$request_uri;
proxy_pass $beyondspace_upstream_url$request_uri;
'';
};
};