Removed settings that are no longer in use (#14802)

refs: TryGhost/Team#1625
refs: TryGhost/Team#1558

- none of these settings are actively used anymore

Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
This commit is contained in:
Hannah Wolfe 2022-05-13 21:19:21 +01:00 committed by GitHub
parent 0d71521b3c
commit 37818a1b71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 60 additions and 561 deletions

View File

@ -32,8 +32,6 @@ const keyTypeMapping = {
members_private_key: 'string',
members_email_auth_secret: 'string',
default_content_visibility: 'string',
members_from_address: 'string',
stripe_product_name: 'string',
stripe_secret_key: 'string',
stripe_publishable_key: 'string',
stripe_connect_publishable_key: 'string',

View File

@ -0,0 +1,52 @@
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
const settingsToRemove = [
'editor_is_launch_complete',
'members_free_price_name',
'members_free_price_description',
'members_paid_signup_redirect',
'members_free_signup_redirect',
'members_from_address',
'members_reply_address',
'stripe_product_name',
'newsletter_show_badge',
'newsletter_header_image',
'newsletter_show_header_icon',
'newsletter_show_header_title',
'newsletter_title_alignment',
'newsletter_title_font_category',
'newsletter_show_feature_image',
'newsletter_body_font_category',
'newsletter_footer_content'
];
// Settings that cannot be removed, but should not be used anymore
// 'members_monthly_price_id',
// 'members_yearly_price_id',
// 'portal_products',
// 'stripe_plans'
module.exports = createTransactionalMigration(
async function up(knex) {
const existingSettings = await knex('settings')
.whereIn('key', settingsToRemove)
.pluck('key');
const settingsInDatabase = settingsToRemove.filter(s => existingSettings.includes(s));
if (settingsInDatabase.length) {
logging.info(`Deleting settings: ${settingsInDatabase.join(', ')}`);
await knex('settings')
.whereIn('key', settingsInDatabase)
.del();
}
const settingsNotInDatabase = settingsToRemove.filter(s => !existingSettings.includes(s));
if (settingsNotInDatabase.length) {
logging.warn(`Unable to delete missing settings: ${settingsNotInDatabase.join(', ')}`);
}
},
async function down() {
// no-op: we don't want to recreate these settings without values
}
);

View File

@ -251,36 +251,11 @@
},
"type": "string"
},
"members_from_address": {
"defaultValue": "noreply",
"flags": "RO",
"type": "string"
},
"members_support_address": {
"defaultValue": "noreply",
"flags": "PUBLIC,RO",
"type": "string"
},
"members_reply_address": {
"defaultValue": "newsletter",
"validations": {
"isEmpty": false,
"isIn": [["newsletter", "support"]]
},
"type": "string"
},
"members_free_signup_redirect": {
"defaultValue": "/",
"type": "string"
},
"members_paid_signup_redirect": {
"defaultValue": "/",
"type": "string"
},
"stripe_product_name": {
"defaultValue": "Ghost Subscription",
"type": "string"
},
"stripe_secret_key": {
"defaultValue": null,
"type": "string"
@ -313,14 +288,6 @@
"defaultValue": null,
"type": "string"
},
"members_free_price_name": {
"defaultValue": "Free",
"type": "string"
},
"members_free_price_description": {
"defaultValue": "Free preview",
"type": "string"
},
"members_monthly_price_id": {
"defaultValue": null,
"type": "string"
@ -466,112 +433,6 @@
"type": "array"
}
},
"newsletter": {
"newsletter_show_badge": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [
[
"true",
"false"
]
]
},
"type": "boolean"
},
"newsletter_header_image": {
"defaultValue": null,
"validations": {
"isLength": {
"max": 2000
}
},
"type": "string"
},
"newsletter_show_header_icon": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [
[
"true",
"false"
]
]
},
"type": "boolean"
},
"newsletter_show_header_title": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [
[
"true",
"false"
]
]
},
"type": "boolean"
},
"newsletter_title_alignment": {
"defaultValue": "center",
"validations": {
"isEmpty": false,
"isIn": [
[
"center",
"left"
]
]
},
"type": "string"
},
"newsletter_title_font_category": {
"defaultValue": "sans_serif",
"validations": {
"isEmpty": false,
"isIn": [
[
"serif",
"sans_serif"
]
]
},
"type": "string"
},
"newsletter_show_feature_image": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [
[
"true",
"false"
]
]
},
"type": "boolean"
},
"newsletter_body_font_category": {
"defaultValue": "sans_serif",
"validations": {
"isEmpty": false,
"isIn": [
[
"serif",
"sans_serif"
]
]
},
"type": "string"
},
"newsletter_footer_content": {
"defaultValue": "",
"type": "string"
}
},
"oauth": {
"oauth_client_id" : {
"defaultValue": null,
@ -598,14 +459,6 @@
"editor_default_email_recipients_filter": {
"defaultValue": "all",
"type": "string"
},
"editor_is_launch_complete": {
"defaultValue": "false",
"validations": {
"isEmpty": false,
"isIn": [["true", "false"]]
},
"type": "boolean"
}
}
}

View File

@ -525,16 +525,6 @@ Object {
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "all",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": "RO",
"group": "members",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "members_from_address",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "noreply",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": "PUBLIC,RO",
@ -545,46 +535,6 @@ Object {
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "noreply",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "members",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "members_reply_address",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "newsletter",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "members",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "members_free_signup_redirect",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "/",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "members",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "members_paid_signup_redirect",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "/",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "members",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "stripe_product_name",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "Ghost Subscription",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
@ -665,26 +615,6 @@ Object {
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": null,
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "members",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "members_free_price_name",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "Free",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "members",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "members_free_price_description",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "Free preview",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
@ -915,96 +845,6 @@ Object {
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "[]",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "newsletter",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "newsletter_show_badge",
"type": "boolean",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": true,
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "newsletter",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "newsletter_header_image",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": null,
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "newsletter",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "newsletter_show_header_icon",
"type": "boolean",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": true,
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "newsletter",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "newsletter_show_header_title",
"type": "boolean",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": true,
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "newsletter",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "newsletter_title_alignment",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "center",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "newsletter",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "newsletter_title_font_category",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "sans_serif",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "newsletter",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "newsletter_show_feature_image",
"type": "boolean",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": true,
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "newsletter",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "newsletter_body_font_category",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "sans_serif",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "newsletter",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "newsletter_footer_content",
"type": "string",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
@ -1045,16 +885,6 @@ Object {
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": "all",
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"flags": null,
"group": "editor",
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
"key": "editor_is_launch_complete",
"type": "boolean",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"value": false,
},
Object {
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"group": "members",
@ -1121,7 +951,7 @@ exports[`Settings API Can request all settings 2: [headers] 1`] = `
Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "18486",
"content-length": "14854",
"content-type": "application/json; charset=utf-8",
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
"vary": "Origin, Accept-Encoding",

View File

@ -2,7 +2,7 @@ const assert = require('assert');
const {agentProvider, fixtureManager, mockManager, matchers} = require('../../utils/e2e-framework');
const {stringMatching, anyEtag, anyObjectId, anyISODateTime} = matchers;
const CURRENT_SETTINGS_COUNT = 87;
const CURRENT_SETTINGS_COUNT = 70;
const settingsMatcher = {
id: anyObjectId,

View File

@ -149,41 +149,11 @@ const defaultSettingsKeyTypes = [
type: 'string',
group: 'members'
},
{
key: 'members_from_address',
type: 'string',
group: 'members'
},
{
key: 'members_support_address',
type: 'string',
group: 'members'
},
{
key: 'members_reply_address',
type: 'string',
group: 'members'
},
{
key: 'members_paid_signup_redirect',
type: 'string',
group: 'members'
},
{
key: 'members_free_signup_redirect',
type: 'string',
group: 'members'
},
{
key: 'members_free_price_name',
type: 'string',
group: 'members'
},
{
key: 'members_free_price_description',
type: 'string',
group: 'members'
},
{
key: 'members_monthly_price_id',
type: 'string',
@ -194,11 +164,6 @@ const defaultSettingsKeyTypes = [
type: 'string',
group: 'members'
},
{
key: 'stripe_product_name',
type: 'string',
group: 'members'
},
{
key: 'stripe_plans',
type: 'array',
@ -349,51 +314,6 @@ const defaultSettingsKeyTypes = [
type: 'string',
group: 'site'
},
{
key: 'newsletter_show_badge',
type: 'boolean',
group: 'newsletter'
},
{
key: 'newsletter_header_image',
type: 'string',
group: 'newsletter'
},
{
key: 'newsletter_show_header_icon',
type: 'boolean',
group: 'newsletter'
},
{
key: 'newsletter_show_header_title',
type: 'boolean',
group: 'newsletter'
},
{
key: 'newsletter_title_alignment',
type: 'string',
group: 'newsletter'
},
{
key: 'newsletter_title_font_category',
type: 'string',
group: 'newsletter'
},
{
key: 'newsletter_show_feature_image',
type: 'boolean',
group: 'newsletter'
},
{
key: 'newsletter_body_font_category',
type: 'string',
group: 'newsletter'
},
{
key: 'newsletter_footer_content',
type: 'string',
group: 'newsletter'
},
{
key: 'oauth_client_id',
type: 'string',
@ -414,11 +334,6 @@ const defaultSettingsKeyTypes = [
type: 'string',
group: 'editor'
},
{
key: 'editor_is_launch_complete',
type: 'boolean',
group: 'editor'
},
{
key: 'labs',
type: 'object',

View File

@ -5,6 +5,8 @@ const db = require('../../../core/server/data/db');
// Stuff we are testing
const models = require('../../../core/server/models');
const SETTINGS_LENGTH = 79;
describe('Settings Model', function () {
before(models.init);
afterEach(testUtils.teardownDb);
@ -17,7 +19,7 @@ describe('Settings Model', function () {
await models.Settings.populateDefaults();
const settingsPopulated = await models.Settings.findAll();
settingsPopulated.length.should.equal(96);
settingsPopulated.length.should.equal(SETTINGS_LENGTH);
});
it('doesn\'t overwrite any existing settings', async function () {
@ -42,7 +44,7 @@ describe('Settings Model', function () {
await models.Settings.populateDefaults();
const settingsPopulated = await models.Settings.findAll();
settingsPopulated.length.should.equal(96);
settingsPopulated.length.should.equal(SETTINGS_LENGTH);
const titleSetting = settingsPopulated.models.find(s => s.get('key') === 'title');
titleSetting.get('value').should.equal('Testing Defaults');

View File

@ -198,7 +198,7 @@ describe('Exporter', function () {
// NOTE: if default settings changed either modify the settings keys blocklist or increase allowedKeysLength
// This is a reminder to think about the importer/exporter scenarios ;)
const allowedKeysLength = 86;
const allowedKeysLength = 69;
totalKeysLength.should.eql(SETTING_KEYS_BLOCKLIST.length + allowedKeysLength);
});
});

View File

@ -37,7 +37,7 @@ describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = '2f4266e6e5087ad92dd30f3e721d46e5';
const currentFixturesHash = '2509ff2c1f6e0293a3c3d84f08593b2f';
const currentSettingsHash = '53606d11dafcd3f4ab1acb3962122082';
const currentSettingsHash = '840ed1334fc8a1d5387bb4ceb134845f';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
// If this test is failing, then it is likely a change has been made that requires a DB version bump,

View File

@ -14,11 +14,9 @@ const configUtils = require('../../../../utils/configUtils');
function createSettingsMock({setDirect, setConnect}) {
const getStub = sinon.stub();
getStub.withArgs('members_from_address').returns('noreply');
getStub.withArgs('members_signup_access').returns('all');
getStub.withArgs('stripe_secret_key').returns(setDirect ? 'direct_secret' : null);
getStub.withArgs('stripe_publishable_key').returns(setDirect ? 'direct_publishable' : null);
getStub.withArgs('stripe_product_name').returns('Test');
getStub.withArgs('stripe_plans').returns([{
name: 'Monthly',
currency: 'usd',

View File

@ -14,11 +14,9 @@ const {getConfig} = require('../../../../../core/server/services/stripe/config')
function createSettingsMock({setDirect, setConnect}) {
const getStub = sinon.stub();
getStub.withArgs('members_from_address').returns('noreply');
getStub.withArgs('members_signup_access').returns('all');
getStub.withArgs('stripe_secret_key').returns(setDirect ? 'direct_secret' : null);
getStub.withArgs('stripe_publishable_key').returns(setDirect ? 'direct_publishable' : null);
getStub.withArgs('stripe_product_name').returns('Test');
getStub.withArgs('stripe_plans').returns([{
name: 'Monthly',
currency: 'usd',

View File

@ -251,36 +251,11 @@
},
"type": "string"
},
"members_from_address": {
"defaultValue": "noreply",
"flags": "RO",
"type": "string"
},
"members_support_address": {
"defaultValue": "noreply",
"flags": "PUBLIC,RO",
"type": "string"
},
"members_reply_address": {
"defaultValue": "newsletter",
"validations": {
"isEmpty": false,
"isIn": [["newsletter", "support"]]
},
"type": "string"
},
"members_free_signup_redirect": {
"defaultValue": "/",
"type": "string"
},
"members_paid_signup_redirect": {
"defaultValue": "/",
"type": "string"
},
"stripe_product_name": {
"defaultValue": "Ghost Subscription",
"type": "string"
},
"stripe_secret_key": {
"defaultValue": null,
"type": "string"
@ -313,14 +288,6 @@
"defaultValue": null,
"type": "string"
},
"members_free_price_name": {
"defaultValue": "Free",
"type": "string"
},
"members_free_price_description": {
"defaultValue": "Free preview",
"type": "string"
},
"members_monthly_price_id": {
"defaultValue": null,
"type": "string"
@ -466,112 +433,6 @@
"type": "array"
}
},
"newsletter": {
"newsletter_show_badge": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [
[
"true",
"false"
]
]
},
"type": "boolean"
},
"newsletter_header_image": {
"defaultValue": null,
"validations": {
"isLength": {
"max": 2000
}
},
"type": "string"
},
"newsletter_show_header_icon": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [
[
"true",
"false"
]
]
},
"type": "boolean"
},
"newsletter_show_header_title": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [
[
"true",
"false"
]
]
},
"type": "boolean"
},
"newsletter_title_alignment": {
"defaultValue": "center",
"validations": {
"isEmpty": false,
"isIn": [
[
"center",
"left"
]
]
},
"type": "string"
},
"newsletter_title_font_category": {
"defaultValue": "sans_serif",
"validations": {
"isEmpty": false,
"isIn": [
[
"serif",
"sans_serif"
]
]
},
"type": "string"
},
"newsletter_show_feature_image": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [
[
"true",
"false"
]
]
},
"type": "boolean"
},
"newsletter_body_font_category": {
"defaultValue": "sans_serif",
"validations": {
"isEmpty": false,
"isIn": [
[
"serif",
"sans_serif"
]
]
},
"type": "string"
},
"newsletter_footer_content": {
"defaultValue": "",
"type": "string"
}
},
"oauth": {
"oauth_client_id" : {
"defaultValue": null,
@ -598,14 +459,6 @@
"editor_default_email_recipients_filter": {
"defaultValue": "all",
"type": "string"
},
"editor_is_launch_complete": {
"defaultValue": "false",
"validations": {
"isEmpty": false,
"isIn": [["true", "false"]]
},
"type": "boolean"
}
}
}