Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ rel/dobby_allinone/
rebar
id_rsa*
priv/erl_sshd
priv/erl_cowboy
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ rebar:

id_rsa:
deps/erl_sshd/make_keys

tls:
deps/erl_cowboy/make_tls.sh
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ This is an Erlang node that contains:
3. [dobby_ui_lib](https://github.com/ivanos/dobby_ui_lib)
3. [erl_sshd](https://github.com/marcsugiyama/erl_sshd)

<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
**Table of Contents**

- [Dobby All In One](#dobby-all-in-one)
- [Requirements](#requirements)
- [Building](#building)
- [Running](#running)
- [Connecting via ssh](#connecting-via-ssh)

<!-- markdown-toc end -->

- [Configuring TLS](#configuring-tls)

## Requirements
- Erlang R17+
Expand Down Expand Up @@ -61,3 +58,37 @@ ssh 127.0.0.1 -p 11133 -i id_rsa
```

To exit the Erlang shell obtained via ssh call `exit().`

## Configuring TLS

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:
```erlang
[
...
{erl_cowboy, [
{port, 8080},
{listeners, 10},
{app, 'dobby_allinone'},
{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 `rel/files/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.
11 changes: 8 additions & 3 deletions rel/files/sys.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
]},
%% erl_mnesia configuration
{erl_mnesia, [
{options, [persistent]}
]},
{options, [persistent]}
]},
%% erl_cowboy configuration
{erl_cowboy, [
{port, 8080},
{listeners, 10}
{listeners, 10},
{app, 'dobby_allinone'},
{tls_enabled, false}
%% ,{tls_opts, [{certfile, "dummy.crt"},
%% {keyfile, "dummy.key"},
%% {password, ""}]}
]},
%% lager configuration
{lager, [
Expand Down