## Place read-only configurations in this file.
## To define configurations that can later be overridden through UI/API/CLI, add them to `etc/base.hocon`.
##
## Config precedence order:
##   etc/base.hocon < cluster.hocon < emqx.conf < environment variables
##
## See https://docs.emqx.com/en/enterprise/latest/configuration/configuration.html for more information.
## Configuration full example can be found in etc/examples

node {
  name = "emqx@127.0.0.1"
  cookie = "emqx50elixir"
  data_dir = "data"
}

cluster {
  name = emqxcl
  discovery_strategy = manual
}

dashboard {
    listeners {
        http.bind = 18083
        # https.bind = 18084
        https {
            ssl_options {
                certfile = "${EMQX_ETC_DIR}/certs/cert.pem"
                keyfile = "${EMQX_ETC_DIR}/certs/key.pem"
            }
        }
    }
}

##--------------------------------------------------------------------
## Authentication
##--------------------------------------------------------------------

allow_anonymous = false

## Load users from file
authn {
  enable = true
  sources = [
    {
      type = file
      path = "etc/passwd"
      password_hash_algorithm {
        name = plain
      }
    }
  ]
}


##--------------------------------------------------------------------
## Authorization (ACL)
##--------------------------------------------------------------------

authorization {
  sources = [
    {
      type = file
      path = "etc/acl.conf"
    }
  ]
  no_match = deny
}


##--------------------------------------------------------------------
## Anonymous access
##--------------------------------------------------------------------

allow_anonymous = true


##--------------------------------------------------------------------
## Listener (basic)
##--------------------------------------------------------------------

listeners.tcp.default {
  bind = "0.0.0.0:1883"
}

listeners.ws.default {
  bind = "0.0.0.0:8083"  # binds to all interfaces
  max_connections = 102400
}
