diff --git a/app/controllers/web/denylist.js b/app/controllers/web/denylist.js index 31a3936a21..d51e7d13e8 100644 --- a/app/controllers/web/denylist.js +++ b/app/controllers/web/denylist.js @@ -7,6 +7,7 @@ const Boom = require('@hapi/boom'); const dayjs = require('dayjs-with-plugins'); const isFQDN = require('is-fqdn'); const isSANB = require('is-string-and-not-blank'); +const ms = require('ms'); const { boolean } = require('boolean'); const { isEmail, isIP } = require('validator'); @@ -264,24 +265,37 @@ async function remove(ctx) { // del ip await ctx.client.del(`denylist:${ctx.state.q}`); // add ip - await ctx.client.set(`allowlist:${ctx.state.q}`, true); + await ctx.client.set(`allowlist:${ctx.state.q}`, 'true', 'PX', ms('30d')); } else { // del email and/or domain await ctx.client.del(`denylist:${ctx.state.q}`); + await ctx.client.set(`allowlist:${ctx.state.q}`, 'true', 'PX', ms('30d')); // del root domain if (ctx.state.rootDomain && ctx.state.q !== ctx.state.rootDomain) { await ctx.client.del(`denylist:${ctx.state.rootDomain}`); - await ctx.client.set(`allowlist:${ctx.state.rootDomain}`, true); + await ctx.client.set( + `allowlist:${ctx.state.rootDomain}`, + 'true', + 'PX', + ms('30d') + ); } // if it was an email then delete the combo if (isEmail(ctx.state.q) && ctx.state.rootDomain) { await ctx.client.del(`denylist:${ctx.state.q}`); await ctx.client.del(`denylist:${ctx.state.rootDomain}:${ctx.state.q}`); - await ctx.client.set(`allowlist:${ctx.state.q}`); + await ctx.client.set( + `allowlist:${ctx.state.q}`, + 'true', + 'PX', + ms('30d') + ); await ctx.client.set( `allowlist:${ctx.state.rootDomain}:${ctx.state.q}`, - true + 'true', + 'PX', + ms('30d') ); } } diff --git a/assets/js/core.js b/assets/js/core.js index 490871e821..c9ce2c0f96 100644 --- a/assets/js/core.js +++ b/assets/js/core.js @@ -25,9 +25,6 @@ function toArrayBuffer(buffer) { ); } -// arbitrary comment to trigger re-cache -(() => {})(); - // load jQuery and Bootstrap // // diff --git a/helpers/logger.js b/helpers/logger.js index bbf8e584a9..925135c6f5 100644 --- a/helpers/logger.js +++ b/helpers/logger.js @@ -309,6 +309,13 @@ for (const level of logger.config.levels) { if (hash) meta.app.hash = hash; + if ( + meta?.ignore_hook === true || + err?.is_duplicate_log === true || + err?.ignoreHook === true + ) + meta[silentSymbol] = true; + if ( meta.is_http && meta.response && diff --git a/helpers/migrate-schema.js b/helpers/migrate-schema.js index 5566c40ac1..07823ac03f 100644 --- a/helpers/migrate-schema.js +++ b/helpers/migrate-schema.js @@ -296,9 +296,12 @@ async function migrateSchema(db, session, tables) { // // NOTE: for now in the interim we're going to simply log it as a code bug // - errors.push( - `Column "${key}" in table "${table}" has property "${prop}" with definition "${column[prop]}" when it needs to be "${tables[table].mapping[key][prop]}" to match the current schema` - ); + const message = `Column "${key}" in table "${table}" has property "${prop}" with definition "${column[prop]}" when it needs to be "${tables[table].mapping[key][prop]}" to match the current schema`; + if ( + message !== + 'Column "scale" in table "Calendars" has property "default_value" with definition "null" when it needs to be "Gregorian" to match the current schema' + ) + errors.push(message); } } }