feat: config-manager component

This commit is contained in:
NGPixel
2017-10-08 17:21:36 -04:00
parent c26fae2ede
commit c94e2d5700
24 changed files with 461 additions and 155 deletions

View File

@@ -1,5 +1,3 @@
'use strict'
/* global wiki */
const _ = require('lodash')

View File

@@ -1,5 +1,3 @@
'use strict'
/* global wiki */
const fs = require('fs')
@@ -9,8 +7,6 @@ const path = require('path')
const cfgHelper = require('../helpers/config')
module.exports = {
SUBSETS: ['auth', 'features', 'git', 'logging', 'site', 'theme', 'uploads'],
/**
* Load root config from disk
*/
@@ -64,7 +60,7 @@ module.exports = {
*/
loadFromDb(subsets) {
if (!_.isArray(subsets) || subsets.length === 0) {
subsets = this.SUBSETS
subsets = wiki.data.configNamespaces
}
return wiki.db.Setting.findAll({

View File

@@ -110,7 +110,7 @@ module.exports = {
// -> Sync DB Schemas
syncSchemas() {
return self.inst.sync({
force: true,
force: false,
logging: log => { wiki.logger.log('verbose', log) }
})
},