make garage better

Signed-off-by: cy <cy@cy7.sh>
This commit is contained in:
cy 2025-01-30 12:35:19 -05:00
parent 4e0c1fbbb4
commit d0ba9ca90b
Signed by: cy
SSH key fingerprint: SHA256:o/geVWV4om1QhUSkKvDQeW/eAihwnjyXkqMwrVdbuts
2 changed files with 23 additions and 6 deletions

View file

@ -1,6 +1,4 @@
{
config,
lib,
pkgs,
...
}:

View file

@ -8,6 +8,12 @@
s3_api = {
s3_region = "earth";
api_bind_addr = "[::]:3900";
root_domain = ".s3.cy7.sh";
};
s3_web = {
bind_addr = "[::]:3902";
root_domain = ".web.s3.cy7.sh";
index = "index.html";
};
admin.api_bind_addr = "[::]:3903";
rpc_bind_addr = "[::]:3901";
@ -17,8 +23,21 @@
environmentFile = config.sops.secrets."garage/env".path;
};
services.caddy.virtualHosts."s3.cy7.sh".extraConfig = ''
import common
reverse_proxy localhost:3900
'';
services.caddy.virtualHosts = {
"s3.cy7.sh" = {
serverAliases = [ "*.s3.cy7.sh" ];
extraConfig = ''
import common
reverse_proxy localhost:3900
'';
};
"*.web.s3.cy7.sh".extraConfig = ''
import common
reverse_proxy localhost:3902
'';
"admin.s3.cy7.sh".extraConfig = ''
import common
reverse_proxy localhost:3903
'';
};
}