mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 06:00:53 +03:00
Add DEFAULT_DOWNLOADS variable to set default download count
Fixes https://github.com/timvisee/send/issues/39
This commit is contained in:
@@ -15,6 +15,7 @@ module.exports = {
|
||||
FOOTER_SOURCE_URL: config.footer_source_url
|
||||
},
|
||||
DEFAULTS: {
|
||||
DOWNLOADS: config.default_downloads,
|
||||
DOWNLOAD_COUNTS: config.download_counts,
|
||||
EXPIRE_TIMES_SECONDS: config.expire_times_seconds,
|
||||
EXPIRE_SECONDS: config.default_expire_seconds
|
||||
|
||||
@@ -64,6 +64,11 @@ const conf = convict({
|
||||
default: [1, 2, 3, 4, 5, 20, 50, 100],
|
||||
env: 'DOWNLOAD_COUNTS'
|
||||
},
|
||||
default_downloads: {
|
||||
format: Number,
|
||||
default: 1,
|
||||
env: 'DEFAULT_DOWNLOADS'
|
||||
},
|
||||
max_downloads: {
|
||||
format: Number,
|
||||
default: 100,
|
||||
|
||||
@@ -26,7 +26,7 @@ module.exports = function(ws, req) {
|
||||
|
||||
const fileInfo = JSON.parse(message);
|
||||
const timeLimit = fileInfo.timeLimit || config.default_expire_seconds;
|
||||
const dlimit = fileInfo.dlimit || 1;
|
||||
const dlimit = fileInfo.dlimit || config.default_downloads;
|
||||
const metadata = fileInfo.fileMetadata;
|
||||
const auth = fileInfo.authorization;
|
||||
const user = await fxa.verify(fileInfo.bearer);
|
||||
|
||||
Reference in New Issue
Block a user