mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-20 07:43:35 -05:00
204 lines
6.6 KiB
Plaintext
204 lines
6.6 KiB
Plaintext
# Copyright (c) 2013 AnsibleWorks, Inc.
|
|
# All Rights Reserved.
|
|
|
|
# Local Django settings for AWX project. Rename to "local_settings.py" and
|
|
# edit as needed for your development environment.
|
|
|
|
ADMINS = (
|
|
# ('Your Name', 'your_email@domain.com'),
|
|
)
|
|
|
|
MANAGERS = ADMINS
|
|
|
|
# Database settings to use PostgreSQL for development.
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
'NAME': 'awx',
|
|
'USER': 'awx',
|
|
'PASSWORD': 'AWXsome!',
|
|
'HOST': '',
|
|
'PORT': '',
|
|
}
|
|
}
|
|
|
|
# Use SQLite for unit tests instead of PostgreSQL.
|
|
if len(sys.argv) >= 2 and sys.argv[1] == 'test':
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
'NAME': os.path.join(BASE_DIR, 'awx.sqlite3'),
|
|
# Test database cannot be :memory: for celery/inventory tests.
|
|
'TEST_NAME': os.path.join(BASE_DIR, 'awx_test.sqlite3'),
|
|
}
|
|
}
|
|
|
|
# Absolute filesystem path to the directory to host projects (with playbooks).
|
|
# This directory should NOT be web-accessible.
|
|
PROJECTS_ROOT = os.path.join(BASE_DIR, 'projects')
|
|
|
|
# Local time zone for this installation. Choices can be found here:
|
|
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
|
# although not all choices may be available on all operating systems.
|
|
# On Unix systems, a value of None will cause Django to use the same
|
|
# timezone as the operating system.
|
|
# If running in a Windows environment this must be set to the same as your
|
|
# system time zone.
|
|
TIME_ZONE = 'America/New_York'
|
|
|
|
# Language code for this installation. All choices can be found here:
|
|
# http://www.i18nguy.com/unicode/language-identifiers.html
|
|
LANGUAGE_CODE = 'en-us'
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
# Hardcoded values can leak through source control. Consider loading
|
|
# the secret key from an environment variable or a file instead.
|
|
SECRET_KEY = 'p7z7g1ql4%6+(6nlebb6hdk7sd^&fnjpal308%n%+p^_e6vo1y'
|
|
|
|
# HTTP headers and meta keys to search to determine remote host name or IP. Add
|
|
# additional items to this list, such as "HTTP_X_FORWARDED_FOR", if behind a
|
|
# reverse proxy.
|
|
REMOTE_HOST_HEADERS = ['REMOTE_ADDR', 'REMOTE_HOST']
|
|
|
|
# LDAP connection and authentication settings. Refer to django-auth-ldap docs:
|
|
# http://pythonhosted.org/django-auth-ldap/authentication.html
|
|
AUTH_LDAP_SERVER_URI = ''
|
|
AUTH_LDAP_BIND_DN = ''
|
|
AUTH_LDAP_BIND_PASSWORD = ''
|
|
AUTH_LDAP_START_TLS = False
|
|
|
|
import ldap
|
|
from django_auth_ldap.config import LDAPSearch, LDAPSearchUnion
|
|
|
|
# LDAP search query to find users.
|
|
AUTH_LDAP_USER_SEARCH = LDAPSearch(
|
|
'OU=Users,DC=example,DC=com',
|
|
ldap.SCOPE_SUBTREE,
|
|
'(sAMAccountName=%(user)s)',
|
|
)
|
|
|
|
# Alternative to user search.
|
|
#AUTH_LDAP_USER_DN_TEMPLATE = 'sAMAccountName=%(user)s,OU=Users,DC=example,DC=com'
|
|
|
|
# Mapping of LDAP attributes to user attributes.
|
|
AUTH_LDAP_USER_ATTR_MAP = {
|
|
'first_name': 'givenName',
|
|
'last_name': 'sn',
|
|
'email': 'mail',
|
|
}
|
|
|
|
# Email address that error messages come from.
|
|
SERVER_EMAIL = 'root@localhost'
|
|
|
|
# The email backend to use. For possible shortcuts see django.core.mail.
|
|
# The default is to use the SMTP backend.
|
|
# Third-party backends can be specified by providing a Python path
|
|
# to a module that defines an EmailBackend class.
|
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
|
|
|
# Host for sending email.
|
|
EMAIL_HOST = 'localhost'
|
|
|
|
# Port for sending email.
|
|
EMAIL_PORT = 25
|
|
|
|
# Optional SMTP authentication information for EMAIL_HOST.
|
|
EMAIL_HOST_USER = ''
|
|
EMAIL_HOST_PASSWORD = ''
|
|
EMAIL_USE_TLS = False
|
|
|
|
# Default email address to use for various automated correspondence from
|
|
# the site managers.
|
|
DEFAULT_FROM_EMAIL = 'webmaster@localhost'
|
|
|
|
# Subject-line prefix for email messages send with django.core.mail.mail_admins
|
|
# or ...mail_managers. Make sure to include the trailing space.
|
|
EMAIL_SUBJECT_PREFIX = '[AWX] '
|
|
|
|
# Enable logging to syslog. Setting level to ERROR captures 500 errors,
|
|
# WARNING also logs 4xx responses.
|
|
LOGGING['handlers']['syslog'] = {
|
|
'level': 'WARNING',
|
|
'filters': [],
|
|
'class': 'logging.handlers.SysLogHandler',
|
|
'address': '/dev/log',
|
|
'facility': 'local0',
|
|
'formatter': 'simple',
|
|
}
|
|
|
|
# Enable the following lines to also log to a file.
|
|
#LOGGING['handlers']['file'] = {
|
|
# 'class': 'logging.FileHandler',
|
|
# 'filename': os.path.join(BASE_DIR, 'awx.log'),
|
|
# 'formatter': 'simple',
|
|
#}
|
|
|
|
# Enable the following lines to turn on lots of permissions-related logging.
|
|
#LOGGING['loggers']['awx.main.access']['propagate'] = True
|
|
#LOGGING['loggers']['awx.main.signals']['propagate'] = True
|
|
#LOGGING['loggers']['awx.main.permissions']['propagate'] = True
|
|
|
|
# Enable the following lines to turn on LDAP auth logging.
|
|
#LOGGING['loggers']['django_auth_ldap']['handlers'] = ['console']
|
|
#LOGGING['loggers']['django_auth_ldap']['level'] = 'DEBUG'
|
|
|
|
# Define additional environment variables to be passed to subprocess started by
|
|
# the celery task.
|
|
#AWX_TASK_ENV['FOO'] = 'BAR'
|
|
|
|
# Define these variables to enable more complete testing of project support for
|
|
# SCM updates.
|
|
try:
|
|
path = os.path.expanduser(os.path.expandvars('~/.ssh/id_rsa.pub'))
|
|
TEST_SSH_KEY_DATA = file(path, 'rb').read()
|
|
except OSError:
|
|
TEST_SSH_KEY_DATA = ''
|
|
|
|
TEST_GIT_USERNAME = ''
|
|
TEST_GIT_PASSWORD = ''
|
|
TEST_GIT_KEY_DATA = TEST_SSH_KEY_DATA
|
|
TEST_GIT_PUBLIC_HTTPS = 'https://github.com/ansible/ansible-examples.git'
|
|
TEST_GIT_PRIVATE_HTTPS = 'https://github.com/ansible/ansible-doc.git'
|
|
TEST_GIT_PRIVATE_SSH = 'git@github.com:ansible/ansible-doc.git'
|
|
|
|
TEST_HG_USERNAME = ''
|
|
TEST_HG_PASSWORD = ''
|
|
TEST_HG_KEY_DATA = TEST_SSH_KEY_DATA
|
|
TEST_HG_PUBLIC_HTTPS = 'https://bitbucket.org/cchurch/django-hotrunner'
|
|
TEST_HG_PRIVATE_HTTPS = ''
|
|
TEST_HG_PRIVATE_SSH = ''
|
|
|
|
TEST_SVN_USERNAME = ''
|
|
TEST_SVN_PASSWORD = ''
|
|
TEST_SVN_PUBLIC_HTTPS = 'https://projects.ninemoreminutes.com/svn/django-site-utils/trunk/'
|
|
TEST_SVN_PRIVATE_HTTPS = ''
|
|
|
|
# LDAP connection and authentication settings for unit tests only. LDAP tests
|
|
# will be skipped if not configured. Refer to django-auth-ldap docs:
|
|
# http://pythonhosted.org/django-auth-ldap/authentication.html
|
|
TEST_AUTH_LDAP_SERVER_URI = ''
|
|
TEST_AUTH_LDAP_BIND_DN = ''
|
|
TEST_AUTH_LDAP_BIND_PASSWORD = ''
|
|
TEST_AUTH_LDAP_START_TLS = False
|
|
|
|
# LDAP username/password for testing authentication.
|
|
TEST_AUTH_LDAP_USERNAME = ''
|
|
TEST_AUTH_LDAP_PASSWORD = ''
|
|
|
|
# LDAP search query to find users.
|
|
TEST_AUTH_LDAP_USER_SEARCH = LDAPSearch(
|
|
'OU=Users,DC=example,DC=com',
|
|
ldap.SCOPE_SUBTREE,
|
|
'(sAMAccountName=%(user)s)',
|
|
)
|
|
|
|
# Alternative to user search.
|
|
TEST_AUTH_LDAP_USER_DN_TEMPLATE = 'sAMAccountName=%(user)s,OU=Users,DC=example,DC=com'
|
|
|
|
# Mapping of LDAP attributes to user attributes.
|
|
TEST_AUTH_LDAP_USER_ATTR_MAP = {
|
|
'first_name': 'givenName',
|
|
'last_name': 'sn',
|
|
'email': 'mail',
|
|
}
|