Add configurable donate, CLI and DMCA and source links in footer

This commit is contained in:
timvisee 2021-01-27 00:13:56 +01:00
parent 7f3da34318
commit 6960cc75fa
No known key found for this signature in database
GPG key ID: B8DB720BC383E172
11 changed files with 98 additions and 9 deletions

View file

@ -13,6 +13,12 @@ module.exports = {
MAX_FILES_PER_ARCHIVE: config.max_files_per_archive,
MAX_ARCHIVES_PER_USER: config.max_archives_per_user
},
WEB_UI: {
FOOTER_DONATE_URL: config.footer_donate_url,
FOOTER_CLI_URL: config.footer_cli_url,
FOOTER_DMCA_URL: config.footer_dmca_url,
FOOTER_SOURCE_URL: config.footer_source_url
},
DEFAULTS: {
DOWNLOAD_COUNTS: config.download_counts,
EXPIRE_TIMES_SECONDS: config.expire_times_seconds,

View file

@ -194,6 +194,26 @@ const conf = convict({
format: String,
default: '',
env: 'IP_DB'
},
footer_donate_url: {
format: String,
default: '',
env: 'SEND_FOOTER_DONATE_URL'
},
footer_cli_url: {
format: String,
default: 'https://github.com/timvisee/ffsend',
env: 'SEND_FOOTER_CLI_URL'
},
footer_dmca_url: {
format: String,
default: '',
env: 'SEND_FOOTER_DMCA_URL'
},
footer_source_url: {
format: String,
default: 'https://github.com/timvisee/send',
env: 'SEND_FOOTER_CLI_URL'
}
});

View file

@ -43,6 +43,7 @@ module.exports = function(state) {
}
var LIMITS = ${JSON.stringify(clientConstants.LIMITS)};
var WEB_UI = ${JSON.stringify(clientConstants.WEB_UI)};
var DEFAULTS = ${JSON.stringify(clientConstants.DEFAULTS)};
var PREFS = ${JSON.stringify(state.prefs)};
var downloadMetadata = ${

View file

@ -6,9 +6,9 @@ class S3Storage {
this.log = log;
const cfg = {};
if (config.s3_endpoint != '') {
cfg['endpoint'] = config.s3_endpoint;
cfg['endpoint'] = config.s3_endpoint;
}
cfg['s3ForcePathStyle'] = config.s3_use_path_style_endpoint
cfg['s3ForcePathStyle'] = config.s3_use_path_style_endpoint;
AWS.config.update(cfg);
this.s3 = new AWS.S3();
}
@ -21,7 +21,9 @@ class S3Storage {
}
getStream(id) {
return this.s3.getObject({ Bucket: this.bucket, Key: id }).createReadStream();
return this.s3
.getObject({ Bucket: this.bucket, Key: id })
.createReadStream();
}
set(id, file) {