|
|
|
@ -28,9 +28,8 @@ apiController.getConfig = function(req, res, next) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var config = {};
|
|
|
|
|
config.environment = process.env.NODE_ENV;
|
|
|
|
|
config.relative_path = nconf.get('relative_path');
|
|
|
|
|
config.socketioTransports = nconf.get('socket.io:transports') || ['polling', 'websocket'];
|
|
|
|
|
config.websocketAddress = nconf.get('socket.io:address') || '';
|
|
|
|
|
config.version = nconf.get('version');
|
|
|
|
|
config.siteTitle = validator.escape(meta.config.title || meta.config.browserTitle || 'NodeBB');
|
|
|
|
|
config.browserTitle = validator.escape(meta.config.browserTitle || meta.config.title || 'NodeBB');
|
|
|
|
@ -40,33 +39,24 @@ apiController.getConfig = function(req, res, next) {
|
|
|
|
|
config.maximumTitleLength = meta.config.maximumTitleLength;
|
|
|
|
|
config.minimumPostLength = meta.config.minimumPostLength;
|
|
|
|
|
config.maximumPostLength = meta.config.maximumPostLength;
|
|
|
|
|
|
|
|
|
|
config.minimumTagsPerTopic = meta.config.minimumTagsPerTopic || 0;
|
|
|
|
|
config.maximumTagsPerTopic = meta.config.maximumTagsPerTopic || 5;
|
|
|
|
|
config.minimumTagLength = meta.config.minimumTagLength || 3;
|
|
|
|
|
config.maximumTagLength = meta.config.maximumTagLength || 15;
|
|
|
|
|
config.hasImageUploadPlugin = plugins.hasListeners('filter:uploadImage');
|
|
|
|
|
config.maximumProfileImageSize = meta.config.maximumProfileImageSize;
|
|
|
|
|
config.minimumUsernameLength = meta.config.minimumUsernameLength;
|
|
|
|
|
config.maximumUsernameLength = meta.config.maximumUsernameLength;
|
|
|
|
|
config.minimumPasswordLength = meta.config.minimumPasswordLength;
|
|
|
|
|
config.useOutgoingLinksPage = parseInt(meta.config.useOutgoingLinksPage, 10) === 1;
|
|
|
|
|
config.allowGuestSearching = parseInt(meta.config.allowGuestSearching, 10) === 1;
|
|
|
|
|
config.allowGuestUserSearching = parseInt(meta.config.allowGuestUserSearching, 10) === 1;
|
|
|
|
|
config.allowGuestHandles = parseInt(meta.config.allowGuestHandles, 10) === 1;
|
|
|
|
|
config.allowFileUploads = parseInt(meta.config.allowFileUploads, 10) === 1;
|
|
|
|
|
config.allowProfileImageUploads = parseInt(meta.config.allowProfileImageUploads) === 1;
|
|
|
|
|
config.allowTopicsThumbnail = parseInt(meta.config.allowTopicsThumbnail, 10) === 1;
|
|
|
|
|
config.allowAccountDelete = parseInt(meta.config.allowAccountDelete, 10) === 1;
|
|
|
|
|
config.allowUserHomePage = parseInt(meta.config.allowUserHomePage, 10) === 1;
|
|
|
|
|
config.privateUserInfo = parseInt(meta.config.privateUserInfo, 10) === 1;
|
|
|
|
|
config.privateTagListing = parseInt(meta.config.privateTagListing, 10) === 1;
|
|
|
|
|
config.usePagination = parseInt(meta.config.usePagination, 10) === 1;
|
|
|
|
|
config.disableSocialButtons = parseInt(meta.config.disableSocialButtons, 10) === 1;
|
|
|
|
|
config.disableChat = parseInt(meta.config.disableChat, 10) === 1;
|
|
|
|
|
config.maximumChatMessageLength = parseInt(meta.config.maximumChatMessageLength, 10) || 1000;
|
|
|
|
|
config.socketioTransports = nconf.get('socket.io:transports') || ['polling', 'websocket'];
|
|
|
|
|
config.websocketAddress = nconf.get('socket.io:address') || '';
|
|
|
|
|
config.maxReconnectionAttempts = meta.config.maxReconnectionAttempts || 5;
|
|
|
|
|
config.reconnectionDelay = meta.config.reconnectionDelay || 1500;
|
|
|
|
|
config.minimumTagsPerTopic = meta.config.minimumTagsPerTopic || 0;
|
|
|
|
|
config.maximumTagsPerTopic = meta.config.maximumTagsPerTopic || 5;
|
|
|
|
|
config.minimumTagLength = meta.config.minimumTagLength || 3;
|
|
|
|
|
config.maximumTagLength = meta.config.maximumTagLength || 15;
|
|
|
|
|
config.topicsPerPage = meta.config.topicsPerPage || 20;
|
|
|
|
|
config.postsPerPage = meta.config.postsPerPage || 20;
|
|
|
|
|
config.maximumFileSize = meta.config.maximumFileSize;
|
|
|
|
@ -74,7 +64,6 @@ apiController.getConfig = function(req, res, next) {
|
|
|
|
|
config['theme:src'] = meta.config['theme:src'];
|
|
|
|
|
config.defaultLang = meta.config.defaultLang || 'en_GB';
|
|
|
|
|
config.userLang = req.query.lang || config.defaultLang;
|
|
|
|
|
config.environment = process.env.NODE_ENV;
|
|
|
|
|
config.loggedIn = !!req.user;
|
|
|
|
|
config['cache-buster'] = meta.config['cache-buster'] || '';
|
|
|
|
|
config.requireEmailConfirmation = parseInt(meta.config.requireEmailConfirmation, 10) === 1;
|
|
|
|
|