|
1 | 1 | # security keys and auth tokens |
2 | | -SECRET_KEY = '{{ .deis_controller_secretKey }}' |
3 | | -BUILDER_KEY = '{{ .deis_controller_builderKey }}' |
| 2 | +SECRET_KEY = '{{ getv "/deis/controller/secretKey" }}' |
| 3 | +BUILDER_KEY = '{{ getv "/deis/controller/builderKey" }}' |
4 | 4 |
|
5 | 5 | # scheduler settings |
6 | | -SCHEDULER_MODULE = 'scheduler.{{ or (.deis_controller_schedulerModule) "fleet" }}' |
7 | | -SCHEDULER_TARGET = '{{ or (.deis_controller_schedulerTarget) "/var/run/fleet.sock" }}' |
| 6 | +SCHEDULER_MODULE = 'scheduler.{{ if exists "/deis/controller/schedulerModule" }}{{ getv "/deis/controller/schedulerModule" }}{{ else }}fleet{{ end }}' |
| 7 | +SCHEDULER_TARGET = '{{ if exists "/deis/controller/schedulerTarget" }}{{ getv "/deis/controller/schedulerTarget" }}{{ else }}/var/run/fleet.sock{{ end }}' |
8 | 8 | try: |
9 | | - SCHEDULER_OPTIONS = dict('{{ or (.deis_controller_schedulerOptions) "{}" }}') |
| 9 | + SCHEDULER_OPTIONS = dict('{{ if exists "/deis/controller/schedulerOptions" }}{{ getv "/deis/controller/schedulerOptions" }}{{ else }}{}{{ end }}') |
10 | 10 | except: |
11 | 11 | SCHEDULER_OPTIONS = {} |
12 | 12 |
|
13 | 13 | # base64-encoded SSH private key to facilitate current version of "deis run" |
14 | | -SSH_PRIVATE_KEY = """{{ or (.deis_platform_sshPrivateKey) "" }}""" |
| 14 | +SSH_PRIVATE_KEY = """{{ if exists "/deis/platform/sshPrivateKey" }}{{ getv "/deis/platform/sshPrivateKey" }}{{ else }}""{{end}}""" |
15 | 15 |
|
16 | 16 | # platform domain must be provided |
17 | | -DEIS_DOMAIN = '{{ .deis_platform_domain }}' |
| 17 | +DEIS_DOMAIN = '{{ getv "/deis/platform/domain" }}' |
18 | 18 |
|
19 | 19 | # use the private registry module |
20 | 20 | REGISTRY_MODULE = 'registry.private' |
21 | | -REGISTRY_URL = '{{ .deis_registry_protocol }}://{{ .deis_registry_host }}:{{ .deis_registry_port }}' # noqa |
22 | | -REGISTRY_HOST = '{{ .deis_registry_host }}' |
23 | | -REGISTRY_PORT = '{{ .deis_registry_port }}' |
| 21 | +REGISTRY_URL = '{{ getv "/deis/registry/protocol" }}://{{ getv "/deis/registry/host" }}:{{ getv "/deis/registry/port" }}' # noqa |
| 22 | +REGISTRY_HOST = '{{ getv "/deis/registry/host" }}' |
| 23 | +REGISTRY_PORT = '{{ getv "/deis/registry/port" }}' |
24 | 24 |
|
25 | 25 | # default to sqlite3, but allow postgresql config through envvars |
26 | 26 | DATABASES = { |
27 | 27 | 'default': { |
28 | | - 'ENGINE': 'django.db.backends.{{ .deis_database_engine }}', |
29 | | - 'NAME': '{{ .deis_database_name }}', |
30 | | - 'USER': '{{ .deis_database_user }}', |
31 | | - 'PASSWORD': '{{ .deis_database_password }}', |
32 | | - 'HOST': '{{ .deis_database_host }}', |
33 | | - 'PORT': '{{ .deis_database_port }}', |
| 28 | + 'ENGINE': 'django.db.backends.{{ getv "/deis/database/engine" }}', |
| 29 | + 'NAME': '{{ getv "/deis/database/name" }}', |
| 30 | + 'USER': '{{ getv "/deis/database/user" }}', |
| 31 | + 'PASSWORD': '{{ getv "/deis/database/password" }}', |
| 32 | + 'HOST': '{{ getv "/deis/database/host" }}', |
| 33 | + 'PORT': '{{ getv "/deis/database/port" }}', |
34 | 34 | } |
35 | 35 | } |
36 | 36 |
|
37 | 37 | # move log directory out of /app/deis |
38 | 38 | DEIS_LOG_DIR = '/data/logs' |
39 | 39 |
|
40 | | -{{ if .deis_controller_registrationEnabled }} |
41 | | -REGISTRATION_ENABLED = bool({{ .deis_controller_registrationEnabled }}) |
| 40 | +{{ if exists "/deis/controller/registrationEnabled" }} |
| 41 | +REGISTRATION_ENABLED = bool({{ getv "/deis/controller/registrationEnabled" }}) |
42 | 42 | {{ end }} |
43 | 43 |
|
44 | | -{{ if .deis_controller_webEnabled }} |
45 | | -WEB_ENABLED = bool({{ .deis_controller_webEnabled }}) |
| 44 | +{{ if exists "/deis/controller/webEnabled" }} |
| 45 | +WEB_ENABLED = bool({{ getv "/deis/controller/webEnabled" }}) |
46 | 46 | {{ end }} |
47 | | - |
48 | | -UNIT_HOSTNAME = '{{ or (.deis_controller_unitHostname) "default" }}' |
| 47 | +UNIT_HOSTNAME = '{{ if exists "/deis/controller/unitHostname" }}{{ getv "/deis/controller/unitHostname" }}{{ else }}default{{ end }}' |
0 commit comments