Home Index
Installation.
For administrators who deployed Networkmaps before June 2019, on newer releases Networkmaps does not use the mysql database anymore to store user information. From now on, the user information will be stored in memory with periodic file exports.
To migrate from the database to a user file, you can use this script on the repository: docs/db2usermigration.js
This script will generate the user file that you can then reference on the configuration file. On the configuration file, you can specify the directory where this file is located. On this directory, the file has to be called: user_db.json
Basic Instalation for Ubuntu (and other Linux distros).
  1. Install Node.js. Version 10.15.1 or higher. Check this link for instructions: GITHUB Node Installation.
  2. Clone the repository.
    git clone https://github.com/pablomarle/networkmaps.git
  3. Create the configuration file. The configuration file uses JSON format. The most basic configuration file would look like this:
    {
        "socket": {
            "address": "<ip>",
            "port": <port>
        },
        "sendmail": {
            "server": "<smtp_server>",
            "port": <smtp_port>,
            "is_secured": <smtp_is_secured>,
            "user": "<smtp_user>",
            "password": "<smtp_password>",
            "from": "<email_from>"
        }
    },
    • <address>: string containing the ip address where the server will be listening. By default will be localhost.
    • <port>: port number where the server will be listening. By default will be 3000.
    • <smtp_server>: smtp server used to send emails to users.
    • <smtp_port>: smtp port where the smtp server is listening.
    • <smtp_is_secured>: true or false depending on whether we use a secured smtp connection (TLS) or not.
    • <smtp_user>: username to authenticate to smtp server.
    • <smtp_password>:
    • <email_from>: email address we will be sending emails from.
    Networkmaps expects the configuration file to be in: /etc/networkmaps/config.json
  4. Create the directories where the user file, diagrams and emails will be stored and make sure you have permissions to read and write on them. If not changed on the configuration file, these will default to:
    • User files: /var/lib/networkmaps/users
    • Diagrams: /var/lib/networkmaps/diagrams
    • Email queue: /var/lib/networkmaps/sendmail/queue
    • Emails sent: /var/lib/networkmaps/sendmail/sent
  5. Run the server. From the Networkmaps directory, run ./server.js
  6. Run the email server. From the Networkmaps directory, run ./smtp_daemon.js
  7. That is all. If you have any question, send me an email: pablo@masshandra.com.
Installation other OS (windows, mac).
Although we haven't tested these options, it should be possible to run Networkmaps on windows or mac.
Running with HTTPS.
To run the service as https, you will have to do three things:
  1. Enable SSL on the socket.
  2. Enable https on the url.
  3. Provide a certificate and it's key.
  4. Configure the fqdn of the server (and the port).
All these actions are done on the config file. Here is an example:
{
    "use_ssl_socket": true,
    "use_ssl": true,
    "server": {
        "hostname": "<fqdn>",
        "port": <client_port>
    },
    "socket": {
        "address": "<ip>",
        "port": <port>,
        "cert": "<cert_path>",
        "key": "<cert_key>"
    },
    "sendmail": {
        "server": "<smtp_server>",
        "port": <smtp_port>,
        "is_secured": <smtp_is_secured>,
        "user": "<smtp_user>",
        "password": "<smtp_password>",
        "from": "<email_from>"
    }
},
  • <fqdn>: fqdn of the service as it appears on the SSL certificate (name must resolve to the IP address of the socket)
  • <client_port>: port where clients have to connect to. In normal circumstances, this is the same port where the socket is listening.
  • <cert_path>: path to the file where the certificate is stored.
  • <cert_key>: path to the file where the key of the certificate is stored.
Running static content on a separated http server.
It's possible to configure Networkmaps to serve it's static content from a different web server (or a CDN). Here is a sample config file. Please note that static content has to be served using the same protocol running on the server (http or https).
{
    "server": {
        "hostname": "<fqdn>",
        "port": <client_port>
    },
    "staticserver": {
        "hostname": "<static_fqdn>",
        "port": <static_port>        
    },
    "socket": {
        "address": "<ip>",
        "port": <port>,
        "cert": "<cert_path>",
        "key": "<cert_key>"
    },
    "sendmail": {
        "server": "<smtp_server>",
        "port": <smtp_port>,
        "is_secured": <smtp_is_secured>,
        "user": "<smtp_user>",
        "password": "<smtp_password>",
        "from": "<email_from>"
    }
},
  • <static_fqdn>: fqdn where static content is running.
  • <static_port>: port where static content is served.
Recomendations.
TODO