only check meta.blockedHosts
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
This commit is contained in:
parent
1b6361f289
commit
492c116510
1 changed files with 1 additions and 8 deletions
|
@ -25,14 +25,7 @@ function sameOrSubdomainOf(host: Instance['host'], blockedHost: Instance['host']
|
||||||
*/
|
*/
|
||||||
export async function shouldBlockInstance(host: Instance['host']): Promise<boolean> {
|
export async function shouldBlockInstance(host: Instance['host']): Promise<boolean> {
|
||||||
const { blockedHosts } = await fetchMeta();
|
const { blockedHosts } = await fetchMeta();
|
||||||
if (blockedHosts.some(blockedHost => sameOrSubdomainOf(host, blockedHost))) {
|
return blockedHosts.some(blockedHost => sameOrSubdomainOf(host, blockedHost));
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = await db.query('SELECT "host" FROM instance WHERE ("host" = $1 OR "host" LIKE \'%.\' || $1) AND "isSuspended"', [
|
|
||||||
host,
|
|
||||||
]);
|
|
||||||
return result.host.length > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue