server: add wildcard matching to blocked hosts #260
Loading…
Reference in a new issue
No description provided.
Delete branch "wildcard-block-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds in wildcard matching. For instance:
*.bad.tld
will match:very.bad.tld
bad.*
will match:bad.something
*.bad.*
will match:very.bad.evil
Changelog: Changed
Supercedes: #259
@ -188,3 +188,3 @@
blockedInstances: "Blocked Instances"
blockedInstancesDescription: "List the hostnames of the instances that you want to\
\ block. Listed instances will no longer be able to communicate with this instance."
\ block. Listed instances will no longer be able to communicate with this instance. Supports wildcard patterns."
I think the wildcards should be described, i.e.
Maybe we should note that admins have to use punicoded domains. Or maybe a better idea to fix that in the backend?
Seems like punycode doesn't play nicely when the wildcard is within a segment instead of on its own segment...
點看.xyz
->xn--c1yn36f.xyz
點看*.xyz
->xn--*-et3cu64i.xyz
點看.*.xyz
->xn--c1yn36f.*.xyz
Wondering if we should only allow wildcards on their own domain segments...
@ -33,3 +54,3 @@
// don't check hosts again that we already know are suspended
// also avoids adding duplicates to the list
hosts.filter(host => !skipped.includes(host) && !host.includes(',')).join(','),
hosts.filter(host => !skipped.some(blockedHost => matchHost(host, blockedHost)) && !host.includes(',')).join(','),
I think this
matchHost
is not necessary because neitherhosts
norskipped
will contain wild cards.6d02286bd8
toa35c98bbd5