Merge pull request #270260 from SuperSandro2000/gitea-camo-hmac
nixos/gitea: add hmacKey support
This commit is contained in:
commit
571f06ad0d
1 changed files with 15 additions and 0 deletions
|
@ -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}'
|
||||
''}
|
||||
|
|
Loading…
Reference in a new issue