add theme to config file, fix #33
This commit is contained in:
parent
781b8683e4
commit
0c071f475f
2
app.js
2
app.js
|
@ -102,6 +102,8 @@ const preferencesMiddleware = (req, res, next) => {
|
||||||
req.cookies.theme = themeOverride
|
req.cookies.theme = themeOverride
|
||||||
// this will set it for future requests
|
// this will set it for future requests
|
||||||
res.cookie('theme', themeOverride, { maxAge: 31536000, httpOnly: true })
|
res.cookie('theme', themeOverride, { maxAge: 31536000, httpOnly: true })
|
||||||
|
} else if(!req.cookies.theme && req.cookies.theme !== '') {
|
||||||
|
req.cookies.theme = config.theme
|
||||||
}
|
}
|
||||||
|
|
||||||
let flairsOverride = req.query.flairs
|
let flairsOverride = req.query.flairs
|
||||||
|
|
|
@ -2,6 +2,7 @@ const config = {
|
||||||
domain: process.env.DOMAIN || '127.0.0.1', // Or for example 'teddit.net'
|
domain: process.env.DOMAIN || '127.0.0.1', // Or for example 'teddit.net'
|
||||||
use_reddit_oauth: process.env.USE_REDDIT_OAUTH === "true" || false, // If false, teddit uses Reddit's public API. If true, you need to have your own Reddit app ID (enter the app ID to the "reddit_app_id" config key).
|
use_reddit_oauth: process.env.USE_REDDIT_OAUTH === "true" || false, // If false, teddit uses Reddit's public API. If true, you need to have your own Reddit app ID (enter the app ID to the "reddit_app_id" config key).
|
||||||
cert_dir: process.env.CERT_DIR || '', // For example '/home/teddit/letsencrypt/live/teddit.net', if you are using https. No trailing slash.
|
cert_dir: process.env.CERT_DIR || '', // For example '/home/teddit/letsencrypt/live/teddit.net', if you are using https. No trailing slash.
|
||||||
|
theme: process.env.THEME || 'dark', // One of: 'dark', ''
|
||||||
flairs_enabled: process.env.FLAIRS_ENABLED !== "true" || true, // Enables the rendering of user and link flairs on teddit
|
flairs_enabled: process.env.FLAIRS_ENABLED !== "true" || true, // Enables the rendering of user and link flairs on teddit
|
||||||
api_enabled: process.env.API_ENABLED !== "true" || true, // Teddit API feature. Might increase loads significantly on your instance.
|
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,
|
video_enabled: process.env.VIDEO_ENABLED !== "true" || true,
|
||||||
|
|
Loading…
Reference in New Issue