Compare commits

...

2 Commits

Author SHA1 Message Date
Teffen Ellis
634c58f753 lifecycle: default MODE_FILE to /tmp when TMPDIR is unset
Line 6 already uses \${TMPDIR:-/tmp} for PROMETHEUS_MULTIPROC_DIR;
apply the same fallback to MODE_FILE so \`ak server\` works outside
a container where TMPDIR is not exported.
2026-04-21 02:39:21 +00:00
Teffen Ellis
1036844a1a core,website/docs: add rust-install make target, document Cargo prerequisites
Cargo tools required by `make lint` (cargo-deny, cargo-machete,
cargo-llvm-cov, cargo-nextest) were silently absent from local dev
environments since PR #20983 introduced the Rust workspace in March 2026.
CI installs them via taiki-e/install-action but no local equivalent existed,
causing `make` to fail on `ci-lint-cargo-machete` with "no such command".

Adds a `rust-install` target that runs `cargo install` for all four tools
and wires it into the existing `install` target alongside node-install,
docs-install, and core-install. Updates the Rust prerequisite bullet in
full-dev-environment.mdx to name the tools and point to `make install`.

Trade-off vs CI: `cargo install` compiles from source, so this is slower
than the pre-built binaries taiki-e/install-action fetches. It is a
one-time setup cost and requires no additional tooling beyond a standard
Rust installation.

core: add --locked to rust-install cargo invocation

cargo-nextest requires --locked when installing from source; apply it to
the whole invocation for reproducible builds across all four tools.
2026-04-21 01:50:36 +00:00
3 changed files with 11 additions and 4 deletions

View File

@@ -125,7 +125,10 @@ core-i18n-extract:
--ignore website \
-l en
install: node-install docs-install core-install ## Install all requires dependencies for `node`, `docs` and `core`
rust-install: ## Install required Cargo tools (cargo-deny, cargo-machete, cargo-llvm-cov, nextest)
$(CARGO) install --locked cargo-deny cargo-machete cargo-llvm-cov cargo-nextest
install: node-install docs-install core-install rust-install ## Install all requires dependencies for `node`, `docs`, `core`, and `rust`
dev-drop-db:
$(eval pg_user := $(shell $(UV) run python -m authentik.lib.config postgresql.user 2>/dev/null))

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env -S bash
set -e -o pipefail
MODE_FILE="${TMPDIR}/authentik-mode"
MODE_FILE="${TMPDIR:-/tmp}/authentik-mode"
if [[ -z "${PROMETHEUS_MULTIPROC_DIR}" ]]; then
export PROMETHEUS_MULTIPROC_DIR="${TMPDIR:-/tmp}/authentik_prometheus_tmp"
@@ -73,6 +73,10 @@ function prepare_debug {
}
mkdir -p "${PROMETHEUS_MULTIPROC_DIR}"
if [[ ! -w "$(dirname "$MODE_FILE")" ]]; then
log "Cannot write mode file — $(dirname "$MODE_FILE") is not writable; check TMPDIR"
exit 1
fi
if [[ "$(python -m authentik.lib.config debugger 2>/dev/null)" == "True" ]]; then
prepare_debug
@@ -90,7 +94,7 @@ elif [[ "$1" == "worker" ]]; then
if [[ -n "${AUTHENTIK_BOOTSTRAP_PASSWORD}" || -n "${AUTHENTIK_BOOTSTRAP_TOKEN}" ]]; then
python -m manage apply_blueprint system/bootstrap.yaml || true
fi
check_if_root "python -m manage worker --pid-file ${TMPDIR}/authentik-worker.pid $@"
check_if_root "python -m manage worker --pid-file ${TMPDIR:-/tmp}/authentik-worker.pid $@"
elif [[ "$1" == "bash" ]]; then
/bin/bash
elif [[ "$1" == "test-all" ]]; then

View File

@@ -18,7 +18,7 @@ Before you begin, ensure you have the following tools installed. You can run the
- [Python](https://www.python.org/) (3.14)
- [uv](https://docs.astral.sh/uv/getting-started/installation/) (Latest stable release)
- [Rust](https://rust-lang.org/learn/get-started/) (We provide a `rust-toolchain.toml` file for the correct version, and we use the nightly toolchain to run formatting with rustfmt.)
- [Rust](https://rust-lang.org/learn/get-started/) (We provide a `rust-toolchain.toml` file for the correct version, and we use the nightly toolchain to run formatting with rustfmt. The required Cargo tools — `cargo-deny`, `cargo-machete`, `cargo-llvm-cov`, and `cargo-nextest` — are installed by `make install`.)
- [Go](https://go.dev/) (1.26 or later)
- [Node.js](https://nodejs.org/en) (24 or later)
- [PostgreSQL](https://www.postgresql.org/) (16 or later)