diff --git a/modules/server/containers/apps/gitea.nix b/modules/server/containers/apps/gitea.nix index 7459e13..f222058 100644 --- a/modules/server/containers/apps/gitea.nix +++ b/modules/server/containers/apps/gitea.nix @@ -140,11 +140,11 @@ in { PSQL="${pkgs.postgresql}/bin/psql -U postgres" TOKEN_STRING="$HOMEPAGE_VAR_GITEA_API" - SALT=$(${nixpkgs.coreutils}/bin/cat /dev/urandom | ${nixpkgs.gnugrep}/bin/tr -dc 'a-zA-Z0-9' | ${nixpkgs.coreutils}/bin/head -c 10) + SALT=$(${pkgs.coreutils}/bin/cat /dev/urandom | ${pkgs.gnugrep}/bin/tr -dc 'a-zA-Z0-9' | ${pkgs.coreutils}/bin/head -c 10) COMBINED_STRING="${SALT}${TOKEN_STRING}" - HASH=$(echo -n "$COMBINED_STRING" | ${nixpkgs.openssl}/bin/openssl dgst -sha256 | ${nixpkgs.coreutils}/bin/cut -d' ' -f2) + HASH=$(echo -n "$COMBINED_STRING" | ${pkgs.openssl}/bin/openssl dgst -sha256 | ${pkgs.coreutils}/bin/cut -d' ' -f2) LAST_8="${TOKEN_STRING: -8}" - NOW=$(${nixpkgs.coreutils}/bin/date +%s) + NOW=$(${pkgs.coreutils}/bin/date +%s) $PSQL -d "gitea_db" -e \ "INSERT INTO access_token (uid, name, token_hash, token_salt, token_last_eight, created_unix, updated_unix) \ VALUES (1, 'homepage-dashboard', '$HASH', '$SALT', '$LAST_8', $NOW, $NOW);"