config: add dnslink-gateway-domains
#258
Labels
dif/medium
Prior experience is likely helpful
effort/days
Estimated to take multiple days, but less than a week
help wanted
Seeking public contribution on this issue
P2
Medium: Good to have, but can wait until someone steps up
Right now (2025Q1, rainbow v1.12), Rainbow will resolve every DNSLink domain passed via
Host
header, which is not the best configuration for public HTTP servers.We only have config options for path, subdomain, and trustless-only:
rainbow/main.go
Lines 120 to 137 in 1bf59f7
There is none for DNSLink gateway (based on the
Host
HTTP header), and instead we just handle every domain.Proposed improvement
Add a new config
dnslink-gateway-domains
, which takes a list of FQDN domains, similar tosubdomain-gateway-domains
.When set:
Host
headerHost
header UNLESS the domain ends with one of names safelisted viadnslink-gateway-domains
Prior art from Kubo
Kubo has global flag at Gateway.NoDNSLink which you can set to true, and then you can add your domain name to Gateway.PublicGateways and set Gateway.PublicGateways: NoDNSLink (for specific domain name) to false, allowing dnslink only on that hostname. See "Hardened dnslink gateway" recipe at https://github.com/ipfs/kubo/blob/master/docs/config.md#gateway-recipes
The text was updated successfully, but these errors were encountered: