Allow specifying the listen_ip on Docker

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-03-26 11:38:39 +01:00
parent b1e6fcd73b
commit b645c7dade
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -2,10 +2,21 @@
import Config import Config
listen_ip = System.get_env("MOBILIZON_INSTANCE_LISTEN_IP", "::")
listen_ip =
case :inet.parse_address(listen_ip) do
{:ok, listen_ip} -> listen_ip
_ -> raise "MOBILIZON_INSTANCE_LISTEN_IP does not match the expected IP format."
end
config :mobilizon, Mobilizon.Web.Endpoint, config :mobilizon, Mobilizon.Web.Endpoint,
server: true, server: true,
url: [host: System.get_env("MOBILIZON_INSTANCE_HOST", "mobilizon.lan")], url: [host: System.get_env("MOBILIZON_INSTANCE_HOST", "mobilizon.lan")],
http: [port: System.get_env("MOBILIZON_INSTANCE_PORT", "4000")], http: [
port: System.get_env("MOBILIZON_INSTANCE_PORT", "4000"),
ip: listen_ip
],
secret_key_base: System.get_env("MOBILIZON_INSTANCE_SECRET_KEY_BASE", "changethis") secret_key_base: System.get_env("MOBILIZON_INSTANCE_SECRET_KEY_BASE", "changethis")
config :mobilizon, Mobilizon.Web.Auth.Guardian, config :mobilizon, Mobilizon.Web.Auth.Guardian,