VEGAS/ipfs: subdomain gateway

BUG: ipfs config cannot escape domain dots, thus the following cannot be
applied with it:

PublicGateways.${domain} = {
  UseSubdomains = true;
  Paths = [
    "/ipfs"
    "/ipns"
  ];
};
This commit is contained in:
Max Headroom 2021-10-16 16:42:26 +02:00
parent 355abdd072
commit 736467f600

View file

@ -94,4 +94,29 @@ in
};
};
services.oauth2_proxy.nginx.virtualHosts = [ "ipfs.admin.${domain}" ];
inherit (tools.acme.dns01) age;
security.acme.certs."ipfs.${domain}" = {
domain = "*.ipfs.${domain}";
extraDomainNames = [ "*.ipns.${domain}" ];
dnsProvider = "rfc2136";
group = "nginx";
inherit (tools.acme.dns01) credentialsFile;
};
services.nginx.virtualHosts."ipfs.${domain}" = vhosts.basic // {
serverName = "~^(.+)\.(ip[fn]s)\.${domain}$";
enableACME = false;
useACMEHost = "ipfs.${domain}";
locations = {
"/" = {
proxyPass = "http://127.0.0.1:48280";
extraConfig = ''
add_header X-Content-Type-Options "";
add_header Access-Control-Allow-Origin *;
'';
};
};
};
}