Skip to content

Commit

Permalink
Merge branch 'goauthentik:main' into sdko/integrations/pgadmin/refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
4d62 authored Jan 11, 2025
2 parents 7e71ca7 + 84de155 commit 2568f38
Show file tree
Hide file tree
Showing 10 changed files with 173 additions and 357 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.2.0
uses: docker/setup-qemu-action@v3.3.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: prepare variables
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-outpost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.2.0
uses: docker/setup-qemu-action@v3.3.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: prepare variables
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.2.0
uses: docker/setup-qemu-action@v3.3.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: prepare variables
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
with:
go-version-file: "go.mod"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.2.0
uses: docker/setup-qemu-action@v3.3.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: prepare variables
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.10.0
github.com/wwt/guac v1.3.2
goauthentik.io/api/v3 v3.2024121.3
goauthentik.io/api/v3 v3.2024122.1
golang.org/x/exp v0.0.0-20230210204819-062eb4c674ab
golang.org/x/oauth2 v0.25.0
golang.org/x/sync v0.10.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
goauthentik.io/api/v3 v3.2024121.3 h1:0s4a/3ktiGEr0jbIJqm8PNHWhYD8vwuoI8SCQo1ptiI=
goauthentik.io/api/v3 v3.2024121.3/go.mod h1:zz+mEZg8rY/7eEjkMGWJ2DnGqk+zqxuybGCGrR2O4Kw=
goauthentik.io/api/v3 v3.2024122.1 h1:LsGUztpcDrKN2XY+//ITQm9GE0Iplc3wWHQN9QO9fQg=
goauthentik.io/api/v3 v3.2024122.1/go.mod h1:zz+mEZg8rY/7eEjkMGWJ2DnGqk+zqxuybGCGrR2O4Kw=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down
389 changes: 71 additions & 318 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pydantic-scim = "*"
pyjwt = "*"
pyrad = "*"
python = "~3.12"
python-kadmin-rs = "0.5.2"
python-kadmin-rs = "0.5.3"
pyyaml = "*"
requests-oauthlib = "*"
scim2-filter-parser = "*"
Expand Down
105 changes: 84 additions & 21 deletions website/docs/developer-docs/setup/full-dev-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
title: Full development environment
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';

## Requirements

- Python 3.12
- Poetry, which is used to manage dependencies
- Go 1.23 or newer
- Node.js 21 or newer
- PostgreSQL 14 or newer
- Redis (any recent version will do)
- [Python](https://www.python.org/) 3.12
- [Poetry](https://python-poetry.org/), which is used to manage dependencies
- Poetry 2.0 or higher also requires the [poetry-plugin-shell](https://github.com/python-poetry/poetry-plugin-shell) extension.
- [Go](https://go.dev/) 1.23 or newer
- [Node.js](https://nodejs.org/en) 21 or newer
- [PostgreSQL](https://www.postgresql.org/) 14 or newer
- [Redis](https://redis.io/) (any recent version will do)
- [Docker](https://www.docker.com/) (Community Edition will do)

## Services Setup

Expand All @@ -23,61 +29,108 @@ If you use locally installed databases, the PostgreSQL credentials given to auth
## Backend Setup

:::info
Depending on your platform, some native dependencies might be required. On macOS, run `brew install libxmlsec1 libpq krb5`, and for the CLI tools `brew install postgresql redis node@20`.
Depending on your platform, some native dependencies might be required.

<Tabs
defaultValue={ (ExecutionEnvironment.canUseDOM) ? (() => {
const ua = window.navigator.userAgent.toLowerCase();
return ["linux", "windows", "mac"].find((p) => ua.includes(p)) || "mac";
})() : "mac" }

values={[
{label: "macOS", value: "mac"},
{label: "Linux", value: "linux"},
{label: "Windows", value: "windows"},
]}>

<TabItem value="mac">
To install the native dependencies on macOS, run:

```sh
$ pip install poetry poetry-plugin-shell
$ brew install libxmlsec1 libpq krb5 # Required development libraries,
$ brew install postgresql redis node@22 golangci-lint # Required CLI tools
```
</TabItem>
<TabItem value="linux">
To install native dependencies on Debian or Ubuntu, run:
```sh
$ pip install poetry poetry-plugin-shell
$ sudo apt-get install libgss-dev krb5-config libkrb5-dev postgresql-server-dev-all
$ sudo apt-get install postresql redis
```

Adjust your needs as required for other distributions such as Red Hat, SUSE, or Arch.

Install golangci-lint locally [from the site
instructions](https://golangci-lint.run/welcome/install/#other-ci).

</TabItem>

<TabItem value="windows">[We request community input on running the full dev environment on Windows]</TabItem>

</Tabs>

:::

1. Create an isolated Python environment. To create the environment and install dependencies, run the following commands in the same directory as your local authentik git repository:

```shell
poetry shell # Creates a python virtualenv, and activates it in a new shell
make install # Installs all required dependencies for Python and Javascript, including development dependencies
poetry shell # Creates a python virtualenv, and activates it in a new shell
make install # Installs all required dependencies for Python and Javascript, including development dependencies
```

2. Configure authentik to use the local databases using a local config file. To generate this file, run the following command in the same directory as your local authentik git repository:

```shell
make gen-dev-config # Generates a local config file
make gen-dev-config # Generates a local config file
```

Generally speaking, authentik is a Django application, ran by gunicorn, proxied by a Go application. The Go application serves static files.

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.

Before committing code, run the following commands in the same directory as your local authentik git repository:

```shell
make lint # Ensures your code is well-formatted
make gen # Generates an updated OpenAPI Docs for any changes you make
```

## Frontend Setup

By default, no compiled bundle of the frontend is included so this step is required even if you're not developing for the UI.

The UI requires the authentik API files for Typescript be built and installed:

```
$ make migrate # On a fresh install, ensures the API schema file is available
$ make gen # Generates the API based on the schema file
```

If you make changes to the authentik API, you must re-run `make gen` so that the corresponding
changes are made to the API library that is used by the UI.

To build the UI once, run the following command in the same directory as your local authentik git repository:

```shell
make web-build # Builds the UI once
make web-build # Builds the UI once
```

If you want to live-edit the UI, you can run the following command in the same directory as your local authentik git repository instead, which will immediately update the UI with any changes you make so you can see the results in real time without needing to rebuild:

```shell
make web-watch # Updates the UI with any changes you make
make web-watch # Updates the UI with any changes you make
```

To format the frontend code, run the following command in the same directory as your authentik git repository:

```shell
make web # Formats the frontend code
make web # Formats the frontend code
```

## Running authentik

Now that the backend and frontend have been setup and built, you can start authentik by running the following command in the same directory as your local authentik git repository:

```shell
ak server # Starts authentik server
ak server # Starts authentik server
```

And now, authentik should now be accessible at `http://localhost:9000`.
Expand All @@ -87,3 +140,13 @@ To define a password for the default admin (called **akadmin**), you can manuall

In case of issues in this process, feel free to use `make dev-reset` which drops and restores the Authentik PostgreSQL instance to a "fresh install" state.
:::

## Submitting Pull Requests

Before submitting a pull request, run the following commands in the same directory as your local authentik git repository:

```shell
make lint # Ensures your code is well-formatted
make gen # Generates an updated OpenAPI Docs for any changes you make
make web # Formats the front-end code
```
16 changes: 8 additions & 8 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
"@docusaurus/tsconfig": "^3.7.0",
"@docusaurus/types": "^3.3.2",
"@types/react": "^18.3.13",
"aws-cdk": "^2.174.1",
"aws-cdk": "^2.175.0",
"cross-env": "^7.0.3",
"prettier": "3.4.2",
"typescript": "~5.7.2",
"typescript": "~5.7.3",
"wireit": "^0.14.9"
},
"wireit": {
Expand Down

0 comments on commit 2568f38

Please sign in to comment.