ha-handler/lib/ha_handler.ex

21 lines
708 B
Elixir
Raw Normal View History

2022-01-24 14:03:10 +01:00
defmodule HAHandler do
@moduledoc """
This top-level module only contains generic configuration helpers.
"""
2022-01-24 14:03:10 +01:00
# Mix is not available in releases, and these things are static
# anyway (@variables are evaluated at compile time).
@otp_app Mix.Project.config()[:app]
@version Mix.Project.config[:version]
@env Mix.env
def http_port, do: Application.get_env(@otp_app, :http_port)
def haproxy_socket, do: Application.get_env(@otp_app, :haproxy_socket)
def acme_challenge_path, do: Application.get_env(@otp_app, :acme_challenge_path)
def static_path(), do: Application.app_dir(@otp_app, "priv/static/")
def otp_app(), do: @otp_app
def version(), do: @version
def env(), do: @env
2022-01-24 14:03:10 +01:00
end