logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

docker.exs (2430B)


  1. import Config
  2. config :pleroma, Pleroma.Web.Endpoint,
  3. url: [host: System.get_env("DOMAIN", "localhost"), scheme: "https", port: 443],
  4. http: [ip: {0, 0, 0, 0}, port: 4000]
  5. config :pleroma, :instance,
  6. name: System.get_env("INSTANCE_NAME", "Pleroma"),
  7. email: System.get_env("ADMIN_EMAIL"),
  8. notify_email: System.get_env("NOTIFY_EMAIL"),
  9. limit: 5000,
  10. registrations_open: false,
  11. healthcheck: true
  12. config :pleroma, Pleroma.Repo,
  13. adapter: Ecto.Adapters.Postgres,
  14. username: System.get_env("DB_USER", "pleroma"),
  15. password: System.fetch_env!("DB_PASS"),
  16. database: System.get_env("DB_NAME", "pleroma"),
  17. hostname: System.get_env("DB_HOST", "db"),
  18. port: System.get_env("DB_PORT", "5432"),
  19. pool_size: 10
  20. # Configure web push notifications
  21. config :web_push_encryption, :vapid_details, subject: "mailto:#{System.get_env("NOTIFY_EMAIL")}"
  22. config :pleroma, :database, rum_enabled: false
  23. config :pleroma, :instance, static_dir: "/var/lib/pleroma/static"
  24. config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads"
  25. # We can't store the secrets in this file, since this is baked into the docker image
  26. if not File.exists?("/var/lib/pleroma/secret.exs") do
  27. secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
  28. signing_salt = :crypto.strong_rand_bytes(8) |> Base.encode64() |> binary_part(0, 8)
  29. {web_push_public_key, web_push_private_key} = :crypto.generate_key(:ecdh, :prime256v1)
  30. secret_file =
  31. EEx.eval_string(
  32. """
  33. import Config
  34. config :pleroma, Pleroma.Web.Endpoint,
  35. secret_key_base: "<%= secret %>",
  36. signing_salt: "<%= signing_salt %>"
  37. config :web_push_encryption, :vapid_details,
  38. public_key: "<%= web_push_public_key %>",
  39. private_key: "<%= web_push_private_key %>"
  40. """,
  41. secret: secret,
  42. signing_salt: signing_salt,
  43. web_push_public_key: Base.url_encode64(web_push_public_key, padding: false),
  44. web_push_private_key: Base.url_encode64(web_push_private_key, padding: false)
  45. )
  46. File.write("/var/lib/pleroma/secret.exs", secret_file)
  47. end
  48. import_config("/var/lib/pleroma/secret.exs")
  49. # For additional user config
  50. if File.exists?("/var/lib/pleroma/config.exs"),
  51. do: import_config("/var/lib/pleroma/config.exs"),
  52. else:
  53. File.write("/var/lib/pleroma/config.exs", """
  54. import Config
  55. # For additional configuration outside of environmental variables
  56. """)