Merge pull request 'hotfix gitea' (#31) from hotfix-gitea into main

Reviewed-on: #31
This commit is contained in:
Charlotte 🦝 Delenk 2023-04-22 11:46:39 +00:00
commit e993505cb5
Signed by: gitea-bot
GPG key ID: C9974EDF9932B558

View file

@ -58,7 +58,7 @@ in {
lfsJwtSecret = "${cfg.customDir}/conf/lfs_jwt_secret"; # new file for LFS_JWT_SECRET lfsJwtSecret = "${cfg.customDir}/conf/lfs_jwt_secret"; # new file for LFS_JWT_SECRET
internalToken = "${cfg.customDir}/conf/internal_token"; internalToken = "${cfg.customDir}/conf/internal_token";
replaceSecretBin = "${pkgs.replace-secret}/bin/replace-secret"; replaceSecretBin = "${pkgs.replace-secret}/bin/replace-secret";
in '' in lib.mkForce ''
# copy custom configuration and generate random secrets if needed # copy custom configuration and generate random secrets if needed
${optionalString (!cfg.useWizard) '' ${optionalString (!cfg.useWizard) ''
function gitea_setup { function gitea_setup {
@ -87,14 +87,13 @@ in {
${replaceSecretBin} '#oauth2jwtsecret#' '${oauth2JwtSecret}' '${runConfig}' ${replaceSecretBin} '#oauth2jwtsecret#' '${oauth2JwtSecret}' '${runConfig}'
${replaceSecretBin} '#internaltoken#' '${internalToken}' '${runConfig}' ${replaceSecretBin} '#internaltoken#' '${internalToken}' '${runConfig}'
${lib.optionalString cfg.lfs.enable '' ${lib.optionalString cfg.lfs.enable ''
${replaceSecretBin} '#lfsjwtsecret#' '${lfsJwtSecret}' '${runConfig}'" ${replaceSecretBin} '#lfsjwtsecret#' '${lfsJwtSecret}' '${runConfig}'
''} ''}
${lib.optionalString (cfg.mailerPasswordFile != null) '' ${lib.optionalString (cfg.mailerPasswordFile != null) ''
${replaceSecretBin} '#mailerpass#' '${cfg.mailerPasswordFile}' '${runConfig}' ${replaceSecretBin} '#mailerpass#' '${cfg.mailerPasswordFile}' '${runConfig}'
''} ''}
${lib.optionalString (cfg.storageSecretFile != null) '' ${lib.optionalString (cfg.storageSecretFile != null) ''
${replaceSecretBin} '#sstorageSecret#' '${cfg.storageSecretFile}' '${runConfig}' ${replaceSecretBin} '#storageSecret#' '${cfg.storageSecretFile}' '${runConfig}'
''} ''}
chmod u-w '${runConfig}' chmod u-w '${runConfig}'
} }