1- # The `common' part is automatically included (and possibly overriden by all
2- # other flavors)
1+ # All other flavors inherit the `common' config snippet
32common : &common
43 # Default log level is info
54 loglevel : _env:LOGLEVEL:info
@@ -24,11 +23,11 @@ common: &common
2423 source_index : _env:MIRROR_SOURCE_INDEX # https://index.docker.io
2524 tags_cache_ttl : _env:MIRROR_TAGS_CACHE_TTL:172800 # seconds
2625
27- # cache:
28- # host: _env:CACHE_REDIS_HOST:localhost
29- # port: _env:CACHE_REDIS_PORT:6379
30- # db: 0
31- # password: _env:CACHE_REDIS_PASSWORD
26+ cache :
27+ host : {{ or (.deis_cache_host) "" }}
28+ port : {{ or (.deis_cache_port) "" }}
29+ password : _env:CACHE_REDIS_PASSWORD
30+ db : 1
3231
3332 # Enabling LRU cache for small files
3433 # This speeds up read/write on small files
@@ -40,95 +39,130 @@ common: &common
4039 # password: _env:CACHE_LRU_REDIS_PASSWORD
4140
4241 # Enabling these options makes the Registry send an email on each code Exception
42+ {{ if .deis_registry_smtpHost }}
4343 email_exceptions :
44- smtp_host : _env:SMTP_HOST
45- smtp_port : _env:SMTP_PORT:25
46- smtp_login : _env:SMTP_LOGIN
47- smtp_password : _env:SMTP_PASSWORD
48- smtp_secure : _env:SMTP_SECURE:false
49- from_addr : _env:SMTP_FROM_ADDR:docker-registry@localdomain.local
50- to_addr : _env:SMTP_TO_ADDR:noise+dockerregistry@localdomain.local
44+ smtp_host : {{ or (.deis_registry_smtpHost) "" }}
45+ smtp_port : {{ or (.deis_registry_smtpPort) "25" }}
46+ smtp_login : {{ or (.deis_registry_smtpLogin) "" }}
47+ smtp_password : {{ or (.deis_registry_smtpPassword) "" }}
48+ smtp_secure : bool({{ or (.deis_registry_smtpSecure) "false" }})
49+ from_addr : {{ or (.deis_registry_smtpFrom) "docker-registry@localdomain.local" }}
50+ to_addr : {{ or (.deis_registry_smtpTo) "noise+dockerregistry@localdomain.local" }}
51+ {{ end }}
5152
5253 # Enable bugsnag (set the API key)
5354 bugsnag : _env:BUGSNAG
5455
55- # This is the default configuration when no flavor is specified
56- dev :
56+ local : &local
5757 << : *common
5858 storage : local
5959 storage_path : /data
6060
61- {{ if .deis_registry_s3accessKey }}
62- # To specify another flavor, set the environment variable SETTINGS_FLAVOR
63- # $ export SETTINGS_FLAVOR=prod
64- prod :
61+
62+ s3 : &s3
63+ << : *common
6564 storage : s3
66- storage_path : /data
67- # Amazon S3 Storage Configuration
68- s3_access_key : {{ .deis_registry_s3accessKey }}
69- s3_secret_key : {{ .deis_registry_s3secretKey }}
70- s3_region : {{ .deis_registry_s3region }}
71- s3_bucket : {{ .deis_registry_s3bucket }}
72- boto_bucket : {{ .deis_registry_s3bucket }}
73- s3_encrypt : bool({{ .deis_registry_s3encrypt }})
74- s3_secure : bool({{ .deis_registry_s3secure }})
75- storage_redirect : True
76- # Enabling query cache on Redis
77- cache :
78- host : {{ .deis_cache_host }}
79- port : {{ .deis_cache_port }}
80- db : 1
81- # Enabling these options makes the Registry send an email on each code Exception
82- email_exceptions :
83- smtp_host : {{ .deis_registry_smtpHost }}
84- smtp_port : {{ .deis_registry_smtpPort }}
85- smtp_login : {{ .deis_registry_smtpLogin }}
86- smtp_password : {{ .deis_registry_smtpPassword }}
87- smtp_secure : {{ .deis_registry_smtpSecure }}
88- from_addr : {{ .deis_registry_smtpFrom }}
89- to_addr : {{ .deis_registry_smtpTo }}
90- # Enable bugsnag (set the API key)
91- bugsnag : REPLACEME
92- {{ end }}
65+ s3_region : {{ or (.deis_registry_s3region) "" }}
66+ s3_bucket : {{ or (.deis_registry_s3bucket) "" }}
67+ boto_bucket : {{ or (.deis_registry_s3bucket) "" }}
68+ storage_path : {{ or (.deis_registry_s3path) "/registry" }}
69+ s3_encrypt : bool({{ or (.deis_registry_s3encrypt) "true" }})
70+ s3_secure : bool({{ or (.deis_registry_s3secure) "true" }})
71+ s3_access_key : {{ or (.deis_registry_s3accessKey) "" }}
72+ s3_secret_key : {{ or (.deis_registry_s3secretKey) "" }}
9373
94- # This flavor is automatically used by unit tests
95- test :
96- storage : local
97- storage_path : /tmp/test
74+ # Google Cloud Storage Configuration
75+ # See:
76+ # https://developers.google.com/storage/docs/reference/v1/getting-startedv1#keys
77+ # for details on access and secret keys.
78+ gcs :
79+ << : *common
80+ storage : gcs
81+ boto_bucket : _env:GCS_BUCKET
82+ storage_path : _env:STORAGE_PATH:/registry
83+ gs_secure : _env:GCS_SECURE:true
84+ gs_access_key : _env:GCS_KEY
85+ gs_secret_key : _env:GCS_SECRET
86+ # OAuth 2.0 authentication with the storage.
87+ # oauth2 can be set to true or false. If it is set to true, gs_access_key,
88+ # gs_secret_key and gs_secure are not needed.
89+ # Client ID and Client Secret must be set into OAUTH2_CLIENT_ID and
90+ # OAUTH2_CLIENT_SECRET environment variables.
91+ # See: https://developers.google.com/accounts/docs/OAuth2.
92+ oauth2 : _env:GCS_OAUTH2:false
9893
9994# This flavor is for storing images in Openstack Swift
100- {{ if .deis_registry_swiftAuthURL }}
101- swift :
95+ swift : &swift
96+ << : *common
10297 storage : swift
103- storage_path : " _env:STORAGE_PATH:/registry"
104- swift_authurl : {{ .deis_registry_swiftAuthURL }}
105- swift_container : {{ .deis_registry_swiftContainer }}
106- swift_user : {{ .deis_registry_swiftUser }}
107- swift_password : {{ .deis_registry_swiftPassword }}
108- swift_tenant_name : {{ .deis_registry_swiftTenantName }}
109- swift_region_name : {{ .deis_registry_swiftRegionName }}
110- {{ end }}
98+ storage_path : _env:STORAGE_PATH:/registry
99+ # keystone authorization
100+ swift_authurl : {{ or (.deis_registry_swiftAuthURL) "" }}
101+ swift_container : {{ or (.deis_registry_swiftContainer) "" }}
102+ swift_user : {{ or (.deis_registry_swiftUser) "" }}
103+ swift_password : {{ or (.deis_registry_swiftPassword) "" }}
104+ swift_tenant_name : {{ or (.deis_registry_swiftTenantName) "" }}
105+ swift_region_name : {{ or (.deis_registry_swiftRegionName) "" }}
111106
112107# This flavor stores the images in Glance (to integrate with openstack)
113108# See also: https://github.com/dotcloud/openstack-docker
114- openstack :
109+ glance : &glance
110+ << : *common
115111 storage : glance
116- storage_alternate : local
117- storage_path : /tmp/registry
118- loglevel : debug
112+ storage_alternate : _env:GLANCE_STORAGE_ALTERNATE:file
113+ storage_path : _env:STORAGE_PATH:/tmp/registry
114+
115+ openstack :
116+ << : *glance
119117
120118# This flavor stores the images in Glance (to integrate with openstack)
121119# and tags in Swift.
122- {{ if .deis_registry_swiftAuthURL }}
123- openstack-swift :
120+ glance-swift : &glance-swift
121+ << : *swift
124122 storage : glance
125- storage_path : /registry
126123 storage_alternate : swift
127- # keystone authorization
128- swift_authurl : {{ .deis_registry_swiftAuthURL }}
129- swift_container : {{ .deis_registry_swiftContainer }}
130- swift_user : {{ .deis_registry_swiftUser }}
131- swift_password : {{ .deis_registry_swiftPassword }}
132- swift_tenant_name : {{ .deis_registry_swiftTenantName }}
133- swift_region_name : {{ .deis_registry_swiftRegionName }}
134- {{ end }}
124+
125+ openstack-swift :
126+ << : *glance-swift
127+
128+ elliptics :
129+ << : *common
130+ storage : elliptics
131+ elliptics_nodes : _env:ELLIPTICS_NODES
132+ elliptics_wait_timeout : _env:ELLIPTICS_WAIT_TIMEOUT:60
133+ elliptics_check_timeout : _env:ELLIPTICS_CHECK_TIMEOUT:60
134+ elliptics_io_thread_num : _env:ELLIPTICS_IO_THREAD_NUM:2
135+ elliptics_net_thread_num : _env:ELLIPTICS_NET_THREAD_NUM:2
136+ elliptics_nonblocking_io_thread_num : _env:ELLIPTICS_NONBLOCKING_IO_THREAD_NUM:2
137+ elliptics_groups : _env:ELLIPTICS_GROUPS
138+ elliptics_verbosity : _env:ELLIPTICS_VERBOSITY:4
139+ elliptics_logfile : _env:ELLIPTICS_LOGFILE:/dev/stderr
140+ elliptics_addr_family : _env:ELLIPTICS_ADDR_FAMILY:2
141+
142+
143+
144+ # This is the default configuration when no flavor is specified
145+ dev : &dev
146+ << : *local
147+ loglevel : _env:LOGLEVEL:debug
148+ search_backend : _env:SEARCH_BACKEND:sqlalchemy
149+
150+ # This flavor is used by unit tests
151+ test :
152+ << : *dev
153+ index_endpoint : https://indexstaging-docker.dotcloud.com
154+ standalone : true
155+ storage_path : _env:STORAGE_PATH:./tmp/test
156+
157+ # To specify another flavor, set the environment variable SETTINGS_FLAVOR
158+ # $ export SETTINGS_FLAVOR=prod
159+ prod :
160+ << : *s3
161+ storage_path : _env:STORAGE_PATH:/prod
162+
163+ # Flavor used by deis
164+ deis :
165+ {{ if .deis_registry_s3accessKey }}<<: *s3
166+ {{ else if .deis_registry_swiftAuthURL }} <<: *openstack-swift
167+ {{ else }} <<: *local
168+ {{ end }}
0 commit comments