forked from cosyverif/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.lua
More file actions
63 lines (59 loc) · 1.66 KB
/
config.lua
File metadata and controls
63 lines (59 loc) · 1.66 KB
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
55
56
57
58
59
60
61
62
63
local Config = require "lapis.config"
local Url = require "socket.url"
local branch = assert (os.getenv "COSY_BRANCH" or os.getenv "WERCKER_GIT_BRANCH")
if not branch or branch == "master" then
branch = "latest"
end
local postgres_url = assert (Url.parse (os.getenv "POSTGRES_PORT"))
local redis_url = assert (Url.parse (os.getenv "REDIS_PORT" ))
local common = {
host = "localhost",
port = 8080,
num_workers = assert (tonumber (os.getenv "NPROC")),
code_cache = "on",
hashid = {
salt = "cosyverif rocks",
length = 8,
},
branch = assert (branch),
postgres = {
backend = "pgmoon",
host = assert (postgres_url.host),
port = assert (postgres_url.port),
user = assert (os.getenv "POSTGRES_USER" ),
password = assert (os.getenv "POSTGRES_PASSWORD"),
database = assert (os.getenv "POSTGRES_DATABASE"),
},
redis = {
host = assert (redis_url.host),
port = assert (redis_url.port),
database = 0,
},
auth0 = {
domain = assert (os.getenv "AUTH0_DOMAIN"),
client_id = assert (os.getenv "AUTH0_ID" ),
client_secret = assert (os.getenv "AUTH0_SECRET"),
api_token = assert (os.getenv "AUTH0_TOKEN" ),
},
docker = {
username = assert (os.getenv "DOCKER_USER" ),
api_key = assert (os.getenv "DOCKER_SECRET"),
},
}
Config ({ "test", "development", "production" }, common)
Config ({ "test", "development" }, {
clean = {
delay = 1, -- second
},
editor = {
timeout = 1, -- second
},
})
Config ("production", {
clean = {
delay = 300, -- second
},
editor = {
timeout = 300, -- second
},
})