87e06e325b5d2585cb175b837b25103a67ea3f10
[genesis.git] / compass / deploy / ansible / roles / dashboard / templates / local_settings.py
1 import os
2
3 from django.utils.translation import ugettext_lazy as _
4
5 from openstack_dashboard import exceptions
6
7 DEBUG = True
8 TEMPLATE_DEBUG = DEBUG
9
10 # Required for Django 1.5.
11 # If horizon is running in production (DEBUG is False), set this
12 # with the list of host/domain names that the application can serve.
13 # For more information see:
14 # https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
15 #ALLOWED_HOSTS = ['horizon.example.com', ]
16
17 # Set SSL proxy settings:
18 # For Django 1.4+ pass this header from the proxy after terminating the SSL,
19 # and don't forget to strip it from the client's request.
20 # For more information see:
21 # https://docs.djangoproject.com/en/1.4/ref/settings/#secure-proxy-ssl-header
22 # SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
23
24 # If Horizon is being served through SSL, then uncomment the following two
25 # settings to better secure the cookies from security exploits
26 #CSRF_COOKIE_SECURE = True
27 #SESSION_COOKIE_SECURE = True
28
29 # Overrides for OpenStack API versions. Use this setting to force the
30 # OpenStack dashboard to use a specific API version for a given service API.
31 # NOTE: The version should be formatted as it appears in the URL for the
32 # service API. For example, The identity service APIs have inconsistent
33 # use of the decimal point, so valid options would be "2.0" or "3".
34 # OPENSTACK_API_VERSIONS = {
35 #     "identity": 3,
36 #     "volume": 2
37 # }
38
39 # Set this to True if running on multi-domain model. When this is enabled, it
40 # will require user to enter the Domain name in addition to username for login.
41 # OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = False
42
43 # Overrides the default domain used when running on single-domain model
44 # with Keystone V3. All entities will be created in the default domain.
45 # OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default'
46
47 # Set Console type:
48 # valid options would be "AUTO", "VNC", "SPICE" or "RDP"
49 # CONSOLE_TYPE = "AUTO"
50
51 # Default OpenStack Dashboard configuration.
52 HORIZON_CONFIG = {
53     'dashboards': ('project', 'admin', 'settings',),
54     'default_dashboard': 'project',
55     'user_home': 'openstack_dashboard.views.get_user_home',
56     'ajax_queue_limit': 10,
57     'auto_fade_alerts': {
58         'delay': 3000,
59         'fade_duration': 1500,
60         'types': ['alert-success', 'alert-info']
61     },
62     'help_url': "http://docs.openstack.org",
63     'exceptions': {'recoverable': exceptions.RECOVERABLE,
64                    'not_found': exceptions.NOT_FOUND,
65                    'unauthorized': exceptions.UNAUTHORIZED},
66 }
67
68 # Specify a regular expression to validate user passwords.
69 # HORIZON_CONFIG["password_validator"] = {
70 #     "regex": '.*',
71 #     "help_text": _("Your password does not meet the requirements.")
72 # }
73
74 # Disable simplified floating IP address management for deployments with
75 # multiple floating IP pools or complex network requirements.
76 # HORIZON_CONFIG["simple_ip_management"] = False
77
78 # Turn off browser autocompletion for the login form if so desired.
79 # HORIZON_CONFIG["password_autocomplete"] = "off"
80
81 LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
82
83 # Set custom secret key:
84 # You can either set it to a specific value or you can let horizion generate a
85 # default secret key that is unique on this machine, e.i. regardless of the
86 # amount of Python WSGI workers (if used behind Apache+mod_wsgi): However, there
87 # may be situations where you would want to set this explicitly, e.g. when
88 # multiple dashboard instances are distributed on different machines (usually
89 # behind a load-balancer). Either you have to make sure that a session gets all
90 # requests routed to the same dashboard instance or you set the same SECRET_KEY
91 # for all of them.
92 from horizon.utils import secret_key
93 SECRET_KEY = 'AJDSKLAJDKASJDKASJDKSAJDKSJAKDSA'
94 # We recommend you use memcached for development; otherwise after every reload
95 # of the django development server, you will have to login again. To use
96 # memcached set CACHES to something like
97 CACHES = {
98    'default': {
99        'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache',
100        'LOCATION' : '127.0.0.1:11211',
101    }
102 }
103
104 #CACHES = {
105 #    'default': {
106 #        'BACKEND' : 'django.core.cache.backends.locmem.LocMemCache'
107 #   }
108 #}
109
110 # Enable the Ubuntu theme if it is present.
111 try:
112         from ubuntu_theme import *
113 except ImportError:
114         pass
115
116 # Default Ubuntu apache configuration uses /horizon as the application root.
117 # Configure auth redirects here accordingly.
118 LOGIN_URL='/horizon/auth/login/'
119 LOGOUT_URL='/horizon/auth/logout/'
120 LOGIN_REDIRECT_URL='/horizon'
121
122 # The Ubuntu package includes pre-compressed JS and compiled CSS to allow
123 # offline compression by default.  To enable online compression, install
124 # the node-less package and enable the following option.
125 COMPRESS_OFFLINE = True
126
127 # By default, validation of the HTTP Host header is disabled.  Production
128 # installations should have this set accordingly.  For more information
129 # see https://docs.djangoproject.com/en/dev/ref/settings/.
130 ALLOWED_HOSTS = ['{{ dashboard_host }}']
131
132 # Send email to the console by default
133 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
134 # Or send them to /dev/null
135 #EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
136
137 # Configure these for your outgoing email host
138 # EMAIL_HOST = 'smtp.my-company.com'
139 # EMAIL_PORT = 25
140 # EMAIL_HOST_USER = 'djangomail'
141 # EMAIL_HOST_PASSWORD = 'top-secret!'
142
143 # For multiple regions uncomment this configuration, and add (endpoint, title).
144 # AVAILABLE_REGIONS = [
145 #     ('http://cluster1.example.com:5000/v2.0', 'cluster1'),
146 #     ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
147 # ]
148
149 OPENSTACK_HOST = "{{ HA_VIP }}"
150 OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
151 OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_"
152
153 # Disable SSL certificate checks (useful for self-signed certificates):
154 # OPENSTACK_SSL_NO_VERIFY = True
155
156 # The CA certificate to use to verify SSL connections
157 # OPENSTACK_SSL_CACERT = '/path/to/cacert.pem'
158
159 # The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
160 # capabilities of the auth backend for Keystone.
161 # If Keystone has been configured to use LDAP as the auth backend then set
162 # can_edit_user to False and name to 'ldap'.
163 #
164 # TODO(tres): Remove these once Keystone has an API to identify auth backend.
165 OPENSTACK_KEYSTONE_BACKEND = {
166     'name': 'native',
167     'can_edit_user': True,
168     'can_edit_group': True,
169     'can_edit_project': True,
170     'can_edit_domain': True,
171     'can_edit_role': True
172 }
173
174 #Setting this to True, will add a new "Retrieve Password" action on instance,
175 #allowing Admin session password retrieval/decryption.
176 #OPENSTACK_ENABLE_PASSWORD_RETRIEVE = False
177
178 # The Xen Hypervisor has the ability to set the mount point for volumes
179 # attached to instances (other Hypervisors currently do not). Setting
180 # can_set_mount_point to True will add the option to set the mount point
181 # from the UI.
182 OPENSTACK_HYPERVISOR_FEATURES = {
183     'can_set_mount_point': False,
184     'can_set_password': False,
185 }
186
187 # The OPENSTACK_NEUTRON_NETWORK settings can be used to enable optional
188 # services provided by neutron. Options currently available are load
189 # balancer service, security groups, quotas, VPN service.
190 OPENSTACK_NEUTRON_NETWORK = {
191     'enable_lb': False,
192     'enable_firewall': False,
193     'enable_quotas': True,
194     'enable_vpn': False,
195     # The profile_support option is used to detect if an external router can be
196     # configured via the dashboard. When using specific plugins the
197     # profile_support can be turned on if needed.
198     'profile_support': None,
199     #'profile_support': 'cisco',
200 }
201
202 # The OPENSTACK_IMAGE_BACKEND settings can be used to customize features
203 # in the OpenStack Dashboard related to the Image service, such as the list
204 # of supported image formats.
205 # OPENSTACK_IMAGE_BACKEND = {
206 #     'image_formats': [
207 #         ('', ''),
208 #         ('aki', _('AKI - Amazon Kernel Image')),
209 #         ('ami', _('AMI - Amazon Machine Image')),
210 #         ('ari', _('ARI - Amazon Ramdisk Image')),
211 #         ('iso', _('ISO - Optical Disk Image')),
212 #         ('qcow2', _('QCOW2 - QEMU Emulator')),
213 #         ('raw', _('Raw')),
214 #         ('vdi', _('VDI')),
215 #         ('vhd', _('VHD')),
216 #         ('vmdk', _('VMDK'))
217 #     ]
218 # }
219
220 # The IMAGE_CUSTOM_PROPERTY_TITLES settings is used to customize the titles for
221 # image custom property attributes that appear on image detail pages.
222 IMAGE_CUSTOM_PROPERTY_TITLES = {
223     "architecture": _("Architecture"),
224     "kernel_id": _("Kernel ID"),
225     "ramdisk_id": _("Ramdisk ID"),
226     "image_state": _("Euca2ools state"),
227     "project_id": _("Project ID"),
228     "image_type": _("Image Type")
229 }
230
231 # OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
232 # in the Keystone service catalog. Use this setting when Horizon is running
233 # external to the OpenStack environment. The default is 'publicURL'.
234 #OPENSTACK_ENDPOINT_TYPE = "publicURL"
235
236 # SECONDARY_ENDPOINT_TYPE specifies the fallback endpoint type to use in the
237 # case that OPENSTACK_ENDPOINT_TYPE is not present in the endpoints
238 # in the Keystone service catalog. Use this setting when Horizon is running
239 # external to the OpenStack environment. The default is None.  This
240 # value should differ from OPENSTACK_ENDPOINT_TYPE if used.
241 #SECONDARY_ENDPOINT_TYPE = "publicURL"
242
243 # The number of objects (Swift containers/objects or images) to display
244 # on a single page before providing a paging element (a "more" link)
245 # to paginate results.
246 API_RESULT_LIMIT = 1000
247 API_RESULT_PAGE_SIZE = 20
248
249 # The timezone of the server. This should correspond with the timezone
250 # of your entire OpenStack installation, and hopefully be in UTC.
251 TIME_ZONE = "UTC"
252
253 # When launching an instance, the menu of available flavors is
254 # sorted by RAM usage, ascending. If you would like a different sort order,
255 # you can provide another flavor attribute as sorting key. Alternatively, you
256 # can provide a custom callback method to use for sorting. You can also provide
257 # a flag for reverse sort. For more info, see
258 # http://docs.python.org/2/library/functions.html#sorted
259 # CREATE_INSTANCE_FLAVOR_SORT = {
260 #     'key': 'name',
261 #      # or
262 #     'key': my_awesome_callback_method,
263 #     'reverse': False,
264 # }
265
266 # The Horizon Policy Enforcement engine uses these values to load per service
267 # policy rule files. The content of these files should match the files the
268 # OpenStack services are using to determine role based access control in the
269 # target installation.
270
271 # Path to directory containing policy.json files
272 #POLICY_FILES_PATH = os.path.join(ROOT_PATH, "conf")
273 # Map of local copy of service policy files
274 #POLICY_FILES = {
275 #    'identity': 'keystone_policy.json',
276 #    'compute': 'nova_policy.json',
277 #    'volume': 'cinder_policy.json',
278 #    'image': 'glance_policy.json',
279 #}
280
281 # Trove user and database extension support. By default support for
282 # creating users and databases on database instances is turned on.
283 # To disable these extensions set the permission here to something
284 # unusable such as ["!"].
285 # TROVE_ADD_USER_PERMS = []
286 # TROVE_ADD_DATABASE_PERMS = []
287
288 LOGGING = {
289     'version': 1,
290     # When set to True this will disable all logging except
291     # for loggers specified in this configuration dictionary. Note that
292     # if nothing is specified here and disable_existing_loggers is True,
293     # django.db.backends will still log unless it is disabled explicitly.
294     'disable_existing_loggers': False,
295     'handlers': {
296         'null': {
297             'level': 'DEBUG',
298             'class': 'django.utils.log.NullHandler',
299         },
300         'console': {
301             # Set the level to "DEBUG" for verbose output logging.
302             'level': 'INFO',
303             'class': 'logging.StreamHandler',
304         },
305     },
306     'loggers': {
307         # Logging from django.db.backends is VERY verbose, send to null
308         # by default.
309         'django.db.backends': {
310             'handlers': ['null'],
311             'propagate': False,
312         },
313         'requests': {
314             'handlers': ['null'],
315             'propagate': False,
316         },
317         'horizon': {
318             'handlers': ['console'],
319             'level': 'DEBUG',
320             'propagate': False,
321         },
322         'openstack_dashboard': {
323             'handlers': ['console'],
324             'level': 'DEBUG',
325             'propagate': False,
326         },
327         'novaclient': {
328             'handlers': ['console'],
329             'level': 'DEBUG',
330             'propagate': False,
331         },
332         'cinderclient': {
333             'handlers': ['console'],
334             'level': 'DEBUG',
335             'propagate': False,
336         },
337         'keystoneclient': {
338             'handlers': ['console'],
339             'level': 'DEBUG',
340             'propagate': False,
341         },
342         'glanceclient': {
343             'handlers': ['console'],
344             'level': 'DEBUG',
345             'propagate': False,
346         },
347         'neutronclient': {
348             'handlers': ['console'],
349             'level': 'DEBUG',
350             'propagate': False,
351         },
352         'heatclient': {
353             'handlers': ['console'],
354             'level': 'DEBUG',
355             'propagate': False,
356         },
357         'ceilometerclient': {
358             'handlers': ['console'],
359             'level': 'DEBUG',
360             'propagate': False,
361         },
362         'troveclient': {
363             'handlers': ['console'],
364             'level': 'DEBUG',
365             'propagate': False,
366         },
367         'swiftclient': {
368             'handlers': ['console'],
369             'level': 'DEBUG',
370             'propagate': False,
371         },
372         'openstack_auth': {
373             'handlers': ['console'],
374             'level': 'DEBUG',
375             'propagate': False,
376         },
377         'nose.plugins.manager': {
378             'handlers': ['console'],
379             'level': 'DEBUG',
380             'propagate': False,
381         },
382         'django': {
383             'handlers': ['console'],
384             'level': 'DEBUG',
385             'propagate': False,
386         },
387         'iso8601': {
388             'handlers': ['null'],
389             'propagate': False,
390         },
391     }
392 }
393
394 # 'direction' should not be specified for all_tcp/udp/icmp.
395 # It is specified in the form.
396 SECURITY_GROUP_RULES = {
397     'all_tcp': {
398         'name': 'ALL TCP',
399         'ip_protocol': 'tcp',
400         'from_port': '1',
401         'to_port': '65535',
402     },
403     'all_udp': {
404         'name': 'ALL UDP',
405         'ip_protocol': 'udp',
406         'from_port': '1',
407         'to_port': '65535',
408     },
409     'all_icmp': {
410         'name': 'ALL ICMP',
411         'ip_protocol': 'icmp',
412         'from_port': '-1',
413         'to_port': '-1',
414     },
415     'ssh': {
416         'name': 'SSH',
417         'ip_protocol': 'tcp',
418         'from_port': '22',
419         'to_port': '22',
420     },
421     'smtp': {
422         'name': 'SMTP',
423         'ip_protocol': 'tcp',
424         'from_port': '25',
425         'to_port': '25',
426     },
427     'dns': {
428         'name': 'DNS',
429         'ip_protocol': 'tcp',
430         'from_port': '53',
431         'to_port': '53',
432     },
433     'http': {
434         'name': 'HTTP',
435         'ip_protocol': 'tcp',
436         'from_port': '80',
437         'to_port': '80',
438     },
439     'pop3': {
440         'name': 'POP3',
441         'ip_protocol': 'tcp',
442         'from_port': '110',
443         'to_port': '110',
444     },
445     'imap': {
446         'name': 'IMAP',
447         'ip_protocol': 'tcp',
448         'from_port': '143',
449         'to_port': '143',
450     },
451     'ldap': {
452         'name': 'LDAP',
453         'ip_protocol': 'tcp',
454         'from_port': '389',
455         'to_port': '389',
456     },
457     'https': {
458         'name': 'HTTPS',
459         'ip_protocol': 'tcp',
460         'from_port': '443',
461         'to_port': '443',
462     },
463     'smtps': {
464         'name': 'SMTPS',
465         'ip_protocol': 'tcp',
466         'from_port': '465',
467         'to_port': '465',
468     },
469     'imaps': {
470         'name': 'IMAPS',
471         'ip_protocol': 'tcp',
472         'from_port': '993',
473         'to_port': '993',
474     },
475     'pop3s': {
476         'name': 'POP3S',
477         'ip_protocol': 'tcp',
478         'from_port': '995',
479         'to_port': '995',
480     },
481     'ms_sql': {
482         'name': 'MS SQL',
483         'ip_protocol': 'tcp',
484         'from_port': '1433',
485         'to_port': '1433',
486     },
487     'mysql': {
488         'name': 'MYSQL',
489         'ip_protocol': 'tcp',
490         'from_port': '3306',
491         'to_port': '3306',
492     },
493     'rdp': {
494         'name': 'RDP',
495         'ip_protocol': 'tcp',
496         'from_port': '3389',
497         'to_port': '3389',
498     },
499 }
500
501 FLAVOR_EXTRA_KEYS = {
502     'flavor_keys': [
503         ('quota:read_bytes_sec', _('Quota: Read bytes')),
504         ('quota:write_bytes_sec', _('Quota: Write bytes')),
505         ('quota:cpu_quota', _('Quota: CPU')),
506         ('quota:cpu_period', _('Quota: CPU period')),
507         ('quota:inbound_average', _('Quota: Inbound average')),
508         ('quota:outbound_average', _('Quota: Outbound average')),
509     ]
510 }
511