mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Made default settings file location configurable
refs https://github.com/TryGhost/Toolbox/issues/214 - The values configuration for the settings table need to become configurable to be able to run our test environment with a pre-defined set of configurations (e.g Stripe-related values). - This change makes it possible to define the default settings file location (currently a JSON) - A new key is now exposed through the "paths.defaultSettings" key in settings, which can be overloaded for the needs of the environment
This commit is contained in:
parent
7f0bf62ec9
commit
4700b14d93
5 changed files with 9 additions and 2 deletions
6
core/server/data/schema/default-settings/index.js
Normal file
6
core/server/data/schema/default-settings/index.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
const config = require('../../../../shared/config');
|
||||
|
||||
const defaultSettingsPath = config.get('paths').defaultSettings;
|
||||
const defaultSettings = require(defaultSettingsPath);
|
||||
|
||||
module.exports = defaultSettings;
|
|
@ -17,6 +17,7 @@
|
|||
"paths": {
|
||||
"contentPath": "content/",
|
||||
"fixtures": "core/server/data/schema/fixtures/fixtures",
|
||||
"defaultSettings": "core/server/data/schema/default-settings/default-settings",
|
||||
"assetSrc": "core/frontend/src"
|
||||
},
|
||||
"adapters": {
|
||||
|
|
|
@ -191,7 +191,7 @@ describe('Exporter', function () {
|
|||
const {
|
||||
SETTING_KEYS_BLOCKLIST
|
||||
} = require('../../../../../core/server/data/exporter/table-lists.js');
|
||||
const defaultSettings = require('../../../../../core/server/data/schema/default-settings.json');
|
||||
const defaultSettings = require('../../../../../core/server/data/schema/default-settings/default-settings.json');
|
||||
|
||||
const totalKeysLength = Object.keys(defaultSettings).reduce((acc, curr, index) => {
|
||||
return acc + Object.keys(defaultSettings[curr]).length;
|
||||
|
|
|
@ -7,7 +7,7 @@ const path = require('path');
|
|||
const {config} = require('../../../../utils/configUtils');
|
||||
const schema = require('../../../../../core/server/data/schema/schema');
|
||||
const fixtures = require('../../../../../core/server/data/schema/fixtures/fixtures.json');
|
||||
const defaultSettings = require('../../../../../core/server/data/schema/default-settings.json');
|
||||
const defaultSettings = require('../../../../../core/server/data/schema/default-settings/default-settings.json');
|
||||
|
||||
// Routes are yaml so we can require the file directly
|
||||
const routeSettings = require('../../../../../core/server/services/route-settings');
|
||||
|
|
Loading…
Add table
Reference in a new issue