Commit graph

35 commits

Author SHA1 Message Date
Sandro
858735116a
Fix indentation of markdown code blocks 2024-10-28 00:23:50 +01:00
WilliButz
0932385a36
module: restart services on-failure 2024-09-08 17:12:43 +02:00
Maximilian Bosch
d4c45b01f2
module: fix media root config
Was changed within upstream commit abc0c2d2a2a0bfb0214798ed6bca9d59359b39f8.

The sole reason this worked was that `settings.storage.media.file.path`
pointed to `./media`, relative to `/var/lib/authentik`.

Update our config accordingly.
2024-06-02 17:40:27 +02:00
WilliButz
47e376250e
module: increase priority for posgresql package default
This gives the default value from this module a slightly higher
priority than the upstream module's default, while still allowing users
to simply set `services.postgresql.package` using the default priority.

The change in 8bc790171f introduced
`mkDefault` for the postgresql package.
Unfortunately the upstream package option default is also specified
using `mkDefault` instead of the more appropriate `mkOptionDefault`.

This meant that users with a `system.stateVersion` other than `22.05`,
`22.11` or `23.05` got an evaluation error because there are two
conflicting definitions for the package option.
2024-05-02 18:27:53 +02:00
WilliButz
965f4d4012
module: drop default settings for airgapped mode
These settings were originally taken from
https://docs.goauthentik.io/docs/installation/air-gapped
but I think they should be configured by users themselves rather than
being enforced by this module.

Notes:
* error reporting is already disabled by default
* the update check setting obviously didn't do anthing as the update
  check was always running
* "startup analytics" currently refers to a post request[1] to upstream authentik,
  that includes the running version and a SHA-512 digest of the unique
  installation id and an env string that refers to the environment in which
  authentik is running, that should be "custom"[2] for NixOS.

[1]: https://github.com/goauthentik/authentik/blob/version/2024.4.1/lifecycle/gunicorn.conf.py#L122-L137
[2]: https://github.com/goauthentik/authentik/blob/version/2024.4.1/authentik/lib/utils/reflection.py#L52-L64
2024-04-28 14:18:53 +02:00
WilliButz
876db63217
module: don't set services.postgresql.package for new installations 2024-04-28 14:18:53 +02:00
Quentin Smith
8bc790171f
module: don't force Postgres 14 2024-04-28 13:13:42 +02:00
Quentin Smith
c178d820d7
module: use TZ environment variable to set UTC timezone instead of overriding system zone 2024-04-28 13:13:26 +02:00
WilliButz
608c5dd4f5
update: 2024.2.3 -> 2024.4.1
Release notes: https://docs.goauthentik.io/docs/releases/2024.4

Notable dependency updates:
python 3.11 -> python 3.12
golang 1.21 -> golang 1.22
nixpkgs-23.11 -> nixpkgs-unstable (for golang 1.22 until 24.05)

Introduces patch to `web/package-lock.json`, see `components/frontend.nix`,
this will cause IFD until the issue is resolved.
https://nixos.org/manual/nix/stable/language/import-from-derivation

Flake lock file updates:

• Updated input 'authentik-src':
    'github:goauthentik/authentik/6bb180f94ec124092c4f87ae5f5d892a70b32ff3' (2024-04-17)
  → 'github:goauthentik/authentik/ca70c963e55daf73b479a4513da06ac5cea77718' (2024-04-26)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/53a2c32bc66f5ae41a28d7a9a49d321172af621e' (2024-04-15)
  → 'github:NixOS/nixpkgs/6143fc5eeb9c4f00163267708e26191d1e918932' (2024-04-21)
• Updated input 'poetry2nix':
    'github:nix-community/poetry2nix/3c92540611f42d3fb2d0d084a6c694cd6544b609' (2024-02-22)
  → 'github:nix-community/poetry2nix/9245811b58905453033f1ef551f516cbee71c42c' (2024-04-26)
2024-04-27 20:59:27 +02:00
Marcel
29c944aece
fixed broken online dependencies 2024-04-06 21:51:16 +02:00
Maximilian Bosch
2da27254c1
module: add ak script
This was made possible by d85dacb6c2
which allows to directly use `manage.py`. That script is
effectively used whenever the `ak` command is referenced in the docs,
e.g. to set a new password for the superuser or to send a test email.

This needs to run as the same (dynamic) user and with the same env file,
otherwise `manage.py` exits early. To achieve that, I
decided to use `systemd-run(1)` because now the invocation can be
configured the same way as services are.
2024-02-26 09:32:48 +01:00
WilliButz
189ab274f5
Merge pull request #17 from MarcelCoding/radius
Added radius outpost
2024-02-22 15:01:51 +01:00
WilliButz
d060292aa6
add patch to fix failing "tenant_files" migration
The new migration in tenant_files.py references a MEDIA_ROOT directory
based on its own path, which in our case is in the read-only /nix/store.

We need it to refer to the actual authentik state directory instead,
which defaults to /var/lib/authentik/media in module.nix
2024-02-21 22:12:02 +01:00
WilliButz
d85dacb6c2
components: drop celery, package manage.py instead 2024-02-21 22:12:02 +01:00
Marcel
52b831735c
Added radius outpost 2024-02-14 22:00:58 +01:00
Marcel
347066b2ca
Made postgres optional 2024-01-31 10:26:11 +01:00
WilliButz
3904e3d29b
module: remove restartTriggers from ldap outpost service
Fixes #15

Before this change it was non-trivial to deploy the ldap outpost without
also activating the main authentik service on the same host. Adding
functionality to provide a separate configuration file for the outpost
service remains an open task.
2024-01-28 21:15:41 +01:00
shokinn
4dd485a366 Add dependency to network-online.target for authentik-ldap.service 2024-01-28 00:42:02 +01:00
shokinn
3bf78b1126 Add dependency to network-online.target for authentik.service 2024-01-24 18:42:16 +01:00
Alexander Sieg
8e23ad0cef
enable media uploads
The media upload feature is build around being deployed in a container
and only enables uploads when `/media` is a mountpoint. This isn't the
case on nixos and as such media uploads are disable.

In order to enable this, we need to patch authentik so that the
`can_save_media` capability is enabled.
2024-01-15 17:10:22 +01:00
WilliButz
1d2fe8bd1e
Merge pull request #9 from Ma27/restart-ldap-outpost
authentik-ldap: restart on failure
2024-01-03 20:06:33 +01:00
Maximilian Bosch
7c6103be81
authentik-ldap: restart on failure
I'm occasionally seeing the following error:

    Jan 01 22:02:10 auth ldap[151813]: fatal error: concurrent map writes
    Jan 01 22:02:10 auth ldap[151813]: fatal error: concurrent map writes
    Jan 01 22:02:10 auth ldap[151813]: goroutine 4841 [running]:
    Jan 01 22:02:10 auth ldap[151813]: goauthentik.io/api/v3.(*Configuration).AddDefaultHeader(...)
    Jan 01 22:02:10 auth ldap[151813]:         goauthentik.io/api/v3@v3.2023101.1/configuration.go:120
    Jan 01 22:02:10 auth ldap[151813]: goauthentik.io/internal/outpost/ldap/search/direct.(*DirectSearcher).Search(0xc0002ba4f8, 0xc000510dd0)
    Jan 01 22:02:10 auth ldap[151813]:         goauthentik.io/internal/outpost/ldap/search/direct/direct.go:112 +0x65a
    [...]
    Jan 01 22:02:10 auth systemd[1]: authentik-ldap.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
    Jan 01 22:02:10 auth systemd[1]: authentik-ldap.service: Failed with result 'exit-code'.

Obviously, I need to find out what's up there. However, services
shouldn't just die on a crash, but restart in that case. If that happens
too often, StartLimitBurst/StartLimitIntervalSec ensure that the
(re)start attempt is aborted eventually.

This is especially problematic because Nextcloud tries to contact the
LDAP server on every single request for a sync which means that the
entire service is down when such a crash happens.
2024-01-03 12:52:42 +01:00
shokinn
47e0cb8e14 link static workdir deps to /run/authentik 2023-12-29 15:01:03 +01:00
WilliButz
07c6476fbf
module: make authentikComponents a simple attrset 2023-12-10 15:16:53 +01:00
WilliButz
8b05ebf200
module: drop unused recursiveUpdate 2023-12-10 15:16:53 +01:00
WilliButz
332d717766
module: update postgres config (ensurePermissions -> ensureDBOwnership)
see https://github.com/NixOS/nixpkgs/pull/266270
2023-12-10 15:16:41 +01:00
WilliButz
f7fa85cc1f
module: add nginx support with cert auto-discovery 2023-10-04 17:55:39 +02:00
WilliButz
251d78a7f2
module: provide option to specify EnvironmentFile for secrets
The systemd service module references the module's environmentFile in a
list to allow for merging with EnvironmentFiles injected elsewhere.
2023-10-04 14:47:29 +02:00
WilliButz
fcc7b2f997
module: authentik-ldap drop environment variables
This should be configured with a proper authentik hostname and a
matching certificate that can be validated with the system CA bundle.
2023-06-29 22:51:57 +02:00
WilliButz
62f7cce184
module: add basic ldap outpost service 2023-06-29 13:24:17 +02:00
WilliButz
360f4c7321
module: refactor as preparation for ldap-outpost 2023-06-28 17:12:36 +02:00
WilliButz
6830ada44a
refactor flake
* switched from flake-utils to flake-parts
* dropped the overlay and instead populate configurable options for all
required authentik components in the module
* `nixosModule.default` is now a top-level output following the flake spec,
instead of the previously incorrect system-specific definition
2023-06-28 16:39:23 +02:00
WilliButz
e079fe0719
module: restart services if global config file changes 2023-06-07 15:11:54 +02:00
WilliButz
3c661c5095
module: use postgres peer auth instead of password auth 2023-06-07 15:11:54 +02:00
WilliButz
4a424259e4
init flake with package, module and test 2023-06-02 16:17:47 +02:00