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