components/openstack/horizon/files/local_settings.py
changeset 1944 56ac2df1785b
parent 1820 f3a6bd7bd4a6
child 1963 fe904db9c438
equal deleted inserted replaced
1943:1a27f000029f 1944:56ac2df1785b
     2 
     2 
     3 from django.utils.translation import ugettext_lazy as _
     3 from django.utils.translation import ugettext_lazy as _
     4 
     4 
     5 from openstack_dashboard import exceptions
     5 from openstack_dashboard import exceptions
     6 
     6 
     7 DEBUG = False
     7 DEBUG = True
     8 TEMPLATE_DEBUG = DEBUG
     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', ]
     9 
    16 
    10 # Set SSL proxy settings:
    17 # Set SSL proxy settings:
    11 # For Django 1.4+ pass this header from the proxy after terminating the SSL,
    18 # For Django 1.4+ pass this header from the proxy after terminating the SSL,
    12 # and don't forget to strip it from the client's request.
    19 # and don't forget to strip it from the client's request.
    13 # For more information see:
    20 # For more information see:
    23 # redirects here accordingly.
    30 # redirects here accordingly.
    24 LOGIN_URL = '/horizon/auth/login/'
    31 LOGIN_URL = '/horizon/auth/login/'
    25 LOGOUT_URL = '/horizon/auth/logout/'
    32 LOGOUT_URL = '/horizon/auth/logout/'
    26 LOGIN_REDIRECT_URL = '/horizon'
    33 LOGIN_REDIRECT_URL = '/horizon'
    27 
    34 
    28 # Set STATIC_ROOT directly.
    35 STATIC_ROOT = '/var/lib/openstack_dashboard/static'
    29 STATIC_ROOT = "/var/lib/openstack_dashboard/static"
       
    30 
    36 
    31 # Enable Solaris theme
    37 # Enable Solaris theme
    32 TEMPLATE_DIRS = ('/var/lib/openstack_dashboard/static/solaris/theme', )
    38 TEMPLATE_DIRS = ('/var/lib/openstack_dashboard/static/solaris/theme', )
       
    39 
       
    40 # Overrides for OpenStack API versions. Use this setting to force the
       
    41 # OpenStack dashboard to use a specfic API version for a given service API.
       
    42 # NOTE: The version should be formatted as it appears in the URL for the
       
    43 # service API. For example, The identity service APIs have inconsistent
       
    44 # use of the decimal point, so valid options would be "2.0" or "3".
       
    45 # OPENSTACK_API_VERSIONS = {
       
    46 #     "identity": 3
       
    47 # }
       
    48 
       
    49 # Set this to True if running on multi-domain model. When this is enabled, it
       
    50 # will require user to enter the Domain name in addition to username for login.
       
    51 # OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = False
       
    52 
       
    53 # Overrides the default domain used when running on single-domain model
       
    54 # with Keystone V3. All entities will be created in the default domain.
       
    55 # OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default'
       
    56 
       
    57 # Set Console type:
       
    58 # valid options would be "AUTO", "VNC" or "SPICE"
       
    59 # CONSOLE_TYPE = "AUTO"
    33 
    60 
    34 # Default OpenStack Dashboard configuration.
    61 # Default OpenStack Dashboard configuration.
    35 HORIZON_CONFIG = {
    62 HORIZON_CONFIG = {
    36     'dashboards': ('project', 'admin', 'settings',),
    63     'dashboards': ('project', 'admin', 'settings',),
    37     'default_dashboard': 'project',
    64     'default_dashboard': 'project',
    60 # HORIZON_CONFIG["simple_ip_management"] = False
    87 # HORIZON_CONFIG["simple_ip_management"] = False
    61 
    88 
    62 # Turn off browser autocompletion for the login form if so desired.
    89 # Turn off browser autocompletion for the login form if so desired.
    63 # HORIZON_CONFIG["password_autocomplete"] = "off"
    90 # HORIZON_CONFIG["password_autocomplete"] = "off"
    64 
    91 
    65 LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
    92 LOCAL_PATH = '/var/lib/openstack_dashboard'
    66 
    93 
    67 # Set custom secret key:
    94 # Set custom secret key:
    68 # You can either set it to a specific value or you can let horizion generate a
    95 # You can either set it to a specific value or you can let horizion generate a
    69 # default secret key that is unique on this machine, e.i. regardless of the
    96 # default secret key that is unique on this machine, e.i. regardless of the
    70 # amount of Python WSGI workers (if used behind Apache+mod_wsgi): However, there
    97 # amount of Python WSGI workers (if used behind Apache+mod_wsgi): However, there
    72 # multiple dashboard instances are distributed on different machines (usually
    99 # multiple dashboard instances are distributed on different machines (usually
    73 # behind a load-balancer). Either you have to make sure that a session gets all
   100 # behind a load-balancer). Either you have to make sure that a session gets all
    74 # requests routed to the same dashboard instance or you set the same SECRET_KEY
   101 # requests routed to the same dashboard instance or you set the same SECRET_KEY
    75 # for all of them.
   102 # for all of them.
    76 from horizon.utils import secret_key
   103 from horizon.utils import secret_key
    77 SECRET_KEY = secret_key.generate_key()
   104 SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
    78 
   105 
    79 # We recommend you use memcached for development; otherwise after every reload
   106 # We recommend you use memcached for development; otherwise after every reload
    80 # of the django development server, you will have to login again. To use
   107 # of the django development server, you will have to login again. To use
    81 # memcached set CACHES to something like
   108 # memcached set CACHES to something like
    82 # CACHES = {
   109 # CACHES = {
   109 #     ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
   136 #     ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
   110 # ]
   137 # ]
   111 
   138 
   112 OPENSTACK_HOST = "127.0.0.1"
   139 OPENSTACK_HOST = "127.0.0.1"
   113 OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
   140 OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
   114 OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
   141 OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_"
   115 
   142 
   116 # Disable SSL certificate checks (useful for self-signed certificates):
   143 # Disable SSL certificate checks (useful for self-signed certificates):
   117 # OPENSTACK_SSL_NO_VERIFY = True
   144 # OPENSTACK_SSL_NO_VERIFY = True
       
   145 
       
   146 # The CA certificate to use to verify SSL connections
       
   147 # OPENSTACK_SSL_CACERT = '/path/to/cacert.pem'
   118 
   148 
   119 # The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
   149 # The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
   120 # capabilities of the auth backend for Keystone.
   150 # capabilities of the auth backend for Keystone.
   121 # If Keystone has been configured to use LDAP as the auth backend then set
   151 # If Keystone has been configured to use LDAP as the auth backend then set
   122 # can_edit_user to False and name to 'ldap'.
   152 # can_edit_user to False and name to 'ldap'.
   123 #
   153 #
   124 # TODO(tres): Remove these once Keystone has an API to identify auth backend.
   154 # TODO(tres): Remove these once Keystone has an API to identify auth backend.
   125 OPENSTACK_KEYSTONE_BACKEND = {
   155 OPENSTACK_KEYSTONE_BACKEND = {
   126     'name': 'native',
   156     'name': 'native',
   127     'can_edit_user': True,
   157     'can_edit_user': True,
   128     'can_edit_project': True
   158     'can_edit_group': True,
       
   159     'can_edit_project': True,
       
   160     'can_edit_domain': True,
       
   161     'can_edit_role': True
   129 }
   162 }
   130 
   163 
   131 OPENSTACK_HYPERVISOR_FEATURES = {
   164 OPENSTACK_HYPERVISOR_FEATURES = {
   132     'can_set_mount_point': True,
   165     'can_set_mount_point': True,
   133 
   166 }
   134     # NOTE: as of Grizzly this is not yet supported in Nova so enabling this
   167 
   135     # setting will not do anything useful
   168 # The OPENSTACK_NEUTRON_NETWORK settings can be used to enable optional
   136     'can_encrypt_volumes': False
   169 # services provided by neutron. Options currenly available are load
   137 }
   170 # balancer service, security groups, quotas, VPN service.
   138 
   171 OPENSTACK_NEUTRON_NETWORK = {
   139 # The OPENSTACK_QUANTUM_NETWORK settings can be used to enable optional
   172     'enable_lb': False,
   140 # services provided by quantum.  Currently only the load balancer service
   173     'enable_firewall': False,
   141 # is available.
   174     'enable_quotas': True,
   142 OPENSTACK_QUANTUM_NETWORK = {
   175     'enable_vpn': False,
   143     'enable_lb': False
   176     # The profile_support option is used to detect if an external router can be
   144 }
   177     # configured via the dashboard. When using specific plugins the
       
   178     # profile_support can be turned on if needed.
       
   179     'profile_support': None,
       
   180     #'profile_support': 'cisco',
       
   181 }
       
   182 
       
   183 # The OPENSTACK_IMAGE_BACKEND settings can be used to customize features
       
   184 # in the OpenStack Dashboard related to the Image service, such as the list
       
   185 # of supported image formats.
       
   186 # OPENSTACK_IMAGE_BACKEND = {
       
   187 #     'image_formats': [
       
   188 #         ('', ''),
       
   189 #         ('aki', _('AKI - Amazon Kernel Image')),
       
   190 #         ('ami', _('AMI - Amazon Machine Image')),
       
   191 #         ('ari', _('ARI - Amazon Ramdisk Image')),
       
   192 #         ('iso', _('ISO - Optical Disk Image')),
       
   193 #         ('qcow2', _('QCOW2 - QEMU Emulator')),
       
   194 #         ('raw', _('Raw')),
       
   195 #         ('vdi', _('VDI')),
       
   196 #         ('vhd', _('VHD')),
       
   197 #         ('vmdk', _('VMDK'))
       
   198 #     ]
       
   199 # }
   145 
   200 
   146 # OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
   201 # OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
   147 # in the Keystone service catalog. Use this setting when Horizon is running
   202 # in the Keystone service catalog. Use this setting when Horizon is running
   148 # external to the OpenStack environment. The default is 'internalURL'.
   203 # external to the OpenStack environment. The default is 'publicURL'.
   149 #OPENSTACK_ENDPOINT_TYPE = "publicURL"
   204 #OPENSTACK_ENDPOINT_TYPE = "publicURL"
       
   205 
       
   206 # SECONDARY_ENDPOINT_TYPE specifies the fallback endpoint type to use in the
       
   207 # case that OPENSTACK_ENDPOINT_TYPE is not present in the endpoints
       
   208 # in the Keystone service catalog. Use this setting when Horizon is running
       
   209 # external to the OpenStack environment. The default is None.  This
       
   210 # value should differ from OPENSTACK_ENDPOINT_TYPE if used.
       
   211 #SECONDARY_ENDPOINT_TYPE = "publicURL"
   150 
   212 
   151 # The number of objects (Swift containers/objects or images) to display
   213 # The number of objects (Swift containers/objects or images) to display
   152 # on a single page before providing a paging element (a "more" link)
   214 # on a single page before providing a paging element (a "more" link)
   153 # to paginate results.
   215 # to paginate results.
   154 API_RESULT_LIMIT = 1000
   216 API_RESULT_LIMIT = 1000
   155 API_RESULT_PAGE_SIZE = 20
   217 API_RESULT_PAGE_SIZE = 20
   156 
   218 
   157 # The timezone of the server. This should correspond with the timezone
   219 # The timezone of the server. This should correspond with the timezone
   158 # of your entire OpenStack installation, and hopefully be in UTC.
   220 # of your entire OpenStack installation, and hopefully be in UTC.
   159 TIME_ZONE = "UTC"
   221 TIME_ZONE = "UTC"
       
   222 
       
   223 # When launching an instance, the menu of available flavors is
       
   224 # sorted by RAM usage, ascending.  Provide a callback method here
       
   225 # (and/or a flag for reverse sort) for the sorted() method if you'd
       
   226 # like a different behaviour.  For more info, see
       
   227 # http://docs.python.org/2/library/functions.html#sorted
       
   228 # CREATE_INSTANCE_FLAVOR_SORT = {
       
   229 #     'key': my_awesome_callback_method,
       
   230 #     'reverse': False,
       
   231 # }
       
   232 
       
   233 # The Horizon Policy Enforcement engine uses these values to load per service
       
   234 # policy rule files. The content of these files should match the files the
       
   235 # OpenStack services are using to determine role based access control in the
       
   236 # target installation.
       
   237 
       
   238 # Path to directory containing policy.json files
       
   239 #POLICY_FILES_PATH = os.path.join(ROOT_PATH, "conf")
       
   240 # Map of local copy of service policy files
       
   241 #POLICY_FILES = {
       
   242 #    'identity': 'keystone_policy.json',
       
   243 #    'compute': 'nova_policy.json'
       
   244 #}
       
   245 
       
   246 # Trove user and database extension support. By default support for
       
   247 # creating users and databases on database instances is turned on.
       
   248 # To disable these extensions set the permission here to something
       
   249 # unusable such as ["!"].
       
   250 # TROVE_ADD_USER_PERMS = []
       
   251 # TROVE_ADD_DATABASE_PERMS = []
   160 
   252 
   161 LOGGING = {
   253 LOGGING = {
   162     'version': 1,
   254     'version': 1,
   163     # When set to True this will disable all logging except
   255     # When set to True this will disable all logging except
   164     # for loggers specified in this configuration dictionary. Note that
   256     # for loggers specified in this configuration dictionary. Note that
   187             'handlers': ['null'],
   279             'handlers': ['null'],
   188             'propagate': False,
   280             'propagate': False,
   189         },
   281         },
   190         'horizon': {
   282         'horizon': {
   191             'handlers': ['console'],
   283             'handlers': ['console'],
       
   284             'level': 'DEBUG',
   192             'propagate': False,
   285             'propagate': False,
   193         },
   286         },
   194         'openstack_dashboard': {
   287         'openstack_dashboard': {
   195             'handlers': ['console'],
   288             'handlers': ['console'],
       
   289             'level': 'DEBUG',
   196             'propagate': False,
   290             'propagate': False,
   197         },
   291         },
   198         'novaclient': {
   292         'novaclient': {
   199             'handlers': ['console'],
   293             'handlers': ['console'],
       
   294             'level': 'DEBUG',
       
   295             'propagate': False,
       
   296         },
       
   297         'cinderclient': {
       
   298             'handlers': ['console'],
       
   299             'level': 'DEBUG',
   200             'propagate': False,
   300             'propagate': False,
   201         },
   301         },
   202         'keystoneclient': {
   302         'keystoneclient': {
   203             'handlers': ['console'],
   303             'handlers': ['console'],
       
   304             'level': 'DEBUG',
   204             'propagate': False,
   305             'propagate': False,
   205         },
   306         },
   206         'glanceclient': {
   307         'glanceclient': {
   207             'handlers': ['console'],
   308             'handlers': ['console'],
       
   309             'level': 'DEBUG',
       
   310             'propagate': False,
       
   311         },
       
   312         'neutronclient': {
       
   313             'handlers': ['console'],
       
   314             'level': 'DEBUG',
       
   315             'propagate': False,
       
   316         },
       
   317         'heatclient': {
       
   318             'handlers': ['console'],
       
   319             'level': 'DEBUG',
       
   320             'propagate': False,
       
   321         },
       
   322         'ceilometerclient': {
       
   323             'handlers': ['console'],
       
   324             'level': 'DEBUG',
       
   325             'propagate': False,
       
   326         },
       
   327         'troveclient': {
       
   328             'handlers': ['console'],
       
   329             'level': 'DEBUG',
       
   330             'propagate': False,
       
   331         },
       
   332         'swiftclient': {
       
   333             'handlers': ['console'],
       
   334             'level': 'DEBUG',
       
   335             'propagate': False,
       
   336         },
       
   337         'openstack_auth': {
       
   338             'handlers': ['console'],
       
   339             'level': 'DEBUG',
   208             'propagate': False,
   340             'propagate': False,
   209         },
   341         },
   210         'nose.plugins.manager': {
   342         'nose.plugins.manager': {
   211             'handlers': ['console'],
   343             'handlers': ['console'],
   212             'propagate': False,
   344             'level': 'DEBUG',
   213         }
   345             'propagate': False,
       
   346         },
       
   347         'django': {
       
   348             'handlers': ['console'],
       
   349             'level': 'DEBUG',
       
   350             'propagate': False,
       
   351         },
       
   352         'iso8601': {
       
   353             'handlers': ['null'],
       
   354             'propagate': False,
       
   355         },
   214     }
   356     }
   215 }
   357 }
       
   358 
       
   359 SECURITY_GROUP_RULES = {
       
   360     'all_tcp': {
       
   361         'name': 'ALL TCP',
       
   362         'ip_protocol': 'tcp',
       
   363         'from_port': '1',
       
   364         'to_port': '65535',
       
   365     },
       
   366     'all_udp': {
       
   367         'name': 'ALL UDP',
       
   368         'ip_protocol': 'udp',
       
   369         'from_port': '1',
       
   370         'to_port': '65535',
       
   371     },
       
   372     'all_icmp': {
       
   373         'name': 'ALL ICMP',
       
   374         'ip_protocol': 'icmp',
       
   375         'from_port': '-1',
       
   376         'to_port': '-1',
       
   377     },
       
   378     'ssh': {
       
   379         'name': 'SSH',
       
   380         'ip_protocol': 'tcp',
       
   381         'from_port': '22',
       
   382         'to_port': '22',
       
   383     },
       
   384     'smtp': {
       
   385         'name': 'SMTP',
       
   386         'ip_protocol': 'tcp',
       
   387         'from_port': '25',
       
   388         'to_port': '25',
       
   389     },
       
   390     'dns': {
       
   391         'name': 'DNS',
       
   392         'ip_protocol': 'tcp',
       
   393         'from_port': '53',
       
   394         'to_port': '53',
       
   395     },
       
   396     'http': {
       
   397         'name': 'HTTP',
       
   398         'ip_protocol': 'tcp',
       
   399         'from_port': '80',
       
   400         'to_port': '80',
       
   401     },
       
   402     'pop3': {
       
   403         'name': 'POP3',
       
   404         'ip_protocol': 'tcp',
       
   405         'from_port': '110',
       
   406         'to_port': '110',
       
   407     },
       
   408     'imap': {
       
   409         'name': 'IMAP',
       
   410         'ip_protocol': 'tcp',
       
   411         'from_port': '143',
       
   412         'to_port': '143',
       
   413     },
       
   414     'ldap': {
       
   415         'name': 'LDAP',
       
   416         'ip_protocol': 'tcp',
       
   417         'from_port': '389',
       
   418         'to_port': '389',
       
   419     },
       
   420     'https': {
       
   421         'name': 'HTTPS',
       
   422         'ip_protocol': 'tcp',
       
   423         'from_port': '443',
       
   424         'to_port': '443',
       
   425     },
       
   426     'smtps': {
       
   427         'name': 'SMTPS',
       
   428         'ip_protocol': 'tcp',
       
   429         'from_port': '465',
       
   430         'to_port': '465',
       
   431     },
       
   432     'imaps': {
       
   433         'name': 'IMAPS',
       
   434         'ip_protocol': 'tcp',
       
   435         'from_port': '993',
       
   436         'to_port': '993',
       
   437     },
       
   438     'pop3s': {
       
   439         'name': 'POP3S',
       
   440         'ip_protocol': 'tcp',
       
   441         'from_port': '995',
       
   442         'to_port': '995',
       
   443     },
       
   444     'ms_sql': {
       
   445         'name': 'MS SQL',
       
   446         'ip_protocol': 'tcp',
       
   447         'from_port': '1433',
       
   448         'to_port': '1433',
       
   449     },
       
   450     'mysql': {
       
   451         'name': 'MYSQL',
       
   452         'ip_protocol': 'tcp',
       
   453         'from_port': '3306',
       
   454         'to_port': '3306',
       
   455     },
       
   456     'rdp': {
       
   457         'name': 'RDP',
       
   458         'ip_protocol': 'tcp',
       
   459         'from_port': '3389',
       
   460         'to_port': '3389',
       
   461     },
       
   462 }