-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
consul_config.py.ctmpl
110 lines (90 loc) · 3.85 KB
/
consul_config.py.ctmpl
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{{- define "KEY" -}}
{{- key (printf "docker-server-configs/MeB/config.%s.json/%s" (env "DEPLOY_ENV") .) -}}
{{- end -}}
{{- define "KEY_OR_NONE" -}}
{{- keyOrDefault (printf "docker-server-configs/MeB/config.%s.json/%s" (env "DEPLOY_ENV") .) "None" -}}
{{- end -}}
{{- define "KEY_ARRAY" -}}
{{- range $index, $element := (key (printf "docker-server-configs/MeB/config.%s.json/%s" (env "DEPLOY_ENV") .) | parseJSON) -}}
"{{.}}",
{{- end -}}
{{- end -}}
SECRET_KEY = '''{{template "KEY" "secret_key"}}'''
DEBUG = False
{{if service "pgbouncer-master"}}
{{with index (service "pgbouncer-master") 0}}
SQLALCHEMY_DATABASE_URI = "postgresql://{{template "KEY" "postgresql/username"}}:{{template "KEY" "postgresql/password"}}@{{.Address}}:{{.Port}}/{{template "KEY" "postgresql/db_name"}}"
SQLALCHEMY_MUSICBRAINZ_URI = 'postgresql://musicbrainz_ro@{{.Address}}:{{.Port}}/musicbrainz_db'
{{end}}
{{end}}
{{if service "metabrainz-redis"}}
{{with index (service "metabrainz-redis") 0}}
REDIS = {
"host": '''{{.Address}}''',
"port": {{.Port}},
"namespace": '''{{template "KEY" "redis/namespace"}}''',
}
{{end}}
{{end}}
# PAYMENTS
PAYMENT_PRODUCTION = {{template "KEY_OR_NONE" "payments/production"}} # Must be `True` or `False`
PAYPAL_ACCOUNT_IDS = {
"USD": '''{{template "KEY" "payments/paypal/account_ids/usd"}}''',
"EUR": '''{{template "KEY" "payments/paypal/account_ids/eur"}}''',
}
PAYPAL_BUSINESS = '''{{template "KEY" "payments/paypal/business_email"}}'''
STRIPE_KEYS = {
"USD": {
"SECRET": '''{{template "KEY" "payments/stripe/secret"}}''',
"PUBLISHABLE": '''{{template "KEY" "payments/stripe/publishable"}}''',
"WEBHOOK_SECRET": '''{{template "KEY" "payments/stripe/webhook_secret"}}''',
},
"EUR": {
"SECRET": '''{{template "KEY" "payments/stripe-eu/secret"}}''',
"PUBLISHABLE": '''{{template "KEY" "payments/stripe-eu/publishable"}}''',
"WEBHOOK_SECRET": '''{{template "KEY" "payments/stripe-eu/webhook_secret"}}''',
},
}
# MusicBrainz Base URL must have a trailing slash.
MUSICBRAINZ_BASE_URL = '''{{template "KEY" "musicbrainz/base_url"}}'''
MUSICBRAINZ_CLIENT_ID = '''{{template "KEY" "musicbrainz/client_id"}}'''
MUSICBRAINZ_CLIENT_SECRET = '''{{template "KEY" "musicbrainz/client_secret"}}'''
# QUICKBOOKS OAUTH
QUICKBOOKS_SANDBOX = '''{{template "KEY" "quickbooks/sandbox"}}'''
QUICKBOOKS_CALLBACK_URL = '''{{template "KEY" "quickbooks/callback_url"}}'''
QUICKBOOKS_CLIENT_ID = '''{{template "KEY" "quickbooks/client_id"}}'''
QUICKBOOKS_CLIENT_SECRET = '''{{template "KEY" "quickbooks/client_secret"}}'''
import os
LOG_SENTRY = {
'dsn': '''{{template "KEY" "sentry/dsn"}}''',
'environment': '''{{template "KEY" "sentry/environment"}}''',
'release': os.getenv('GIT_SHA', None),
}
# reCAPTCHA (https://www.google.com/recaptcha/)
RECAPTCHA_PUBLIC_KEY = '''{{template "KEY" "recaptcha/public_key"}}'''
RECAPTCHA_PRIVATE_KEY = '''{{template "KEY" "recaptcha/private_key"}}'''
{{if service "metabrainz-org.exim-relay"}}
{{with index (service "metabrainz-org.exim-relay") 0}}
SMTP_SERVER = '''{{.Address}}'''
SMTP_PORT = {{.Port}}
{{end}}
{{end}}
MAIL_FROM_DOMAIN = '''{{template "KEY" "mail_from_domain"}}'''
# See http://flask.pocoo.org/docs/0.10/config/#builtin-configuration-values
PREFERRED_URL_SCHEME = '''{{template "KEY" "preferred_url_scheme"}}'''
SERVER_BASE_URL = f"{PREFERRED_URL_SCHEME}://{MAIL_FROM_DOMAIN}"
# List of email addresses
NOTIFICATION_RECIPIENTS = [
{{template "KEY_ARRAY" "notification_recipients"}}
]
# List of MusicBrainz usernames of people that are allowed to access
# admin section of the website. Usernames are case-sensetive!
ADMINS = [
{{template "KEY_ARRAY" "admins"}}
]
# REPLICATION PACKETS
REPLICATION_PACKETS_DIR = "/data/replication_packets"
# JSON DUMPS
JSON_DUMPS_DIR = "/data/json_dumps"
USE_COMPILED_STYLING = True
DEBUG_TB_INTERCEPT_REDIRECTS = False