# Alliance Auth EVE University Core
EVE University Core Services for [Alliance Auth](https://gitlab.com/allianceauth/allianceauth)
![License](https://img.shields.io/badge/license-MIT-green)
![python](https://img.shields.io/badge/python-3.8-informational)
![django](https://img.shields.io/badge/django-4.0-informational)
![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)
## Features
- EVE University template/theme adapted from Bootswatch Slate v3.4.1
- Extends Alliance Auth's authenticate backend to fake email registration
- Extends Django Template Engine to allow this app to override any templates
## Future Plans
- Add support for more core EVE Uni services such as Wiki, Mumble, etc.
## How to Use It
This application can be installed via EVE Uni's PyPi repo, built and installed, or installed from the sour ce.
It is designed solely to provide the Alliance Auth/Django overrides, extensions, or services needed by EVE University.
**Example production installation**
```bash
pip install aa-euni-core
python myauth/manage.py collectstatic
```
Add these lines somewhere in your local.py:
### Cloning From Repo
When cloning from the repo we will assume you are using a dev environment (e.g. aa-dev) and you will be installing this
app under one top folder.
Something like this:
```text
aa-dev
|- venv/
|- myauth/
|- aa-euni-core
|- (other AA projects ...)
```
Then just cd into the top folder (e.g. aa-dev) and clone the repo.
Finally, enable [pre-commit](https://pre-commit.com) to enable automatic code style
checking.
```bash
git clone https://github.com/EVE-University/aa-euni-core.git
cd aa-euni-core
pre-commit install
```
## Writing Unit Tests
Write your unit tests in `aa-eveuni-core/eunicore/tests/` and make sure that you use a "test\_"
prefix for files with your unit tests.
## Installing Into Your Dev AA
Once you have cloned or copied all files into place you are ready to install it to your dev AA instance.
Make sure you are in your venv. Then install it with pip in editable mode:
```bash
pip install -e aa-euni-core
```
First add the following to your Django project's `local.py`:
```python
INSTALLED_APPS += ["eunicore"]
AUTHENTICATION_BACKENDS = [
"eunicore.auth.backends.EUniBackend",
"django.contrib.auth.backends.ModelBackend",
]
TEMPLATES[0]["BACKEND"] = "eunicore.template.backends.EUniDjangoTemplates"
```
Next collect statics:
```bash
python manage.py collectstatic
```
Then run a check to see if everything is set up correctly.
```bash
python manage.py check
```
In case they are errors make sure to fix them before proceeding.
Finally, restart your AA server and that's it.
## Installing Into Production AA
To install your plugin into a production AA run this command within the virtual
Python environment of your AA installation:
```bash
pip install git+https://github.com/EVE-University/aa-euni-core.git
```
Note you may need a personal access token
Alternatively you can create a package file from the repo and manually upload it to your
production AA:
```bash
make build
```
You'll find the package under `./dist/aa_euni_core.tar.gz` after this.
Install your package directly from the package file:
```bash
pip install aa_euni_core.tar.gz
```
Add the following to your production's `local.py`:
```python
INSTALLED_APPS += ["eunicore"]
AUTHENTICATION_BACKENDS = [
"eunicore.auth.backends.EUniBackend",
"django.contrib.auth.backends.ModelBackend",
]
TEMPLATES[0]["BACKEND"] = "eunicore.template.backends.EUniDjangoTemplates"
```
## Components
This app breaks up most of its functionality into descrete components.
### Auth Backend
Extends `allianceauth.authentication.backends.StateBackend` create_user() method which is called
by authenticate() when a user isn't registered. The overriden create_user() method activates the
created user account and defines a `[user_id]@eveuniversity.org` as the email.
### Template Backend
Extends `django.template.backends.django.DjangoTemplates` to add the `eunicore/templates` to the
template loader's dirs if it isn't already present.
### Templates
The `eunicore/templates` directory can be used to override any template file used by the
Alliance Auth application.
### AA v4.x Theme
Add `eunicore.theme.slate` to INSTALLED_APPS.
Add the following to `local.py` as well if you only the Slate theme available.
```python
# Sets default theme to Slate.
DEFAULT_THEME = "eunicore.theme.slate.auth_hooks.SlateThemeHook"
# Legacy AAv3 user.profile.night_mode=1. This is the default set by the EUni Auth Backend.
DEFAULT_THEME_DARK = "eunicore.theme.slate.auth_hooks.SlateThemeHook"
# Remove the default BS5 themes
INSTALLED_APPS.remove("allianceauth.theme.darkly")
INSTALLED_APPS.remove("allianceauth.theme.flatly")
INSTALLED_APPS.remove("allianceauth.theme.materia")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/EVE-University/aa-euni-core",
"name": "aa-euni-core",
"maintainer": "Marn Vermuldir",
"docs_url": null,
"requires_python": "~=3.8",
"maintainer_email": "marn@minin.io",
"keywords": "allianceauth, eunicore",
"author": "Marn Vermuldir",
"author_email": "marn@minin.io",
"download_url": "https://files.pythonhosted.org/packages/7b/d4/ccfd78356b3148703d7a84dd12babf81c2c5ecf5b6057a1376761e30bf28/aa_euni_core-0.1.1.tar.gz",
"platform": null,
"description": "# Alliance Auth EVE University Core\n\nEVE University Core Services for [Alliance Auth](https://gitlab.com/allianceauth/allianceauth)\n\n\n![License](https://img.shields.io/badge/license-MIT-green)\n![python](https://img.shields.io/badge/python-3.8-informational)\n![django](https://img.shields.io/badge/django-4.0-informational)\n![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)\n\n## Features\n\n- EVE University template/theme adapted from Bootswatch Slate v3.4.1\n- Extends Alliance Auth's authenticate backend to fake email registration\n- Extends Django Template Engine to allow this app to override any templates\n\n## Future Plans\n- Add support for more core EVE Uni services such as Wiki, Mumble, etc.\n\n## How to Use It\n\nThis application can be installed via EVE Uni's PyPi repo, built and installed, or installed from the sour ce.\n\nIt is designed solely to provide the Alliance Auth/Django overrides, extensions, or services needed by EVE University.\n\n**Example production installation**\n```bash\npip install aa-euni-core\n\npython myauth/manage.py collectstatic\n```\n\nAdd these lines somewhere in your local.py:\n\n### Cloning From Repo\n\nWhen cloning from the repo we will assume you are using a dev environment (e.g. aa-dev) and you will be installing this\napp under one top folder.\n\nSomething like this:\n```text\naa-dev\n|- venv/\n|- myauth/\n|- aa-euni-core\n|- (other AA projects ...)\n```\n\nThen just cd into the top folder (e.g. aa-dev) and clone the repo.\nFinally, enable [pre-commit](https://pre-commit.com) to enable automatic code style\nchecking.\n\n```bash\ngit clone https://github.com/EVE-University/aa-euni-core.git\ncd aa-euni-core\npre-commit install\n```\n\n## Writing Unit Tests\n\nWrite your unit tests in `aa-eveuni-core/eunicore/tests/` and make sure that you use a \"test\\_\"\nprefix for files with your unit tests.\n\n## Installing Into Your Dev AA\n\nOnce you have cloned or copied all files into place you are ready to install it to your dev AA instance.\n\nMake sure you are in your venv. Then install it with pip in editable mode:\n\n```bash\npip install -e aa-euni-core\n```\n\nFirst add the following to your Django project's `local.py`:\n```python\nINSTALLED_APPS += [\"eunicore\"]\n\nAUTHENTICATION_BACKENDS = [\n \"eunicore.auth.backends.EUniBackend\",\n \"django.contrib.auth.backends.ModelBackend\",\n]\n\nTEMPLATES[0][\"BACKEND\"] = \"eunicore.template.backends.EUniDjangoTemplates\"\n```\n\n\nNext collect statics:\n\n```bash\npython manage.py collectstatic\n```\n\nThen run a check to see if everything is set up correctly.\n\n```bash\npython manage.py check\n```\n\n\nIn case they are errors make sure to fix them before proceeding.\n\nFinally, restart your AA server and that's it.\n\n## Installing Into Production AA\n\nTo install your plugin into a production AA run this command within the virtual\nPython environment of your AA installation:\n\n```bash\npip install git+https://github.com/EVE-University/aa-euni-core.git\n```\nNote you may need a personal access token\n\nAlternatively you can create a package file from the repo and manually upload it to your\nproduction AA:\n\n```bash\nmake build\n```\n\nYou'll find the package under `./dist/aa_euni_core.tar.gz` after this.\n\nInstall your package directly from the package file:\n\n```bash\npip install aa_euni_core.tar.gz\n```\n\nAdd the following to your production's `local.py`:\n```python\nINSTALLED_APPS += [\"eunicore\"]\n\nAUTHENTICATION_BACKENDS = [\n \"eunicore.auth.backends.EUniBackend\",\n \"django.contrib.auth.backends.ModelBackend\",\n]\n\nTEMPLATES[0][\"BACKEND\"] = \"eunicore.template.backends.EUniDjangoTemplates\"\n```\n\n## Components\nThis app breaks up most of its functionality into descrete components.\n### Auth Backend\nExtends `allianceauth.authentication.backends.StateBackend` create_user() method which is called\nby authenticate() when a user isn't registered. The overriden create_user() method activates the\ncreated user account and defines a `[user_id]@eveuniversity.org` as the email.\n\n### Template Backend\nExtends `django.template.backends.django.DjangoTemplates` to add the `eunicore/templates` to the\ntemplate loader's dirs if it isn't already present.\n\n### Templates\nThe `eunicore/templates` directory can be used to override any template file used by the\nAlliance Auth application.\n\n### AA v4.x Theme\n\nAdd `eunicore.theme.slate` to INSTALLED_APPS.\n\nAdd the following to `local.py` as well if you only the Slate theme available.\n\n```python\n# Sets default theme to Slate.\nDEFAULT_THEME = \"eunicore.theme.slate.auth_hooks.SlateThemeHook\"\n\n# Legacy AAv3 user.profile.night_mode=1. This is the default set by the EUni Auth Backend.\nDEFAULT_THEME_DARK = \"eunicore.theme.slate.auth_hooks.SlateThemeHook\"\n\n# Remove the default BS5 themes\nINSTALLED_APPS.remove(\"allianceauth.theme.darkly\")\nINSTALLED_APPS.remove(\"allianceauth.theme.flatly\")\nINSTALLED_APPS.remove(\"allianceauth.theme.materia\")\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "EVE University Core Plugin for Alliance Auth",
"version": "0.1.1",
"project_urls": {
"Changelog": "https://github.com/EVE-University/aa-euni-core/blob/master/CHANGELOG.md",
"Homepage": "https://github.com/EVE-University/aa-euni-core",
"Issue / Bug Reports": "https://github.com/EVE-University/aa-euni-core/issues"
},
"split_keywords": [
"allianceauth",
" eunicore"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5bd80d17bf7938e3d921f47dc36b011aa3deb8a092732a26e2bd666fa54dc37e",
"md5": "531dc7faafda892d3140c95f95fbc5fd",
"sha256": "2104b2eebb9f4203f5fe22ea537d4e3cea38c9f2875d628b73b03fecaab485a4"
},
"downloads": -1,
"filename": "aa_euni_core-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "531dc7faafda892d3140c95f95fbc5fd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 326660,
"upload_time": "2024-10-10T22:01:12",
"upload_time_iso_8601": "2024-10-10T22:01:12.844152Z",
"url": "https://files.pythonhosted.org/packages/5b/d8/0d17bf7938e3d921f47dc36b011aa3deb8a092732a26e2bd666fa54dc37e/aa_euni_core-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7bd4ccfd78356b3148703d7a84dd12babf81c2c5ecf5b6057a1376761e30bf28",
"md5": "8a38633bf5e0d6183fed4d9d48e30dbc",
"sha256": "9df78f2219591f4903aee1218a8358466bf427072c29c7a72d2d522be7f59233"
},
"downloads": -1,
"filename": "aa_euni_core-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "8a38633bf5e0d6183fed4d9d48e30dbc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 323916,
"upload_time": "2024-10-10T22:01:14",
"upload_time_iso_8601": "2024-10-10T22:01:14.916255Z",
"url": "https://files.pythonhosted.org/packages/7b/d4/ccfd78356b3148703d7a84dd12babf81c2c5ecf5b6057a1376761e30bf28/aa_euni_core-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-10 22:01:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "EVE-University",
"github_project": "aa-euni-core",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "aa-euni-core"
}