pleroma-docker/docker-config.exs

49 lines
1.4 KiB
Elixir
Raw Normal View History

2018-04-08 14:15:44 +00:00
use Mix.Config
2018-04-08 15:04:06 +00:00
defmodule Docker do
def env(name, verbatim \\ false) do
env_name = (if verbatim, do: "", else: "pleroma_") <> Atom.to_string(name) |> String.upcase
env_var = System.get_env(env_name)
if env_var == nil do
raise "Could not find #{env_name} in environment. Please define it and try again."
end
System.put_env(env_name, "")
env_var
end
2018-04-08 14:15:44 +00:00
end
config :pleroma, Pleroma.Web.Endpoint,
url: [
2018-04-08 15:04:06 +00:00
host: Docker.env(:url),
scheme: Docker.env(:scheme),
port: 4000
2018-04-08 14:15:44 +00:00
],
2018-04-08 15:04:06 +00:00
secret_key_base: Docker.env(:secret_key_base)
2018-04-08 14:15:44 +00:00
2018-04-08 22:33:52 +00:00
config :pleroma, Pleroma.Upload,
uploads: Docker.env(:uploads_path)
config :pleroma, :chat,
enabled: Docker.env(:chat_enabled)
2018-04-08 14:15:44 +00:00
config :pleroma, :instance,
2018-04-08 22:33:52 +00:00
name: Docker.env(:name),
email: Docker.env(:admin_email),
limit: Docker.env(:max_notice_chars),
2018-04-08 22:33:52 +00:00
registrations_open: Docker.env(:registrations_open)
2018-04-08 14:15:44 +00:00
config :pleroma, :media_proxy,
2018-04-08 22:33:52 +00:00
enabled: Docker.env(:media_proxy_enabled),
redirect_on_failure: Docker.env(:media_proxy_redirect_on_failure),
base_url: Docker.env(:media_proxy_url)
2018-04-08 14:15:44 +00:00
config :pleroma, Pleroma.Repo,
2018-04-08 22:33:52 +00:00
adapter: Ecto.Adapters.Postgres,
username: Docker.env(:postgres_user, true),
password: Docker.env(:postgres_password, true),
database: Docker.env(:postgres_db, true),
hostname: Docker.env(:postgres_ip, true),
pool_size: Docker.env(:db_pool_size)