37 lines
905 B
Elixir
37 lines
905 B
Elixir
if System.get_env("PHX_SERVER") do
|
|
config :arcology, ArcologyWeb.Endpoint, server: true
|
|
end
|
|
|
|
if config_env() == :prod do
|
|
|
|
database_path =
|
|
System.get_env("DATABASE_PATH") ||
|
|
raise """
|
|
environment variable DATABASE_PATH is missing.
|
|
For example: /etc/arcology/arcology.db
|
|
"""
|
|
|
|
config :arcology, Arcology.Repo,
|
|
database: database_path,
|
|
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "5")
|
|
|
|
secret_key_base =
|
|
System.get_env("SECRET_KEY_BASE") ||
|
|
raise """
|
|
environment variable SECRET_KEY_BASE is missing.
|
|
You can generate one by calling: mix phx.gen.secret
|
|
"""
|
|
|
|
host = System.get_env("PHX_HOST") || "example.com"
|
|
port = String.to_integer(System.get_env("PORT") || "4000")
|
|
|
|
config :arcology, ArcologyWeb.Endpoint,
|
|
url: [host: host, port: 443, scheme: "https"],
|
|
http: [
|
|
ip: {127, 0, 0, 1},
|
|
port: port
|
|
],
|
|
secret_key_base: secret_key_base
|
|
|
|
end
|