Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into feature/pinned...
[akkoma] / lib / mix / tasks / pleroma / instance.ex
index c6632270783ad84ee14b933fabb657b93240ad22..0a2c891c004f79000cd32b436c1303e76ab2ed07 100644 (file)
@@ -1,6 +1,9 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Mix.Tasks.Pleroma.Instance do
   use Mix.Task
-  alias Pleroma.{Repo, User}
   alias Mix.Tasks.Pleroma.Common
 
   @shortdoc "Manages Pleroma instance"
@@ -59,17 +62,20 @@ defmodule Mix.Tasks.Pleroma.Instance do
     proceed? = Enum.empty?(will_overwrite) or Keyword.get(options, :force, false)
 
     unless not proceed? do
-      domain =
-        Common.get_option(
-          options,
-          :domain,
-          "What domain will your instance use? (e.g pleroma.soykaf.com)"
-        )
+      [domain, port | _] =
+        String.split(
+          Common.get_option(
+            options,
+            :domain,
+            "What domain will your instance use? (e.g pleroma.soykaf.com)"
+          ),
+          ":"
+        ) ++ [443]
 
       name =
         Common.get_option(
           options,
-          :name,
+          :instance_name,
           "What is the name of your instance? (e.g. Pleroma/Soykaf)"
         )
 
@@ -105,6 +111,7 @@ defmodule Mix.Tasks.Pleroma.Instance do
         EEx.eval_file(
           "sample_config.eex" |> Path.expand(__DIR__),
           domain: domain,
+          port: port,
           email: email,
           name: name,
           dbhost: dbhost,