base.py 18.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Copyright 2014 Budapest University of Technology and Economics (BME IK)
#
# This file is part of CIRCLE Cloud.
#
# CIRCLE is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# CIRCLE is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along
# with CIRCLE.  If not, see <http://www.gnu.org/licenses/>.

18
"""Common settings and globals."""
Őry Máté committed
19
# flake8: noqa
20
from os import environ
Bach Dániel committed
21
from os.path import (abspath, basename, dirname, join, normpath, isfile,
22
                     exists, expanduser)
23
from sys import path
Bach Dániel committed
24
from subprocess import check_output
25
from uuid import getnode
26 27

from django.core.exceptions import ImproperlyConfigured
28
from django.utils.translation import ugettext_lazy as _
29
from json import loads
30 31


Kálmán Viktor committed
32
# from socket import SOCK_STREAM
33

34

35 36 37
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.

Kálmán Viktor committed
38

39 40 41 42 43 44 45 46 47 48 49 50 51 52
def get_env_variable(var_name, default=None):
    """ Get the environment variable or return exception/default """
    try:
        return environ[var_name]
    except KeyError:
        if default is None:
            error_msg = "Set the %s environment variable" % var_name
            raise ImproperlyConfigured(error_msg)
        else:
            return default


########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
Bach Dániel committed
53
BASE_DIR = dirname(dirname(abspath(__file__)))
54 55

# Absolute filesystem path to the top-level project folder:
Bach Dániel committed
56
SITE_ROOT = dirname(BASE_DIR)
57 58

# Site name:
Bach Dániel committed
59
SITE_NAME = basename(BASE_DIR)
60

61
# Url to site: (e.g. http://localhost:8080/)
62
DJANGO_URL = get_env_variable('DJANGO_URL', '/')
63

64 65
# Add our project to our pythonpath, this way we don't need to type our project
# name in our dotted import paths:
Bach Dániel committed
66
path.append(BASE_DIR)
67 68 69 70 71 72 73 74 75 76 77 78 79 80
########## END PATH CONFIGURATION


########## DEBUG CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = False

# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
TEMPLATE_DEBUG = DEBUG
########## END DEBUG CONFIGURATION


########## MANAGER CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#admins
81 82 83
ADMINS = (
    ('Root', 'root@localhost'),
)
84

85 86
EMAIL_SUBJECT_PREFIX = get_env_variable('DJANGO_SUBJECT_PREFIX', '[CIRCLE] ')

87 88 89 90 91 92 93 94
########## END MANAGER CONFIGURATION


########## DATABASE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.' +
Kálmán Viktor committed
95
        get_env_variable('DJANG_DB_TYPE', 'postgresql_psycopg2'),
96 97 98 99 100 101 102 103 104 105 106 107 108 109
        'NAME':  get_env_variable('DJANGO_DB_NAME', 'circle'),
        'USER':  get_env_variable('DJANGO_DB_USER', 'circle'),
        'PASSWORD':  get_env_variable('DJANGO_DB_PASSWORD'),
        'HOST': get_env_variable('DJANGO_DB_HOST', ''),
        'PORT': get_env_variable('DJANGO_DB_PORT', ''),
    }
}
########## END DATABASE CONFIGURATION


########## GENERAL CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#time-zone
try:
    with open("/etc/timezone", "r") as f:
Kálmán Viktor committed
110
        systz = f.readline().rstrip()
111 112 113 114 115 116
except:
    systz = None

TIME_ZONE = get_env_variable('DJANGO_TIME_ZONE', default=systz)

# See: https://docs.djangoproject.com/en/dev/ref/settings/#language-code
117
LANGUAGE_CODE = get_env_variable("DJANGO_LANGUAGE_CODE", "en")
118 119 120 121 122 123

# https://docs.djangoproject.com/en/dev/ref/settings/#languages
LANGUAGES = (
    ('en', _('English')),
    ('hu', _('Hungarian')),
)
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158

# See: https://docs.djangoproject.com/en/dev/ref/settings/#site-id
SITE_ID = 1

# See: https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
USE_I18N = True

# See: https://docs.djangoproject.com/en/dev/ref/settings/#use-l10n
USE_L10N = True

# See: https://docs.djangoproject.com/en/dev/ref/settings/#use-tz
USE_TZ = True
########## END GENERAL CONFIGURATION


########## MEDIA CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-root
MEDIA_ROOT = normpath(join(SITE_ROOT, 'media'))

# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-url
MEDIA_URL = get_env_variable('DJANGO_MEDIA_URL', default='/media/')
########## END MEDIA CONFIGURATION


########## STATIC FILE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
STATIC_ROOT = normpath(join(SITE_ROOT, 'static_collected'))

# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
STATIC_URL = get_env_variable('DJANGO_STATIC_URL', default='/static/')

# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
159
    'pipeline.finders.PipelineFinder',
160 161
)
########## END STATIC FILE CONFIGURATION
162
STATICFILES_DIRS = [normpath(join(SITE_ROOT, 'bower_components'))]
163

164
p = normpath(join(SITE_ROOT, '../../site-circle/static'))
165
if exists(p):
166 167 168 169 170 171 172
    STATICFILES_DIRS.append(p)

STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
PIPELINE_COMPILERS = (
    'pipeline.compilers.less.LessCompiler',
)
PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor'
173 174
# PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.slimit.SlimItCompressor'
PIPELINE_JS_COMPRESSOR = None
175
PIPELINE_DISABLE_WRAPPER = True
176
PIPELINE_LESS_ARGUMENTS = u'--include-path={}'.format(':'.join(STATICFILES_DIRS))
177 178
PIPELINE_CSS = {
    "all": {"source_filenames": (
179 180
        "compile_bootstrap.less",
        "bootstrap/dist/css/bootstrap-theme.css",
181 182
        "fontawesome/css/font-awesome.css",
        "jquery-simple-slider/css/simple-slider.css",
183
        "intro.js/introjs.css",
184 185 186
        "template.less",
        "dashboard/dashboard.less",
        "network/network.less",
187
        "autocomplete_light/style.css",
188 189 190 191 192 193 194 195 196
    ),
        "output_filename": "all.css",
    }
}
PIPELINE_JS = {
    "all": {"source_filenames": (
        # "jquery/dist/jquery.js",  # included separately
        "bootbox/bootbox.js",
        "bootstrap/dist/js/bootstrap.js",
197
        "intro.js/intro.js",
198 199
        "jquery-knob/dist/jquery.knob.min.js",
        "jquery-simple-slider/js/simple-slider.js",
200
        "favico.js/favico.js",
201
        "datatables/media/js/jquery.dataTables.js",
202
        "dashboard/dashboard.js",
203
        "dashboard/activity.js",
204 205
        "dashboard/group-details.js",
        "dashboard/group-list.js",
206
        "dashboard/js/stupidtable.min.js",  # no bower file
207 208 209 210 211 212 213 214 215
        "dashboard/node-create.js",
        "dashboard/node-details.js",
        "dashboard/node-list.js",
        "dashboard/profile.js",
        "dashboard/store.js",
        "dashboard/template-list.js",
        "dashboard/vm-common.js",
        "dashboard/vm-create.js",
        "dashboard/vm-list.js",
216
        "dashboard/help.js",
217 218 219
        "js/host.js",
        "js/network.js",
        "js/switch-port.js",
220
        "js/host-list.js",
221 222 223 224 225
        "autocomplete_light/autocomplete.js",
        "autocomplete_light/widget.js",
        "autocomplete_light/addanother.js",
        "autocomplete_light/text_widget.js",
        "autocomplete_light/remote.js",
226 227 228 229
    ),
        "output_filename": "all.js",
    },
    "vm-detail": {"source_filenames": (
230
        "dashboard/vm-details.js",
231 232
        "no-vnc/include/util.js",
        "no-vnc/include/webutil.js",
233 234
        "no-vnc/include/base64.js",
        "no-vnc/include/websock.js",
235
        "no-vnc/include/des.js",
Kálmán Viktor committed
236 237
        "no-vnc/include/keysym.js",
        "no-vnc/include/keysymdef.js",
238 239
        "no-vnc/include/keyboard.js",
        "no-vnc/include/input.js",
240
        "no-vnc/include/display.js",
241
        "no-vnc/include/jsunzip.js",
242 243 244 245 246 247 248 249
        "no-vnc/include/rfb.js",
        "dashboard/vm-console.js",
        "dashboard/vm-tour.js",
    ),
        "output_filename": "vm-detail.js",
    },
}

250

251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284

########## SECRET CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
# Note: This key should only be used for development and testing.
SECRET_KEY = r"a5w*b0wajigd^kd7b=@w=5=+l_0c62@vljnhzqu3dfc@vx2jw-"
########## END SECRET CONFIGURATION


########## SITE CONFIGURATION
# Hosts/domain names that are valid for this site
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []
########## END SITE CONFIGURATION


########## FIXTURE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FIXTURE_DIRS
FIXTURE_DIRS = (
    normpath(join(SITE_ROOT, 'fixtures')),
)
########## END FIXTURE CONFIGURATION


########## TEMPLATE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'django.core.context_processors.static',
    'django.core.context_processors.tz',
    'django.contrib.messages.context_processors.messages',
    'django.core.context_processors.request',
285
    'dashboard.context_processors.notifications',
286
    'dashboard.context_processors.extract_settings',
287
    'dashboard.context_processors.broadcast_messages',
288 289 290 291
)

# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
TEMPLATE_DIRS = (
292
    normpath(join(SITE_ROOT, '../../site-circle/templates')),
293 294 295 296 297 298 299 300 301 302 303
    normpath(join(SITE_ROOT, 'templates')),
)
########## END TEMPLATE CONFIGURATION


########## MIDDLEWARE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#middleware-classes
MIDDLEWARE_CLASSES = (
    # Default Django middleware.
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
304
    'django.middleware.locale.LocaleMiddleware',
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
########## END MIDDLEWARE CONFIGURATION


########## URL CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#root-urlconf
ROOT_URLCONF = '%s.urls' % SITE_NAME
########## END URL CONFIGURATION


########## APP CONFIGURATION
DJANGO_APPS = (
    # Default Django apps:
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    # Useful template tags:
    # 'django.contrib.humanize',

    # Admin panel and documentation:
    'django.contrib.admin',
    # 'django.contrib.admindocs',
)

THIRD_PARTY_APPS = (
338 339
    'django_tables2',
    'crispy_forms',
340
    'sizefield',
341
    'taggit',
342
    'statici18n',
343
    'django_sshkey',
344
    'autocomplete_light',
345
    'pipeline',
346 347
)

Bach Dániel committed
348

349 350
# Apps specific for this project go here.
LOCAL_APPS = (
351
    'common',
352 353 354
    'vm',
    'storage',
    'firewall',
355
    'network',
356
    'dashboard',
357
    'manager',
Őry Máté committed
358
    'acl',
359
    'monitor',
Kálmán Viktor committed
360
    'request',
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377
)

# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
########## END APP CONFIGURATION


########## LOGGING CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#logging
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
Kálmán Viktor committed
378
    'formatters': {
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
        'simple': {
            'format': '%(asctime)s [%(levelname)s]: %(name)s %(message)s',
            'datefmt': '%Y-%m-%d %H:%M:%S',
        },
    },
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'filters': ['require_debug_false'],
            'class': 'django.utils.log.AdminEmailHandler'
        },
Kálmán Viktor committed
395 396 397
        'syslog': {
            'level': 'INFO',
            'class': 'logging.handlers.SysLogHandler',
398
            'formatter': 'simple',
Kálmán Viktor committed
399 400 401 402
            'address': '/dev/log',
            # 'socktype': SOCK_STREAM,
            # 'address': ('host', '514'),
        }
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins', 'syslog'],
            'level': 'INFO',
            'propagate': True,
        },
    }
}
########## END LOGGING CONFIGURATION


########## WSGI CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#wsgi-application
WSGI_APPLICATION = '%s.wsgi.application' % SITE_NAME
########## END WSGI CONFIGURATION
419 420

FIREWALL_SETTINGS = loads(get_env_variable('DJANGO_FIREWALL_SETTINGS'))
421 422

CRISPY_TEMPLATE_PACK = 'bootstrap3'
423 424 425

# format: id: (name, port, protocol)
VM_ACCESS_PROTOCOLS = loads(get_env_variable('DJANGO_VM_ACCESS_PROTOCOLS',
Őry Máté committed
426 427 428
                                             '''{"nx": ["NX", 22, "tcp"],
                                                 "rdp": ["RDP", 3389, "tcp"],
                                                 "ssh": ["SSH", 22, "tcp"]}'''))
429
VM_SCHEDULER = 'manager.scheduler'
430

431
#BROKER_URL = get_env_variable('AMQP_URI')
432

433
#BROKER_URL=get_env_variable('AMQP_URI')
434 435 436

CACHES = {
    'default': {
437
        'BACKEND': 'pylibmc',
438 439
        'LOCATION': '127.0.0.1:11211',
    }
440
}
441 442 443 444 445 446 447 448 449


if get_env_variable('DJANGO_SAML', 'FALSE') == 'TRUE':
    try:
        from shutil import which  # python >3.4
    except ImportError:
        from shutilwhich import which
    from saml2 import BINDING_HTTP_POST, BINDING_HTTP_REDIRECT

450
    INSTALLED_APPS += (
451 452
        'djangosaml2',
    )
453 454
    AUTHENTICATION_BACKENDS = (
        'django.contrib.auth.backends.ModelBackend',
455
        'common.backends.Saml2Backend',
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498
    )

    remote_metadata = join(SITE_ROOT, 'remote_metadata.xml')
    if not isfile(remote_metadata):
        raise ImproperlyConfigured('Download SAML2 metadata to %s' %
                                   remote_metadata)
    required_attrs = loads(get_env_variable('DJANGO_SAML_REQUIRED',
                                            '["uid"]'))
    optional_attrs = loads(get_env_variable('DJANGO_SAML_OPTIONAL',
                                            '["mail", "cn", "sn"]'))

    SAML_CONFIG = {
        'xmlsec_binary': which('xmlsec1'),
        'entityid': DJANGO_URL + 'saml2/metadata/',
        'attribute_map_dir': join(SITE_ROOT, 'attribute-maps'),
        'service': {
            'sp': {
                'name': SITE_NAME,
                'endpoints': {
                    'assertion_consumer_service': [
                        (DJANGO_URL + 'saml2/acs/', BINDING_HTTP_POST),
                    ],
                    'single_logout_service': [
                        (DJANGO_URL + 'saml2/ls/', BINDING_HTTP_REDIRECT),
                    ],
                },
                'required_attributes': required_attrs,
                'optional_attributes': optional_attrs,
            },
        },
        'metadata': {'local': [remote_metadata], },
        'key_file': join(SITE_ROOT, 'samlcert.key'),  # private part
        'cert_file': join(SITE_ROOT, 'samlcert.pem'),  # public part
    }
    try:
        SAML_CONFIG += loads(get_env_variable('DJANGO_SAML_SETTINGS'))
    except ImproperlyConfigured:
        pass
    SAML_CREATE_UNKNOWN_USER = True
    SAML_ATTRIBUTE_MAPPING = loads(get_env_variable(
        'DJANGO_SAML_ATTRIBUTE_MAPPING',
        '{"mail": ["email"], "sn": ["last_name"], '
        '"uid": ["username"], "cn": ["first_name"]}'))
499 500 501 502 503
    SAML_GROUP_ATTRIBUTES = get_env_variable(
        'DJANGO_SAML_GROUP_ATTRIBUTES', '').split(',')
    SAML_GROUP_OWNER_ATTRIBUTES = get_env_variable(
        'DJANGO_SAML_GROUP_OWNER_ATTRIBUTES', '').split(',')

504
    SAML_CREATE_UNKNOWN_USER = True
505
    if get_env_variable('DJANGO_SAML_ORG_ID_ATTRIBUTE', False) is not False:
506 507
        SAML_ORG_ID_ATTRIBUTE = get_env_variable(
            'DJANGO_SAML_ORG_ID_ATTRIBUTE')
508 509
    SAML_MAIN_ATTRIBUTE_MAX_LENGTH = int(get_env_variable(
        "DJANGO_SAML_MAIN_ATTRIBUTE_MAX_LENGTH", 0))
510 511

LOGIN_REDIRECT_URL = "/"
512

Bach Dániel committed
513 514
AGENT_DIR = get_env_variable(
    'DJANGO_AGENT_DIR', join(unicode(expanduser("~")), 'agent'))
515 516 517 518 519 520 521 522 523
    # AGENT_DIR is the root directory for the agent.
    # The directory structure SHOULD be:
    # /home/username/agent
    # |-- agent-linux
    # |    |-- .git
    # |    +-- ...
    # |-- agent-win
    # |    +-- agent-win-%(version).exe
    #
Bach Dániel committed
524 525

try:
526
    git_env = {'GIT_DIR': join(join(AGENT_DIR, "agent-linux"), '.git')}
Bach Dániel committed
527 528 529 530 531
    AGENT_VERSION = check_output(
        ('git', 'log', '-1', r'--pretty=format:%h', 'HEAD'), env=git_env)
except:
    AGENT_VERSION = None

532
LOCALE_PATHS = (join(SITE_ROOT, 'locale'), )
533
COMPANY_NAME = get_env_variable("COMPANY_NAME", "BME IK 2015")
Bach Dániel committed
534

535
first, last = get_env_variable(
536
    'VNC_PORT_RANGE', '50000, 60000').replace(' ', '').split(',')
537 538
VNC_PORT_RANGE = (int(first), int(last))  # inclusive start, exclusive end

539 540
graphite_host = environ.get("GRAPHITE_HOST", None)
graphite_port = environ.get("GRAPHITE_PORT", None)
Bach Dániel committed
541 542 543 544
if graphite_host and graphite_port:
    GRAPHITE_URL = 'http://%s:%s/render/' % (graphite_host, graphite_port)
else:
    GRAPHITE_URL = None
545

546 547 548
STORE_BASIC_AUTH = get_env_variable("STORE_BASIC_AUTH", "") == "True"
STORE_VERIFY_SSL = get_env_variable("STORE_VERIFY_SSL", "") == "True"
STORE_SSL_AUTH = get_env_variable("STORE_SSL_AUTH", "") == "True"
549 550 551 552
STORE_CLIENT_USER = get_env_variable("STORE_CLIENT_USER", "")
STORE_CLIENT_PASSWORD = get_env_variable("STORE_CLIENT_PASSWORD", "")
STORE_CLIENT_KEY = get_env_variable("STORE_CLIENT_KEY", "")
STORE_CLIENT_CERT = get_env_variable("STORE_CLIENT_CERT", "")
553
STORE_URL = get_env_variable("STORE_URL", "")
554

555 556
SESSION_COOKIE_NAME = "csessid%x" % (((getnode() // 139) ^
                                      (getnode() % 983)) & 0xffff)
557 558

MAX_NODE_RAM = get_env_variable("MAX_NODE_RAM", 1024)
559 560

# Url to download the client: (e.g. http://circlecloud.org/client/download/)
561
CLIENT_DOWNLOAD_URL = get_env_variable('CLIENT_DOWNLOAD_URL', 'http://circlecloud.org/client/download/')
562 563

ADMIN_ENABLED = False
564 565

BLACKLIST_PASSWORD = get_env_variable("BLACKLIST_PASSWORD", "")
566
BLACKLIST_HOOK_URL = get_env_variable("BLACKLIST_HOOK_URL", "")
567
REQUEST_HOOK_URL = get_env_variable("REQUEST_HOOK_URL", "")
Bach Dániel committed
568 569

SSHKEY_EMAIL_ADD_KEY = False