From ad3a50e25bf2fa029ce772b443b1717ebdb67f4a Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Mon, 14 Jan 2019 15:56:20 +0100 Subject: nixos/gitea: add option to disable registration Although this can be added to `extraOptions` I figured that it makes sense to add an option to explicitly promote this feature in our documentation since most of the self-hosted gitea instances won't be intended for common use I guess. Also added a notice that this should be added after the initial deploy as you have to register yourself using that feature unless the install wizard is used. --- nixos/modules/services/misc/gitea.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'nixos/modules/services/misc/gitea.nix') diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix index 7a10bd87299..9a646000981 100644 --- a/nixos/modules/services/misc/gitea.nix +++ b/nixos/modules/services/misc/gitea.nix @@ -46,6 +46,9 @@ let ROOT_PATH = ${cfg.log.rootPath} LEVEL = ${cfg.log.level} + [service] + DISABLE_REGISTRATION = ${boolToString cfg.disableRegistration} + ${cfg.extraConfig} ''; in @@ -248,6 +251,18 @@ in description = "Upper level of template and static files path."; }; + disableRegistration = mkEnableOption "the registration lock" // { + description = '' + By default any user can create an account on this gitea instance. + This can be disabled by using this option. + + Note: please keep in mind that this should be added after the initial + deploy unless services.gitea.useWizard + is true as the first registered user will be the administrator if + no install wizard is used. + ''; + }; + extraConfig = mkOption { type = types.str; default = ""; -- cgit 1.4.1