forked from metabrainz/acousticbrainz-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
consul_config.py.ctmpl
54 lines (42 loc) · 1.83 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
{{- define "KEY" -}}
{{ key (printf "docker-server-configs/AB/config.%s.json/%s" (env "DEPLOY_ENV") .) }}
{{- end -}}
{{- define "KEY_ARRAY" -}}
{{- range $index, $element := (key (printf "docker-server-configs/AB/config.%s.json/%s" (env "DEPLOY_ENV") .) | parseJSON) -}}
"{{.}}",
{{- end -}}
{{- end -}}
import os
DEBUG = False
SECRET_KEY = '''{{template "KEY" "secret_key"}}'''
{{if service "pgbouncer-acousticbrainz"}}
{{with index (service "pgbouncer-acousticbrainz") 0}}
SQLALCHEMY_DATABASE_URI = "postgresql://acousticbrainz:acousticbrainz@{{.Address}}:{{.Port}}/acousticbrainz"
POSTGRES_ADMIN_URI="postgresql://postgres@{{.Address}}:{{.Port}}/template1"
POSTGRES_ADMIN_AB_URI="postgresql://postgres@{{.Address}}:{{.Port}}/acousticbrainz"
{{end}}
{{end}}
{{if service "acousticbrainz-redis"}}
{{with index (service "acousticbrainz-redis") 0}}
REDIS_HOST = "{{.Address}}"
REDIS_PORT = {{.Port}}
REDIS_NAMESPACE = "acousticbrainz"
REDIS_NS_VERSIONS_LOCATION = '/cache_namespaces'
{{end}}
{{end}}
MUSICBRAINZ_USERAGENT = '''{{template "KEY" "musicbrainz_useragent"}}'''
MUSICBRAINZ_HOSTNAME = '''{{template "KEY" "musicbrainz_hostname"}}'''
MUSICBRAINZ_CLIENT_ID = '''{{template "KEY" "musicbrainz/client_id"}}'''
MUSICBRAINZ_CLIENT_SECRET = '''{{template "KEY" "musicbrainz/client_secret"}}'''
# Set to True if Less should be compiled in browser. Set to False if styling is pre-compiled.
COMPILE_LESS = False
LOG_SENTRY = {
'dsn':'''{{template "KEY" "sentry_dsn"}}''',
'environment': 'production',
'level': 'WARN',
}
DATASET_DIR = '''{{template "KEY" "dataset_dir"}}'''
FILE_STORAGE_DIR = '''{{template "KEY" "file_storage_dir"}}'''
FEATURE_EVAL_LOCATION = False
RATELIMIT_PER_IP = {{template "KEY" "ratelimit_per_ip"}} # number of requests per ip
RATELIMIT_WINDOW = {{template "KEY" "ratelimit_window"}} # window size in seconds