erldns_admin (erldns v10.5.4)

View Source

Erldns admin API.

Configuration:

This application will read from your sys.config the following example:

{erldns, [
    {admin, [
        {port, 8083},
        {tls, false},
        {credentials, {~"username", ~"password"}},
        {middleware, [my_custom_middleware, another_middleware]},
        {routes, [{~"/custom/:action", my_custom_route_handler, #{}}]}
    ]}
]}

The accepted values are:

  • port: an integer between 1 and 65535 indicating the port to listen on (default: 8083 without TLS and 8483 when TLS is enabled).
  • tls: false, or {true, SslOpts} where SslOpts is a list of ssl:tls_server_option/0, indicating whether to use TLS (default: false).
  • credentials: false if no authentication is required, or a tuple of {Username, Password} binary strings. If configured, all routes will require authentication (default: false).
  • middleware: an optional list of cowboy compliant middleware modules to apply to all admin API requests (default: []).
  • routes: an optional list of additional routes to add to the admin API. This is a list of cowboy_router:route_path() elements that will be prepended to the default routes (default: []).

Summary

Functions

maybe_start()

-spec maybe_start() -> ok | {ok, pid()} | {error, term()}.