mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 04:45:39 +00:00
nixos/gitea: add hmacKey support
This commit is contained in:
parent
6dd2f029a7
commit
1ebb7d7bba
@ -239,6 +239,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;
|
||||
@ -434,6 +441,10 @@ in
|
||||
LFS_JWT_SECRET = "#lfsjwtsecret#";
|
||||
};
|
||||
|
||||
camo = mkIf (cfg.camoHmacKeyFile != null) {
|
||||
HMAC_KEY = "#hmackey#";
|
||||
};
|
||||
|
||||
session = {
|
||||
COOKIE_NAME = lib.mkDefault "session";
|
||||
};
|
||||
@ -575,6 +586,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 New Issue
Block a user