Brain Structural Validation / Validate Markdown Structure & Links (push) Failing after 7s
Curate operational guides, architectural evaluations, and completed plans for the Stalwart mail server + Brevo relay deployment, LLDAP dynamic user directory integration, and Homepage multirepo reintegration into Core.
4.1 KiB
4.1 KiB
type, project, tags
| type | project | tags | |||||
|---|---|---|---|---|---|---|---|
| guide | homelab |
|
LLDAP + Authelia Integration & Pre-Commit Quality Gate Walkthrough
Summary of Completed Implementations
1. Repository Tests in Pre-Commit Hook
- Hook Location:
.githooks/pre-commit(executable, tracked in git). - Git Hooks Path: Configured via
git config core.hooksPath .githookson both local dev and production server environments. - Flake Integration:
flake.nixnow includes ashellHookthat automatically ensurescore.hooksPathis registered whenever entering the Nix development shell. - Structural Invariant Test: Added
.githooks/pre-commitpresence and executable bit verification intests/structural/test_repository_structure.py. - Verification: Verified automatically on
git commit— executes Ruff linter and the full 35 Pytest invariant tests in ~0.12s before allowing commits.
2. LLDAP Service & Dynamic User Backend
- Service Container:
nitnelave/lldap:stabledeployed indocker-compose.ymlonproxy-net. - Public Admin & Self-Service UI: https://users.roadtotech.me (secured with Traefik TLS ACME certificate).
- Internal LDAP Endpoint:
ldap://lldap:3890with Base DNdc=roadtotech,dc=me. - Decoupled SOPS Secrets:
LLDAP_JWT_SECRETLLDAP_KEY_SEEDLLDAP_LDAP_USER_PASS/AUTHELIA_LDAP_PASSWORD- Added to encrypted
nixos/secrets.yamland exposed vianixos/modules/homeserver.nix.
3. Authelia LDAP Reconfiguration
- Backend Switched:
config/authelia/configuration.ymlreplaced the staticfilebackend withldappointing toldap://lldap:3890. - Users File Removed: Removed
/run/secrets/rendered/users.yml:/config/users.yml:romount from Authelia. - Bypass Rule: Added
users.{{ env "DOMAIN" }}to Authelia's bypass list so users can access LLDAP's login and self-service portal directly. - Appctl Integration: Registered
lldapunder Core Infrastructure inscripts/appctl_engine.pyand Homepage dashboard card (lldap.pngicon).
4. Directory Seeding & Verification
- Created
scripts/bootstrap_lldap_users.py. - Groups created in LLDAP:
admins,dev,users. - Users migrated:
kiskaadee(fcortesbio@gmail.com) -> Groups:admins,devmisa(icdf0728@gmail.com) -> Groups:usersvalenvg(vegavalentina069@gmail.com) -> Groups:users
- Live Authelia Authentication Test:
POST https://auth.roadtotech.me/api/firstfactorverified in real time: returns{"status":"OK"}for valid LLDAP credentials and rejects invalid passwords.
Managing Users Going Forward (Zero Secrets Touched)
Web Interface
Navigate to https://users.roadtotech.me:
- Log in as
admin(or as userkiskaadeewith admin privileges). - Add User: Click Add user, enter display name, username, and email.
- Assign Groups: Assign
admins,dev, oruserswith checkboxes. - Reset/Set Passwords: Click on the user -> Change password or send an invitation link.
- Changes take effect in Authelia immediately with zero downtime and without modifying any git files or SOPS secrets.
CLI Password Reset
To set/reset any user's password from the server terminal:
docker exec lldap /app/lldap_set_password \
--base-url http://localhost:17170 \
--admin-username admin \
--admin-password <ADMIN_PASSWORD> \
--username <USERNAME> \
--password <NEW_PASSWORD>