kumo.start_http_listener { PARAMS }
Configure and start HTTP service.
This function should be called only from inside your init event handler.
PARAMS
is a lua table that can accept the keys listed below.
hostname
Specifies the hostname to use when configuring TLS. The default, if unspecified, is to use the hostname of the local machine.
listen
Specifies the local IP and port number to which the HTTP service should bind and listen.
Use 0.0.0.0
to bind to all IPv4 addresses.
tls_certificate
Specify the path to a TLS certificate file to use for the server identity when
use_tls is set to true
.
The default, if unspecified, is to dynamically allocate a self-signed certificate.
You may specify that the certificate be loaded from a HashiCorp Vault:
kumo.start_http_listener {
-- ..
tls_certificate = {
vault_mount = 'secret',
vault_path = 'tls/mail.example.com.cert',
-- Specify how to reach the vault; if you omit these,
-- values will be read from $VAULT_ADDR and $VAULT_TOKEN
-- vault_address = "http://127.0.0.1:8200"
-- vault_token = "hvs.TOKENTOKENTOKEN"
},
}
The key must be stored as key
(even though this is a certificate!) under the
path
specified. For example, you might populate it like this:
tls_private_key
Specify the path to the TLS private key file that corresponds to the tls_certificate
.
The default, if unspecified, is to dynamically allocate a self-signed certificate.
You may specify that the key be loaded from a HashiCorp Vault:
kumo.start_http_listener {
-- ..
tls_private_key = {
vault_mount = 'secret',
vault_path = 'tls/mail.example.com.key',
-- Specify how to reach the vault; if you omit these,
-- values will be read from $VAULT_ADDR and $VAULT_TOKEN
-- vault_address = "http://127.0.0.1:8200"
-- vault_token = "hvs.TOKENTOKENTOKEN"
},
}
The key must be stored as key
under the path
specified.
For example, you might populate it like this:
trusted_hosts
Specify the hosts which are trusted to access the HTTP service. Each item can be an IP literal or a CIDR mask.
The defaults are to allow the local host.
use_tls
If true, the listener will start with TLS enabled and require clients to use
https
.
Created: 2023-02-26