Miss any of our Open RFC calls?Watch the recordings here! »

fog-controller

0.1.18 • Public • Published

Fog Controller Setup

1. Install fog-controller

   npm install -g fog-controller

2. Create user

   fog-controller user -add <email> <firstName> <lastName> <password>

3. Start fog-controller

   fog-controller start

4. Open your browser and hit following endpoints to setup IOFog, provision key and fog access token.

  • Create Fog

   http://localhost:3000/api/v2/instance/create/type/:type?t=:userAccessToken

   where ':type' is FogType which can be 1 for Standard Linux (x86) OR 2 for ARM Linux

   and ':userAccessToken' is obtained by creating user

  • Fog provisioning

   http://localhost:3000/api/v2/authoring/fabric/provisioningkey/instanceid/:instanceId

   where ':instanceId' is obtained by creating fog.

   The provision key generated by this endpoint will be used by ioFog for provisioning.

  • Create fog access token

   http://localhost:3000/api/v2/instance/provision/key/:provisionKey/fabrictype/:fabricType

   where ':provisionKey' is obtained by provisioning fog

   and ':fabricType' is a FogType

Usage

1. To view help menu

    fog-controller help

2. To view current status

    fog-controller status   

3. To view version and license

    fog-controller version

Logs

  • Log files are located at './node_modules/fog-controller/logs/'
  • Log files are rotated on daily basis or if a file size exceeds 20 MB

System Requirements (Recommended)

  • Processor: 64 bit Dual Core or better
  • RAM: 2 GB
  • Hard Disk: 10 GB

Platforms Supported

  • Ubuntu
  • macOS Sierra
  • Windows

Configuration Management

1. To list configurations

    fog-controller config -list

2. To add a configuration

    fog-controller config -add <key> <value>

Note: Configuration keys can be one of following

  • port
  • ssl_key
  • intermediate_cert
  • ssl_cert

To setup HTTPS for fog controller, do following steps:

    fog-controller config -add port 443
    fog-controller config -add ssl_key '/home/certificates/key.pem'
    fog-controller config -add intermediate_cert '/home/certificates/gs_intermediate_ca.crt'
    fog-controller config -add ssl_cert '/home/certificates/certificate.pem'

3. To remove a configuration

    fog-controller config -remove <key>

User Managment

1. To list users

    fog-controller user -list

2. To add a user

    fog-controller user -add <email> <firstName> <lastName> <password>

3. To remove a user

    fog-controller user -remove <email>

4. To reset password

    fog-controller user -generateToken <email>

ComSat Managment

1. To list all ComSat(s)

    fog-controller comsat -list

2. To add a ComSat

    fog-controller comsat -add <name> <domain> <publicIP>

3. To remove a ComSat

    fog-controller comsat -remove <ID>

Execute Fog-Controller on startup

 For Windows, do following steps:

   - Open a new text document

   - Insert following line in it:

    fog-controller start

   - Save text document with extension as ‘.bat’

   - Put the .bat file in

    “C:\Users\username\AppData\Roaming\Microsoft\Windows\StartMenu\Programs\Startup\” 
    (replacing ‘username’ with the name of your user).

 For Ubuntu, do following steps:

   - Create a file as ‘fog-controller.conf’ in /etc/init/ directory with following command:

    sudo gedit /etc/init/fog-controller.conf

   - Save following text in the file:

    # fog-controller.conf
    description "Fog Controller project @ iotracks.com"
    start on startup
    stop on shutdown
    post-start script
            mkdir -p /usr/local/lib/node_modules/fog-controller
            cd /usr/local/lib/node_modules/fog-controller
            sudo fog-controller start
    end script
    respawn

Keywords

Install

npm i [email protected]

Version

0.1.18

License

Copyright (C) 2017 iotracks, inc. Eclipse ioFog is provided under the Eclipse Public License (EPL) https://www.eclipse.org/legal/epl-v10.html

Last publish

Collaborators

  • avatar