summary refs log tree commit diff
diff options
context:
space:
mode:
authorFélix Baylac-Jacqué <felix@alternativebit.fr>2022-03-17 13:21:56 +0100
committerFélix Baylac-Jacqué <felix@alternativebit.fr>2022-03-17 15:22:14 +0100
commitb205832efe0c92c58576ffe47851c90cd405ee4b (patch)
treec1529e0849a81ebbe57359e57813006810775731
parente7f6370701a3e65082e67cd0f9696bcd32c2e9ec (diff)
downloadnixpkgs-b205832efe0c92c58576ffe47851c90cd405ee4b.tar
nixpkgs-b205832efe0c92c58576ffe47851c90cd405ee4b.tar.gz
nixpkgs-b205832efe0c92c58576ffe47851c90cd405ee4b.tar.bz2
nixpkgs-b205832efe0c92c58576ffe47851c90cd405ee4b.tar.lz
nixpkgs-b205832efe0c92c58576ffe47851c90cd405ee4b.tar.xz
nixpkgs-b205832efe0c92c58576ffe47851c90cd405ee4b.tar.zst
nixpkgs-b205832efe0c92c58576ffe47851c90cd405ee4b.zip
nixos/pleroma: regenerate empty release cookie files
Since b9cfbcafdf0ca9573de1cdc06137c020e70e44a8, the lack of hexdump in
the closure lead to the generation of empty cookie files. This empty
cookie file is making pleroma to crash at startup now we correctly
read it.

We introduce a migration forcing these empty cookies to be
re-generated to something not empty.
-rw-r--r--nixos/modules/services/networking/pleroma.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/pleroma.nix b/nixos/modules/services/networking/pleroma.nix
index d94cfb17999..c6d4c14dcb7 100644
--- a/nixos/modules/services/networking/pleroma.nix
+++ b/nixos/modules/services/networking/pleroma.nix
@@ -118,7 +118,7 @@ in {
         # Better be safe than sorry migration-wise.
         ExecStartPre =
           let preScript = pkgs.writers.writeBashBin "pleromaStartPre" ''
-            if [ ! -f "${cookieFile}" ]
+            if [ ! -f "${cookieFile}" ] || [ ! -s "${cookieFile}" ]
             then
               echo "Creating cookie file"
               dd if=/dev/urandom bs=1 count=16 | ${pkgs.hexdump}/bin/hexdump -e '16/1 "%02x"' > "${cookieFile}"