instance.gen: Warn that stripping exif requires exiftool
authorrinpatch <rinpatch@sdf.org>
Sat, 12 Dec 2020 17:37:14 +0000 (20:37 +0300)
committerrinpatch <rinpatch@sdf.org>
Sat, 12 Dec 2020 17:38:51 +0000 (20:38 +0300)
And default to no if it is not installed

Closes #2343

lib/mix/tasks/pleroma/instance.ex

index a4f1c81bce8f1c0dae5c015858c52c2f102ca9c5..853c4eaa26fe1456dce6d04cdfb75fe9c862c564 100644 (file)
@@ -161,12 +161,21 @@ defmodule Mix.Tasks.Pleroma.Instance do
         )
         |> Path.expand()
 
+      {strip_uploads_message, strip_uploads_default} =
+        if Pleroma.Utils.command_available?("exiftool") do
+          {"Do you want to strip location (GPS) data from uploaded images? This requires exiftool, it was detected as installed. (y/n)",
+           "y"}
+        else
+          {"Do you want to strip location (GPS) data from uploaded images? This requires exiftool, it was detected as not installed, please install it if you answer yes. (y/n)",
+           "n"}
+        end
+
       strip_uploads =
         get_option(
           options,
           :strip_uploads,
-          "Do you want to strip location (GPS) data from uploaded images? (y/n)",
-          "y"
+          strip_uploads_message,
+          strip_uploads_default
         ) === "y"
 
       anonymize_uploads =