projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'bugfix/wrong-date-format' into 'develop'
[akkoma]
/
lib
/
mix
/
tasks
/
pleroma
/
instance.ex
diff --git
a/lib/mix/tasks/pleroma/instance.ex
b/lib/mix/tasks/pleroma/instance.ex
index e0ebb3f5ebb8ec308e3f1663a35405adb021da24..1ba452275e376396ad0f15d9b6db05e2320c34c3 100644
(file)
--- a/
lib/mix/tasks/pleroma/instance.ex
+++ b/
lib/mix/tasks/pleroma/instance.ex
@@
-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
defmodule Mix.Tasks.Pleroma.Instance do
use Mix.Task
- alias Pleroma.{Repo, User}
alias Mix.Tasks.Pleroma.Common
@shortdoc "Manages Pleroma instance"
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
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 =
Common.get_option(
options,
- :name,
+ :
instance_
name,
"What is the name of your instance? (e.g. Pleroma/Soykaf)"
)
"What is the name of your instance? (e.g. Pleroma/Soykaf)"
)
@@
-99,11
+105,14
@@
defmodule Mix.Tasks.Pleroma.Instance do
)
secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
)
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)
+ {web_push_public_key, web_push_private_key} = :crypto.generate_key(:ecdh, :prime256v1)
result_config =
EEx.eval_file(
"sample_config.eex" |> Path.expand(__DIR__),
domain: domain,
result_config =
EEx.eval_file(
"sample_config.eex" |> Path.expand(__DIR__),
domain: domain,
+ port: port,
email: email,
name: name,
dbhost: dbhost,
email: email,
name: name,
dbhost: dbhost,
@@
-111,7
+120,10
@@
defmodule Mix.Tasks.Pleroma.Instance do
dbuser: dbuser,
dbpass: dbpass,
version: Pleroma.Mixfile.project() |> Keyword.get(:version),
dbuser: dbuser,
dbpass: dbpass,
version: Pleroma.Mixfile.project() |> Keyword.get(:version),
- secret: secret
+ secret: secret,
+ signing_salt: signing_salt,
+ web_push_public_key: Base.url_encode64(web_push_public_key, padding: false),
+ web_push_private_key: Base.url_encode64(web_push_private_key, padding: false)
)
result_psql =
)
result_psql =