Skip to content

Commit 571f06a

Browse files
authored
Merge pull request #270260 from SuperSandro2000/gitea-camo-hmac
nixos/gitea: add hmacKey support
2 parents 3d19c43 + 1ebb7d7 commit 571f06a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

nixos/modules/services/misc/gitea.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ in
234234
description = lib.mdDoc "Path to the git repositories.";
235235
};
236236

237+
camoHmacKeyFile = mkOption {
238+
type = types.nullOr types.str;
239+
default = null;
240+
example = "/var/lib/secrets/gitea/camoHmacKey";
241+
description = lib.mdDoc "Path to a file containing the camo HMAC key.";
242+
};
243+
237244
mailerPasswordFile = mkOption {
238245
type = types.nullOr types.str;
239246
default = null;
@@ -429,6 +436,10 @@ in
429436
LFS_JWT_SECRET = "#lfsjwtsecret#";
430437
};
431438

439+
camo = mkIf (cfg.camoHmacKeyFile != null) {
440+
HMAC_KEY = "#hmackey#";
441+
};
442+
432443
session = {
433444
COOKIE_NAME = lib.mkDefault "session";
434445
};
@@ -570,6 +581,10 @@ in
570581
${replaceSecretBin} '#lfsjwtsecret#' '${lfsJwtSecret}' '${runConfig}'
571582
''}
572583
584+
${lib.optionalString (cfg.camoHmacKeyFile != null) ''
585+
${replaceSecretBin} '#hmackey#' '${cfg.camoHmacKeyFile}' '${runConfig}'
586+
''}
587+
573588
${lib.optionalString (cfg.mailerPasswordFile != null) ''
574589
${replaceSecretBin} '#mailerpass#' '${cfg.mailerPasswordFile}' '${runConfig}'
575590
''}

0 commit comments

Comments
 (0)