Merge pull request #270260 from SuperSandro2000/gitea-camo-hmac

nixos/gitea: add hmacKey support
This commit is contained in:
Maximilian Bosch 2023-12-20 19:02:20 +01:00 committed by GitHub
commit 571f06ad0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -234,6 +234,13 @@ in
description = lib.mdDoc "Path to the git repositories.";
};
camoHmacKeyFile = mkOption {
type = types.nullOr types.str;
default = null;
example = "/var/lib/secrets/gitea/camoHmacKey";
description = lib.mdDoc "Path to a file containing the camo HMAC key.";
};
mailerPasswordFile = mkOption {
type = types.nullOr types.str;
default = null;
@ -429,6 +436,10 @@ in
LFS_JWT_SECRET = "#lfsjwtsecret#";
};
camo = mkIf (cfg.camoHmacKeyFile != null) {
HMAC_KEY = "#hmackey#";
};
session = {
COOKIE_NAME = lib.mkDefault "session";
};
@ -570,6 +581,10 @@ in
${replaceSecretBin} '#lfsjwtsecret#' '${lfsJwtSecret}' '${runConfig}'
''}
${lib.optionalString (cfg.camoHmacKeyFile != null) ''
${replaceSecretBin} '#hmackey#' '${cfg.camoHmacKeyFile}' '${runConfig}'
''}
${lib.optionalString (cfg.mailerPasswordFile != null) ''
${replaceSecretBin} '#mailerpass#' '${cfg.mailerPasswordFile}' '${runConfig}'
''}