s/access_ttl/download_ttl/ to match documentation
This commit is contained in:
parent
4ea4cfb025
commit
35007c7975
2
app.js
2
app.js
|
@ -74,7 +74,7 @@ app.get('/:rpath(*)', pwrap(async (req, res) => {
|
|||
}
|
||||
|
||||
else if (invoice) {
|
||||
if (invoice.completed) res.redirect(escape(file.name) + '?token=' + tokenr.make(invoice, conf.access_ttl))
|
||||
if (invoice.completed) res.redirect(escape(file.name) + '?token=' + tokenr.make(invoice, conf.download_ttl))
|
||||
else res.render('file', { ...file, invoice })
|
||||
}
|
||||
|
||||
|
|
|
@ -9,25 +9,25 @@ module.exports = basePath => {
|
|||
const configPath = fs.statSync(basePath).isFile() ? basePath : path.join(basePath, '_filebazaar.yaml')
|
||||
, config = fs.existsSync(configPath) ? yaml.safeLoad(fs.readFileSync(configPath)) : {}
|
||||
|
||||
config.env = config.env || process.env.NODE_ENV || 'development'
|
||||
config.host = config.host || process.env.HOST || 'localhost'
|
||||
config.port = config.port || process.env.PORT || 9678
|
||||
config.url = config.url || process.env.URL || `http://${config.host}:${config.port}/`
|
||||
config.proxied = config.proxied || process.env.PROXIED || false
|
||||
config.env = config.env || process.env.NODE_ENV || 'development'
|
||||
config.host = config.host || process.env.HOST || 'localhost'
|
||||
config.port = config.port || process.env.PORT || 9678
|
||||
config.url = config.url || process.env.URL || `http://${config.host}:${config.port}/`
|
||||
config.proxied = config.proxied || process.env.PROXIED || false
|
||||
|
||||
config.directory = config.directory || process.env.BASE_DIR || path.dirname(configPath)
|
||||
config.token_secret = config.token_secret || process.env.TOKEN_SECRET || assert(false, 'token_secret is required')
|
||||
config.cache_path = config.cache_path || process.env.CACHE_PATH || path.join(config.directory, '_filebazaar_cache')
|
||||
config.directory = config.directory || process.env.BASE_DIR || path.dirname(configPath)
|
||||
config.token_secret = config.token_secret || process.env.TOKEN_SECRET || assert(false, 'token_secret is required')
|
||||
config.cache_path = config.cache_path || process.env.CACHE_PATH || path.join(config.directory, '_filebazaar_cache')
|
||||
|
||||
config.kite_url = config.kite_url || process.env.KITE_URL || 'http://localhost:9112'
|
||||
config.kite_url = config.kite_url || process.env.KITE_URL || 'http://localhost:9112'
|
||||
config.kite_token = config.kite_token || process.env.KITE_TOKEN
|
||||
|
||||
config.invoice_ttl = config.invoice_ttl || +process.env.INVOICE_TTL || 3600 // 1 hour
|
||||
config.access_ttl = config.access_ttl || +process.env.ACCESS_TTL || 172800 // 2 days
|
||||
config.invoice_ttl = config.invoice_ttl || +process.env.INVOICE_TTL || 3600 // 1 hour
|
||||
config.download_ttl = config.download_ttl || +process.env.DOWNLOAD_TTL || 172800 // 2 days
|
||||
|
||||
config.views_dir = config.views_dir || process.env.VIEWS_DIR || path.join(__dirname, '..', 'views')
|
||||
config.static_dir = config.static_dir || process.env.STATIC_DIR || path.join(__dirname, '..', 'static')
|
||||
config.theme = config.theme || process.env.THEME || 'yeti'
|
||||
config.views_dir = config.views_dir || process.env.VIEWS_DIR || path.join(__dirname, '..', 'views')
|
||||
config.static_dir = config.static_dir || process.env.STATIC_DIR || path.join(__dirname, '..', 'static')
|
||||
config.theme = config.theme || process.env.THEME || 'yeti'
|
||||
config.css = config.css || process.env.CSS
|
||||
|
||||
config.files = parseFiles(config.files || (process.env.FILES_JSON ? JSON.parse(process.env.FILES_JSON) : {}))
|
||||
|
|
Loading…
Reference in New Issue