mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
Restructure tests folder.
Remove DOMAIN setting. Use localhost for services revoked emails.
This commit is contained in:
parent
44de49cbb0
commit
cd6963daa6
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1 +0,0 @@
|
|||||||
*/*.py.example linguist-language=Python
|
|
8
.gitignore
vendored
8
.gitignore
vendored
@ -53,20 +53,12 @@ docs/_build/
|
|||||||
# PyBuilder
|
# PyBuilder
|
||||||
target/
|
target/
|
||||||
|
|
||||||
.vagrant/
|
|
||||||
alliance_auth/settings.py
|
|
||||||
*Thumbs.db
|
*Thumbs.db
|
||||||
nginx_config.txt
|
nginx_config.txt
|
||||||
|
|
||||||
# custom staticfiles
|
|
||||||
static/*
|
|
||||||
|
|
||||||
#celerybeat
|
#celerybeat
|
||||||
*.pid
|
*.pid
|
||||||
celerybeat-schedule
|
celerybeat-schedule
|
||||||
|
|
||||||
#pycharm
|
#pycharm
|
||||||
.idea/*
|
.idea/*
|
||||||
|
|
||||||
#log folder
|
|
||||||
log/*
|
|
||||||
|
@ -3,6 +3,5 @@ from django.conf import settings
|
|||||||
|
|
||||||
def auth_settings(request):
|
def auth_settings(request):
|
||||||
return {
|
return {
|
||||||
'DOMAIN': settings.DOMAIN,
|
|
||||||
'SITE_NAME': settings.SITE_NAME,
|
'SITE_NAME': settings.SITE_NAME,
|
||||||
}
|
}
|
||||||
|
2
allianceauth/log/.gitignore
vendored
Normal file
2
allianceauth/log/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
!.gitignore
|
||||||
|
*
|
@ -195,7 +195,7 @@ class Phpbb3Manager:
|
|||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
|
|
||||||
password = Phpbb3Manager.__gen_hash(Phpbb3Manager.__generate_random_pass())
|
password = Phpbb3Manager.__gen_hash(Phpbb3Manager.__generate_random_pass())
|
||||||
revoke_email = "revoked@" + settings.DOMAIN
|
revoke_email = "revoked@localhost"
|
||||||
try:
|
try:
|
||||||
pwhash = Phpbb3Manager.__gen_hash(password)
|
pwhash = Phpbb3Manager.__gen_hash(password)
|
||||||
cursor.execute(Phpbb3Manager.SQL_DIS_USER, [revoke_email, pwhash, username])
|
cursor.execute(Phpbb3Manager.SQL_DIS_USER, [revoke_email, pwhash, username])
|
||||||
|
@ -235,7 +235,7 @@ class SmfManager:
|
|||||||
cursor = connections['smf'].cursor()
|
cursor = connections['smf'].cursor()
|
||||||
|
|
||||||
password = cls.generate_random_pass()
|
password = cls.generate_random_pass()
|
||||||
revoke_email = "revoked@" + settings.DOMAIN
|
revoke_email = "revoked@localhost"
|
||||||
try:
|
try:
|
||||||
pwhash = cls.gen_hash(username, password)
|
pwhash = cls.gen_hash(username, password)
|
||||||
cursor.execute(cls.SQL_DIS_USER, [revoke_email, pwhash, username])
|
cursor.execute(cls.SQL_DIS_USER, [revoke_email, pwhash, username])
|
||||||
|
@ -37,29 +37,6 @@ INSTALLED_APPS = [
|
|||||||
'allianceauth.groupmanagement',
|
'allianceauth.groupmanagement',
|
||||||
'allianceauth.notifications',
|
'allianceauth.notifications',
|
||||||
'allianceauth.thirdparty.navhelper',
|
'allianceauth.thirdparty.navhelper',
|
||||||
|
|
||||||
# Optional apps - remove if not desired
|
|
||||||
# 'allianceauth.corputils',
|
|
||||||
# 'allianceauth.hrapplications',
|
|
||||||
# 'allianceauth.timerboard',
|
|
||||||
# 'allianceauth.srp',
|
|
||||||
# 'allianceauth.optimer',
|
|
||||||
# 'allianceauth.fleetup',
|
|
||||||
# 'allianceauth.fleetactivitytracking',
|
|
||||||
# 'allianceauth.permissions_tool',
|
|
||||||
|
|
||||||
# Services - remove if not used
|
|
||||||
# 'allianceauth.services.modules.mumble',
|
|
||||||
# 'allianceauth.services.modules.discord',
|
|
||||||
# 'allianceauth.services.modules.discourse',
|
|
||||||
# 'allianceauth.services.modules.ips4',
|
|
||||||
# 'allianceauth.services.modules.market',
|
|
||||||
# 'allianceauth.services.modules.openfire',
|
|
||||||
# 'allianceauth.services.modules.seat',
|
|
||||||
# 'allianceauth.services.modules.smf',
|
|
||||||
# 'allianceauth.services.modules.phpbb3',
|
|
||||||
# 'allianceauth.services.modules.xenforo',
|
|
||||||
# 'allianceauth.services.modules.teamspeak3',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Celery configuration
|
# Celery configuration
|
||||||
@ -127,6 +104,7 @@ TEMPLATES = [
|
|||||||
'django.template.context_processors.tz',
|
'django.template.context_processors.tz',
|
||||||
'allianceauth.notifications.context_processors.user_notification_count',
|
'allianceauth.notifications.context_processors.user_notification_count',
|
||||||
'allianceauth.groupmanagement.context_processors.can_manage_groups',
|
'allianceauth.groupmanagement.context_processors.can_manage_groups',
|
||||||
|
'allianceauth.context_processors.auth_settings',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -272,25 +250,20 @@ LOGGING = {
|
|||||||
'handlers': ['log_file', 'console', 'notifications'],
|
'handlers': ['log_file', 'console', 'notifications'],
|
||||||
'level': 'DEBUG',
|
'level': 'DEBUG',
|
||||||
},
|
},
|
||||||
'celerytask': {
|
|
||||||
'handlers': ['log_file', 'console', 'notifications'],
|
|
||||||
'level': 'DEBUG',
|
|
||||||
},
|
|
||||||
'portal': {
|
|
||||||
'handlers': ['log_file', 'console', 'notifications'],
|
|
||||||
'level': 'DEBUG',
|
|
||||||
},
|
|
||||||
'registration': {
|
|
||||||
'handlers': ['log_file', 'console', 'notifications'],
|
|
||||||
'level': 'DEBUG',
|
|
||||||
},
|
|
||||||
'util': {
|
|
||||||
'handlers': ['log_file', 'console', 'notifications'],
|
|
||||||
'level': 'DEBUG',
|
|
||||||
},
|
|
||||||
'django': {
|
'django': {
|
||||||
'handlers': ['log_file', 'console'],
|
'handlers': ['log_file', 'console'],
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def add_auth_apps(APPS):
|
||||||
|
"""
|
||||||
|
Merges required auth apps with a list of custom user apps for project settings.
|
||||||
|
Leaves order of passed INSTALLED_APPS unchanged (passed apps come first) to allow overriding templates/static/etc
|
||||||
|
https://docs.djangoproject.com/en/2.0/ref/settings/#installed-apps
|
||||||
|
:param APPS: INSTALLED_APPS list
|
||||||
|
:return: Merged INSTALLED_APPS
|
||||||
|
"""
|
||||||
|
APPS += [app for app in INSTALLED_APPS if app not in APPS]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from django.conf import settings
|
from allianceauth import NAME
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import logging
|
import logging
|
||||||
@ -20,7 +20,7 @@ class SRPManager:
|
|||||||
def get_kill_data(kill_id):
|
def get_kill_data(kill_id):
|
||||||
url = ("https://www.zkillboard.com/api/killID/%s/" % kill_id)
|
url = ("https://www.zkillboard.com/api/killID/%s/" % kill_id)
|
||||||
headers = {
|
headers = {
|
||||||
'User-Agent': "%s Alliance Auth" % settings.DOMAIN,
|
'User-Agent': NAME,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
}
|
}
|
||||||
r = requests.get(url, headers=headers)
|
r = requests.get(url, headers=headers)
|
||||||
|
@ -3,7 +3,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_allianceauth.settings'
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from django.core.management import execute_from_command_line
|
from django.core.management import execute_from_command_line
|
||||||
|
@ -1,409 +0,0 @@
|
|||||||
"""
|
|
||||||
Alliance Auth Test Suite Django settings.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from django.contrib import messages
|
|
||||||
|
|
||||||
import alliance_auth
|
|
||||||
|
|
||||||
# Use nose to run all tests
|
|
||||||
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
|
|
||||||
|
|
||||||
NOSE_ARGS = [
|
|
||||||
#'--with-coverage',
|
|
||||||
#'--cover-package=',
|
|
||||||
#'--exe', # If your tests need this to be found/run, check they py files are not chmodded +x
|
|
||||||
]
|
|
||||||
|
|
||||||
# Celery configuration
|
|
||||||
CELERY_ALWAYS_EAGER = True # Forces celery to run locally for testing
|
|
||||||
|
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(alliance_auth.__file__)))
|
|
||||||
|
|
||||||
SECRET_KEY = 'testing only'
|
|
||||||
|
|
||||||
DEBUG = False
|
|
||||||
|
|
||||||
# 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',
|
|
||||||
'django_celery_beat',
|
|
||||||
'bootstrapform',
|
|
||||||
'esi',
|
|
||||||
'bootstrap_pagination',
|
|
||||||
'allianceauth',
|
|
||||||
'allianceauth.authentication',
|
|
||||||
'allianceauth.services',
|
|
||||||
'allianceauth.eveonline',
|
|
||||||
'allianceauth.groupmanagement',
|
|
||||||
'allianceauth.hrapplications',
|
|
||||||
'allianceauth.timerboard',
|
|
||||||
'allianceauth.srp',
|
|
||||||
'allianceauth.optimer',
|
|
||||||
'allianceauth.corputils',
|
|
||||||
'allianceauth.fleetactivitytracking',
|
|
||||||
'allianceauth.fleetup',
|
|
||||||
'allianceauth.notifications',
|
|
||||||
'allianceauth.permissions_tool',
|
|
||||||
'allianceauth.thirdparty.navhelper',
|
|
||||||
|
|
||||||
'allianceauth.services.modules.mumble',
|
|
||||||
'allianceauth.services.modules.discord',
|
|
||||||
'allianceauth.services.modules.discourse',
|
|
||||||
'allianceauth.services.modules.ips4',
|
|
||||||
'allianceauth.services.modules.market',
|
|
||||||
'allianceauth.services.modules.openfire',
|
|
||||||
'allianceauth.services.modules.seat',
|
|
||||||
'allianceauth.services.modules.smf',
|
|
||||||
'allianceauth.services.modules.phpbb3',
|
|
||||||
'allianceauth.services.modules.xenforo',
|
|
||||||
'allianceauth.services.modules.teamspeak3',
|
|
||||||
'django_nose',
|
|
||||||
]
|
|
||||||
|
|
||||||
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 = 'test_allianceauth.urls'
|
|
||||||
|
|
||||||
LOCALE_PATHS = (
|
|
||||||
os.path.join(BASE_DIR, 'locale/'),
|
|
||||||
)
|
|
||||||
|
|
||||||
ugettext = lambda s: s
|
|
||||||
LANGUAGES = (
|
|
||||||
('en', ugettext('English')),
|
|
||||||
('de', ugettext('German')),
|
|
||||||
)
|
|
||||||
LOGIN_TOKEN_SCOPES = ['esi-characters.read_opportunities.v1']
|
|
||||||
TEMPLATES = [
|
|
||||||
{
|
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
||||||
'DIRS': [],
|
|
||||||
'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',
|
|
||||||
'allianceauth.context_processors.auth_settings',
|
|
||||||
'allianceauth.notifications.context_processors.user_notification_count',
|
|
||||||
'allianceauth.groupmanagement.context_processors.can_manage_groups',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
# Database
|
|
||||||
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
|
|
||||||
|
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
'NAME': 'alliance_auth',
|
|
||||||
'USER': os.environ.get('AA_DB_DEFAULT_USER', None),
|
|
||||||
'PASSWORD': os.environ.get('AA_DB_DEFAULT_PASSWORD', None),
|
|
||||||
'HOST': os.environ.get('AA_DB_DEFAULT_HOST', None)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
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')
|
|
||||||
|
|
||||||
TIME_ZONE = os.environ.get('AA_TIME_ZONE', 'UTC')
|
|
||||||
|
|
||||||
USE_I18N = True
|
|
||||||
|
|
||||||
USE_L10N = True
|
|
||||||
|
|
||||||
USE_TZ = True
|
|
||||||
|
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, "static")
|
|
||||||
|
|
||||||
# Bootstrap messaging css workaround
|
|
||||||
MESSAGE_TAGS = {
|
|
||||||
messages.ERROR: 'danger'
|
|
||||||
}
|
|
||||||
|
|
||||||
CACHES = {
|
|
||||||
'default': {
|
|
||||||
'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AUTHENTICATION_BACKENDS = ['allianceauth.authentication.backends.StateBackend', 'django.contrib.auth.backends.ModelBackend']
|
|
||||||
|
|
||||||
#####################################################
|
|
||||||
##
|
|
||||||
## 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')
|
|
||||||
SITE_NAME = os.environ.get('AA_SITE_NAME', 'Test Alliance Auth')
|
|
||||||
EMAIL_HOST = os.environ.get('AA_EMAIL_HOST', 'smtp.example.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')
|
|
||||||
|
|
||||||
###################
|
|
||||||
# SSO Settings
|
|
||||||
###################
|
|
||||||
# Optional SSO.
|
|
||||||
# Get client ID and client secret from registering an app at
|
|
||||||
# https://developers.eveonline.com/
|
|
||||||
# Callback URL should be http://mydomain.com/sso/callback
|
|
||||||
# Leave callback blank to hide SSO button on login page
|
|
||||||
###################
|
|
||||||
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', '')
|
|
||||||
|
|
||||||
#######################
|
|
||||||
# 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', 'xml')
|
|
||||||
EVEONLINE_CORP_PROVIDER = os.environ.get('AA_EVEONLINE_CORP_PROVIDER', 'xml')
|
|
||||||
EVEONLINE_ALLIANCE_PROVIDER = os.environ.get('AA_EVEONLINE_ALLIANCE_PROVIDER', 'xml')
|
|
||||||
EVEONLINE_ITEMTYPE_PROVIDER = os.environ.get('AA_EVEONLINE_ITEMTYPE_PROVIDER', 'xml')
|
|
||||||
|
|
||||||
#####################
|
|
||||||
# Alliance Market
|
|
||||||
#####################
|
|
||||||
MARKET_URL = os.environ.get('AA_MARKET_URL', 'http://yourdomain.com/market')
|
|
||||||
|
|
||||||
#####################
|
|
||||||
# HR Configuration
|
|
||||||
#####################
|
|
||||||
# JACK_KNIFE_URL - Url for the audit page of API Jack knife
|
|
||||||
# Should seriously replace with your own.
|
|
||||||
#####################
|
|
||||||
JACK_KNIFE_URL = os.environ.get('AA_JACK_KNIFE_URL', 'http://example.com/eveapi/audit.php')
|
|
||||||
|
|
||||||
########################
|
|
||||||
# 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_URL = os.environ.get('AA_FORUM_URL', '')
|
|
||||||
|
|
||||||
######################################
|
|
||||||
# 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', '0118999')
|
|
||||||
DISCORD_BOT_TOKEN = os.environ.get('AA_DISCORD_BOT_TOKEN', 'bottoken')
|
|
||||||
DISCORD_INVITE_CODE = os.environ.get('AA_DISCORD_INVITE_CODE', 'invitecode')
|
|
||||||
DISCORD_APP_ID = os.environ.get('AA_DISCORD_APP_ID', 'appid')
|
|
||||||
DISCORD_APP_SECRET = os.environ.get('AA_DISCORD_APP_SECRET', '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', 'https://example.com')
|
|
||||||
DISCOURSE_API_USERNAME = os.environ.get('AA_DISCOURSE_API_USERNAME', '')
|
|
||||||
DISCOURSE_API_KEY = os.environ.get('AA_DISCOURSE_API_KEY', '')
|
|
||||||
DISCOURSE_SSO_SECRET = 'd836444a9e4084d5b224a60c208dce14'
|
|
||||||
# Example secret from https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045
|
|
||||||
|
|
||||||
#####################################
|
|
||||||
# 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', '')
|
|
||||||
|
|
||||||
#####################################
|
|
||||||
# SEAT Configuration
|
|
||||||
#####################################
|
|
||||||
# SEAT_URL - base url of the seat install (no trailing slash)
|
|
||||||
# SEAT_XTOKEN - API key X-Token provided by SeAT
|
|
||||||
#####################################
|
|
||||||
SEAT_URL = os.environ.get('AA_SEAT_URL', 'http://example.com/seat')
|
|
||||||
SEAT_XTOKEN = os.environ.get('AA_SEAT_XTOKEN', 'tokentokentoken')
|
|
||||||
|
|
||||||
######################################
|
|
||||||
# SMF Configuration
|
|
||||||
######################################
|
|
||||||
SMF_URL = os.environ.get('AA_SMF_URL', '')
|
|
||||||
|
|
||||||
######################################
|
|
||||||
# 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', '')
|
|
||||||
|
|
||||||
PASSWORD_HASHERS = [
|
|
||||||
'django.contrib.auth.hashers.MD5PasswordHasher',
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
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': {
|
|
||||||
'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': 'allianceauth.notifications.handlers.NotificationHandler',
|
|
||||||
'formatter': 'verbose',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'loggers': {
|
|
||||||
'allianceauth': {
|
|
||||||
'handlers': ['console', 'notifications'],
|
|
||||||
'level': 'DEBUG',
|
|
||||||
},
|
|
||||||
'celerytask': {
|
|
||||||
'handlers': ['console', 'notifications'],
|
|
||||||
'level': 'DEBUG',
|
|
||||||
},
|
|
||||||
'django': {
|
|
||||||
'handlers': ['console', 'notifications'],
|
|
||||||
'level': 'ERROR',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGING = None # Comment out to enable logging for debugging
|
|
195
tests/settings.py
Normal file
195
tests/settings.py
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
"""
|
||||||
|
Alliance Auth Test Suite Django settings.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from allianceauth.settings.base import *
|
||||||
|
|
||||||
|
# Use nose to run all tests
|
||||||
|
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
|
||||||
|
|
||||||
|
NOSE_ARGS = [
|
||||||
|
#'--with-coverage',
|
||||||
|
#'--cover-package=',
|
||||||
|
#'--exe', # If your tests need this to be found/run, check they py files are not chmodded +x
|
||||||
|
]
|
||||||
|
|
||||||
|
# Celery configuration
|
||||||
|
CELERY_ALWAYS_EAGER = True # Forces celery to run locally for testing
|
||||||
|
|
||||||
|
INSTALLED_APPS = [
|
||||||
|
'allianceauth.hrapplications',
|
||||||
|
'allianceauth.timerboard',
|
||||||
|
'allianceauth.srp',
|
||||||
|
'allianceauth.optimer',
|
||||||
|
'allianceauth.corputils',
|
||||||
|
'allianceauth.fleetactivitytracking',
|
||||||
|
'allianceauth.fleetup',
|
||||||
|
'allianceauth.permissions_tool',
|
||||||
|
'allianceauth.services.modules.mumble',
|
||||||
|
'allianceauth.services.modules.discord',
|
||||||
|
'allianceauth.services.modules.discourse',
|
||||||
|
'allianceauth.services.modules.ips4',
|
||||||
|
'allianceauth.services.modules.market',
|
||||||
|
'allianceauth.services.modules.openfire',
|
||||||
|
'allianceauth.services.modules.seat',
|
||||||
|
'allianceauth.services.modules.smf',
|
||||||
|
'allianceauth.services.modules.phpbb3',
|
||||||
|
'allianceauth.services.modules.xenforo',
|
||||||
|
'allianceauth.services.modules.teamspeak3',
|
||||||
|
'django_nose',
|
||||||
|
]
|
||||||
|
|
||||||
|
add_auth_apps(INSTALLED_APPS)
|
||||||
|
|
||||||
|
ROOT_URLCONF = 'tests.urls'
|
||||||
|
|
||||||
|
CACHES['default'] = {'BACKEND': 'django.core.cache.backends.db.DatabaseCache'}
|
||||||
|
|
||||||
|
#####################
|
||||||
|
# Alliance Market
|
||||||
|
#####################
|
||||||
|
MARKET_URL = 'http://yourdomain.com/market'
|
||||||
|
|
||||||
|
#####################
|
||||||
|
# HR Configuration
|
||||||
|
#####################
|
||||||
|
# JACK_KNIFE_URL - Url for the audit page of API Jack knife
|
||||||
|
# Should seriously replace with your own.
|
||||||
|
#####################
|
||||||
|
JACK_KNIFE_URL = 'http://example.com/eveapi/audit.php'
|
||||||
|
|
||||||
|
########################
|
||||||
|
# XenForo Configuration
|
||||||
|
########################
|
||||||
|
XENFORO_ENDPOINT = 'example.com/api.php'
|
||||||
|
XENFORO_DEFAULT_GROUP = 0
|
||||||
|
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 = "example.com"
|
||||||
|
JABBER_PORT = 5223
|
||||||
|
JABBER_SERVER = "example.com"
|
||||||
|
OPENFIRE_ADDRESS = "http://example.com:9090"
|
||||||
|
OPENFIRE_SECRET_KEY = "somekey"
|
||||||
|
BROADCAST_USER = "broadcast@" + JABBER_URL
|
||||||
|
BROADCAST_USER_PASSWORD = "somepassword"
|
||||||
|
BROADCAST_SERVICE_NAME = "broadcast"
|
||||||
|
|
||||||
|
######################################
|
||||||
|
# Mumble Configuration
|
||||||
|
######################################
|
||||||
|
# MUMBLE_URL - Mumble server url
|
||||||
|
# MUMBLE_SERVER_ID - Mumble server id
|
||||||
|
######################################
|
||||||
|
MUMBLE_URL = "example.com"
|
||||||
|
MUMBLE_SERVER_ID = 1
|
||||||
|
|
||||||
|
######################################
|
||||||
|
# PHPBB3 Configuration
|
||||||
|
######################################
|
||||||
|
PHPBB3_URL = ''
|
||||||
|
|
||||||
|
######################################
|
||||||
|
# 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 = '127.0.0.1'
|
||||||
|
TEAMSPEAK3_SERVER_PORT = 10011
|
||||||
|
TEAMSPEAK3_SERVERQUERY_USER = 'serveradmin'
|
||||||
|
TEAMSPEAK3_SERVERQUERY_PASSWORD = 'passwordhere'
|
||||||
|
TEAMSPEAK3_VIRTUAL_SERVER = 1
|
||||||
|
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 = '0118999'
|
||||||
|
DISCORD_BOT_TOKEN = 'bottoken'
|
||||||
|
DISCORD_INVITE_CODE = 'invitecode'
|
||||||
|
DISCORD_APP_ID = 'appid'
|
||||||
|
DISCORD_APP_SECRET = 'secret'
|
||||||
|
DISCORD_CALLBACK_URL = 'http://example.com/discord/callback'
|
||||||
|
DISCORD_SYNC_NAMES = 'True' == '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 = 'https://example.com'
|
||||||
|
DISCOURSE_API_USERNAME = ''
|
||||||
|
DISCOURSE_API_KEY = ''
|
||||||
|
DISCOURSE_SSO_SECRET = 'd836444a9e4084d5b224a60c208dce14'
|
||||||
|
# Example secret from https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# IPS4 Configuration
|
||||||
|
#####################################
|
||||||
|
# IPS4_URL - base url of the IPS4 install (no trailing slash)
|
||||||
|
# IPS4_API_KEY - API key provided by IPS4
|
||||||
|
#####################################
|
||||||
|
IPS4_URL = 'http://example.com/ips4'
|
||||||
|
IPS4_API_KEY = ''
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# SEAT Configuration
|
||||||
|
#####################################
|
||||||
|
# SEAT_URL - base url of the seat install (no trailing slash)
|
||||||
|
# SEAT_XTOKEN - API key X-Token provided by SeAT
|
||||||
|
#####################################
|
||||||
|
SEAT_URL = 'http://example.com/seat'
|
||||||
|
SEAT_XTOKEN = 'tokentokentoken'
|
||||||
|
|
||||||
|
######################################
|
||||||
|
# SMF Configuration
|
||||||
|
######################################
|
||||||
|
SMF_URL = ''
|
||||||
|
|
||||||
|
######################################
|
||||||
|
# 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 = ''
|
||||||
|
FLEETUP_USER_ID = ''
|
||||||
|
FLEETUP_API_ID = ''
|
||||||
|
FLEETUP_GROUP_ID = ''
|
||||||
|
|
||||||
|
PASSWORD_HASHERS = [
|
||||||
|
'django.contrib.auth.hashers.MD5PasswordHasher',
|
||||||
|
]
|
||||||
|
|
||||||
|
LOGGING = None # Comment out to enable logging for debugging
|
@ -1,4 +1,5 @@
|
|||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
|
|
||||||
import allianceauth.urls
|
import allianceauth.urls
|
||||||
from . import views
|
from . import views
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user