[ English | English (United Kingdom) | 中文 (简体, 中国) | Indonesia | русский | français | नेपाली | Deutsch | Esperanto | português (Brasil) | español | 한국어 (대한민국) ]

대시보 사용자 정의와 설정

대시보드를 설치했다면 프로젝트, 비즈니스 등의 필요한 환경에 따라 마음껏 커스터마이징 할 수 있습니다.

HTTP 운용 또는 안전한 HTTPS 운용으로 대시보드를 구성할 수 있습니다. 표준 오픈스택 설치는 암호화 되지 않은 HTTP 채널을 사용하지만 대시보드에 대한 SSL 설정을 활성화 할 수 있습니다.

HTTPS 나 HTTP 요구사항에 대한 정보는 `configure_dashboard`를 살펴보세요.

대시보드 사용자 정의

우분투 환경에서의 오픈스택 대시보드는 openstack-dashboard-ubuntu-theme 패키지를 기본적으로 설치합니다. 테마 사용을 원치 않으면, 해당 패키지와 그에 따른 의존 패키지를 삭제하십시오.

# apt-get remove --auto-remove openstack-dashboard-ubuntu-theme

참고

본 가이드는 local_settings.py 파일을 집중적으로 다룹니다.

아래의 대시보드 내용은 필요게 맞게끔 커스터마이징 할 수 있습니다.

  • 로고

  • 사이트 테마

  • HTML 제목

  • 로고 링크

  • 도움말 URL

로고와 사이트 테마

  1. 다음 크기를 사용하여 투명 배경을 갖는 두 개의 PNG 로고 파일을 생성합니다:

    • 로그인 화면: 365 x 50

    • 배너 속 로그: 216 x 35

  2. 새로운 이미지를 /usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/img/ 에 업로드합니다.

  3. CSS 스타일 시트를 /usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/scss/ 에 생성합니다.

  4. 색상과 이미지 파일을 적절하게 변경하십시오. 디렉토리 상대 경로가 동일한지 확인 하십시오. 아래 예시는 CSS 파일을 어떻게 커스터마이징 하는지 보여 줍니다.

    /*
    * New theme colors for dashboard that override the defaults:
    *  dark blue: #355796 / rgb(53, 87, 150)
    *  light blue: #BAD3E1 / rgb(186, 211, 225)
    *
    * By Preston Lee <[email protected]>
    */
    h1.brand {
    background: #355796 repeat-x top left;
    border-bottom: 2px solid #BAD3E1;
    }
    h1.brand a {
    background: url(../img/my_cloud_logo_small.png) top left no-repeat;
    }
    #splash .login {
    background: #355796 url(../img/my_cloud_logo_medium.png) no-repeat center 35px;
    }
    #splash .login .modal-header {
    border-top: 1px solid #BAD3E1;
    }
    .btn-primary {
    background-image: none !important;
    background-color: #355796 !important;
    border: none !important;
    box-shadow: none;
    }
    .btn-primary:hover,
    .btn-primary:active {
    border: none;
    box-shadow: none;
    background-color: #BAD3E1 !important;
    text-decoration: none;
    }
    
  5. 다음 HTML 템플릿을 선호하는 편집기로 엽니다:

    /usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html
    
  6. 새로 추가한 스타일시트에 한줄을 포함합니다. 예로 들면 custom.css 파일:

    <link href='{{ STATIC_URL }}bootstrap/css/bootstrap.min.css' media='screen' rel='stylesheet' />
    <link href='{{ STATIC_URL }}dashboard/css/{% choose_css %}' media='screen' rel='stylesheet' />
    <link href='{{ STATIC_URL }}dashboard/css/custom.css' media='screen' rel='stylesheet' />
    
  7. Apache 서비스를 재시작합니다.

  8. 변경 사항을 보려면, 대시보드를 다시 로드합니다. 필요하다면 뒤로 돌아가 CSS 파일을 적절히 수정합니다.

HTML 제목

  1. 다음 줄을 local_settings.py 에 추가하여, 브라우저 창 상단에 보이는 HTML 제목을 설정합니다:

    SITE_BRANDING = "Example, Inc. Cloud"
    
  2. 해당 변경 사항을 적용하기 위해 Apache를 재시작합니다.

도움말 URL

  1. 기본으로 도움말 URL은 https://docs.openstack.org 입니다. 이를 변경하려면 ``local_settings.py``에서 다음 속성을 편집하십시오:

    HORIZON_CONFIG["help_url"] = "http://openstack.mycompany.org"
    
  2. 해당 변경 사항을 적용하기 위해 Apache를 재시작합니다.

대시보드 구성

다음 섹션에서는 보안 HTTPS 배포 또는 HTTP 배포를 위해 대시보드를 구성하는 방법에 대해 구체적인 예를 사용하여 명확하게 설명합니다. 그러나 파일 경로는 배포에 따라 다릅니다. 필요한 경우 대시보드에서 VNC 창 크기를 조정할 수도 있습니다.

HTTP에 대한 대시보드를 설정하십시오

간단한 HTTP 운용으로 대시보드를 설정할 수 있습니다. 표준 설치는 암호화 하지 않은 HTTP 채널을 사용합니다.

  1. ``OPENSTACK_HOST``설정인 ``local_settings.py``파일에서 아이덴티티 서비스 종단점의 호스트를 지정합니다.

    아래 예시는 이와 같은 설정 값을 보여 줍니다.

    import os
    
    from django.utils.translation import gettext_lazy as _
    
    DEBUG = False
    TEMPLATE_DEBUG = DEBUG
    PROD = True
    
    SITE_BRANDING = 'OpenStack Dashboard'
    
    # Ubuntu-specific: Enables an extra panel in the 'Settings' section
    # that easily generates a Juju environments.yaml for download,
    # preconfigured with endpoints and credentials required for bootstrap
    # and service deployment.
    ENABLE_JUJU_PANEL = True
    
    # Note: You should change this value
    SECRET_KEY = 'elj1IWiLoWHgryYxFT6j7cM5fGOOxWY0'
    
    # Specify a regular expression to validate user passwords.
    # HORIZON_CONFIG = {
    #     "password_validator": {
    #         "regex": '.*',
    #         "help_text": _("Your password does not meet the requirements.")
    #     }
    # }
    
    LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
    
    CACHES = {
        'default': {
            'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache',
            'LOCATION' : '127.0.0.1:11211'
        }
    }
    
    # Send email to the console by default
    EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
    # Or send them to /dev/null
    #EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
    
    # Configure these for your outgoing email host
    # EMAIL_HOST = 'smtp.my-company.com'
    # EMAIL_PORT = 25
    # EMAIL_HOST_USER = 'djangomail'
    # EMAIL_HOST_PASSWORD = 'top-secret!'
    
    # For multiple regions uncomment this configuration, and add (endpoint, title).
    # AVAILABLE_REGIONS = [
    #     ('http://cluster1.example.com/identity/v3', 'cluster1'),
    #     ('http://cluster2.example.com/identity/v3', 'cluster2'),
    # ]
    
    OPENSTACK_HOST = "127.0.0.1"
    OPENSTACK_KEYSTONE_URL = "http://%s/identity/v3" % OPENSTACK_HOST
    OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
    
    # The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
    # capabilities of the auth backend for Keystone.
    # If Keystone has been configured to use LDAP as the auth backend then set
    # can_edit_user to False and name to 'ldap'.
    #
    # TODO(tres): Remove these once Keystone has an API to identify auth backend.
    OPENSTACK_KEYSTONE_BACKEND = {
        'name': 'native',
        'can_edit_user': True
    }
    
    # OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
    # in the Keystone service catalog. Use this setting when Horizon is running
    # external to the OpenStack environment. The default is 'internalURL'.
    #OPENSTACK_ENDPOINT_TYPE = "publicURL"
    
    # The number of Swift containers and objects to display on a single page before
    # providing a paging element (a "more" link) to paginate results.
    API_RESULT_LIMIT = 1000
    
    # If you have external monitoring links, eg:
    # EXTERNAL_MONITORING = [
    #     ['Nagios','http://foo.com'],
    #     ['Ganglia','http://bar.com'],
    # ]
    
    LOGGING = {
            'version': 1,
            # When set to True this will disable all logging except
            # for loggers specified in this configuration dictionary. Note that
            # if nothing is specified here and disable_existing_loggers is True,
            # django.db.backends will still log unless it is disabled explicitly.
            'disable_existing_loggers': False,
            'handlers': {
                'null': {
                    'level': 'DEBUG',
                    'class': 'logging.NullHandler',
                    },
                'console': {
                    # Set the level to "DEBUG" for verbose output logging.
                    'level': 'INFO',
                    'class': 'logging.StreamHandler',
                    },
                },
            'loggers': {
                # Logging from django.db.backends is VERY verbose, send to null
                # by default.
                'django.db.backends': {
                    'handlers': ['null'],
                    'propagate': False,
                    },
                'horizon': {
                    'handlers': ['console'],
                    'propagate': False,
                },
                'novaclient': {
                    'handlers': ['console'],
                    'propagate': False,
                },
                'keystoneclient': {
                    'handlers': ['console'],
                    'propagate': False,
                }
            }
    }
    

    ID 서비스의 서비스 카탈로그 구성에 따라 대시보드에 서비스가 표시되는지 여부가 결정됩니다. 전체 목록에서 다음을 참조하십시오:install-settings.

  2. Apache HTTP 서버를 재시작합니다.

  3. Memcached 서비스를 재시작합니다:

HTTP

여러분은 안전한 HTTPS 운용으로 대시보드를 구성할 수 있습니다. 표준 설치가 암호화되지않은 HTTP 채널을 사용하면, 여러분은 대시보드에 SSL_support를 사용할 수 있습니다.

이 예제는``http://openstack.example.com`` 도메인을 사용합니다. 당신의 현재 설정에 맞는 도메인을 사용하세요.

  1. local_settings.py 파일에서, 다음 옵션들을 업데이트하세요:

    CSRF_COOKIE_SECURE = True
    SESSION_COOKIE_SECURE = True
    SESSION_COOKIE_HTTPONLY = True
    

    HTTPS를 사용가능하게 하는 다른 옵션들의 필요 조건은;옵션들이 cross-site scripting을 방어하는 조건입니다.

  2. openstack-dashboard.conf 파일을 Example After: 에서 처럼 편집하세요.

    이전 예제

    WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi.py
    WSGIDaemonProcess horizon user=www-data group=www-data processes=3 threads=10
    Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static/
    <Location />
      <ifVersion >=2.4>
        Require all granted
      </ifVersion>
      <ifVersion <2.4>
        Order allow,deny
        Allow from all
      </ifVersion>
    </Location>
    

    이후 예제

    <VirtualHost *:80>
      ServerName openstack.example.com
      <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
      </IfModule>
      <IfModule !mod_rewrite.c>
        RedirectPermanent / https://openstack.example.com
      </IfModule>
    </VirtualHost>
    
    <VirtualHost *:443>
      ServerName openstack.example.com
    
      SSLEngine On
      # Remember to replace certificates and keys with valid paths in your environment
      SSLCertificateFile /etc/apache2/SSL/openstack.example.com.crt
      SSLCACertificateFile /etc/apache2/SSL/openstack.example.com.crt
      SSLCertificateKeyFile /etc/apache2/SSL/openstack.example.com.key
      SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    
      # HTTP Strict Transport Security (HSTS) enforces that all communications
      # with a server go over SSL. This mitigates the threat from attacks such
      # as SSL-Strip which replaces links on the wire, stripping away https prefixes
      # and potentially allowing an attacker to view confidential information on the
      # wire
      Header add Strict-Transport-Security "max-age=15768000"
    
      WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi.py
      WSGIDaemonProcess horizon user=www-data group=www-data processes=3 threads=10
      Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static/
      <Location />
        Options None
        AllowOverride None
        # For Apache http server 2.4 and later:
        <ifVersion >=2.4>
          Require all granted
        </ifVersion>
        # For Apache http server 2.2 and earlier:
        <ifVersion <2.4>
          Order allow,deny
          Allow from all
        </ifVersion>
      </Location>
    </VirtualHost>
    

    이 구성에서, 아파치 HTTP 서버는 port 443번에서 listen하고 HTTPS 프로토콜로 온 모든 안전하지 않은 요청을 재할당합니다. 안전한 섹션은 private 키, 공개키, 증명서로 사용이 가능합니다.

  3. Apache HTTP 서버를 재시작합니다.

  4. Memcached 서비스를 재시작합니다:

    여러분이 HTTP를 통해 대시보드에 접근하려고 시도하면, 브라우저는 당신을 HTTPS 페이지로 재할당합니다.

    참고

    HTTPS용 대시보드를 구성하려면 noVNC 프록시 서비스에 대해 SSL을 사용하도록 설정해야 합니다. 컨트롤러 노드에서 /etc/nova/nova.conf 파일의 [DEFAULT] 부분에 다음과 같은 추가 옵션을 추가합니다

    [DEFAULT]
    # ...
    ssl_only = true
    cert = /etc/apache2/SSL/openstack.example.com.crt
    key = /etc/apache2/SSL/openstack.example.com.key
    

    compute nodes에서, ``nonvncproxy_base_url``옵션이 HTTPS 형식의 URL인지 확실히 하세요.

    [DEFAULT]
    # ...
    novncproxy_base_url = https://controller:6080/vnc_auto.html