website: separate development docs

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-04-18 17:25:03 +02:00
parent 8628595590
commit 84ce2c1df2
5 changed files with 45 additions and 11 deletions

View File

@ -1,11 +0,0 @@
---
title: API
---
Starting with 2021.3.5, every authentik instance has a built-in API browser, which can be accessed at https://authentik.company/api/v2beta/.
To generate an API client, you can use the Swagger schema at https://authentik.company/api/v2beta/swagger.json.
While testing, the API requests are authenticated by your browser session. To send an API request from outside the browser, you need to set an `Authorization` header.
The value needs to be set to the base64-encoded token key.

View File

@ -1,56 +0,0 @@
---
title: Setting up a local dev environment
---
## Backend
To create a local development setup for authentik, you need the following:
- Python 3.9
- pipenv, which is used to manage dependencies, and can be installed with `pip install pipenv`
- PostgreSQL (any recent version will do)
- Redis (any recent version will do)
For PostgreSQL and Redis, you can use the docker-compose file in `scripts/`. You can also use a native install, if you prefer.
To configure authentik to use the local databases, create a file in the authentik directory called `local.env.yml`, with the following contents
```yaml
debug: true
postgresql:
user: postgres
log_level: debug
```
Afterwards, you can start authentik by running `./manage.py runserver`. Generally speaking, authentik is a Django application.
Most functions and classes have type-hints and docstrings, so it is recommended to install a Python Type-checking Extension in your IDE to navigate around the code.
## Frontend
By default, no transpiled bundle of the frontend is included. To build the UI, you need Node 12 or newer.
The Frontend also uses a generated API client to talk with the backend. To generate this client, you can use the [openapitools/openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator) CLI tool.
If you want to generate the client without installing anything, run this command:
```shell
docker run \
--rm -v $(pwd):/local \
openapitools/openapi-generator-cli generate \
-i /local/swagger.yaml \
-g typescript-fetch \
-o /local/web/api \
--additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=authentik-api,npmVersion=1.0.0
```
To build the UI, run these commands:
```
cd web/
npm i
npm run build
```
If you want to make changes to the UI, run `npm run watch` instead.