C2: Build authentik from source (Mikado chain) #274

Merged
eblume merged 16 commits from mikado/authentik-source-build into main 2026-03-01 13:45:01 -08:00

16 commits

Author SHA1 Message Date
6612c3febc C2(authentik-source-build): finalize chain for merge
- Add version = "2026.2.0" to default.nix for CI workflow version extraction
- Update service-versions.yaml to 2026.2.0, mark reviewed 2026-03-01
- Update changelog entry to reflect completed work
- Rewrite goal card as historical how-to documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 13:44:17 -08:00
0792b74152 C2(authentik-source-build): close build-authentik-from-source
All components assembled into default.nix: webui → authentik-django
→ authentik-server, with ak wrapper and container entrypoint. Tested
on ringtail via test-build.nix -A assembled. The chain is complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 13:20:04 -08:00
6ea5011739 C2(authentik-source-build): impl assemble components into container image
Wire webui → authentik-django → authentik-server and replace
pkgs.authentik with custom source-built derivations. The ak wrapper
sets PATH/VIRTUAL_ENV and delegates to lifecycle/ak. Tested on
ringtail with nix-build test-build.nix -A assembled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 13:19:09 -08:00
f58fa079be C2(authentik-source-build): close authentik-web-ui-derivation
Web UI derivation verified on ringtail: esbuild/wireit main build + rollup SFE,
outputs dist/ and authentik/ directories in ~33s.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 13:00:02 -08:00
f21ace82ff C2(authentik-source-build): impl web UI derivation
Two-stage Nix build for the authentik web frontend:
- webui-deps.nix: FOD for npm dependencies (platform-specific hash)
- webui.nix: esbuild/wireit build + rollup SFE, outputs dist/ and authentik/

Verified on ringtail: build completes in ~33s, output has correct structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 12:59:10 -08:00
3cc712a010 C2(authentik-source-build): close authentik-go-server-derivation
Go server binary builds successfully on ringtail:
- buildGoModule with apiGoVendorHook and overrideModAttrs
- Lifecycle paths patched to authentik-django store path
- Web asset paths use placeholder (resolved when webui derivation is built)
- authentik --help verified working

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 12:18:53 -08:00
47cfd980fa C2(authentik-source-build): impl Go server derivation
buildGoModule derivation for cmd/server with:
- apiGoVendorHook for generated Go API client injection
- substituteInPlace patches for lifecycle (authentik-django) and web
  asset paths (3 files: gounicorn.go, web/static.go, internal/web/static.go)
- overrideModAttrs.postPatch="" to keep vendorHash stable
- Parameterized webui input with placeholder for pre-webui-derivation builds
- CGO_ENABLED=0, binary renamed from server to authentik
- Verified on ringtail: builds in ~32s, --help works

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 12:11:50 -08:00
11995f8d4e C2(authentik-source-build): close authentik-python-backend-derivation
Python backend builds and verifies on ringtail. Updated lessons learned
with dynamic store-ref discovery, pipefail/grep fixes, and build results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:47:02 -08:00
eb11d7c960 C2(authentik-source-build): close mirror-authentik-build-deps and authentik-api-client-generation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:47:02 -08:00
be87bb4b37 C2(authentik-source-build): impl complete Python backend derivation
Replace static refTargets list with dynamic store-path discovery in
python-deps.nix FOD. Add real output hashes for both python-deps and
opencontainers fetchFromGitHub. Add test-build.nix harness for ringtail.

Both python-deps FOD and authentik-django build successfully on ringtail.
autoPatchelfHook resolves all .so dependencies with 0 unsatisfied.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:46:38 -08:00
effe80c0a7 C2(authentik-source-build): impl Python backend derivation (WIP)
Two-phase build: FOD (uv sync + strip store refs) and main derivation
(autoPatchelfHook + workspace packages + patches). uv sync completes
successfully; 6 residual store refs remain in FOD output to fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:46:38 -08:00
d6f76a3058 C2(authentik-source-build): impl API client generation derivations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:46:38 -08:00
c563081377 C2(authentik-source-build): plan update Python backend card with build findings
Document approach pivot from uv pip download (doesn't exist in uv 0.9.29)
to uv sync FOD + autoPatchelfHook. Record build issue fixes: pg_config,
gssapi S4U headers, xmlsec libltdl, FOD store reference stripping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:46:17 -08:00
2522f93805 C2(authentik-source-build): plan move test-build.nix to card docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:45:55 -08:00
f65106dcef C2(authentik-source-build): plan pivot to uv-based Python packaging
Drop the nixpkgs packageOverrides approach for Python deps. Instead, use
uv + fixed-output derivation to install from PyPI where cp314 wheels
already exist. Eliminates the entire class of Python 3.14 nixpkgs compat
issues (astor, dacite, exceptiongroup, pydantic-core).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:45:39 -08:00
df327d3a44 C2(authentik-source-build): plan add mirror-authentik-build-deps prerequisite
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:45:39 -08:00