Skip to content

Commit f3fa553

Browse files
Merge branch 'main' into web/lift-license-status-to-context
* main: (109 commits) translate: Updates for file web/xliff/en.xlf in fr (#8296) translate: Updates for file locale/en/LC_MESSAGES/django.po in fr (#8295) website: update wording (#8290) enterrpise: exclude inactive users from license (#8294) web: bump API Client version (#8292) core: compile backend translations (#8291) events: migrate SystemTasks to DB (#8159) web/admin: fix footer links not being parsed on settings page (#8289) root: fix system check warnings (#8277) web: bump API Client version (#8288) enterprise: add full audit log [AUTH-458] (#8177) web: bump the esbuild group in /web with 2 updates (#8282) web: bump the sentry group in /web with 1 update (#8281) web: bump @codemirror/lang-html from 6.4.7 to 6.4.8 in /web (#8283) core: bump bandit from 1.7.6 to 1.7.7 (#8285) core: bump selenium from 4.16.0 to 4.17.2 (#8284) core: bump github.com/go-openapi/runtime from 0.26.2 to 0.27.0 (#8287) core: bump github.com/google/uuid from 1.5.0 to 1.6.0 (#8286) website/docs: Improve example nginx reverse proxy config (#8160) translate: Updates for file web/xliff/en.xlf in zh_CN (#8274) ...
2 parents b93b5f2 + 035795d commit f3fa553

346 files changed

Lines changed: 21042 additions & 16125 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Setup authentik testing environment"
44
inputs:
55
postgresql_version:
66
description: "Optional postgresql image tag"
7-
default: "12"
7+
default: "16"
88

99
runs:
1010
using: "composite"
@@ -18,7 +18,7 @@ runs:
1818
- name: Setup python and restore poetry
1919
uses: actions/setup-python@v4
2020
with:
21-
python-version-file: 'pyproject.toml'
21+
python-version-file: "pyproject.toml"
2222
cache: "poetry"
2323
- name: Setup node
2424
uses: actions/setup-node@v3

.github/actions/setup/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.7"
22

33
services:
44
postgresql:
5-
image: docker.io/library/postgres:${PSQL_TAG:-12}
5+
image: docker.io/library/postgres:${PSQL_TAG:-16}
66
volumes:
77
- db-data:/var/lib/postgresql/data
88
environment:

.github/workflows/ci-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ jobs:
172172
run: |
173173
docker-compose -f tests/e2e/docker-compose.yml up -d
174174
- id: cache-web
175-
uses: actions/cache@v3
175+
uses: actions/cache@v4
176176
with:
177177
path: web/dist
178178
key: ${{ runner.os }}-web-${{ hashFiles('web/package-lock.json', 'web/src/**') }}

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ scripts/ @goauthentik/backend
1111
tests/ @goauthentik/backend
1212
pyproject.toml @goauthentik/backend
1313
poetry.lock @goauthentik/backend
14+
go.mod @goauthentik/backend
15+
go.sum @goauthentik/backend
1416
# Infrastructure
1517
.github/ @goauthentik/infrastructure
1618
Dockerfile @goauthentik/infrastructure

Makefile

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,18 @@ lint: ## Lint the python and golang sources
6767
pylint $(PY_SOURCES)
6868
golangci-lint run -v
6969

70+
core-install:
71+
poetry install
72+
7073
migrate: ## Run the Authentik Django server's migrations
7174
python -m lifecycle.migrate
7275

73-
i18n-extract: i18n-extract-core web-i18n-extract ## Extract strings that require translation into files to send to a translation service
76+
i18n-extract: core-i18n-extract web-i18n-extract ## Extract strings that require translation into files to send to a translation service
7477

75-
i18n-extract-core:
78+
core-i18n-extract:
7679
ak makemessages --ignore web --ignore internal --ignore web --ignore web-api --ignore website -l en
7780

78-
install: web-install website-install ## Install all requires dependencies for `web`, `website` and `core`
79-
poetry install
81+
install: web-install website-install core-install ## Install all requires dependencies for `web`, `website` and `core`
8082

8183
dev-drop-db:
8284
dropdb -U ${pg_user} -h ${pg_host} ${pg_name}
@@ -94,8 +96,14 @@ dev-reset: dev-drop-db dev-create-db migrate ## Drop and restore the Authentik
9496
#########################
9597

9698
gen-build: ## Extract the schema from the database
97-
AUTHENTIK_DEBUG=true ak make_blueprint_schema > blueprints/schema.json
98-
AUTHENTIK_DEBUG=true ak spectacular --file schema.yml
99+
AUTHENTIK_DEBUG=true \
100+
AUTHENTIK_TENANTS__ENABLED=true \
101+
AUTHENTIK_OUTPOSTS__DISABLE_EMBEDDED_OUTPOST=true \
102+
ak make_blueprint_schema > blueprints/schema.json
103+
AUTHENTIK_DEBUG=true \
104+
AUTHENTIK_TENANTS__ENABLED=true \
105+
AUTHENTIK_OUTPOSTS__DISABLE_EMBEDDED_OUTPOST=true \
106+
ak spectacular --file schema.yml
99107

100108
gen-changelog: ## (Release) generate the changelog based from the commits since the last tag
101109
git log --pretty=format:" - %s" $(shell git describe --tags $(shell git rev-list --tags --max-count=1))...$(shell git branch --show-current) | sort > changelog.md
@@ -114,12 +122,16 @@ gen-diff: ## (Release) generate the changelog diff between the current schema a
114122
sed -i 's/}/}/g' diff.md
115123
npx prettier --write diff.md
116124

117-
gen-clean:
118-
rm -rf gen-go-api/
125+
gen-clean-ts: ## Remove generated API client for Typescript
119126
rm -rf gen-ts-api/
120127
rm -rf web/node_modules/@goauthentik/api/
121128

122-
gen-client-ts: ## Build and install the authentik API for Typescript into the authentik UI Application
129+
gen-clean-go: ## Remove generated API client for Go
130+
rm -rf gen-go-api/
131+
132+
gen-clean: gen-clean-ts gen-clean-go ## Remove generated API clients
133+
134+
gen-client-ts: gen-clean-ts ## Build and install the authentik API for Typescript into the authentik UI Application
123135
docker run \
124136
--rm -v ${PWD}:/local \
125137
--user ${UID}:${GID} \
@@ -135,7 +147,7 @@ gen-client-ts: ## Build and install the authentik API for Typescript into the a
135147
cd gen-ts-api && npm i
136148
\cp -rfv gen-ts-api/* web/node_modules/@goauthentik/api
137149

138-
gen-client-go: ## Build and install the authentik API for Golang
150+
gen-client-go: gen-clean-go ## Build and install the authentik API for Golang
139151
mkdir -p ./gen-go-api ./gen-go-api/templates
140152
wget https://raw.githubusercontent.com/goauthentik/client-go/main/config.yaml -O ./gen-go-api/config.yaml
141153
wget https://raw.githubusercontent.com/goauthentik/client-go/main/templates/README.mustache -O ./gen-go-api/templates/README.mustache
@@ -155,7 +167,7 @@ gen-client-go: ## Build and install the authentik API for Golang
155167
gen-dev-config: ## Generate a local development config file
156168
python -m scripts.generate_config
157169

158-
gen: gen-build gen-clean gen-client-ts
170+
gen: gen-build gen-client-ts
159171

160172
#########################
161173
## Web

authentik/admin/api/system.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from rest_framework.views import APIView
1414

1515
from authentik.core.api.utils import PassiveSerializer
16+
from authentik.lib.config import CONFIG
1617
from authentik.lib.utils.reflection import get_env
1718
from authentik.outposts.apps import MANAGED_OUTPOST
1819
from authentik.outposts.models import Outpost
@@ -37,8 +38,9 @@ class SystemInfoSerializer(PassiveSerializer):
3738
http_host = SerializerMethodField()
3839
http_is_secure = SerializerMethodField()
3940
runtime = SerializerMethodField()
40-
tenant = SerializerMethodField()
41+
brand = SerializerMethodField()
4142
server_time = SerializerMethodField()
43+
embedded_outpost_disabled = SerializerMethodField()
4244
embedded_outpost_host = SerializerMethodField()
4345

4446
def get_http_headers(self, request: Request) -> dict[str, str]:
@@ -69,14 +71,18 @@ def get_runtime(self, request: Request) -> RuntimeDict:
6971
"uname": " ".join(platform.uname()),
7072
}
7173

72-
def get_tenant(self, request: Request) -> str:
73-
"""Currently active tenant"""
74-
return str(request._request.tenant)
74+
def get_brand(self, request: Request) -> str:
75+
"""Currently active brand"""
76+
return str(request._request.brand)
7577

7678
def get_server_time(self, request: Request) -> datetime:
7779
"""Current server time"""
7880
return now()
7981

82+
def get_embedded_outpost_disabled(self, request: Request) -> bool:
83+
"""Whether the embedded outpost is disabled"""
84+
return CONFIG.get_bool("outposts.disable_embedded_outpost", False)
85+
8086
def get_embedded_outpost_host(self, request: Request) -> str:
8187
"""Get the FQDN configured on the embedded outpost"""
8288
outposts = Outpost.objects.filter(managed=MANAGED_OUTPOST)

authentik/admin/api/tasks.py

Lines changed: 0 additions & 134 deletions
This file was deleted.

authentik/admin/apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ class AuthentikAdminConfig(ManagedAppConfig):
1515
verbose_name = "authentik Admin"
1616
default = True
1717

18-
def reconcile_load_admin_signals(self):
18+
def reconcile_global_load_admin_signals(self):
1919
"""Load admin signals"""
2020
self.import_module("authentik.admin.signals")

authentik/admin/signals.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""admin signals"""
22
from django.dispatch import receiver
33

4-
from authentik.admin.api.tasks import TaskInfo
54
from authentik.admin.apps import GAUGE_WORKERS
65
from authentik.root.celery import CELERY_APP
76
from authentik.root.monitoring import monitoring_set
@@ -12,10 +11,3 @@ def monitoring_set_workers(sender, **kwargs):
1211
"""Set worker gauge"""
1312
count = len(CELERY_APP.control.ping(timeout=0.5))
1413
GAUGE_WORKERS.set(count)
15-
16-
17-
@receiver(monitoring_set)
18-
def monitoring_set_tasks(sender, **kwargs):
19-
"""Set task gauges"""
20-
for task in TaskInfo.all().values():
21-
task.update_metrics()

authentik/admin/tasks.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@
1111
from authentik import __version__, get_build_hash
1212
from authentik.admin.apps import PROM_INFO
1313
from authentik.events.models import Event, EventAction, Notification
14-
from authentik.events.monitored_tasks import (
15-
MonitoredTask,
16-
TaskResult,
17-
TaskResultStatus,
18-
prefill_task,
19-
)
14+
from authentik.events.system_tasks import SystemTask, TaskStatus, prefill_task
2015
from authentik.lib.config import CONFIG
2116
from authentik.lib.utils.http import get_http_session
2217
from authentik.root.celery import CELERY_APP
@@ -54,13 +49,13 @@ def clear_update_notifications():
5449
notification.delete()
5550

5651

57-
@CELERY_APP.task(bind=True, base=MonitoredTask)
52+
@CELERY_APP.task(bind=True, base=SystemTask)
5853
@prefill_task
59-
def update_latest_version(self: MonitoredTask):
54+
def update_latest_version(self: SystemTask):
6055
"""Update latest version info"""
6156
if CONFIG.get_bool("disable_update_check"):
6257
cache.set(VERSION_CACHE_KEY, "0.0.0", VERSION_CACHE_TIMEOUT)
63-
self.set_status(TaskResult(TaskResultStatus.WARNING, messages=["Version check disabled."]))
58+
self.set_status(TaskStatus.WARNING, "Version check disabled.")
6459
return
6560
try:
6661
response = get_http_session().get(
@@ -70,9 +65,7 @@ def update_latest_version(self: MonitoredTask):
7065
data = response.json()
7166
upstream_version = data.get("stable", {}).get("version")
7267
cache.set(VERSION_CACHE_KEY, upstream_version, VERSION_CACHE_TIMEOUT)
73-
self.set_status(
74-
TaskResult(TaskResultStatus.SUCCESSFUL, ["Successfully updated latest Version"])
75-
)
68+
self.set_status(TaskStatus.SUCCESSFUL, "Successfully updated latest Version")
7669
_set_prom_info()
7770
# Check if upstream version is newer than what we're running,
7871
# and if no event exists yet, create one.
@@ -89,7 +82,7 @@ def update_latest_version(self: MonitoredTask):
8982
Event.new(EventAction.UPDATE_AVAILABLE, **event_dict).save()
9083
except (RequestException, IndexError) as exc:
9184
cache.set(VERSION_CACHE_KEY, "0.0.0", VERSION_CACHE_TIMEOUT)
92-
self.set_status(TaskResult(TaskResultStatus.ERROR).with_error(exc))
85+
self.set_error(exc)
9386

9487

9588
_set_prom_info()

0 commit comments

Comments
 (0)