support larger upload sizes for users with premium accounts

This commit is contained in:
ansuz
2020-02-26 13:09:11 -05:00
parent 87ef2b0899
commit 59ad80d7f1
4 changed files with 50 additions and 3 deletions

View File

@@ -43,6 +43,7 @@ module.exports.create = function (config, cb) {
//historyKeeper: config.historyKeeper,
intervals: config.intervals || {},
maxUploadSize: config.maxUploadSize || (20 * 1024 * 1024),
premiumUploadSize: false, // overridden below...
Sessions: {},
paths: {},
//msgStore: config.store,
@@ -70,6 +71,13 @@ module.exports.create = function (config, cb) {
domain: config.domain
};
(function () {
var pes = config.premiumUploadSize;
if (!isNaN(pes) && pes >= Env.maxUploadSize) {
Env.premiumUploadSize = pes;
}
}());
var paths = Env.paths;
var keyOrDefaultString = function (key, def) {