Run mix format

This commit is contained in:
Ashlynn Anderson 2019-08-03 13:42:57 -04:00
parent 04327721d7
commit 4007717534
1 changed files with 27 additions and 26 deletions

View File

@ -1,8 +1,8 @@
import Config import Config
config :pleroma, Pleroma.Web.Endpoint, config :pleroma, Pleroma.Web.Endpoint,
url: [host: System.get_env("DOMAIN", "localhost"), scheme: "https", port: 443], url: [host: System.get_env("DOMAIN", "localhost"), scheme: "https", port: 443],
http: [ip: {0, 0, 0, 0}, port: 4000] http: [ip: {0, 0, 0, 0}, port: 4000]
config :pleroma, :instance, config :pleroma, :instance,
name: System.get_env("INSTANCE_NAME", "Pleroma"), name: System.get_env("INSTANCE_NAME", "Pleroma"),
@ -21,8 +21,7 @@
pool_size: 10 pool_size: 10
# Configure web push notifications # Configure web push notifications
config :web_push_encryption, :vapid_details, config :web_push_encryption, :vapid_details, subject: "mailto:#{System.get_env("NOTIFY_EMAIL")}"
subject: "mailto:#{System.get_env("NOTIFY_EMAIL")}"
config :pleroma, :database, rum_enabled: false config :pleroma, :database, rum_enabled: false
config :pleroma, :instance, static_dir: "/var/lib/pleroma/static" config :pleroma, :instance, static_dir: "/var/lib/pleroma/static"
@ -34,23 +33,24 @@
signing_salt = :crypto.strong_rand_bytes(8) |> Base.encode64() |> binary_part(0, 8) 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) {web_push_public_key, web_push_private_key} = :crypto.generate_key(:ecdh, :prime256v1)
secret_file = EEx.eval_string( secret_file =
""" EEx.eval_string(
import Config """
import Config
config :pleroma, Pleroma.Web.Endpoint,
secret_key_base: "<%= secret %>", config :pleroma, Pleroma.Web.Endpoint,
signing_salt: "<%= signing_salt %>" secret_key_base: "<%= secret %>",
signing_salt: "<%= signing_salt %>"
config :web_push_encryption, :vapid_details,
public_key: "<%= web_push_public_key %>", config :web_push_encryption, :vapid_details,
private_key: "<%= web_push_private_key %>" public_key: "<%= web_push_public_key %>",
""", private_key: "<%= web_push_private_key %>"
secret: secret, """,
signing_salt: signing_salt, secret: secret,
web_push_public_key: Base.url_encode64(web_push_public_key, padding: false), signing_salt: signing_salt,
web_push_private_key: Base.url_encode64(web_push_private_key, padding: false) 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)
)
File.write("/var/lib/pleroma/secret.exs", secret_file) File.write("/var/lib/pleroma/secret.exs", secret_file)
end end
@ -60,8 +60,9 @@
# For additional user config # For additional user config
if File.exists?("/var/lib/pleroma/config.exs"), if File.exists?("/var/lib/pleroma/config.exs"),
do: import_config("/var/lib/pleroma/config.exs"), do: import_config("/var/lib/pleroma/config.exs"),
else: File.write("/var/lib/pleroma/config.exs", """ else:
import Config File.write("/var/lib/pleroma/config.exs", """
import Config
# For additional configuration outside of environmental variables
""") # For additional configuration outside of environmental variables
""")