mirror of
https://github.com/goauthentik/authentik
synced 2026-05-15 03:16:22 +02:00
Compare commits
6 Commits
sdko/remov
...
pgdog-pool
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ee2e70f7b | ||
|
|
3d1f28c6c0 | ||
|
|
66d8c04404 | ||
|
|
776f691c00 | ||
|
|
c5f9a25a84 | ||
|
|
fa06af35e5 |
7
.github/actions/setup/compose.yml
vendored
7
.github/actions/setup/compose.yml
vendored
@@ -11,6 +11,13 @@ services:
|
||||
ports:
|
||||
- 5432:5432
|
||||
restart: always
|
||||
pgdog:
|
||||
image: ghcr.io/pgdogdev/pgdog:latest
|
||||
volumes:
|
||||
- ./pgdog.toml:/pgdog/pgdog.toml:ro
|
||||
ports:
|
||||
- 127.0.0.1:6432:6432
|
||||
restart: always
|
||||
s3:
|
||||
container_name: s3
|
||||
image: docker.io/zenko/cloudserver
|
||||
|
||||
18
.github/actions/setup/pgdog.toml
vendored
Normal file
18
.github/actions/setup/pgdog.toml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
[general]
|
||||
host = "[::]"
|
||||
port = 6432
|
||||
passthrough_auth = "enabled_plain"
|
||||
prepared_statements = "extended_anonymous"
|
||||
pub_sub_channel_size = 8192
|
||||
|
||||
[admin]
|
||||
password = "admin"
|
||||
[[databases]]
|
||||
host = "postgresql"
|
||||
name = "postgres"
|
||||
[[databases]]
|
||||
host = "postgresql"
|
||||
name = "authentik"
|
||||
[[databases]]
|
||||
host = "postgresql"
|
||||
name = "test_authentik"
|
||||
13
.github/workflows/ci-main.yml
vendored
13
.github/workflows/ci-main.yml
vendored
@@ -128,7 +128,7 @@ jobs:
|
||||
CI_RUN_ID: ${{ matrix.run_id }}
|
||||
CI_TOTAL_RUNS: "5"
|
||||
run: |
|
||||
uv run make ci-test
|
||||
make ci-test glob="authentik"
|
||||
- uses: ./.github/actions/test-results
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
@@ -157,7 +157,7 @@ jobs:
|
||||
CI_RUN_ID: ${{ matrix.run_id }}
|
||||
CI_TOTAL_RUNS: "5"
|
||||
run: |
|
||||
uv run make ci-test
|
||||
make ci-test glob="authentik"
|
||||
- uses: ./.github/actions/test-results
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
@@ -173,8 +173,7 @@ jobs:
|
||||
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
|
||||
- name: run integration
|
||||
run: |
|
||||
uv run coverage run manage.py test tests/integration
|
||||
uv run coverage xml
|
||||
make ci-test glob="tests/integration"
|
||||
- uses: ./.github/actions/test-results
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
@@ -229,8 +228,7 @@ jobs:
|
||||
npm run build:sfe
|
||||
- name: run e2e
|
||||
run: |
|
||||
uv run coverage run manage.py test ${{ matrix.job.glob }}
|
||||
uv run coverage xml
|
||||
make ci-test glob="${{ matrix.job.glob }}"
|
||||
- uses: ./.github/actions/test-results
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
@@ -272,8 +270,7 @@ jobs:
|
||||
npm run build:sfe
|
||||
- name: run conformance
|
||||
run: |
|
||||
uv run coverage run manage.py test ${{ matrix.job.glob }}
|
||||
uv run coverage xml
|
||||
make ci-test glob="${{ matrix.job.glob }}"
|
||||
- uses: ./.github/actions/test-results
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
|
||||
15
Makefile
15
Makefile
@@ -126,17 +126,22 @@ install: node-install docs-install core-install ## Install all requires depende
|
||||
|
||||
dev-drop-db:
|
||||
$(eval pg_user := $(shell $(UV) run python -m authentik.lib.config postgresql.user 2>/dev/null))
|
||||
$(eval pg_pass := $(shell $(UV) run python -m authentik.lib.config postgresql.password 2>/dev/null))
|
||||
$(eval pg_host := $(shell $(UV) run python -m authentik.lib.config postgresql.host 2>/dev/null))
|
||||
$(eval pg_name := $(shell $(UV) run python -m authentik.lib.config postgresql.name 2>/dev/null))
|
||||
dropdb -U ${pg_user} -h ${pg_host} ${pg_name} || true
|
||||
PGPASSWORD="${pg_pass}" psql -U ${pg_user} -h ${pg_host} postgres -c "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '${pg_name}'"
|
||||
PGPASSWORD="${pg_pass}" dropdb -U ${pg_user} -h ${pg_host} ${pg_name} || true
|
||||
# Also remove the test-db if it exists
|
||||
dropdb -U ${pg_user} -h ${pg_host} test_${pg_name} || true
|
||||
PGPASSWORD="${pg_pass}" psql -U ${pg_user} -h ${pg_host} postgres -c "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'test_${pg_name}'"
|
||||
PGPASSWORD="${pg_pass}" dropdb -U ${pg_user} -h ${pg_host} test_${pg_name} || true
|
||||
|
||||
dev-create-db:
|
||||
$(eval pg_user := $(shell $(UV) run python -m authentik.lib.config postgresql.user 2>/dev/null))
|
||||
$(eval pg_pass := $(shell $(UV) run python -m authentik.lib.config postgresql.password 2>/dev/null))
|
||||
$(eval pg_host := $(shell $(UV) run python -m authentik.lib.config postgresql.host 2>/dev/null))
|
||||
$(eval pg_name := $(shell $(UV) run python -m authentik.lib.config postgresql.name 2>/dev/null))
|
||||
createdb -U ${pg_user} -h ${pg_host} ${pg_name}
|
||||
PGPASSWORD="${pg_pass}" createdb -U ${pg_user} -h ${pg_host} ${pg_name} || true
|
||||
PGPASSWORD="${pg_pass}" createdb -U ${pg_user} -h ${pg_host} test_${pg_name} || true
|
||||
|
||||
dev-reset: dev-drop-db dev-create-db migrate ## Drop and restore the Authentik PostgreSQL instance to a "fresh install" state.
|
||||
|
||||
@@ -352,7 +357,7 @@ ci-bandit: ci--meta-debug
|
||||
ci-pending-migrations: ci--meta-debug
|
||||
$(UV) run ak makemigrations --check
|
||||
|
||||
ci-test: ci--meta-debug
|
||||
$(UV) run coverage run manage.py test --keepdb authentik
|
||||
ci-test: ci--meta-debug dev-create-db
|
||||
$(UV) run coverage run manage.py test --keepdb $(glob)
|
||||
$(UV) run coverage report
|
||||
$(UV) run coverage xml
|
||||
|
||||
@@ -12,6 +12,14 @@ services:
|
||||
ports:
|
||||
- 127.0.0.1:5432:5432
|
||||
restart: always
|
||||
pgdog:
|
||||
container_name: pgdog
|
||||
image: ghcr.io/pgdogdev/pgdog:latest
|
||||
volumes:
|
||||
- ./pgdog.toml:/pgdog/pgdog.toml:ro
|
||||
ports:
|
||||
- 127.0.0.1:6432:6432
|
||||
restart: always
|
||||
s3:
|
||||
container_name: s3
|
||||
image: docker.io/zenko/cloudserver
|
||||
|
||||
@@ -18,6 +18,7 @@ def generate_local_config() -> dict[str, Any]:
|
||||
"secret_key": generate_id(),
|
||||
"postgresql": {
|
||||
"user": "postgres",
|
||||
"port": 6432,
|
||||
},
|
||||
"outposts": {
|
||||
"container_image_base": "ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s",
|
||||
|
||||
20
scripts/pgdog.toml
Normal file
20
scripts/pgdog.toml
Normal file
@@ -0,0 +1,20 @@
|
||||
[general]
|
||||
host = "[::]"
|
||||
port = 6432
|
||||
auth_type = "trust"
|
||||
passthrough_auth = "enabled_plain"
|
||||
prepared_statements = "extended_anonymous"
|
||||
pub_sub_channel_size = 8192
|
||||
|
||||
[admin]
|
||||
password = "admin"
|
||||
[[databases]]
|
||||
host = "postgresql"
|
||||
name = "postgres"
|
||||
[[databases]]
|
||||
host = "postgresql"
|
||||
name = "authentik"
|
||||
pool_size = 8
|
||||
[[databases]]
|
||||
host = "postgresql"
|
||||
name = "test_authentik"
|
||||
Reference in New Issue
Block a user