server: block subdomains of a blocked host #259
Loading…
Reference in a new issue
No description provided.
Delete branch "wildcard-block"
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?
For example, if
blocked.tld
is blocked, then so isiam.blocked.tld
.Changelog: Changed
Hopefully I got where all of the blocked host checks were done, but let me know if there's any I missed.
Also if there's a better way to do this, that would be appeciated as well.
496094c4b8
toe8783d52b1
I think it would be a better idea to replace all checks with a function, similar to
shouldSkipInstance
. That way if we want to change it in the future we don't have to search everything again.I'm also not sure if we should always do this or if we should use an explicit
*
instead.i18n.ts.blockedInstancesDescription
should also be adjusted to reflect the new meaning.e8783d52b1
toe64fe1c04d
I decided to just use
shouldSkipInstance
since it does what all of those previous checks did.Using that is a very bad idea in
queue/processors/inbox
because it would mean you can never unblock an instance if it was blocked more than the dead instance threshold. Currently, if an instance sends something our way, the instance will no longer be detected as dead because thelastCommunicatedAt
will be updated. Blocking an instance from sending us something if they are dead disallows this. It needs to be a separate function.e64fe1c04d
to1765caa7c5
1765caa7c5
to0f709026b1
Good point, I made a separate function for that.
@ -12,0 +29,4 @@
return true;
}
const result = await db.query('SELECT "host" FROM instance WHERE ("host" = $1 OR "host" LIKE \'%.\' || $1) AND "isSuspended"', [
Being suspended does not mean incoming activities will be dropped.
I'm still thinking about using a
*
placeholder because it could also allow to block all hosts that start withmisskey-forkbomb
... 🤔@ -20,3 +39,3 @@
const { blockedHosts } = await fetchMeta();
const skipped = hosts.filter(host => blockedHosts.includes(host));
const skipped = hosts.filter(host => blockedHosts.some(blockedHost => sameOrSubdomainOf(host, blockedHost)));
Closed in favour of #260
Pull request closed