mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
* Hooks registration, discovery and retrieval module Will discover @hooks.register decorated functions inside the auth_hooks module in any installed django app. * Class to register modular service apps * Register service modules URLs * Example service module * Refactor services into modules Each service type has been split out into its own django app/module. A hook mechanism is provided to register a subclass of the ServiceHook class. The modules then overload functions defined in ServiceHook as required to provide interoperability with alliance auth. Service modules provide their own urls and views for user registration and account management and a partial template to display on the services page. Where possible, new modules should provide their own models for local data storage. * Added menu items hooks and template tags * Added menu item hook for broadcasts * Added str method to ServicesHook * Added exception handling to hook iterators * Refactor mumble migration and table name Upgrading will require `migrate mumble --fake-initial` to be run first and then `migrate mumble` to rename the table. * Refactor teamspeak3 migration and rename table Upgrading will require `migrate teamspeak3 --fake-initial` * Added module models and migrations for refactoring AuthServicesInfo * Migrate AuthServiceInfo fields to service modules models * Added helper for getting a users main character * Added new style celery instance * Changed Discord from AuthServicesInfo to DiscordUser model * Switch celery tasks to staticmethods * Changed Discourse from AuthServicesInfo to DiscourseUser model * Changed IPBoard from AuthServicesInfo to IpboardUser model * Changed Ips4 from AuthServicesInfo to Ips4User model Also added disable service task. This service still needs some love though. Was always missing a deactivate services hook (before refactoring) for reasons I'm unsure of so I'm reluctant to add it without knowing why. * Changed Market from AuthServicesInfo to MarketUser model * Changed Mumble from AuthServicesInfo to MumbleUser model Switched user foreign key to one to one relationship. Removed implicit password change on user exists. Combined regular and blue user creation. * Changed Openfire from AuthServicesInfo to OpenfireUser model * Changed SMF from AuthServicesInfo to SmfUser model Added disable task * Changed Phpbb3 from AuthServicesInfo to Phpbb3User model * Changed XenForo from AuthServicesInfo to XenforoUser model * Changed Teamspeak3 from AuthServicesInfo to Teamspeak3User model * Remove obsolete manager functions * Standardise URL format This will break some callback URLs Discord changes from /discord_callback/ to /discord/callback/ * Removed unnecessary imports * Mirror upstream decorator change * Setup for unit testing * Unit tests for discord service * Added add main character helper * Added Discourse unit tests * Added Ipboard unit tests * Added Ips4 unit tests * Fix naming of market manager, switch to use class methods * Remove unused hook functions * Added market service unit tests * Added corp ticker to add main character helper * Added mumble unit tests * Fix url name and remove namespace * Fix missing return and add missing URL * Added openfire unit tests * Added missing return * Added phpbb3 unit tests * Fix SmfManager naming inconsistency and switch to classmethods * Added smf unit tests * Remove unused functions, Added missing return * Added xenforo unit tests * Added missing return * Fixed reference to old model * Fixed error preventing groups from syncing on reset request * Added teamspeak3 unit tests * Added nose as test runner and some test settings * Added package requirements for running tests * Added unit tests for services signals and tasks * Remove unused tests file * Fix teamspeak3 service signals * Added unit tests for teamspeak3 signals Changed other unit tests setUp to inert signals * Fix password gen and hashing python3 compatibility Fixes #630 Adds unit tests to check the password functions run on both platforms. * Fix unit test to not rely on checking url params * Add Travis CI settings file * Remove default blank values from services models * Added dynamic user model admin actions for syncing service groups * Remove unused search fields * Add hook function for syncing nicknames * Added discord hook for sync nickname * Added user admin model menu actions for sync nickname hook * Remove obsolete code * Rename celery config app to avoid package name clash * Added new style celerybeat schedule configuration periodic_task decorator is depreciated * Added string representations * Added admin pages for services user models * Removed legacy code * Move link discord button to correct template * Remove blank default fields from example model * Disallow empty django setting * Fix typos * Added coverage configuration file * Add coverage and coveralls to travis config Should probably use nose's built in coverage, but this works for now. * Replace AuthServicesInfo get_or_create instances with get Reflects upstream changes to AuthServicesInfo behaviour. * Update mumble user table name * Split out mumble authenticator requirements zeroc-ice seems to cause long build times on travis-ci and isn't required for the core projects functionality or testing.
702 lines
28 KiB
Python
702 lines
28 KiB
Python
"""
|
|
Django settings for alliance_auth project.
|
|
|
|
Generated by 'django-admin startproject' using Django 1.10.1.
|
|
|
|
For more information on this file, see
|
|
https://docs.djangoproject.com/en/1.10/topics/settings/
|
|
|
|
For the full list of settings and their values, see
|
|
https://docs.djangoproject.com/en/1.10/ref/settings/
|
|
"""
|
|
|
|
import os
|
|
|
|
import djcelery
|
|
|
|
from django.contrib import messages
|
|
from celery.schedules import crontab
|
|
|
|
djcelery.setup_loader()
|
|
|
|
# Celery configuration
|
|
BROKER_URL = 'redis://localhost:6379/0'
|
|
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
|
|
CELERYBEAT_SCHEDULE = {
|
|
"""
|
|
Uncomment this if you are using the Teamspeak3 service
|
|
'run_ts3_group_update': {
|
|
'task': 'services.modules.teamspeak3.tasks.Teamspeak3Tasks.run_ts3_group_update',
|
|
'schedule': crontab(minute='*/30'),
|
|
},
|
|
"""
|
|
}
|
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
SECRET_KEY = ''
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
DEBUG = 'True' == os.environ.get('AA_DEBUG','True')
|
|
|
|
ALLOWED_HOSTS = []
|
|
|
|
|
|
# Application definition
|
|
|
|
INSTALLED_APPS = [
|
|
'django.contrib.admin',
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.messages',
|
|
'django.contrib.staticfiles',
|
|
'django.contrib.humanize',
|
|
'djcelery',
|
|
'bootstrapform',
|
|
'authentication',
|
|
'services',
|
|
'eveonline',
|
|
'groupmanagement',
|
|
'hrapplications',
|
|
'timerboard',
|
|
'srp',
|
|
'optimer',
|
|
'corputils',
|
|
'fleetactivitytracking',
|
|
'notifications',
|
|
'esi',
|
|
'geelweb.django.navhelper',
|
|
'bootstrap_pagination',
|
|
|
|
# Services
|
|
'services.modules.mumble',
|
|
'services.modules.discord',
|
|
'services.modules.discourse',
|
|
'services.modules.ipboard',
|
|
'services.modules.ips4',
|
|
'services.modules.market',
|
|
'services.modules.openfire',
|
|
'services.modules.smf',
|
|
'services.modules.phpbb3',
|
|
'services.modules.xenforo',
|
|
'services.modules.teamspeak3',
|
|
]
|
|
|
|
MIDDLEWARE = [
|
|
'django.middleware.security.SecurityMiddleware',
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
'django.middleware.common.CommonMiddleware',
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
'django.middleware.locale.LocaleMiddleware',
|
|
]
|
|
|
|
ROOT_URLCONF = 'alliance_auth.urls'
|
|
|
|
LOCALE_PATHS = (
|
|
os.path.join(BASE_DIR, 'locale/'),
|
|
)
|
|
|
|
ugettext = lambda s: s
|
|
LANGUAGES = (
|
|
('en', ugettext('English')),
|
|
('de', ugettext('German')),
|
|
)
|
|
|
|
TEMPLATES = [
|
|
{
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
'DIRS': [
|
|
os.path.join(BASE_DIR, 'customization/templates'),
|
|
os.path.join(BASE_DIR, 'stock/templates'),
|
|
],
|
|
'APP_DIRS': True,
|
|
'OPTIONS': {
|
|
'context_processors': [
|
|
'django.template.context_processors.debug',
|
|
'django.template.context_processors.request',
|
|
'django.contrib.auth.context_processors.auth',
|
|
'django.contrib.messages.context_processors.messages',
|
|
'django.template.context_processors.i18n',
|
|
'django.template.context_processors.media',
|
|
'django.template.context_processors.static',
|
|
'django.template.context_processors.tz',
|
|
'services.context_processors.auth_settings',
|
|
'notifications.context_processors.user_notification_count',
|
|
'authentication.context_processors.states',
|
|
'authentication.context_processors.membership_state',
|
|
'groupmanagement.context_processors.can_manage_groups',
|
|
],
|
|
},
|
|
},
|
|
]
|
|
|
|
WSGI_APPLICATION = 'alliance_auth.wsgi.application'
|
|
|
|
|
|
# Database
|
|
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
|
|
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.mysql',
|
|
'NAME': 'alliance_auth',
|
|
'USER': os.environ.get('AA_DB_DEFAULT_USER', 'allianceserver'),
|
|
'PASSWORD': os.environ.get('AA_DB_DEFAULT_PASSWORD', 'password'),
|
|
'HOST': os.environ.get('AA_DB_DEFAULT_HOST', '127.0.0.1'),
|
|
'PORT': os.environ.get('AA_DB_DEFAULT_PORT', '3306'),
|
|
},
|
|
}
|
|
|
|
# Password validation
|
|
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
},
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
|
},
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
},
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
},
|
|
]
|
|
|
|
LOGIN_URL = 'auth_login_user'
|
|
|
|
SUPERUSER_STATE_BYPASS = 'True' == os.environ.get('AA_SUPERUSER_STATE_BYPASS', 'True')
|
|
|
|
# Internationalization
|
|
# https://docs.djangoproject.com/en/1.10/topics/i18n/
|
|
|
|
LANGUAGE_CODE = os.environ.get('AA_LANGUAGE_CODE', 'en-us')
|
|
|
|
TIME_ZONE = os.environ.get('AA_TIME_ZONE', 'UTC')
|
|
|
|
USE_I18N = True
|
|
|
|
USE_L10N = True
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
# https://docs.djangoproject.com/en/1.10/howto/static-files/
|
|
|
|
STATIC_URL = '/static/'
|
|
STATIC_ROOT = os.path.join(BASE_DIR, "static")
|
|
STATICFILES_DIRS = (
|
|
os.path.join(BASE_DIR, "customization/static"),
|
|
os.path.join(BASE_DIR, "stock/static"),
|
|
)
|
|
|
|
# Bootstrap messaging css workaround
|
|
MESSAGE_TAGS = {
|
|
messages.ERROR: 'danger'
|
|
}
|
|
|
|
CACHES = {
|
|
"default": {
|
|
"BACKEND": "django_redis.cache.RedisCache",
|
|
"LOCATION": "redis://127.0.0.1:6379/1",
|
|
"OPTIONS": {
|
|
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
|
}
|
|
}
|
|
}
|
|
|
|
#####################################################
|
|
##
|
|
## Auth configuration starts here
|
|
##
|
|
#####################################################
|
|
|
|
#################
|
|
# EMAIL SETTINGS
|
|
#################
|
|
# DOMAIN - The alliance auth domain_url
|
|
# EMAIL_HOST - SMTP Server URL
|
|
# EMAIL_PORT - SMTP Server PORT
|
|
# EMAIL_HOST_USER - Email Username (for gmail, the entire address)
|
|
# EMAIL_HOST_PASSWORD - Email Password
|
|
# EMAIL_USE_TLS - Set to use TLS encryption
|
|
#################
|
|
DOMAIN = os.environ.get('AA_DOMAIN', 'https://example.com')
|
|
EMAIL_HOST = os.environ.get('AA_EMAIL_HOST', 'smtp.gmail.com')
|
|
EMAIL_PORT = int(os.environ.get('AA_EMAIL_PORT', '587'))
|
|
EMAIL_HOST_USER = os.environ.get('AA_EMAIL_HOST_USER', '')
|
|
EMAIL_HOST_PASSWORD = os.environ.get('AA_EMAIL_HOST_PASSWORD', '')
|
|
EMAIL_USE_TLS = 'True' == os.environ.get('AA_EMAIL_USE_TLS', 'True')
|
|
|
|
####################
|
|
# Front Page Links
|
|
####################
|
|
# KILLBOARD_URL - URL for your killboard. Blank to hide link
|
|
# MEDIA_URL - URL for your media page (youtube etc). Blank to hide link
|
|
# FORUM_URL - URL for your forums. Blank to hide link
|
|
# SITE_NAME - Name of the auth site.
|
|
####################
|
|
KILLBOARD_URL = os.environ.get('AA_KILLBOARD_URL', '')
|
|
EXTERNAL_MEDIA_URL = os.environ.get('AA_EXTERNAL_MEDIA_URL', '')
|
|
FORUM_URL = os.environ.get('AA_FORUM_URL', '')
|
|
SITE_NAME = os.environ.get('AA_SITE_NAME', 'Alliance Auth')
|
|
|
|
###################
|
|
# SSO Settings
|
|
###################
|
|
# Get client ID and client secret from registering an app at
|
|
# https://developers.eveonline.com/
|
|
# Callback URL should be https://example.com/sso/callback
|
|
###################
|
|
ESI_SSO_CLIENT_ID = os.environ.get('AA_ESI_SSO_CLIENT_ID', '')
|
|
ESI_SSO_CLIENT_SECRET = os.environ.get('AA_ESI_SSO_CLIENT_SECRET', '')
|
|
ESI_SSO_CALLBACK_URL = os.environ.get('AA_ESI_SSO_CALLBACK_URL', '')
|
|
|
|
#########################
|
|
# Default Group Settings
|
|
#########################
|
|
# DEFAULT_AUTH_GROUP - Default group members are put in
|
|
# DEFAULT_BLUE_GROUP - Default group for blue members
|
|
# MEMBER_CORP_GROUPS - Assign members to a group representing their main corp
|
|
# BLUE_CORP_GROUPS - Assign blues to a group representing their main corp
|
|
#########################
|
|
DEFAULT_AUTH_GROUP = os.environ.get('AA_DEFAULT_ALLIANCE_GROUP', 'Member')
|
|
DEFAULT_BLUE_GROUP = os.environ.get('AA_DEFAULT_BLUE_GROUP', 'Blue')
|
|
MEMBER_CORP_GROUPS = 'True' == os.environ.get('AA_MEMBER_CORP_GROUPS', 'True')
|
|
MEMBER_ALLIANCE_GROUPS = 'True' == os.environ.get('AA_MEMBER_ALLIANCE_GROUPS', 'False')
|
|
BLUE_CORP_GROUPS = 'True' == os.environ.get('AA_BLUE_CORP_GROUPS', 'False')
|
|
BLUE_ALLIANCE_GROUPS = 'True' == os.environ.get('AA_BLUE_ALLIANCE_GROUPS', 'False')
|
|
|
|
#########################
|
|
# Alliance Service Setup
|
|
#########################
|
|
# ENABLE_AUTH_FORUM - Enable forum support in the auth for auth'd members
|
|
# ENABLE_AUTH_JABBER - Enable jabber support in the auth for auth'd members
|
|
# ENABLE_AUTH_MUMBLE - Enable mumble support in the auth for auth'd members
|
|
# ENABLE_AUTH_IPBOARD - Enable IPBoard forum support in the auth for auth'd members
|
|
# ENABLE_AUTH_DISCORD - Enable Discord support in the auth for auth'd members
|
|
# ENABLE_AUTH_DISCOURSE - Enable Discourse support in the auth for auth'd members
|
|
# ENABLE_AUTH_IPS4 - Enable IPS4 support in the auth for auth'd members
|
|
# ENABLE_AUTH_SMF - Enable SMF forum support in the auth for auth'd members
|
|
# ENABLE_AUTH_MARKET = Enable Alliance Market support in auth for auth'd members
|
|
# ENABLE_AUTH_XENFORO = Enable XenForo forums support in the auth for auth'd members
|
|
#########################
|
|
ENABLE_AUTH_FORUM = 'True' == os.environ.get('AA_ENABLE_AUTH_FORUM', 'False')
|
|
ENABLE_AUTH_JABBER = 'True' == os.environ.get('AA_ENABLE_AUTH_JABBER', 'False')
|
|
ENABLE_AUTH_MUMBLE = 'True' == os.environ.get('AA_ENABLE_AUTH_MUMBLE', 'False')
|
|
ENABLE_AUTH_IPBOARD = 'True' == os.environ.get('AA_ENABLE_AUTH_IPBOARD', 'False')
|
|
ENABLE_AUTH_TEAMSPEAK3 = 'True' == os.environ.get('AA_ENABLE_AUTH_TEAMSPEAK3', 'False')
|
|
ENABLE_AUTH_DISCORD = 'True' == os.environ.get('AA_ENABLE_AUTH_DISCORD', 'False')
|
|
ENABLE_AUTH_DISCOURSE = 'True' == os.environ.get('AA_ENABLE_AUTH_DISCOURSE', 'False')
|
|
ENABLE_AUTH_IPS4 = 'True' == os.environ.get('AA_ENABLE_AUTH_IPS4', 'False')
|
|
ENABLE_AUTH_SMF = 'True' == os.environ.get('AA_ENABLE_AUTH_SMF', 'False')
|
|
ENABLE_AUTH_MARKET = 'True' == os.environ.get('AA_ENABLE_AUTH_MARKET', 'False')
|
|
ENABLE_AUTH_XENFORO = 'True' == os.environ.get('AA_ENABLE_AUTH_XENFORO', 'False')
|
|
|
|
#####################
|
|
# Blue service Setup
|
|
#####################
|
|
# ENABLE_BLUE_FORUM - Enable forum support in the auth for blues
|
|
# ENABLE_BLUE_JABBER - Enable jabber support in the auth for blues
|
|
# ENABLE_BLUE_MUMBLE - Enable mumble support in the auth for blues
|
|
# ENABLE_BLUE_IPBOARD - Enable IPBoard forum support in the auth for blues
|
|
# ENABLE_BLUE_DISCORD - Enable Discord support in the auth for blues
|
|
# ENABLE_BLUE_DISCOURSE - Enable Discord support in the auth for blues
|
|
# ENABLE_BLUE_IPS4 - Enable IPS4 forum support in the auth for blues
|
|
# ENABLE_BLUE_SMF - Enable SMF forum support in the auth for blues
|
|
# ENABLE_BLUE_MARKET - Enable Alliance Market in the auth for blues
|
|
# ENABLE_BLUE_XENFORO = Enable XenForo forum support in the auth for blue
|
|
#####################
|
|
ENABLE_BLUE_FORUM = 'True' == os.environ.get('AA_ENABLE_BLUE_FORUM', 'False')
|
|
ENABLE_BLUE_JABBER = 'True' == os.environ.get('AA_ENABLE_BLUE_JABBER', 'False')
|
|
ENABLE_BLUE_MUMBLE = 'True' == os.environ.get('AA_ENABLE_BLUE_MUMBLE', 'False')
|
|
ENABLE_BLUE_IPBOARD = 'True' == os.environ.get('AA_ENABLE_BLUE_IPBOARD', 'False')
|
|
ENABLE_BLUE_TEAMSPEAK3 = 'True' == os.environ.get('AA_ENABLE_BLUE_TEAMSPEAK3', 'False')
|
|
ENABLE_BLUE_DISCORD = 'True' == os.environ.get('AA_ENABLE_BLUE_DISCORD', 'False')
|
|
ENABLE_BLUE_DISCOURSE = 'True' == os.environ.get('AA_ENABLE_BLUE_DISCOURSE', 'False')
|
|
ENABLE_BLUE_IPS4 = 'True' == os.environ.get('AA_ENABLE_BLUE_IPS4', 'False')
|
|
ENABLE_BLUE_SMF = 'True' == os.environ.get('AA_ENABLE_BLUE_SMF', 'False')
|
|
ENABLE_BLUE_MARKET = 'True' == os.environ.get('AA_ENABLE_BLUE_MARKET', 'False')
|
|
ENABLE_BLUE_XENFORO = 'True' == os.environ.get('AA_ENABLE_BLUE_XENFORO', 'False')
|
|
|
|
#########################
|
|
# Tenant Configuration
|
|
#########################
|
|
# CORP_IDS - A list of corporation IDs to treat as members.
|
|
# ALLIANCE_IDS - A list of alliance IDs to treat as members.
|
|
# Any corps in a specified alliance will be treated as members, so do not include them in CORP_IDS
|
|
#########################
|
|
CORP_IDS = []
|
|
ALLIANCE_IDS = []
|
|
|
|
#########################
|
|
# Standings Configuration
|
|
#########################
|
|
# Add a corp API key to add blue standings to grant access.
|
|
# CORP_API_ID - Set this to the api id for the corp API key
|
|
# CORP_API_VCODE - Set this to the api vcode for the corp API key
|
|
# BLUE_STANDING - The lowest standings value to consider blue
|
|
# STANDING_LEVEL - The level of standings to query. Accepted values are 'corp' and 'alliance'.
|
|
########################
|
|
CORP_API_ID = os.environ.get('AA_CORP_API_ID', '')
|
|
CORP_API_VCODE = os.environ.get('AA_CORP_API_VCODE', '')
|
|
BLUE_STANDING = float(os.environ.get('AA_BLUE_STANDING', '5.0'))
|
|
STANDING_LEVEL = os.environ.get('AA_STANDING_LEVEL', 'corp')
|
|
|
|
########################
|
|
# API Configuration
|
|
########################
|
|
# MEMBER_API_MASK - Numeric value of minimum API mask required for members
|
|
# MEMBER_API_ACCOUNT - Require API to be for Account and not character restricted
|
|
# BLUE_API_MASK - Numeric value of minimum API mask required for blues
|
|
# BLUE_API_ACCOUNT - Require API to be for Account and not character restricted
|
|
# REJECT_OLD_APIS - Require each submitted API be newer than the latest submitted API
|
|
# REJECT_OLD_APIS_MARGIN - Margin from latest submitted API ID within which a newly submitted API is still accepted
|
|
# API_SSO_VALIDATION - Require users to prove ownership of newly entered API keys via SSO
|
|
# Requires SSO to be configured.
|
|
#######################
|
|
MEMBER_API_MASK = os.environ.get('AA_MEMBER_API_MASK', 268435455)
|
|
MEMBER_API_ACCOUNT = 'True' == os.environ.get('AA_MEMBER_API_ACCOUNT', 'True')
|
|
BLUE_API_MASK = os.environ.get('AA_BLUE_API_MASK', 8388608)
|
|
BLUE_API_ACCOUNT = 'True' == os.environ.get('AA_BLUE_API_ACCOUNT', 'False')
|
|
REJECT_OLD_APIS = 'True' == os.environ.get('AA_REJECT_OLD_APIS', 'False')
|
|
REJECT_OLD_APIS_MARGIN = os.environ.get('AA_REJECT_OLD_APIS_MARGIN', 50)
|
|
API_SSO_VALIDATION = 'True' == os.environ.get('AA_API_SSO_VALIDATION', 'False')
|
|
|
|
#######################
|
|
# EVE Provider Settings
|
|
#######################
|
|
# EVEONLINE_CHARACTER_PROVIDER - Name of default data source for getting eve character data
|
|
# EVEONLINE_CORP_PROVIDER - Name of default data source for getting eve corporation data
|
|
# EVEONLINE_ALLIANCE_PROVIDER - Name of default data source for getting eve alliance data
|
|
# EVEONLINE_ITEMTYPE_PROVIDER - Name of default data source for getting eve item type data
|
|
#
|
|
# Available sources are 'esi' and 'xml'. Leaving blank results in the default 'esi' being used.
|
|
#######################
|
|
EVEONLINE_CHARACTER_PROVIDER = os.environ.get('AA_EVEONLINE_CHARACTER_PROVIDER', '')
|
|
EVEONLINE_CORP_PROVIDER = os.environ.get('AA_EVEONLINE_CORP_PROVIDER', '')
|
|
EVEONLINE_ALLIANCE_PROVIDER = os.environ.get('AA_EVEONLINE_ALLIANCE_PROVIDER', '')
|
|
EVEONLINE_ITEMTYPE_PROVIDER = os.environ.get('AA_EVEONLINE_ITEMTYPE_PROVIDER', '')
|
|
|
|
#####################
|
|
# Alliance Market
|
|
#####################
|
|
MARKET_URL = os.environ.get('AA_MARKET_URL', 'http://example.com/market')
|
|
MARKET_DB = {
|
|
'ENGINE': 'django.db.backends.mysql',
|
|
'NAME': 'alliance_market',
|
|
'USER': os.environ.get('AA_DB_MARKET_USER', 'allianceserver'),
|
|
'PASSWORD': os.environ.get('AA_DB_MARKET_PASSWORD', 'password'),
|
|
'HOST': os.environ.get('AA_DB_MARKET_HOST', '127.0.0.1'),
|
|
'PORT': os.environ.get('AA_DB_MARKET_PORT', '3306'),
|
|
}
|
|
|
|
#####################
|
|
# HR Configuration
|
|
#####################
|
|
# API_KEY_AUDIT_URL - URL for viewing API keys.
|
|
# Other URLs are supported. Use string formatting notation {} with parameter names api_id, vcode, pk
|
|
# Example URL formats are shown below:
|
|
# Old Jacknife: 'https://example.com/jacknife/eveapi/audit.php?usid={api_id}&apik={vcode}'
|
|
# New Jacknife: 'https://example.com/jacknife/?usid={api_id}&apik={vcode}'
|
|
# SeAT: 'https://seat.example.com/api-key/detail/{api_id}'
|
|
# Django Admin: '/admin/eveonline/eveapikeypair/{pk}/change'
|
|
# Leave blank for the verification code to be shown in a popup on click.
|
|
#####################
|
|
API_KEY_AUDIT_URL = os.environ.get('AA_API_KEY_AUDIT_URL', '')
|
|
|
|
#####################
|
|
# Forum Configuration
|
|
#####################
|
|
# IPBOARD_ENDPOINT - Api endpoint if using ipboard
|
|
# IPBOARD_APIKEY - Api key to interact with ipboard
|
|
# IPBOARD_APIMODULE - Module for alliance auth *leave alone*
|
|
#####################
|
|
IPBOARD_ENDPOINT = os.environ.get('AA_IPBOARD_ENDPOINT', 'example.com/interface/board/index.php')
|
|
IPBOARD_APIKEY = os.environ.get('AA_IPBOARD_APIKEY', 'somekeyhere')
|
|
IPBOARD_APIMODULE = 'aa'
|
|
|
|
########################
|
|
# XenForo Configuration
|
|
########################
|
|
XENFORO_ENDPOINT = os.environ.get('AA_XENFORO_ENDPOINT', 'example.com/api.php')
|
|
XENFORO_DEFAULT_GROUP = os.environ.get('AA_XENFORO_DEFAULT_GROUP', 0)
|
|
XENFORO_APIKEY = os.environ.get('AA_XENFORO_APIKEY', 'yourapikey')
|
|
#####################
|
|
|
|
######################
|
|
# Jabber Configuration
|
|
######################
|
|
# JABBER_URL - Jabber address url
|
|
# JABBER_PORT - Jabber service portal
|
|
# JABBER_SERVER - Jabber server url
|
|
# OPENFIRE_ADDRESS - Address of the openfire admin console including port
|
|
# Please use http with 9090 or https with 9091
|
|
# OPENFIRE_SECRET_KEY - Openfire REST API secret key
|
|
# BROADCAST_USER - Broadcast user JID
|
|
# BROADCAST_USER_PASSWORD - Broadcast user password
|
|
######################
|
|
JABBER_URL = os.environ.get('AA_JABBER_URL', "example.com")
|
|
JABBER_PORT = int(os.environ.get('AA_JABBER_PORT', '5223'))
|
|
JABBER_SERVER = os.environ.get('AA_JABBER_SERVER', "example.com")
|
|
OPENFIRE_ADDRESS = os.environ.get('AA_OPENFIRE_ADDRESS', "http://example.com:9090")
|
|
OPENFIRE_SECRET_KEY = os.environ.get('AA_OPENFIRE_SECRET_KEY', "somekey")
|
|
BROADCAST_USER = os.environ.get('AA_BROADCAST_USER', "broadcast@") + JABBER_URL
|
|
BROADCAST_USER_PASSWORD = os.environ.get('AA_BROADCAST_USER_PASSWORD', "somepassword")
|
|
BROADCAST_SERVICE_NAME = os.environ.get('AA_BROADCAST_SERVICE_NAME', "broadcast")
|
|
|
|
######################################
|
|
# Mumble Configuration
|
|
######################################
|
|
# MUMBLE_URL - Mumble server url
|
|
# MUMBLE_SERVER_ID - Mumble server id
|
|
######################################
|
|
MUMBLE_URL = os.environ.get('AA_MUMBLE_URL', "example.com")
|
|
MUMBLE_SERVER_ID = int(os.environ.get('AA_MUMBLE_SERVER_ID', '1'))
|
|
|
|
######################################
|
|
# PHPBB3 Configuration
|
|
######################################
|
|
PHPBB3_DB = {
|
|
'ENGINE': 'django.db.backends.mysql',
|
|
'NAME': 'alliance_forum',
|
|
'USER': os.environ.get('AA_DB_PHPBB3_USER', 'allianceserver'),
|
|
'PASSWORD': os.environ.get('AA_DB_PHPBB3_PASSWORD', 'password'),
|
|
'HOST': os.environ.get('AA_DB_PHPBB3_HOST', '127.0.0.1'),
|
|
'PORT': os.environ.get('AA_DB_PHPBB3_PORT', '3306'),
|
|
}
|
|
|
|
######################################
|
|
# Teamspeak3 Configuration
|
|
######################################
|
|
# TEAMSPEAK3_SERVER_IP - Teamspeak3 server ip
|
|
# TEAMSPEAK3_SERVER_PORT - Teamspeak3 server port
|
|
# TEAMSPEAK3_SERVERQUERY_USER - Teamspeak3 serverquery username
|
|
# TEAMSPEAK3_SERVERQUERY_PASSWORD - Teamspeak3 serverquery password
|
|
# TEAMSPEAK3_VIRTUAL_SERVER - Virtual server id
|
|
# TEAMSPEAK3_AUTHED_GROUP_ID - Default authed group id
|
|
# TEAMSPEAK3_PUBLIC_URL - teamspeak3 public url used for link creation
|
|
######################################
|
|
TEAMSPEAK3_SERVER_IP = os.environ.get('AA_TEAMSPEAK3_SERVER_IP', '127.0.0.1')
|
|
TEAMSPEAK3_SERVER_PORT = int(os.environ.get('AA_TEAMSPEAK3_SERVER_PORT', '10011'))
|
|
TEAMSPEAK3_SERVERQUERY_USER = os.environ.get('AA_TEAMSPEAK3_SERVERQUERY_USER', 'serveradmin')
|
|
TEAMSPEAK3_SERVERQUERY_PASSWORD = os.environ.get('AA_TEAMSPEAK3_SERVERQUERY_PASSWORD', 'passwordhere')
|
|
TEAMSPEAK3_VIRTUAL_SERVER = int(os.environ.get('AA_TEAMSPEAK3_VIRTUAL_SERVER', '1'))
|
|
TEAMSPEAK3_PUBLIC_URL = os.environ.get('AA_TEAMSPEAK3_PUBLIC_URL', 'example.com')
|
|
|
|
######################################
|
|
# Discord Configuration
|
|
######################################
|
|
# DISCORD_GUILD_ID - ID of the guild to manage
|
|
# DISCORD_BOT_TOKEN - oauth token of the app bot user
|
|
# DISCORD_INVITE_CODE - invite code to the server
|
|
# DISCORD_APP_ID - oauth app client ID
|
|
# DISCORD_APP_SECRET - oauth app secret
|
|
# DISCORD_CALLBACK_URL - oauth callback url
|
|
# DISCORD_SYNC_NAMES - enable to force discord nicknames to be set to eve char name (bot needs Manage Nicknames permission)
|
|
######################################
|
|
DISCORD_GUILD_ID = os.environ.get('AA_DISCORD_GUILD_ID', '')
|
|
DISCORD_BOT_TOKEN = os.environ.get('AA_DISCORD_BOT_TOKEN', '')
|
|
DISCORD_INVITE_CODE = os.environ.get('AA_DISCORD_INVITE_CODE', '')
|
|
DISCORD_APP_ID = os.environ.get('AA_DISCORD_APP_ID', '')
|
|
DISCORD_APP_SECRET = os.environ.get('AA_DISCORD_APP_SECRET', '')
|
|
DISCORD_CALLBACK_URL = os.environ.get('AA_DISCORD_CALLBACK_URL', 'http://example.com/discord_callback')
|
|
DISCORD_SYNC_NAMES = 'True' == os.environ.get('AA_DISCORD_SYNC_NAMES', 'False')
|
|
|
|
######################################
|
|
# Discourse Configuration
|
|
######################################
|
|
# DISCOURSE_URL - Web address of the forums (no trailing slash)
|
|
# DISCOURSE_API_USERNAME - API account username
|
|
# DISCOURSE_API_KEY - API Key
|
|
# DISCOURSE_SSO_SECRET - SSO secret key
|
|
######################################
|
|
DISCOURSE_URL = os.environ.get('AA_DISCOURSE_URL', '')
|
|
DISCOURSE_API_USERNAME = os.environ.get('AA_DISCOURSE_API_USERNAME', '')
|
|
DISCOURSE_API_KEY = os.environ.get('AA_DISCOURSE_API_KEY', '')
|
|
DISCOURSE_SSO_SECRET = os.environ.get('AA_DISCOURSE_SSO_SECRET', '')
|
|
|
|
#####################################
|
|
# IPS4 Configuration
|
|
#####################################
|
|
# IPS4_URL - base url of the IPS4 install (no trailing slash)
|
|
# IPS4_API_KEY - API key provided by IPS4
|
|
#####################################
|
|
IPS4_URL = os.environ.get('AA_IPS4_URL', 'http://example.com/ips4')
|
|
IPS4_API_KEY = os.environ.get('AA_IPS4_API_KEY', '')
|
|
IPS4_DB = {
|
|
'ENGINE': 'django.db.backends.mysql',
|
|
'NAME': 'alliance_ips4',
|
|
'USER': os.environ.get('AA_DB_IPS4_USER', 'allianceserver'),
|
|
'PASSWORD': os.environ.get('AA_DB_IPS4_PASSWORD', 'password'),
|
|
'HOST': os.environ.get('AA_DB_IPS4_HOST', '127.0.0.1'),
|
|
'PORT': os.environ.get('AA_DB_IPS4_PORT', '3306'),
|
|
}
|
|
|
|
|
|
######################################
|
|
# SMF Configuration
|
|
######################################
|
|
SMF_URL = os.environ.get('AA_SMF_URL', '')
|
|
SMF_DB = {
|
|
'ENGINE': 'django.db.backends.mysql',
|
|
'NAME': 'alliance_smf',
|
|
'USER': os.environ.get('AA_DB_SMF_USER', 'allianceserver'),
|
|
'PASSWORD': os.environ.get('AA_DB_SMF_PASSWORD', 'password'),
|
|
'HOST': os.environ.get('AA_DB_SMF_HOST', '127.0.0.1'),
|
|
'PORT': os.environ.get('AA_DB_SMF_PORT', '3306'),
|
|
}
|
|
|
|
######################################
|
|
# Fleet-Up Configuration
|
|
######################################
|
|
# FLEETUP_APP_KEY - The app key from http://fleet-up.com/Api/MyApps
|
|
# FLEETUP_USER_ID - The user id from http://fleet-up.com/Api/MyKeys
|
|
# FLEETUP_API_ID - The API id from http://fleet-up.com/Api/MyKeys
|
|
# FLEETUP_GROUP_ID - The id of the group you want to pull data from, see http://fleet-up.com/Api/Endpoints#groups_mygroupmemberships
|
|
######################################
|
|
FLEETUP_APP_KEY = os.environ.get('AA_FLEETUP_APP_KEY', '')
|
|
FLEETUP_USER_ID = os.environ.get('AA_FLEETUP_USER_ID', '')
|
|
FLEETUP_API_ID = os.environ.get('AA_FLEETUP_API_ID', '')
|
|
FLEETUP_GROUP_ID = os.environ.get('AA_FLEETUP_GROUP_ID', '')
|
|
|
|
#####################################
|
|
# Logging Configuration
|
|
#####################################
|
|
# Set log_file and console level to desired state:
|
|
# DEBUG - basically stack trace, explains every step
|
|
# INFO - model creation, deletion, updates, etc
|
|
# WARN - unexpected function outcomes that do not impact user
|
|
# ERROR - unexcpeted function outcomes which prevent user from achieving desired outcome
|
|
# EXCEPTION - something critical went wrong, unhandled
|
|
#####################################
|
|
# Recommended level for log_file is INFO, console is DEBUG
|
|
# Change log level of individual apps below to narrow your debugging
|
|
#####################################
|
|
LOGGING = {
|
|
'version': 1,
|
|
'disable_existing_loggers': False,
|
|
'formatters': {
|
|
'verbose': {
|
|
'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
|
|
'datefmt' : "%d/%b/%Y %H:%M:%S"
|
|
},
|
|
'simple': {
|
|
'format': '%(levelname)s %(message)s'
|
|
},
|
|
},
|
|
'handlers': {
|
|
'log_file': {
|
|
'level': 'INFO', # edit this line to change logging level to file
|
|
'class': 'logging.handlers.RotatingFileHandler',
|
|
'filename': os.path.join(BASE_DIR,'log/allianceauth.log'),
|
|
'formatter': 'verbose',
|
|
'maxBytes': 1024*1024*5, # edit this line to change max log file size
|
|
'backupCount': 5, # edit this line to change number of log backups
|
|
},
|
|
'console': {
|
|
'level': 'DEBUG', # edit this line to change logging level to console
|
|
'class': 'logging.StreamHandler',
|
|
'formatter': 'verbose',
|
|
},
|
|
'notifications': { # creates notifications for users with logging_notifications permission
|
|
'level': 'ERROR', # edit this line to change logging level to notifications
|
|
'class': 'notifications.handlers.NotificationHandler',
|
|
'formatter': 'verbose',
|
|
},
|
|
},
|
|
'loggers': {
|
|
'authentication': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'celerytask': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'eveonline': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'groupmanagement': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'hrapplications': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'portal': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'registration': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'services': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'srp': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'timerboard': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'sigtracker': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'optimer': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'corputils': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'fleetactivitytracking': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'ERROR',
|
|
},
|
|
'util': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'DEBUG',
|
|
},
|
|
'django': {
|
|
'handlers': ['log_file', 'console', 'notifications'],
|
|
'level': 'ERROR',
|
|
},
|
|
}
|
|
}
|
|
|
|
# Conditionally add databases only if configured
|
|
if ENABLE_AUTH_FORUM or ENABLE_BLUE_FORUM:
|
|
DATABASES['phpbb3'] = PHPBB3_DB
|
|
if ENABLE_AUTH_SMF or ENABLE_BLUE_SMF:
|
|
DATABASES['smf'] = SMF_DB
|
|
if ENABLE_AUTH_MARKET or ENABLE_BLUE_MARKET:
|
|
DATABASES['market'] = MARKET_DB
|
|
if ENABLE_AUTH_IPS4 or ENABLE_BLUE_IPS4:
|
|
DATABASES['ips4'] = IPS4_DB
|
|
|
|
# Ensure corp/alliance IDs are expected types
|
|
STR_CORP_IDS = [str(id) for id in CORP_IDS]
|
|
STR_ALLIANCE_IDS = [str(id) for id in ALLIANCE_IDS]
|