configuration.nix/hosts/wynne/services/apps/acomputer.lol.nix

43 lines
1.2 KiB
Nix
Raw Normal View History

2024-09-14 19:55:57 +05:30
_:
let
inherit (import ../../../shared/caddy-helpers.nix) logFormat;
domainName = "acomputer.lol";
in
{
2024-07-20 23:16:03 +05:30
services = {
2024-09-14 19:55:57 +05:30
caddy.virtualHosts."${domainName}" = {
logFormat = logFormat domainName;
2024-07-20 23:16:03 +05:30
extraConfig = ''
handle /.well-known/matrix/server {
header Content-Type application/json
header Access-Control-Allow-Origin *
2024-09-14 19:55:57 +05:30
respond `{"m.server": "matrix.${domainName}:443"}`
2024-07-20 23:16:03 +05:30
}
handle /.well-known/matrix/client {
header Content-Type application/json
header Access-Control-Allow-Origin *
#respond `{"m.homeserver": {"base_url": "https://matrix.${domainName}:443"}, "org.matrix.msc3575.proxy": {"url": "https://matrix.${domainName}"}}`
respond `{"m.homeserver": {"base_url": "https://matrix.${domainName}:443"}}`
2024-07-20 23:16:03 +05:30
}
'';
};
frp.settings.proxies = [
{
2024-09-14 19:55:57 +05:30
name = "http.${domainName}";
2024-07-20 23:16:03 +05:30
type = "http";
2024-09-14 19:55:57 +05:30
customDomains = [ "${domainName}" ];
2024-07-20 23:16:03 +05:30
localPort = 80;
transport.useCompression = true;
}
{
2024-09-14 19:55:57 +05:30
name = "https.${domainName}";
2024-07-20 23:16:03 +05:30
type = "https";
2024-09-14 19:55:57 +05:30
customDomains = [ "${domainName}" ];
2024-07-20 23:16:03 +05:30
localPort = 443;
transport.useCompression = true;
}
];
};
}