root: make postgres connection in makefile customizable#6977
Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for authentik ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6977 +/- ##
==========================================
+ Coverage 90.51% 90.97% +0.47%
==========================================
Files 567 567
Lines 27939 27939
==========================================
+ Hits 25286 25416 +130
+ Misses 2653 2523 -130
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-core-alt-pg-credentials-1695677726-5a263d1
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sFor arm64, use these values: AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-core-alt-pg-credentials-1695677726-5a263d1-arm64
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-core-alt-pg-credentials-1695677726-5a263d1For arm64, use these values: authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-core-alt-pg-credentials-1695677726-5a263d1-arm64Afterwards, run the upgrade commands from the latest release notes. |
This commit allows the `dev-reset` command in the Makefile to pick up and use credentials from the
`.env` file if they are present, or fallback to the defaults provided if they are not. This is the
only place in the Makefile where the database credentials are used directly against postgresql
binaries. The syntax was tested with bash, zsh, and csh, and did not fail under those.
The `$${:-}` syntax is a combination of a Makefile idiom for "Pass a single `$` to the environment
where this command will be executed," and the shell expresion `${VARIABLE:-default}` means
"dereference the environment variable; if it is undefined, used the default value provided."
Nothing wrong with recursive make; it just wasn't essential here. `migrate` is just a build target, not a task.
checkmake [options] <makefile>... checkmake -h | --help checkmake --version checkmake --list-rules Makefile linting tool.
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
0f4fd80 to
5a263d1
Compare
* main: (41 commits) root: fix missing /lifecycle in path website/blog: add info-block to blog about m2m (#7002) root: handle SIGHUP and SIGUSR2, healthcheck gunicorn (#6630) flows: stage_invalid() makes flow restart depending on invalid_response_action setting (#6780) core: bump psycopg from 3.1.11 to 3.1.12 (#6997) core: bump pydantic from 2.4.0 to 2.4.1 (#6998) web: bump the sentry group in /web with 2 updates (#6999) web: bump pyright from 1.1.328 to 1.1.329 in /web (#7000) website/blog: improved sentence (#6995) website/blog: fix missing link in m2m post (#6994) web/user: fix incorrect link to admin interface (#6993) root: disable APPEND_SLASH (#6928) root: replace boj/redistore with vendored version of rbcervilla/redisstore (#6988) sources/ldap: add default property mapping to mirror directory structure (#6990) website/blogs: Blog about m2m (#6974) root: make Celery worker concurrency configurable (#6837) root: make postgres connection in makefile customizable (#6977) core: prevent self-impersonation (#6885) web: bump @typescript-eslint/parser from 6.7.2 to 6.7.3 in /web (#6984) core: bump pydantic from 2.3.0 to 2.4.0 (#6979) ...

This commit allows the
dev-resetcommand in the Makefile to pick up and use credentials from the.envfile if they are present, or fallback to the defaults provided if they are not. This is the only place in the Makefile where the database credentials are used directly against postgresql binaries. The syntax was tested with bash, zsh, and csh, and did not fail under those.The
$${:-}syntax is a combination of a Makefile idiom for "Pass a single$to the environment where this command will be executed," and the shell expresion${VARIABLE:-default}means "dereference the environment variable; if it is undefined, used the default value provided."I've added
helpto the Makefile:The help feature uses BSD
awk, which is available on MacOS and Linux. The syntax is simply## your help message hereas a comment on a Makefile target line.Checklist
ak test authentik/)make lint-fix)If an API change has been made
make gen-build)If changes to the frontend have been made
make web)make i18n-extract)If applicable
make website)