mirror of
https://codeberg.org/tacerus/teddit.git
synced 2024-11-22 06:49:26 +01:00
Add config REDIS_DB, REDIS_PASSWORD
This commit is contained in:
parent
b69c953148
commit
8b366d9ffd
8
app.js
8
app.js
@ -28,6 +28,10 @@ const redis = (() => {
|
||||
port: 6379
|
||||
}
|
||||
|
||||
if (config.redis_db) {
|
||||
redisOptions.db = config.redis_db
|
||||
}
|
||||
|
||||
if (config.redis_host) {
|
||||
redisOptions.host = config.redis_host
|
||||
}
|
||||
@ -36,6 +40,10 @@ const redis = (() => {
|
||||
redisOptions.port = config.redis_port
|
||||
}
|
||||
|
||||
if (config.redis_password) {
|
||||
redisOptions.password = config.redis_password
|
||||
}
|
||||
|
||||
return r.createClient(redisOptions)
|
||||
})()
|
||||
const helmet = require('helmet')
|
||||
|
@ -8,7 +8,9 @@ const config = {
|
||||
api_enabled: process.env.API_ENABLED !== 'true' || true, // Teddit API feature. Might increase loads significantly on your instance.
|
||||
video_enabled: process.env.VIDEO_ENABLED !== 'true' || true,
|
||||
redis_enabled: process.env.REDIS_ENABLED !== 'true' || true, // If disabled, does not cache Reddit API calls
|
||||
redis_db: process.env.REDIS_DB,
|
||||
redis_host: process.env.REDIS_HOST || '127.0.0.1',
|
||||
redis_password: process.env.REDIS_PASSWORD,
|
||||
redis_port: process.env.REDIS_PORT || 6379,
|
||||
ssl_port: process.env.SSL_PORT || 8088,
|
||||
nonssl_port: process.env.NONSSL_PORT || 8080,
|
||||
|
Loading…
Reference in New Issue
Block a user