-
-
Notifications
You must be signed in to change notification settings - Fork 58
/
consul_config.py.ctmpl
71 lines (58 loc) · 2.62 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
{{- define "KEY" -}}
{{ key (printf "docker-server-configs/CB/config.%s.json/%s" (env "DEPLOY_ENV") .) }}
{{- end -}}
{{- define "KEY_ARRAY" -}}
{{- range $index, $element := (key (printf "docker-server-configs/CB/config.%s.json/%s" (env "DEPLOY_ENV") .) | parseJSON) -}}
"{{.}}",
{{- end -}}
{{- end }}
import os
SECRET_KEY = '''{{template "KEY" "secret_key"}}'''
LOG_SENTRY = {
'dsn': '''{{template "KEY" "sentry/dsn"}}''',
'environment': '''{{template "KEY" "sentry/environment"}}''',
'release': os.getenv('GIT_SHA', None),
}
MUSICBRAINZ_HOSTNAME = '''{{template "KEY" "musicbrainz/hostname"}}'''
MUSICBRAINZ_USERAGENT = '''{{template "KEY" "musicbrainz/useragent"}}'''
MUSICBRAINZ_CLIENT_ID = '''{{template "KEY" "musicbrainz/client_id"}}'''
MUSICBRAINZ_CLIENT_SECRET = '''{{template "KEY" "musicbrainz/client_secret"}}'''
MUSICBRAINZ_OAUTH_URL = '''{{template "KEY" "musicbrainz/oauth_url"}}'''
{{if service "pgbouncer-master"}}
{{with index (service "pgbouncer-master") 0}}
SQLALCHEMY_DATABASE_URI = "postgresql://{{template "KEY" "critiquebrainz/dbuser"}}:{{template "KEY" "critiquebrainz/dbpass"}}@{{.Address}}:{{.Port}}/{{template "KEY" "critiquebrainz/dbname"}}"
BB_DATABASE_URI = "postgresql://{{template "KEY" "bookbrainz/dbuser"}}:{{template "KEY" "bookbrainz/dbpass"}}@{{.Address}}:{{.Port}}/{{template "KEY" "bookbrainz/dbname"}}"
{{end}}
{{end}}
{{if service "pgbouncer-slave"}}
{{with index (service "pgbouncer-slave") 0}}
MB_DATABASE_URI = "postgresql://musicbrainz_ro@{{.Address}}:{{.Port}}/musicbrainz_db"
{{end}}
{{else if service "pgbouncer-master"}}
{{with index (service "pgbouncer-master") 0}}
MB_DATABASE_URI = "postgresql://musicbrainz_ro@{{.Address}}:{{.Port}}/musicbrainz_db"
{{end}}
{{end}}
{{if service "critiquebrainz-redis"}}
{{with index (service "critiquebrainz-redis") 0}}
REDIS_HOST = "{{.Address}}"
REDIS_PORT = {{.Port}}
REDIS_NAMESPACE = "CB-{{(env "DEPLOY_ENV")}}"
{{end}}
{{end}}
{{if service "critiquebrainz-org.exim-relay"}}
{{with index (service "critiquebrainz-org.exim-relay") 0}}
SMTP_SERVER = '''{{.Address}}'''
SMTP_PORT = {{.Port}}
{{end}}
{{end}}
MBSPOTIFY_BASE_URI = '''{{template "KEY" "mbspotify_url"}}'''
MBSPOTIFY_ACCESS_KEY = '''{{template "KEY" "mbspotify_key"}}'''
SPOTIFY_CLIENT_ID = '''{{template "KEY" "spotify/client_id"}}'''
SPOTIFY_CLIENT_SECRET = '''{{template "KEY" "spotify/client_secret"}}'''
# 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"}}
]
ADMIN_NOTIFICATION_EMAIL_ADDRESS = '''{{template "KEY" "admin_notification_email_address"}}'''