ha-handler/lib/ha_handler.ex

24 lines
845 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)
2022-02-19 10:18:05 +01:00
def pgsql_instances, do: Application.get_env(@otp_app, :pgsql_instances, [])
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 template_dir(), do: "lib/ha_handler/web/templates"
def otp_app(), do: @otp_app
def version(), do: @version
def env(), do: @env
2022-01-24 14:03:10 +01:00
end