instance.gen task: make instance name default to the domain
[akkoma] / lib / mix / tasks / pleroma / instance.ex
index 9af6cda3031523e663aafb3cfb55a44a94a40afe..fee2ab9d93a8a87b0c2892182995a572133d5a2d 100644 (file)
@@ -6,6 +6,8 @@ defmodule Mix.Tasks.Pleroma.Instance do
   use Mix.Task
   import Mix.Pleroma
 
+  alias Pleroma.Config
+
   @shortdoc "Manages Pleroma instance"
   @moduledoc File.read!("docs/administration/CLI_tasks/instance.md")
 
@@ -63,7 +65,8 @@ defmodule Mix.Tasks.Pleroma.Instance do
         get_option(
           options,
           :instance_name,
-          "What is the name of your instance? (e.g. Pleroma/Soykaf)"
+          "What is the name of your instance? (e.g. Pleroma/Soykaf)",
+          domain
         )
 
       email = get_option(options, :admin_email, "What is your admin email address?")
@@ -153,6 +156,8 @@ defmodule Mix.Tasks.Pleroma.Instance do
           Pleroma.Config.get([:instance, :static_dir])
         )
 
+      Config.put([:instance, :static_dir], static_dir)
+
       secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
       jwt_secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
       signing_salt = :crypto.strong_rand_bytes(8) |> Base.encode64() |> binary_part(0, 8)