Merge branch 'feature/mix-task-instance-port-specification' into 'develop'

Allow port specification in `instance.ex` config generator

See merge request pleroma/pleroma!552
This commit is contained in:
lambda 2018-12-15 15:21:40 +00:00
commit 9194e84d95
2 changed files with 11 additions and 7 deletions

View file

@ -58,12 +58,15 @@ defmodule Mix.Tasks.Pleroma.Instance do
proceed? = Enum.empty?(will_overwrite) or Keyword.get(options, :force, false) proceed? = Enum.empty?(will_overwrite) or Keyword.get(options, :force, false)
unless not proceed? do unless not proceed? do
domain = [domain, port | _] =
String.split(
Common.get_option( Common.get_option(
options, options,
:domain, :domain,
"What domain will your instance use? (e.g pleroma.soykaf.com)" "What domain will your instance use? (e.g pleroma.soykaf.com)"
) ),
":"
) ++ [443]
name = name =
Common.get_option( Common.get_option(
@ -104,6 +107,7 @@ defmodule Mix.Tasks.Pleroma.Instance do
EEx.eval_file( EEx.eval_file(
"sample_config.eex" |> Path.expand(__DIR__), "sample_config.eex" |> Path.expand(__DIR__),
domain: domain, domain: domain,
port: port,
email: email, email: email,
name: name, name: name,
dbhost: dbhost, dbhost: dbhost,

View file

@ -6,7 +6,7 @@
use Mix.Config use Mix.Config
config :pleroma, Pleroma.Web.Endpoint, config :pleroma, Pleroma.Web.Endpoint,
url: [host: "<%= domain %>", scheme: "https", port: 443], url: [host: "<%= domain %>", scheme: "https", port: <%= port %>],
secret_key_base: "<%= secret %>" secret_key_base: "<%= secret %>"
config :pleroma, :instance, config :pleroma, :instance,