This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.lua
58 lines (54 loc) · 1.86 KB
/
config.lua
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
local config = require("lapis.config")
local inspect = require("inspect")
-- any environment variables used here must also be declared in nginx.conf
config({'development', 'docker', 'kubernetes'}, {
postgres = {
database = "mudletrepo",
user = "mudletrepo",
password = "pleasechangeme"
},
secret = "pleasechangeme",
custom_resolver = "",
custom_user = "",
session_name = "mudlet-package-repo-session",
salt = "12",
body_size = "20m",
num_workers = 2,
data_dir = os.getenv("DATA_DIR") or "data",
smtp_host = "127.0.0.1",
smtp_port = 1025,
smtp_username = nil,
smtp_password = nil,
sender_address = "do-not-reply@mudlet.org",
admin_email = "demonnic@gmail.com",
admin_password = "supersecretadminpass", -- this can be removed once you've viewed the page for the first time
base_url = "http://localhost:8080/",
website_name = "Mudlet Package Repository (experimental)"
})
config({'docker'}, {
-- need to use docker resolver inside docker
custom_resolver = 'resolver 127.0.0.11 ipv6=off;',
postgres = {
host = "psql"
},
code_cache = "on",
smtp_host = os.getenv("SMTP_HOST"),
smtp_port = os.getenv("SMTP_PORT"),
smtp_username = os.getenv("SMTP_USERNAME"),
smtp_password = os.getenv("SMTP_PASSWORD")
})
config({'kubernetes'}, {
base_url = os.getenv("REPO_BASE_URL"),
custom_resolver = 'resolver kube-dns.kube-system.svc.cluster.local;',
postgres = {
host = "psql.default.svc.cluster.local"
},
code_cache = "on",
-- nginx spawns child processes as 'nobody' by default, which means they can't write to data directories
-- under kubernetes since k8s default process is root and thus the data folder is owned by it
custom_user = "user root root;",
smtp_host = os.getenv("SMTP_HOST"),
smtp_port = os.getenv("SMTP_PORT"),
smtp_username = os.getenv("SMTP_USERNAME"),
smtp_password = os.getenv("SMTP_PASSWORD")
})