Commit Graph

4 Commits

Author SHA1 Message Date
Niklas Hambüchen
349582c965 nixos/plausible: re-add declarative admin user creation (secure initial deployment)
In #356221 nixpkgs removed `services.plausible.adminUser.*`
because Plausible upstream removed the ability to do that with an easy
CLI command, see:
https://github.com/plausible/analytics/pull/2357#issuecomment-4595200593

However, Plausible's default setup without automatic admin user creation
is unsafe for Plausible instances exposed to the Internet because it
offers a setup wizard, allowing anybody who can reach its webserver
to create the first admin users.
Plausible is usually exposed to the Internet, given that it is a web
analytics tool which must be web-reachable to function.
NixOS defaults configure it to listen only on `localhost`, which is
already good, but on NixOS it generally makes sense to be able to
configure services declaratively so they work out of the box on
first deploy. Workarounds such as "deploy first binding
only to localhost, manually do the setup wizard, then deploy another
config to expose it" are annoying.

Thus, this commit adds back the original declarative `adminUser`
implementation, doing the needed DB changes directly, race-free,
and with better security (allowing to configure a password has instead
of a plain-text password).

Assisted-By: Zoo Code with Claude Opus 4.8, human review
2026-06-22 20:20:59 +00:00
Alexander Sieg
e8c9fa5bc8 plausible: 2.0.0 -> 2.1.4 2024-11-22 13:52:18 +01:00
Janne Heß
bc77c7a973 treewide: Mark Nix blocks in markdown as Nix
This should help us with highlighting and future formatting.
2024-03-28 09:28:12 +01:00
pennae
1bb00a9c12 nixos/plausible: convert manual chapter to MD 2023-01-10 10:31:58 +01:00