Merge pull request 'Add support for changing Redis address' (#41) from agg23/teddit:agg23/RedisConfig into main
Reviewed-on: https://codeberg.org/teddit/teddit/pulls/41
This commit is contained in:
commit
2c447f967f
16
app.js
16
app.js
|
@ -10,7 +10,21 @@ const compression = require('compression')
|
||||||
const express = require('express')
|
const express = require('express')
|
||||||
const cookieParser = require('cookie-parser')
|
const cookieParser = require('cookie-parser')
|
||||||
const r = require('redis')
|
const r = require('redis')
|
||||||
const redis = r.createClient()
|
|
||||||
|
const redisOptions = {
|
||||||
|
host: '127.0.0.1',
|
||||||
|
port: 6379
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.redis_host) {
|
||||||
|
redisOptions.host = config.redis_host
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.redis_port && config.redis_port > 0) {
|
||||||
|
redisOptions.port = config.redis_port
|
||||||
|
}
|
||||||
|
|
||||||
|
const redis = r.createClient(redisOptions)
|
||||||
const helmet = require('helmet')
|
const helmet = require('helmet')
|
||||||
const bodyParser = require('body-parser')
|
const bodyParser = require('body-parser')
|
||||||
const fetch = require('node-fetch')
|
const fetch = require('node-fetch')
|
||||||
|
|
|
@ -3,6 +3,8 @@ const config = {
|
||||||
reddit_app_id: 'H6-HjZ5pUPjaFQ', // You should obtain your own Reddit app ID. For testing purposes it's okay to use this project's default app ID. Create your Reddit app here: https://old.reddit.com/prefs/apps/. Make sure to create an "installed app" type of app.
|
reddit_app_id: 'H6-HjZ5pUPjaFQ', // You should obtain your own Reddit app ID. For testing purposes it's okay to use this project's default app ID. Create your Reddit app here: https://old.reddit.com/prefs/apps/. Make sure to create an "installed app" type of app.
|
||||||
cert_dir: '', // For example '/home/teddit/letsencrypt/live/teddit.net', if you are using https. No trailing slash.
|
cert_dir: '', // For example '/home/teddit/letsencrypt/live/teddit.net', if you are using https. No trailing slash.
|
||||||
video_enabled: true,
|
video_enabled: true,
|
||||||
|
redis_host: '127.0.0.1',
|
||||||
|
redis_port: 6379,
|
||||||
ssl_port: 8088,
|
ssl_port: 8088,
|
||||||
nonssl_port: 8080,
|
nonssl_port: 8080,
|
||||||
listen_address: '0.0.0.0',
|
listen_address: '0.0.0.0',
|
||||||
|
|
Loading…
Reference in New Issue