blacklisted -> blocked

This commit is contained in:
Girish Ramakrishnan
2024-05-23 09:52:05 +02:00
parent 92b6a7e335
commit 4229e9921c
3 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -1380,7 +1380,7 @@ async function install(data, auditSource) {
error = validateEnv(env);
if (error) throw error;
if (constants.DEMO && constants.DEMO_BLACKLISTED_APPS.includes(appStoreId)) throw new BoxError(BoxError.BAD_FIELD, 'This app is blacklisted in the demo');
if (constants.DEMO && constants.DEMO_BLOCKED_APPS.includes(appStoreId)) throw new BoxError(BoxError.BAD_FIELD, 'This app is blocked in the demo');
// sendmail is enabled by default
const enableMailbox = 'enableMailbox' in data ? data.enableMailbox : true;
+1 -1
View File
@@ -52,7 +52,7 @@ exports = module.exports = {
DEMO: fs.existsSync('/etc/cloudron/DEMO'),
DEMO_USERNAME: 'cloudron',
DEMO_BLACKLISTED_APPS: [
DEMO_BLOCKED_APPS: [
'org.jupyter.cloudronapp',
'com.github.cloudtorrent',
'net.alltubedownload.cloudronapp',
+8 -8
View File
@@ -499,12 +499,12 @@ async function checkRblStatus(domain) {
const flippedIp = ip.split('.').reverse().join('.');
// https://tools.ietf.org/html/rfc5782
const blacklistedServers = [];
const blockedServers = [];
for (const rblServer of RBL_LIST) {
const [error, records] = await safe(dig.resolve(flippedIp + '.' + rblServer.dns, 'A', DNS_OPTIONS));
if (error || !records) continue; // not listed
debug(`checkRblStatus: ${domain} (flippedIp: ${flippedIp}) is in the blacklist of ${JSON.stringify(rblServer)}`);
debug(`checkRblStatus: ${domain} (flippedIp: ${flippedIp}) is in the blocklist of ${JSON.stringify(rblServer)}`);
const result = Object.assign({}, rblServer);
@@ -513,12 +513,12 @@ async function checkRblStatus(domain) {
debug(`checkRblStatus: ${domain} (error: ${error2?.message || null}) (txtRecords: ${JSON.stringify(txtRecords)})`);
blacklistedServers.push(result);
blockedServers.push(result);
}
debug(`checkRblStatus: ${domain} (ip: ${ip}) blacklistedServers: ${JSON.stringify(blacklistedServers)})`);
debug(`checkRblStatus: ${domain} (ip: ${ip}) blockedServers: ${JSON.stringify(blockedServers)})`);
return { status: blacklistedServers.length === 0, ip, servers: blacklistedServers };
return { status: blockedServers.length === 0, ip, servers: blockedServers };
}
async function getStatus(domain) {
@@ -574,14 +574,14 @@ async function getStatus(domain) {
}
async function checkConfiguration() {
let messages = {};
const messages = {};
const allDomains = await listDomains();
for (const domainObject of allDomains) {
const result = await getStatus(domainObject.domain);
let message = [];
const message = [];
Object.keys(result.dns).forEach((type) => {
const record = result.dns[type];
@@ -590,7 +590,7 @@ async function checkConfiguration() {
if (result.relay && result.relay.status === false) message.push(`Relay error: ${result.relay.value}`);
if (result.rbl && result.rbl.status === false) { // rbl field contents is optional
const servers = result.rbl.servers.map((bs) => `[${bs.name}](${bs.site})`); // in markdown
message.push(`This server's IP \`${result.rbl.ip}\` is blacklisted in the following servers - ${servers.join(', ')}`);
message.push(`This server's IP \`${result.rbl.ip}\` is blocked in the following servers - ${servers.join(', ')}`);
}
if (message.length) messages[domainObject.domain] = message;