import Config # Runtime configuration for the docs-site release (MIX_ENV=docs). Evaluated when # the release boots, so it reads the container's environment variables. if config_env() == :docs do port = String.to_integer(System.get_env("PORT") || "8080") secret_key_base = System.get_env("SECRET_KEY_BASE") || raise """ environment variable SECRET_KEY_BASE is missing. Generate one with: mix phx.gen.secret (or: openssl rand -base64 48) """ host = System.get_env("PHX_HOST") || "localhost" bind_ip = case :inet.parse_address(String.to_charlist(System.get_env("PHX_BIND_IP") || "::")) do {:ok, ip} -> ip {:error, _} -> raise "PHX_BIND_IP must be a valid IPv4 or IPv6 address" end config :shadix, Shadix.Website.Endpoint, # Bind all interfaces (IPv6 any also accepts IPv4-mapped) so Fly's proxy can # reach the app inside the container. Local release checks explicitly set # PHX_BIND_IP=127.0.0.1 so the test service is not exposed to the network. http: [ip: bind_ip, port: port], url: [host: host, port: 443, scheme: "https"], secret_key_base: secret_key_base end