forked from Metastem/Wikiless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwikiless.config
54 lines (48 loc) · 2.23 KB
/
wikiless.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const config = {
/**
* Set these configs below to suite your environment.
*/
domain: process.env.DOMAIN || '', // Set to your own domain
default_lang: process.env.DEFAULT_LANG || 'en', // Set your own language by default
theme: process.env.THEME || 'dark', // Set to 'white' or 'dark' by default
http_addr: process.env.HTTP_ADDR || '0.0.0.0', // don't touch, unless you know what your doing
nonssl_port: process.env.NONSSL_PORT || 8080, // don't touch, unless you know what your doing
/**
* You can configure redis below if needed.
* By default Wikiless uses 'redis://127.0.0.1:6379' as the Redis URL.
* Versions before 0.1.1 Wikiless used redis_host and redis_port properties,
* but they are not supported anymore.
* process.env.REDIS_HOST is still here for backwards compatibility.
*/
redis_url: process.env.REDIS_URL || process.env.REDIS_HOST || 'wikiless_redis',
redis_password: process.env.REDIS_PASSWORD,
/**
* You might need to change these configs below if you host through a reverse
* proxy like nginx.
*/
trust_proxy: process.env.TRUST_PROXY === 'true' || true,
trust_proxy_address: process.env.TRUST_PROXY_ADDRESS || '127.0.0.1',
/**
* Redis cache expiration values (in seconds).
* When the cache expires, new content is fetched from Wikipedia (when the
* given URL is revisited).
*/
setexs: {
wikipage: process.env.WIKIPAGE_CACHE_EXPIRATION || (60 * 60 * 1), // 1 hour
},
/**
* Wikimedia requires a HTTP User-agent header for all Wikimedia related
* requests. It's a good idea to change this to something unique.
* Read more: https://useragents.me/
*/
wikimedia_useragent: process.env.wikimedia_useragent || 'Mozilla/5.0 (Linux; Android 10; SAMSUNG SM-G980F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/22.0 Chrome/111.0.5563.116 Mobile Safari/537.3',
/**
* Cache control. Wikiless can automatically remove the cached media files from
* the server. Cache control is on by default.
* 'cache_control_interval' sets the interval for often the cache directory
* is emptied (in hours). Default is every 24 hours.
*/
cache_control: process.env.CACHE_CONTROL !== 'true' || true,
cache_control_interval: process.env.CACHE_CONTROL_INTERVAL || 24,
}
module.exports = config