diff options
author | Rin Toshaka <rinpatch@sdf.org> | 2018-12-15 11:00:54 +0100 |
---|---|---|
committer | Rin Toshaka <rinpatch@sdf.org> | 2018-12-15 11:00:54 +0100 |
commit | 4a895a46d111286e5c6cf923b9fdb4e50115104a (patch) | |
tree | e824512b4a3204482feb736eccda9c861882cfa1 | |
parent | e74f384b685edff5e4fac9da788a7516dd83fe94 (diff) | |
download | pleroma-4a895a46d111286e5c6cf923b9fdb4e50115104a.tar.gz |
Allow port specification in instance.ex
-rw-r--r-- | lib/mix/tasks/pleroma/instance.ex | 16 | ||||
-rw-r--r-- | lib/mix/tasks/pleroma/sample_config.eex | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/lib/mix/tasks/pleroma/instance.ex b/lib/mix/tasks/pleroma/instance.ex index 3be856115..02e1ce27d 100644 --- a/lib/mix/tasks/pleroma/instance.ex +++ b/lib/mix/tasks/pleroma/instance.ex @@ -58,12 +58,15 @@ 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( @@ -104,6 +107,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, diff --git a/lib/mix/tasks/pleroma/sample_config.eex b/lib/mix/tasks/pleroma/sample_config.eex index 0cd572797..740b9f8d1 100644 --- a/lib/mix/tasks/pleroma/sample_config.eex +++ b/lib/mix/tasks/pleroma/sample_config.eex @@ -6,7 +6,7 @@ use Mix.Config config :pleroma, Pleroma.Web.Endpoint, - url: [host: "<%= domain %>", scheme: "https", port: 443], + url: [host: "<%= domain %>", scheme: "https", port: <%= port %>], secret_key_base: "<%= secret %>" config :pleroma, :instance, |