mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 16:05:49 +01:00
closes #3176
This commit is contained in:
@@ -1,106 +1,28 @@
|
||||
[
|
||||
{
|
||||
"field": "title",
|
||||
"value": "NodeBB"
|
||||
},
|
||||
{
|
||||
"field": "showSiteTitle",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"field": "postDelay",
|
||||
"value": 10
|
||||
},
|
||||
{
|
||||
"field": "initialPostDelay",
|
||||
"value": 10
|
||||
},
|
||||
{
|
||||
"field": "newbiePostDelay",
|
||||
"value": 120
|
||||
},
|
||||
{
|
||||
"field": "newbiePostDelayThreshold",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"field": "minimumPostLength",
|
||||
"value": 8
|
||||
},
|
||||
{
|
||||
"field": "maximumPostLength",
|
||||
"value": 32767
|
||||
},
|
||||
{
|
||||
"field": "allowGuestSearching",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"field": "allowTopicsThumbnail",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"field": "allowRegistration",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"field": "allowLocalLogin",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"field": "allowAccountDelete",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"field": "allowFileUploads",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"field": "maximumFileSize",
|
||||
"value": 2048
|
||||
},
|
||||
{
|
||||
"field": "minimumTitleLength",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"field": "maximumTitleLength",
|
||||
"value": 255
|
||||
},
|
||||
{
|
||||
"field": "minimumUsernameLength",
|
||||
"value": 2
|
||||
},
|
||||
{
|
||||
"field": "maximumUsernameLength",
|
||||
"value": 16
|
||||
},
|
||||
{
|
||||
"field": "minimumPasswordLength",
|
||||
"value": 6
|
||||
},
|
||||
{
|
||||
"field": "maximumSignatureLength",
|
||||
"value": 255
|
||||
},
|
||||
{
|
||||
"field": "maximumAboutMeLength",
|
||||
"value": 1000
|
||||
},
|
||||
{
|
||||
"field": "maximumProfileImageSize",
|
||||
"value": 256
|
||||
},
|
||||
{
|
||||
"field": "profileImageDimension",
|
||||
"value": 128
|
||||
},
|
||||
{
|
||||
"field": "requireEmailConfirmation",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"field": "profile:allowProfileImageUploads",
|
||||
"value": 1
|
||||
}
|
||||
]
|
||||
{
|
||||
"title": "NodeBB",
|
||||
"showSiteTitle": 1,
|
||||
"postDelay": 10,
|
||||
"initialPostDelay": 10,
|
||||
"newbiePostDelay": 120,
|
||||
"newbiePostDelayThreshold": 3,
|
||||
"minimumPostLength": 8,
|
||||
"maximumPostLength": 32767,
|
||||
"allowGuestSearching": 0,
|
||||
"allowTopicsThumbnail": 0,
|
||||
"allowRegistration": 1,
|
||||
"allowLocalLogin": 1,
|
||||
"allowAccountDelete": 1,
|
||||
"allowFileUploads": 0,
|
||||
"maximumFileSize": 2048,
|
||||
"minimumTitleLength": 3,
|
||||
"maximumTitleLength": 255,
|
||||
"minimumUsernameLength": 2,
|
||||
"maximumUsernameLength": 16,
|
||||
"minimumPasswordLength": 6,
|
||||
"maximumSignatureLength": 255,
|
||||
"maximumAboutMeLength": 1000,
|
||||
"maximumProfileImageSize": 256,
|
||||
"profileImageDimension": 128,
|
||||
"requireEmailConfirmation": 0,
|
||||
"profile:allowProfileImageUploads": 1
|
||||
}
|
||||
|
||||
@@ -239,24 +239,39 @@ function setupDefaultConfigs(next) {
|
||||
var meta = require('./meta'),
|
||||
defaults = require(path.join(__dirname, '../', 'install/data/defaults.json'));
|
||||
|
||||
async.each(defaults, function (configObj, next) {
|
||||
meta.configs.setOnEmpty(configObj.field, configObj.value, next);
|
||||
async.each(Object.keys(defaults), function (key, next) {
|
||||
meta.configs.setOnEmpty(key, defaults[key], next);
|
||||
}, function (err) {
|
||||
meta.configs.init(next);
|
||||
});
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if (install.values) {
|
||||
setIfPaired('social:twitter:key', 'social:twitter:secret');
|
||||
setIfPaired('social:google:id', 'social:google:secret');
|
||||
setIfPaired('social:facebook:app_id', 'social:facebook:secret');
|
||||
async.parallel([
|
||||
async.apply(setIfPaired, 'social:twitter:key', 'social:twitter:secret'),
|
||||
async.apply(setIfPaired, 'social:google:id', 'social:google:secret'),
|
||||
async.apply(setIfPaired, 'social:facebook:app_id', 'social:facebook:secret')
|
||||
], function(err) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
meta.configs.init(next);
|
||||
});
|
||||
} else {
|
||||
meta.configs.init(next);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setIfPaired(key1, key2) {
|
||||
function setIfPaired(key1, key2, callback) {
|
||||
var meta = require('./meta');
|
||||
if (install.values[key1] && install.values[key2]) {
|
||||
meta.configs.setOnEmpty(key1, install.values[key1]);
|
||||
meta.configs.setOnEmpty(key2, install.values[key2]);
|
||||
async.parallel([
|
||||
async.apply(meta.configs.setOnEmpty, key1, install.values[key1]),
|
||||
async.apply(meta.configs.setOnEmpty, key2, install.values[key2])
|
||||
], callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user