This is an Erlang node that contains:
Table of Contents
- Erlang R17+
- npm
To build the application call: make
. This will:
- download the dependencies,
- compile the code,
- copy the
dobby_ui_lib
nodeJS artefact to thedobby_rest/priv/static/www
- generate an Erlang release,
- generate ssh keys
- private and public user keys:
ida_rsa
andid_rsa.pub
respectively in the project root directory - public and private system keys in the
priv/erl_sshd
that will be used by the ssh deamon running in the Erlang node authorized_keys
file that will already have the previously generated user public key
- private and public user keys:
You may add your own public keys to the authorized_keys
file in
priv/erl_sshd
(remember to make rel
afterwards).
If you want to connect to the dobby Erlang shell using ssh with
a username and password, add or modify the usernames and passwords
to the erl_sshd
section of config/sys.config
.
_rel/leviathan/bin/leviathan
To access the Dobby Visualizer go to http://localhost:8080/static/www/index.html
If you genereated keys in erl_sshd before generating the dobby release, you can connect to the dobby server's Erlang shell using ssh.
ssh 127.0.0.1 -p 11155 -i id_rsa
To exit the Erlang shell obtained via ssh call exit().
Logs are published to websocket clients connecting to ws://.../lager/websocket
. A simple viewer is provided at http://.../lager/static/www/index.html
.
To enable TLS support for the HTTP interface you have to configure it in the erl_cowboy
application and provide the following options:
- certificate file name (expected in the
priv/erl_cowboy
) - key file name (expected in the
priv/erl_cowboy
) - password to the key if it is password protected
The configuration has to be placed in the sys.config file. Below is an example:
[
...
{erl_cowboy, [
{port, 8080},
{listeners, 10},
{app, leviathan},
{tls_enabled, true},
{tls_opts, [{certfile, "dummy.crt"},
{keyfile, "dummy.key"},
{password, ""}]}
]},
...
]
There is a sample certificate and key generator that you can run with:
make tls
.
The above example config works with the generated files. To test the TLS,
put the config snippet into the config/sys.config
. Remember
to re-generated the release after the change.
With TLS enabled, the Visualizer can be accessed via https://localhost:8080/static/www/index.html.
An example usage of Leviathan is described in the example file.
There is a multi-host version of Leviathan on the multi-host branch.