# Path: badwolf/utils.py
# def yesish(value):
#     """Typecast booleanish environment variables to :py:class:`bool`.
# 
#     :param string value: An environment variable value.
#     :returns: :py:class:`True` if ``value`` is ``1``, ``true``, or ``yes``
#         (case-insensitive); :py:class:`False` otherwise.
#     """
#     if isinstance(value, bool):
#         return value
#     return value.lower() in ('1', 'true', 'yes')


import os
import sys
import base64
import tempfile
import platform
import raven
import deansi
from badwolf.utils import yesish
# -*- coding: utf-8 -*-



# is debugging
DEBUG = yesish(os.getenv('BADWOLF_DEBUG', False))

JSON_AS_ASCII = yesish(os.getenv('JSON_AS_ASCII', False))
SERVER_NAME = os.getenv('SERVER_NAME', 'localhost:8000')

# secret key
SECRET_KEY = os.getenv('SECRET_KEY', '')

# secure token key
SECURE_TOKEN_KEY = os.getenv('SECURE_TOKEN_KEY', base64.urlsafe_b64encode(os.urandom(32)))

# Sentry
SENTRY_DSN = os.getenv('SENTRY_DSN', '')

# Docker
DOCKER_HOST = os.getenv('DOCKER_HOST', 'unix:///var/run/docker.sock')
DOCKER_API_TIMEOUT = int(os.getenv('DOCKER_API_TIMEOUT', 600))
DOCKER_RUN_TIMEOUT = int(os.getenv('DOCKER_RUN_TIMEOUT', 1200))

# Mail
MAIL_SERVER = os.getenv('MAIL_SERVER', '')
MAIL_PORT = int(os.getenv('MAIL_PORT', 587))

# Path: badwolf/utils.py
# def yesish(value):
#     """Typecast booleanish environment variables to :py:class:`bool`.
# 
#     :param string value: An environment variable value.
#     :returns: :py:class:`True` if ``value`` is ``1``, ``true``, or ``yes``
#         (case-insensitive); :py:class:`False` otherwise.
#     """
#     if isinstance(value, bool):
#         return value
#     return value.lower() in ('1', 'true', 'yes')


# Path: badwolf/default_settings.py
import os
import sys
import base64
import tempfile
import platform
import raven
import deansi
from badwolf.utils import yesish

# -*- coding: utf-8 -*-



# is debugging
DEBUG = yesish(os.getenv('BADWOLF_DEBUG', False))

JSON_AS_ASCII = yesish(os.getenv('JSON_AS_ASCII', False))
SERVER_NAME = os.getenv('SERVER_NAME', 'localhost:8000')

# secret key
SECRET_KEY = os.getenv('SECRET_KEY', '')

# secure token key
SECURE_TOKEN_KEY = os.getenv('SECURE_TOKEN_KEY', base64.urlsafe_b64encode(os.urandom(32)))

# Sentry
SENTRY_DSN = os.getenv('SENTRY_DSN', '')

# Docker
DOCKER_HOST = os.getenv('DOCKER_HOST', 'unix:///var/run/docker.sock')
DOCKER_API_TIMEOUT = int(os.getenv('DOCKER_API_TIMEOUT', 600))
DOCKER_RUN_TIMEOUT = int(os.getenv('DOCKER_RUN_TIMEOUT', 1200))

# Mail
MAIL_SERVER = os.getenv('MAIL_SERVER', '')
MAIL_PORT = int(os.getenv('MAIL_PORT', 587))

MAIL_USE_TLS = yesish(os.getenv('MAIL_USE_TLS', True))