Upgrading to external auth
Replace built-in auth with Authentik, Authelia, or another proxy.
Overview
The built-in auth (lazysite-auth.pl) and external auth proxies use
the same mechanism: HTTP headers. The processor reads X-Remote-User
and X-Remote-Groups regardless of what sets them. Upgrading from
built-in to external requires no changes to pages or the processor.
Steps
- Set up your auth proxy (Authentik, Authelia, etc.) with your domain
- Configure the proxy to forward
X-Remote-UserandX-Remote-Groupsheaders to the backend - If your proxy uses different header names, update
lazysite.conf:
auth_header_user: Remote-User
auth_header_groups: Remote-Groups
- Change the Apache
FallbackResourcefromlazysite-auth.plback tolazysite-processor.pl:
FallbackResource /cgi-bin/lazysite-processor.pl
- Replace
login.mdwith a redirect to your proxy's login page - Test:
curl -H "X-Remote-User: alice" -H "X-Remote-Groups: admins" \
https://example.com/protected-page
What stays the same
After upgrading, these all work identically:
auth: requiredandauth: optionalin front matterauth_groups:access restrictions[% authenticated %],[% auth_user %]and other TT variables- Custom
403.mdwith context variables - Cache behaviour (protected pages never cached)
What changes
- Login is handled by the external proxy, not
login.md lazysite-auth.plis no longer in the request path- User management moves from
lazysite-users.plto the proxy's admin interface - Cookie-based sessions are replaced by the proxy's session mechanism
- Manager access (
manager_groupsinlazysite.conf) must match the group names your proxy forwards inX-Remote-Groups