diff --git a/alliance_auth/settings.py.example b/alliance_auth/settings.py.example index f753be20..54dc4b15 100644 --- a/alliance_auth/settings.py.example +++ b/alliance_auth/settings.py.example @@ -211,7 +211,7 @@ CACHES = { # EMAIL_HOST_PASSWORD - Email Password # EMAIL_USE_TLS - Set to use TLS encryption ################# -DOMAIN = os.environ.get('AA_DOMAIN', 'https://yourdomain.com') +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', '') @@ -236,7 +236,7 @@ SITE_NAME = os.environ.get('AA_SITE_NAME', 'Alliance Auth') ################### # Get client ID and client secret from registering an app at # https://developers.eveonline.com/ -# Callback URL should be https://mydomain.com/sso/callback +# 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', '') @@ -371,7 +371,7 @@ EVEONLINE_ITEMTYPE_PROVIDER = os.environ.get('AA_EVEONLINE_ITEMTYPE_PROVIDER', ' ##################### # Alliance Market ##################### -MARKET_URL = os.environ.get('AA_MARKET_URL', 'http://yourdomain.com/market') +MARKET_URL = os.environ.get('AA_MARKET_URL', 'http://example.com/market') MARKET_DB = { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'alliance_market', @@ -384,10 +384,16 @@ MARKET_DB = { ##################### # HR Configuration ##################### -# JACK_KNIFE_URL - Url for the audit page of API Jack knife -# Should seriously replace with your own. +# 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. ##################### -JACK_KNIFE_URL = os.environ.get('AA_JACK_KNIFE_URL', 'http://ridetheclown.com/eveapi/audit.php') +API_KEY_AUDIT_URL = os.environ.get('AA_API_KEY_AUDIT_URL', '') ##################### # Forum Configuration @@ -396,14 +402,14 @@ JACK_KNIFE_URL = os.environ.get('AA_JACK_KNIFE_URL', 'http://ridetheclown.com/ev # IPBOARD_APIKEY - Api key to interact with ipboard # IPBOARD_APIMODULE - Module for alliance auth *leave alone* ##################### -IPBOARD_ENDPOINT = os.environ.get('AA_IPBOARD_ENDPOINT', 'yourdomain.com/interface/board/index.php') +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', 'yourdomain.com/api.php') +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') ##################### @@ -420,10 +426,10 @@ XENFORO_APIKEY = os.environ.get('AA_XENFORO_APIKEY', 'yourapikey') # BROADCAST_USER - Broadcast user JID # BROADCAST_USER_PASSWORD - Broadcast user password ###################### -JABBER_URL = os.environ.get('AA_JABBER_URL', "yourdomain.com") +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', "yourdomain.com") -OPENFIRE_ADDRESS = os.environ.get('AA_OPENFIRE_ADDRESS', "http://yourdomain.com:9090") +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") @@ -435,7 +441,7 @@ BROADCAST_SERVICE_NAME = os.environ.get('AA_BROADCAST_SERVICE_NAME', "broadcast" # MUMBLE_URL - Mumble server url # MUMBLE_SERVER_ID - Mumble server id ###################################### -MUMBLE_URL = os.environ.get('AA_MUMBLE_URL', "yourdomain.com") +MUMBLE_URL = os.environ.get('AA_MUMBLE_URL', "example.com") MUMBLE_SERVER_ID = int(os.environ.get('AA_MUMBLE_SERVER_ID', '1')) ###################################### @@ -466,7 +472,7 @@ 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', 'yourdomain.com') +TEAMSPEAK3_PUBLIC_URL = os.environ.get('AA_TEAMSPEAK3_PUBLIC_URL', 'example.com') ###################################### # Discord Configuration @@ -484,7 +490,7 @@ 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://mydomain.com/discord_callback') +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') ###################################### @@ -506,7 +512,7 @@ DISCOURSE_SSO_SECRET = os.environ.get('AA_DISCOURSE_SSO_SECRET', '') # 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://yourdomain.com/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', diff --git a/corputils/templates/corputils/corpstats.html b/corputils/templates/corputils/corpstats.html index 45a2a63c..48a70eb5 100644 --- a/corputils/templates/corputils/corpstats.html +++ b/corputils/templates/corputils/corpstats.html @@ -2,6 +2,7 @@ {% load i18n %} {% load humanize %} {% load bootstrap_pagination %} +{% load eveonline_extras %} {% block member_data %} {% if corpstats %}
@@ -71,7 +72,7 @@ {{ member.character_name }} {% if corpstats.show_apis %} {% if member.api %} - {{ member.api.api_id }} + {{ member.api|api_link:'label label-primary' }} {% else %} {% endif %} diff --git a/docs/installation/auth/cloudflare.md b/docs/installation/auth/cloudflare.md index 8865405e..50bdd785 100644 --- a/docs/installation/auth/cloudflare.md +++ b/docs/installation/auth/cloudflare.md @@ -10,21 +10,21 @@ Along the top bar, select `Add Site` Enter your domain name. It will scan records and let you know you can add the site. Continue setup. -On the next page you should see an A record for yourdomain.com pointing at your server IP. If not, manually add one: +On the next page you should see an A record for example.com pointing at your server IP. If not, manually add one: - A yourdomain.com my.server.ip.address Automatic TTL + A example.com my.server.ip.address Automatic TTL Add the record and ensure the cloud under Status is orange. If not, click it. This ensures traffic gets screened by CloudFlare. If you want forums or kb on a subdomain, and want these to be protected by CloudFlare, add an additional record for for each subdomain in the following format, ensuring the cloud is orange: - CNAME subdomain yourdomain.com Automatic TTL + CNAME subdomain example.com Automatic TTL CloudFlare blocks ports outside 80 and 443 on hosts it protects. This means, if the cloud is orange, only web traffic will get through. We need to reconfigure AllianceAuth to provide services under a subdomain. Configure these subdomains as above, but ensure the cloud is not orange (arrow should go around a grey cloud). ## Redirect to HTTPS -Now we need to configure the https redirect to force all traffic to https. Along the top bar of CloudFlare, select `Page Rules`. Add a new rule, Pattern is yourdomain.com, toggle the `Always use https` to ON, and save. It’ll take a few minutes to propagate. +Now we need to configure the https redirect to force all traffic to https. Along the top bar of CloudFlare, select `Page Rules`. Add a new rule, Pattern is example.com, toggle the `Always use https` to ON, and save. It’ll take a few minutes to propagate. ![infographic](http://i.stack.imgur.com/VUBvo.jpg) diff --git a/docs/installation/auth/settings.md b/docs/installation/auth/settings.md index c5c76145..89faed63 100644 --- a/docs/installation/auth/settings.md +++ b/docs/installation/auth/settings.md @@ -19,145 +19,150 @@ When changing these booleans, edit the setting within the brackets (eg `('AA_MEM # Fields to Modify ## Required - - [SECRET_KEY](#secret_key) + - [SECRET_KEY](#secret-key) - Use [this tool](http://www.miniwebtool.com/django-secret-key-generator/) to generate a key on initial install - [DEBUG](#debug) - If issues are encountered, set this to `True` to view a more detailed error report, otherwise set `False` - - [ALLOWED_HOSTS](#allowed_hosts) + - [ALLOWED_HOSTS](#allowed-hosts) - This restricts web addresses auth will answer to. Separate with commas. - - Should include localhost `127.0.0.1` and `yourdomain.com` + - Should include localhost `127.0.0.1` and `example.com` - To allow from all, include `'*'` - [DATABASES](#databases) - Fill out the database name and user credentials to manage the auth database. - [DOMAIN](#domain) - Set to the domain name AllianceAuth will be accessible under - - [EMAIL_HOST_USER](#email_host_user) + - [EMAIL_HOST_USER](#email-host-user) - Username to send emails from. If gmail account, the full gmail address. - - [EMAIL_HOST_PASSWORD](#email_host_password) + - [EMAIL_HOST_PASSWORD](#email-host-password) - Password for the email user. - - [CORP_IDS](#corp_ids) + - [CORP_IDS](#corp-ids) - List of corp IDs who are members. Exclude if their alliance is in `ALLIANCE_IDS` - - [ALLIANCE_IDS](#alliance_ids) + - [ALLIANCE_IDS](#alliance-ids) - List of alliance IDs who are members. - - [ESI_SSO_CLIENT_ID](#esi_sso_client_id) - - EVE application ID from the developers site. See the [SSO Configuration Instruction](#ESI_SSO_CLIENT_ID) - - [ESI_SSO_CLIENT_SECRET](#esi_sso_client_secret) + - [ESI_SSO_CLIENT_ID](#esi-sso-client_id) + - EVE application ID from the developers site. See the [SSO Configuration Instruction](#sso-settings) + - [ESI_SSO_CLIENT_SECRET](#esi-sso-client-secret) - EVE application secret from the developers site. - - [ESI_SSO_CALLBACK_URL](#esi_sso_callback_url) + - [ESI_SSO_CALLBACK_URL](#esi-sso-callback-url) - OAuth callback URL. Should be `https://mydomain.com/sso/callback` ## Services ### Member Services After installing services, enable specific services for members by setting the following to `True` -- [ENABLE_AUTH_FORUM](#enable_auth_forum) -- [ENABLE_AUTH_JABBER](#enable_auth_jabber) -- [ENABLE_AUTH_MUMBLE](#enable_auth_mumble) -- [ENABLE_AUTH_IPBOARD](#enable_auth_ipboard) -- [ENABLE_AUTH_TEAMSPEAK3](#enable_auth_teamspeak3) -- [ENABLE_AUTH_DISCORD](#enable_auth_discord) -- [ENABLE_AUTH_DISCOURSE](#enable_auth_discourse) -- [ENABLE_AUTH_IPS4](#enable_auth_ips4) -- [ENABLE_AUTH_SMF](#enable_auth_smf) -- [ENABLE_AUTH_MARKET](#enable_auth_market) -- [ENABLE_AUTH_XENFORO](#enable_auth_xenforo) +- [ENABLE_AUTH_FORUM](#enable-auth-forum) +- [ENABLE_AUTH_JABBER](#enable-auth-jabber) +- [ENABLE_AUTH_MUMBLE](#enable-auth-mumble) +- [ENABLE_AUTH_IPBOARD](#enable-auth-ipboard) +- [ENABLE_AUTH_TEAMSPEAK3](#enable-auth-teamspeak3) +- [ENABLE_AUTH_DISCORD](#enable-auth-discord) +- [ENABLE_AUTH_DISCOURSE](#enable-auth-discourse) +- [ENABLE_AUTH_IPS4](#enable-auth-ips4) +- [ENABLE_AUTH_SMF](#enable-auth-smf) +- [ENABLE_AUTH_MARKET](#enable-auth-market) +- [ENABLE_AUTH_XENFORO](#enable-auth-xenforo) ### Blue Services After installing services, enable specific services for blues by setting the following to `True` -- [ENABLE_BLUE_FORUM](#enable_blue_forum) -- [ENABLE_BLUE_JABBER](#enable_blue_jabber) -- [ENABLE_BLUE_MUMBLE](#enable_blue_mumble) -- [ENABLE_BLUE_IPBOARD](#enable_blue_ipboard) -- [ENABLE_BLUE_TEAMSPEAK3](#enable_blue_teamspeak3) -- [ENABLE_BLUE_DISCORD](#enable_blue_discord) -- [ENABLE_BLUE_DISCOURSE](#enable_blue_discourse) -- [ENABLE_BLUE_IPS4](#enable_blue_ips4) -- [ENABLE_BLUE_SMF](#enable_blue_smf) -- [ENABLE_BLUE_MARKET](#enable_blue_market) -- [ENABLE_BLUE_XENFORO](#enable_blue_xenforo) +- [ENABLE_BLUE_FORUM](#enable-blue-forum) +- [ENABLE_BLUE_JABBER](#enable-blue-jabber) +- [ENABLE_BLUE_MUMBLE](#enable-blue-mumble) +- [ENABLE_BLUE_IPBOARD](#enable-blue-ipboard) +- [ENABLE_BLUE_TEAMSPEAK3](#enable-blue-teamspeak3) +- [ENABLE_BLUE_DISCORD](#enable-blue-discord) +- [ENABLE_BLUE_DISCOURSE](#enable-blue-discourse) +- [ENABLE_BLUE_IPS4](#enable-blue-ips4) +- [ENABLE_BLUE_SMF](#enable-blue-smf) +- [ENABLE_BLUE_MARKET](#enable-blue-market) +- [ENABLE_BLUE_XENFORO](#enable-blue-xenforo) ### IPBoard -If using IPBoard, the following need to be set - - [IPBOARD_ENDPOINT](#ipboard_endpoint) - - [IPBOARD_APIKEY](#ipboard_apikey) - - [IPBOARD_APIMODULE](#ipboard_apimodule) +If using IPBoard, the following need to be set in accordance with the [install instructions](../services/ipboard3.md) + - [IPBOARD_ENDPOINT](#ipboard-endpoint) + - [IPBOARD_APIKEY](#ipboard-apikey) + - [IPBOARD_APIMODULE](#ipboard-apimodule) ### XenForo -If using XenForo, the following need to be set - - [XENFORO_ENDPOINT](#xenforo_endpoint) - - [XENFORO_APIKEY](#xenforo_apikey) +If using XenForo, the following need to be set in accordance with the [install instructions](../services/xenforo.md) + - [XENFORO_ENDPOINT](#xenforo-endpoint) + - [XENFORO_APIKEY](#xenforo-apikey) ### Openfire -If using Openfire, the following need to be set - - [JABBER_URL](#jabber_url) - - [JABBER_PORT](#jabber_port) - - [JABBER_SERVER](#jabber_server) - - [OPENFIRE_ADDRESS](#openfire_address) - - [OPENFIRE_SECRET_KEY](#openfire_secret_key) - - [BROADCAST_USER](#broadcast_user) - - [BROADCAST_USER_PASSWORD](#broadcast_user_password) - - [BROADCAST_SERVICE_NAME](#broadcast_service_name) +If using Openfire, the following need to be set in accordance with the [install instructions](../services/openfire.md) + - [JABBER_URL](#jabber-url) + - [JABBER_PORT](#jabber-port) + - [JABBER_SERVER](#jabber-server) + - [OPENFIRE_ADDRESS](#openfire-address) + - [OPENFIRE_SECRET_KEY](#openfire-secret-key) + - [BROADCAST_USER](#broadcast-user) + - [BROADCAST_USER_PASSWORD](#broadcast-user-password) + - [BROADCAST_SERVICE_NAME](#broadcast-service-name) ### Mumble -If using Mumble, the following need to be set - - [MUMBLE_URL](#mumble_url) +If using Mumble, the following needs to be set to the address of the mumble server: + - [MUMBLE_URL](#mumble-url) ### PHPBB3 If using phpBB3, the database needs to be defined. ### Teamspeak3 -If using Teamspeak3, the following need to be set - - [TEAMSPEAK3_SERVER_IP](#teamspeak3_server_ip) - - [TEAMSPEAK3_SERVER_PORT](#teamspeak3_server_port) - - [TEAMSPEAK3_SERVERQUERY_USER](#teamspeak3_serverquery_user) - - [TEAMSPEAK3_SERVERQUERY_PASSWORD](#teamspeak3_serverquery_password) - - [TEAMSPEAK3_VIRTUAL_SERVER](#teamspeak3_virtual_server) - - [TEAMSPEAK3_PUBLIC_URL](#teamspeak3_public_url) +If using Teamspeak3, the following need to be set in accordance with the [install instrictions](../services/teamspeak3.md) + - [TEAMSPEAK3_SERVER_IP](#teamspeak3-server-ip) + - [TEAMSPEAK3_SERVER_PORT](#teamspeak3-server-port) + - [TEAMSPEAK3_SERVERQUERY_USER](#teamspeak3-serverquery-user) + - [TEAMSPEAK3_SERVERQUERY_PASSWORD](#teamspeak3-serverquery-password) + - [TEAMSPEAK3_VIRTUAL_SERVER](#teamspeak3-virtual-server) + - [TEAMSPEAK3_PUBLIC_URL](#teamspeak3-public-url) ### Discord -If connecting to a Discord server, set the following - - [DISCORD_SERVER_ID](#discord_server_id) - - [DISCORD_USER_EMAIL](#discord_user_email) - - [DISCORD_USER_PASSWORD](#discord_user_password) +If connecting to a Discord server, set the following in accordance with the [install instructions](../services/discord.md) + - [DISCORD_GUILD_ID](#discord-guild-id) + - [DISCORD_BOT_TOKEN](#discord-bot-token) + - [DISCORD_INVITE_CODE](#discord-invite-code) + - [DISCORD_APP_ID](#discord-app-id) + - [DISCORD_APP_SECRET](#discord-app-secret) + - [DISCORD_CALLBACK_URL](#discord-callback-url) + - [DISCORD_SYNC_NAMES](#discord-sync-names) ### Discourse -If connecting to Discourse, set the following - - [DISCOURSE_URL](#discourse_url) - - [DISCOURSE_API_USERNAME](#discourse_api_username) - - [DISCOURSE_API_KEY](#discourse_api_key) - - [DISCOURSE_SSO_SECRET](#discourse_sso_secret) +If connecting to Discourse, set the following in accordance with the [install instructions](../services/discourse.md) + - [DISCOURSE_URL](#discourse-url) + - [DISCOURSE_API_USERNAME](#discourse-api-username) + - [DISCOURSE_API_KEY](#discourse-api-key) + - [DISCOURSE_SSO_SECRET](#discourse-sso-secret) ### IPSuite4 If using IPSuite4 (aka IPBoard4) the following are required: - - [IPS4_URL](#ips4_url) + - [IPS4_URL](#ips4-url) - the database needs to be defined ### SMF If using SMF the following are required: - - [SMF_URL](#smf_url) + - [SMF_URL](#smf-url) - the database needs to be defined ## Optional ### Standings To allow access to blues, a corp API key is required to pull standings from. Corp does not need to be owning corp or in owning alliance. Required mask is 16 (Communications/ContactList) - - [CORP_API_ID](#corp_api_id) - - [CORP_API_VCODE](#corp_api_vcode) + - [CORP_API_ID](#corp-api-id) + - [CORP_API_VCODE](#corp-api-vcode) -### Jacknife -To view APIs on a different Jacknife install, set [JACK_KNIFE_URL](#jack_knife_url) +### API Key Audit URL +To define what happens when an API is clicked, set according to [these instructions](#hr-configuration) + - [API_KEY_AUDIT_URL](#api-key-audit-url) ### Auto Groups Groups can be automatically assigned based on a user's corp or alliance. Set the following to `True` to enable this feature. - - [MEMBER_CORP_GROUPS](#member_corp_groups) - - [MEMBER_ALLIANCE_GROUPS](#member_alliance_groups) - - [BLUE_CORP_GROUPS](#blue_corp_groups) - - [BLUE_ALLIANCE_GROUPS](#blue_alliance_groups) + - [MEMBER_CORP_GROUPS](#member-corp-groups) + - [MEMBER_ALLIANCE_GROUPS](#member-alliance-groups) + - [BLUE_CORP_GROUPS](#blue-corp-groups) + - [BLUE_ALLIANCE_GROUPS](#blue-alliance-groups) ### Fleet-Up Fittings and operations can be imported from Fleet-Up. Define the following to do so. - - [FLEETUP_APP_KEY](#fleetup_app_key) - - [FLEETUP_USER_ID](#fleetup_user_id) - - [FLEETUP_API_ID](#fleetup_api_id) - - [FLEETUP_GROUP_ID](#fleetup_group_id) + - [FLEETUP_APP_KEY](#fleetup-app-key) + - [FLEETUP_USER_ID](#fleetup-user-id) + - [FLEETUP_API_ID](#fleetup-api-id) + - [FLEETUP_GROUP_ID](#fleetup-group-id) # Description of Settings ## Django @@ -166,7 +171,7 @@ A random string used in cryptographic functions, such as password hashing. Chang ### DEBUG Replaces the generic `SERVER ERROR (500)` page when an error is encountered with a page containing a traceback and variables. May expose sensitive information so not recommended for production. ### ALLOWED_HOSTS -A list of addresses used to validate headers: AllianceAuth will block connection coming from any other address unless `DEBUG` is `True`. This should be a list of URLs and IPs to allow. For instance, include 'mydomain.com', 'www.mydomain.com', and the server's IP address to ensure connections will be accepted. +A list of addresses used to validate headers: AllianceAuth will block connection coming from any other address. This should be a list of URLs and IPs to allow. In most cases, just adding `'example.com'` is sufficient. This also accepts the `'*'` wildcard for testing purposes. ### DATABASES List of databases available. Contains the Django database, and may include service ones if enabled. Service databases are defined in their individual sections and appended as needed automatically. ### LANGUAGE_CODE @@ -178,7 +183,7 @@ Absolute URL to serve static files from. ### STATIC_ROOT Root folder to store static files in. ### SUPERUSER_STATE_BYPASS -Overrides superuser account states to always return True on membership tests. If issues are encountered, or you want to test access to certain portions of the site, set to False to disable. +Overrides superuser account states to always return True on membership tests. If issues are encountered, or you want to test access to certain portions of the site, set to False to respect true states of superusers. ## EMAIL SETTINGS ### DOMAIN The URL to which emails will link. @@ -208,7 +213,7 @@ The application cliend ID generated from the [developers site.](https://develope ### ESI_SSO_CLIENT_SECRET The application secret key generated from the [developers site.](https://developers.eveonline.com) ### ESI_SSO_CALLBACK_URL -The callback URL for authentication handshake. Should be `https://mydomain.com/sso/callback`. +The callback URL for authentication handshake. Should be `https://example.com/sso/callback`. ## Default Group Settings ### DEFAULT_AUTH_GROUP Name of the group members of the owning corp or alliance are put in. @@ -318,8 +323,14 @@ The web address to access the Evernus Alliance Market application. ### MARKET_DB The Evernus Alliance Market database connection information. ## HR Configuration -### JACK_KNIFE_URL -Link to an install of [eve-jackknife](https://code.google.com/archive/p/eve-jackknife/) +### API_KEY_AUDIT_URL +This setting defines what happens when someone clicks on an API key (such as in corpstats or an application). + +Default behaviour is to show the verification code in a popup, but this can be set to link out to a website. + +The URL set here uses python string formatting notation. Variable names are enclosed in `{}` brackets. Three variable names are available: `api_id`, `vcode`, and `pk` (which is the primary key of the API in the database - only useful on the admin site). + +Example URL structures are provided. Jacknife can be installed on your server following [its setup guide.](../services/jacknife.md) ## IPBoard3 Configuration ### IPBOARD_ENDPOINT URL to the `index.php` file of a IPBoard install's API server. @@ -329,20 +340,20 @@ API key for accessing an IPBoard install's API Module to access while using the API ## XenForo Configuration ### XENFORO_ENDPOINT -The address of the XenForo API. Should look like `https://mydomain.com/forum/api.php` +The address of the XenForo API. Should look like `https://example.com/forum/api.php` ### XENFORO_DEFAULT_GROUP The group ID of the group to assign to member. Default is 0. ### XENFORO_APIKEY The API key generated from XenForo to allow API access. ## Jabber Configuration ### JABBER_URL -Address to instruct members to connect their jabber clients to, in order to reach an Openfire install. Usually just `mydomain.com` +Address to instruct members to connect their jabber clients to, in order to reach an Openfire install. Usually just `example.com` ### JABBER_PORT Port to instruct members to connect their jabber clients to, in order to reach an Openfire install. Usually 5223. ### JABBER_SERVER -Server name of an Openfire install. Usually `mydomain.com` +Server name of an Openfire install. Usually `example.com` ### OPENFIRE_ADDRESS -URL of the admin web interface for an Openfire install. Usually `http://mydomain.com:9090`. If HTTPS is desired, change port to 9091: `https://mydomain.com:9091` +URL of the admin web interface for an Openfire install. Usually `http://example.com:9090`. If HTTPS is desired, change port to 9091: `https://example.com:9091` ### OPENFIRE_SECRET_KEY Secret key used to authenticate with an Openfire admin interface. ### BROADCAST_USER @@ -368,7 +379,7 @@ Password to use when authenticating as the `TEAMSPEAK3_SERVERQUERY_USER`. Provid ### TEAMSPEAK3_VIRTUAL_SERVER ID of the server on which to manage users. Usually `1`. ### TEAMSPEAK3_PUBLIC_URL -Address to instruct members to connect their Teamspeak3 clients to. Usually `mydomain.com` +Address to instruct members to connect their Teamspeak3 clients to. Usually `example.com` ## Discord Configuration ### DISCORD_GUILD_ID The ID of a Discord server on which to manage users. @@ -381,7 +392,7 @@ The application ID obtained from defining an application on the [Discord develop ### DISCORD_APP_SECRET The application secret key obtained from defining an application on the [Discord developers site.](https://discordapp.com/developers/applications/me) ### DISCORD_CALLBACK_URL -The callback URL used for authenticaiton flow. Should be `https://mydomain.com/discord_callback`. Must match exactly the one used when defining the application. +The callback URL used for authenticaiton flow. Should be `https://example.com/discord_callback`. Must match exactly the one used when defining the application. ### DISCORD_SYNC_NAMES Override usernames on the server to match the user's main character. ## Discourse Configuration @@ -419,4 +430,5 @@ This section is used to manage how logging messages are processed. To turn off logging notifications, change the `handlers` `notifications` `class` to `logging.NullHandler` -## Everything below logging is magic. Do Not Touch +## Danger Zone +Everything below logging is magic. **Do not touch.** diff --git a/docs/installation/services/discord.md b/docs/installation/services/discord.md index 574bddbf..83f0dd4c 100644 --- a/docs/installation/services/discord.md +++ b/docs/installation/services/discord.md @@ -29,7 +29,7 @@ This returns a code that looks like `https://discord.gg/0fmA8MyXV6qt7XAZ`. The p Navigate to the [Discord Developers site.](https://discordapp.com/developers/applications/me) Press the plus sign to create a new application. -Give it a name and description relating to your auth site. Add a redirect to `https://mydomain.com/discord_callback`, substituting your domain. Press Create Application. +Give it a name and description relating to your auth site. Add a redirect to `https://example.com/discord_callback`, substituting your domain. Press Create Application. Update settings.py, inputting this redirect address as `DISCORD_CALLBACK_URL` diff --git a/docs/installation/services/discourse.md b/docs/installation/services/discourse.md index 21d4b658..49d19ba0 100644 --- a/docs/installation/services/discourse.md +++ b/docs/installation/services/discourse.md @@ -71,7 +71,7 @@ Discourse must run on its own subdomain - it can't handle routing behind an alia And enter the following, changing the port if you used a different number: - ServerName discourse.mydomain.com + ServerName discourse.example.com ProxyPass / http://0.0.0.0:7890/ ProxyPassReverse / http://0.0.0.0:7890/ @@ -94,22 +94,22 @@ Follow prompts, being sure to answer `y` when asked to allow admin privileges. ### Create API key -Navigate to `discourse.mydomain.com` and log on. Top right press the 3 lines and select `Admin`. Go to API tab and press `Generate Master API Key`. +Navigate to `discourse.example.com` and log on. Top right press the 3 lines and select `Admin`. Go to API tab and press `Generate Master API Key`. Now go to the allianceauth folder and edit settings: nano /home/allianceserver/allianceauth/alliance_auth/settings.py Scroll down to the Discourse section and set the following: - - `DISCOURSE_URL`: `discourse.mydomain.com` + - `DISCOURSE_URL`: `discourse.example.com` - `DISCOURSE_API_USERNAME`: the username of the admin account you generated the API key with - `DISCOURSE_API_KEY`: the key you just generated ### Configure SSO -Navigate to `discourse.mydomain.com` and log in. Back to the admin site, scroll down to find SSO settings and set the following: +Navigate to `discourse.example.com` and log in. Back to the admin site, scroll down to find SSO settings and set the following: - `enable_sso`: True - - `sso_url`: `http://mydomain.com/discourse_sso` + - `sso_url`: `http://example.com/discourse_sso` - `sso_secret`: some secure key Save, now change settings.py and add the following: diff --git a/docs/installation/services/ipboard3.md b/docs/installation/services/ipboard3.md index f3451380..fea7f887 100644 --- a/docs/installation/services/ipboard3.md +++ b/docs/installation/services/ipboard3.md @@ -14,7 +14,7 @@ IPBoard needs a database table. Log in to mysql and run: That’s all for SQL work. Control+D to close. -Navigate to http://yourdomain.com/ipboard and proceed with the install. If it whines about permissions make sure to `chown` again. Point it at that database we just made, using the `allianceserver` MySQL user account from the full install. +Navigate to http://example.com/ipboard and proceed with the install. If it whines about permissions make sure to `chown` again. Point it at that database we just made, using the `allianceserver` MySQL user account from the full install. Once you get everything installed we need to copy the api module folder @@ -29,7 +29,7 @@ Enable the API by toggling the `XML-RPC Status` from `disabled` to `enabled` (re Copy the API key. Now edit your settings.py as follows: - IPBOARD_APIKEY is the key you just copied - - IPBOARD_ENDPOINT is `http://yourdomain.com/ipboard/interface/board/index.php` + - IPBOARD_ENDPOINT is `http://example.com/ipboard/interface/board/index.php` Now enable IPBoard for Auth and/or Blue by editing the auth settings. diff --git a/docs/installation/services/jacknife.md b/docs/installation/services/jacknife.md index 53428576..b3eb4925 100644 --- a/docs/installation/services/jacknife.md +++ b/docs/installation/services/jacknife.md @@ -32,14 +32,14 @@ Add the database user information: Change ownership of the directory: `sudo chown -R www-data:www-data ../eve-jacknife` -Eve Jacknife can be served two ways: on its own subdomain (`jacknife.mydomain.com`) or as an alias (`mydomain.com/jacknife`) +Eve Jacknife can be served two ways: on its own subdomain (`jacknife.example.com`) or as an alias (`example.com/jacknife`) ### Subdomain As its own subdomain, create a new apache config: `sudo nano /etc/apache2/sites-available/jacknife.conf` and enter the following: DocumentRoot "/var/www/eve-jacknife" - ServerName jacknife.mydomain.com + ServerName jacknife.example.com Require all granted AllowOverride all @@ -68,4 +68,4 @@ Enter your database password and press Check. If all the boxes come back green p ## Update Auth Settings -Edit your aut settings file (`nano ~/allianceauth/alliance_auth/settings.py`) and replace `JACK_KNIFE_URL` with either `jacknife.mydomain.com/` or `mydomain.com/jacknife/` depending on your apache choice. \ No newline at end of file +Edit your aut settings file (`nano ~/allianceauth/alliance_auth/settings.py`) and replace `JACK_KNIFE_URL` with either `jacknife.example.com/` or `example.com/jacknife/` depending on your apache choice. \ No newline at end of file diff --git a/docs/installation/services/mumble.md b/docs/installation/services/mumble.md index ac3e24ef..7cc494c0 100644 --- a/docs/installation/services/mumble.md +++ b/docs/installation/services/mumble.md @@ -44,7 +44,7 @@ Now restart the server to see the changes reflected. sudo service mumble-server restart -That’s it! Your server is ready to be connected to at yourdomain.com:64738 +That’s it! Your server is ready to be connected to at example.com:64738 ## Configuring the Authenticator diff --git a/docs/installation/services/openfire.md b/docs/installation/services/openfire.md index 5b22bbd9..3b38a604 100644 --- a/docs/installation/services/openfire.md +++ b/docs/installation/services/openfire.md @@ -29,11 +29,11 @@ Now install from the debian. Replace the filename with your file name (the last sudo dpkg -i openfire_4.1.1_all.deb ### Web Configuration -The remainder of the setup occurs through Openfire’s web interface. Navigate to http://yourdomain.com:9090, or if you’re behind CloudFlare, go straight to your server’s IP:9090. +The remainder of the setup occurs through Openfire’s web interface. Navigate to http://example.com:9090, or if you’re behind CloudFlare, go straight to your server’s IP:9090. Select your language. I sure hope it’s english if you’re reading this guide. -Under Server Settings, set the Domain to `yourdomain.com` replacing it with your actual domain. Don’t touch the rest. +Under Server Settings, set the Domain to `example.com` replacing it with your actual domain. Don’t touch the rest. Under Database Settings, select `Standard Database Connection` @@ -78,7 +78,7 @@ Navigate to the `Server` tab, `Server Manager` subtab, and select `System Proper - Value: `True` - Do not encrypt this property value - Name: `plugin.broadcast.allowedUsers` - - Value: `broadcast@yourdomain.com`, replacing the domain name with yours + - Value: `broadcast@example.com`, replacing the domain name with yours - Do not encrypt this property value ### Group Chat diff --git a/docs/installation/services/pathfinder.md b/docs/installation/services/pathfinder.md index e53f243d..c84a7517 100644 --- a/docs/installation/services/pathfinder.md +++ b/docs/installation/services/pathfinder.md @@ -24,7 +24,7 @@ The logging and caching folders need to be created and have permission set. If u ## .htaccess Configuration -In your `pathfinder` directory there are two `.htaccess` files. The default installation instructions want you to choose one for rewriting purposes, and these force you to www.pathfinder.mydomain.com. Personally I don't like that. +In your `pathfinder` directory there are two `.htaccess` files. The default installation instructions want you to choose one for rewriting purposes, and these force you to www.pathfinder.example.com. Personally I don't like that. So we'll frankenstein our own. We'll use the HTTP one as a base: @@ -61,14 +61,14 @@ The default configuration should be fine in most cases. Edit all values with cau environment.ini - `SERVER` Should be changed to `PRODUCTION` - `BASE` is the full filesystem path to the application root on your server. In our case, `/var/www/pathfinder/` - - `URL` Is the URL to your app (without a trailing slash). In our case, `http://pathfinder.mydomain.com` + - `URL` Is the URL to your app (without a trailing slash). In our case, `http://pathfinder.example.com` - `DEBUG` sets the level of debugging (1,2 or 3) (check /logs for a more detail backtrace information) - `DB_*` sets your DB connection information - `SMTP_*` are used to send out emails, you will need an SMTP server login to make this work. (not required) - `SSO_CCP_*` follow the [official docs](https://github.com/exodus4d/pathfinder/wiki/CREST) ## Database Setup -This is done through the browser. Go to `pathfinder.yourdomain.com/setup` and see the [official docs](https://github.com/exodus4d/pathfinder/wiki/Database) for instructions. +This is done through the browser. Go to `pathfinder.example.com/setup` and see the [official docs](https://github.com/exodus4d/pathfinder/wiki/Database) for instructions. ## Cron Jobs Again the [official docs](https://github.com/exodus4d/pathfinder/wiki/Cronjob) do a good job here. diff --git a/docs/installation/services/phpbb3.md b/docs/installation/services/phpbb3.md index 91326696..429bd038 100644 --- a/docs/installation/services/phpbb3.md +++ b/docs/installation/services/phpbb3.md @@ -29,7 +29,7 @@ The web server needs read/write permission to this folder sudo chown -R www-data:www-data /var/www/forums ### Web Install -Navigate to http://yourdomain.com/forums where you will be presented with an installer. +Navigate to http://example.com/forums where you will be presented with an installer. Click on the `Install` tab. diff --git a/docs/installation/services/smf.md b/docs/installation/services/smf.md index b099bf25..60c0943c 100644 --- a/docs/installation/services/smf.md +++ b/docs/installation/services/smf.md @@ -29,7 +29,7 @@ The web server needs read/write permission to this folder sudo chown -R www-data:www-data /var/www/forums ### Web Install -Navigate to http://yourdomain.com/forums where you will be presented with an installer. +Navigate to http://example.com/forums where you will be presented with an installer. Click on the `Install` tab. diff --git a/docs/installation/services/teamspeak3.md b/docs/installation/services/teamspeak3.md index 0435182a..a96a9116 100644 --- a/docs/installation/services/teamspeak3.md +++ b/docs/installation/services/teamspeak3.md @@ -67,7 +67,7 @@ Click the URL provided to automatically connect to our server. It will prompt yo Now we need to make groups. AllianceAuth handles groups in teamspeak differently: instead of creating groups it creates an association between groups in TeamSpeak and groups in AllianceAuth. Go ahead and make the groups you want to associate with auth groups, keeping in mind multiple TeamSpeak groups can be associated with a single auth group. -Navigate back to the AllianceAuth admin interface (yourdomain.com/admin) and under `Services`, select `Auth / TS Groups`. In the top-right corner click `Add`. +Navigate back to the AllianceAuth admin interface (example.com/admin) and under `Services`, select `Auth / TS Groups`. In the top-right corner click `Add`. The dropdown box provides all auth groups. Select one and assign TeamSpeak groups from the panels below. If these panels are empty, wait a minute for the database update to run, or see the [troubleshooting section](#ts-group-models-not-populating-on-admin-site) below. diff --git a/eveonline/templatetags/__init__.py b/eveonline/templatetags/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/eveonline/templatetags/eveonline_extras.py b/eveonline/templatetags/eveonline_extras.py new file mode 100644 index 00000000..2e9d349f --- /dev/null +++ b/eveonline/templatetags/eveonline_extras.py @@ -0,0 +1,17 @@ +from django import template +from django.conf import settings +from django.utils.safestring import mark_safe + +register = template.Library() + + +@register.filter(name='api_link') +def api_link(api, style_class): + if settings.API_KEY_AUDIT_URL: + url = settings.API_KEY_AUDIT_URL.format(api_id=api.api_id, vcode=api.api_key, pk=api.pk) + element = "{api_id}".format(url=url, style=style_class, + api_id=api.api_id) + else: + element = "{api_id}".format( + style=style_class, prompt='"Verification Code"', vcode='"%s"' % api.api_key, api_id=api.api_id) + return mark_safe(element) diff --git a/hrapplications/models.py b/hrapplications/models.py index 85372faa..c76e3da4 100755 --- a/hrapplications/models.py +++ b/hrapplications/models.py @@ -15,7 +15,7 @@ class ApplicationQuestion(models.Model): help_text = models.CharField(max_length=254, blank=True, null=True) def __str__(self): - return "Question: " + self.title.encode('utf-8') + return "Question: " + self.title @python_2_unicode_compatible diff --git a/stock/templates/registered/hrapplicationview.html b/stock/templates/registered/hrapplicationview.html index 88d0e927..ec5b6afe 100644 --- a/stock/templates/registered/hrapplicationview.html +++ b/stock/templates/registered/hrapplicationview.html @@ -2,6 +2,7 @@ {% load staticfiles %} {% load bootstrap %} {% load i18n %} +{% load eveonline_extras %} {% block title %}Alliance Auth - View Application{% endblock %} {% block page_title %}{% trans "View Application" %}{% endblock page_title %} @@ -50,7 +51,8 @@ {% for char in app.characters %} - + {{ char.character_name }} {{ char.corporation_name }} @@ -58,63 +60,76 @@ {% endfor %} -
+
- {% for response in responses %} -
-
{{ response.question.title }}
-
{{ response.answer|linebreaksbr }}
-
- {% endfor %} + {% for response in responses %} +
+
{{ response.question.title }}
+
{{ response.answer|linebreaksbr }}
+
+ {% endfor %}
{% if buttons %} -
{% if perms.auth.human_resources %} -
-
{% trans "Actions" %}
- {% if app.approved == None %} - {% if app.reviewer == user %} - {% if perms.hrapplications.approve_application %} - {% trans "Approve" %} + {% if perms.hrapplications.view_apis %} +
+
+
{% trans 'API Keys' %}
+
+ {% for api in apis %} + {{ api|api_link:'btn btn-info' }} + {% endfor %} +
+
+
+ {% endif %} +
+
+
{% trans "Actions" %}
+ {% if app.approved == None %} + {% if app.reviewer == user %} + {% if perms.hrapplications.approve_application %} + {% trans "Approve" %} + {% endif %} + {% if perms.hrapplications.reject_application %} + {% trans "Reject" %} + {% endif %} + {% if perms.hrapplications.delete_application %} + {% trans "Delete" %} + {% endif %} + {% elif not app.reviewer %} + {% trans "Mark in Progress" %} {% endif %} - {% if perms.hrapplications.reject_application %} - {% trans "Reject" %} - {% endif %} - {% if perms.hrapplications.delete_application %} - {% trans "Delete" %} - {% endif %} - {% elif not app.reviewer %} - {% trans "Mark in Progress" %} {% endif %} - {% endif %} - {% if perms.hrapplications.add_applicationcomment %} - - {% endif %} - {% if perms.hrapplications.view_apis %} - {% for api in apis %} - {% trans "API" %} {{ api.api_id }} - {% endfor %} - {% endif %} + {% if perms.hrapplications.add_applicationcomment %} + + {% endif %} +
+ aria-labelledby="headingThree">
{% for comment in comments %}
{{ comment.text|linebreaks }}
@@ -124,32 +139,32 @@
{% endif %} -
{% endif %}
-{% if perms.hrapplications.add_applicationcomment %} -