Skip to content

ivanos/ivancp_allinone_node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IvanOS Control Plane All In One

This is an Erlang node that contains:

  1. erl_sshd
  2. dobby_core_lib
  3. dobby_rest_lib
  4. dobby_ui_lib
  5. lucet_core_lib
  6. weave_core_lib
  7. erl_cowboy

Table of Contents

Requirements

  • Erlang R17+
  • npm

Building

To build the application call: make. This will:

  • download the dependencies,
  • compile the code,
  • copy the dobby_ui_lib nodeJS artefact to the dobby_rest/priv/static/www
  • generate an Erlang release,
  • generate ssh keys
    • private and public user keys: ida_rsa and id_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

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.

Running

_rel/ivancp_allinone/bin/ivancp_allinone

To access the Dobby Visualizer go to http://localhost:8080/static/www/index.html

You can follow an example on how to use Dobby Publishers with Lucet.

Connecting via ssh

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 11144 -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:

[
...
 {erl_cowboy, [
               {port, 8080},
               {listeners, 10},
               {app, 'ivancp_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 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published