From b205832efe0c92c58576ffe47851c90cd405ee4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Baylac-Jacqu=C3=A9?= Date: Thu, 17 Mar 2022 13:21:56 +0100 Subject: [PATCH] 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. --- nixos/modules/services/networking/pleroma.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/pleroma.nix b/nixos/modules/services/networking/pleroma.nix index d94cfb17999c..c6d4c14dcb7e 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}"