Merge pull request #260877 from moritzrickert/plausible-registration-invite-only

nixos/plausible: add invite only registrations
This commit is contained in:
Peder Bergebakken Sundt 2023-10-27 23:49:49 +02:00 committed by GitHub
commit a9d001fd4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,9 +78,9 @@ in {
server = {
disableRegistration = mkOption {
default = true;
type = types.bool;
type = types.enum [true false "invite_only"];
description = lib.mdDoc ''
Whether to prohibit creating an account in plausible's UI.
Whether to prohibit creating an account in plausible's UI or allow on `invite_only`.
'';
};
secretKeybaseFile = mkOption {
@ -209,7 +209,7 @@ in {
# Configuration options from
# https://plausible.io/docs/self-hosting-configuration
PORT = toString cfg.server.port;
DISABLE_REGISTRATION = boolToString cfg.server.disableRegistration;
DISABLE_REGISTRATION = if isBool cfg.server.disableRegistration then boolToString cfg.server.disableRegistration else cfg.server.disableRegistration;
RELEASE_TMP = "/var/lib/plausible/tmp";
# Home is needed to connect to the node with iex