Code Monkey home page Code Monkey logo

tiguitto's Introduction

TIGUITTO

Highly used Telegraf + InfluxDBv1.8 + Grafana stack with Mosquitto MQTT broker. Hence, the name:

T   I   G   UITTO
            |--(mosq)
        |--(rafana)
    |--(nfluxDB)
 |--(elegraf)

Initially created for Medium.com Post: Creating Your IoT Node and Edge Prototype with InfluxDB, Telegraf and Docker

Cases

Since the stack is very often used in IoT Setups, there are three usable scenarios that are thought of:

CASE Security Usage Status
prototype Basic Auth. Quick Deployments, Tests on Edge Devices DONE
selfsigned X.509 Certificates For Standalone Stacks for internal infrastructure DONE
certbot Let's Encrypt Certificates For Production-Ready Cloud Deployments DONE

Usage

  1. Refer to README.md in each case directory, since before bringing the stack up you will need to configure the case by executing some scripts and commands

  2. from root directory:

     docker-compose -f <CASE>/docker-compose.<CASE>.yml up -d
    

tiguitto's People

Contributors

akayeshmantha avatar marcolew avatar shantanoo-desai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tiguitto's Issues

[mosquitto] Enable Websockets connection

Tasks

  • Enable port 1884 for insecure Websockets (prototype case)
  • Enable port 8884 for secure Websockets (selfsigned, certbot case)
  • Add simple python script to distinguish the selfsigned can certbot case i.e. Insecure TLS verification

Prototype MQTT Mosquito Connection not working

Hi, I am attempted to connect to mosquitto broker but since MQTTFX is no longer free, I've been trying to use MQTT Explorer, MQTTBOX, MQTTLens, EMQX Client ( MQTTX ) with no luck connecting to mosquitto, any help is appreciated.

( I will test selfsigned now, then move on to Lety's Encrypt )
self signed could not complete as error states: IP does not match certificate's altenames: IP: 192.168.10.25 is not in the cert's list:
I edited the generate-certs.sh with the following:
CN=$(192.168.10.25 -I

Certbot folder is missing

00-install-certbot.sh
01-generate-certs.sh

๐Ÿค”

[Self-Signed] Telegraf is unable to connect to the TLS enabled Mosquitto Broker

With the current code on the branch selfsigned, the telegraf container keeps trying to connect to the mosquitto container configured with TLS certificates and available on port 8883 on a machine.

Publishing/Subscribing from mosquitto-clients is possible and data is being sent via usage of client certificates, but telegraf is unable to connect with the broker.

Suspicion lies in using the Common Name (CN) during creation of the Certificates.

Perhaps add CN=0.0.0.0 or CN=mosquitto

Sources

MQTT TLS Ubuntu 18.04

Bash Scripts for certbot installation + certificate creation

Provide bash scripts for the following tasks:

  • Install certbot for the machine (POSIX-ish compliant)
  • Enable the HTTP Port (80) via firewall for certbot
  • Generate SSL certificates via certbot CLI for a given domain name and e-mail address
  • Append necessary environment variables for certbot.env

Scripts:

  • 00-install-certbot.sh
  • 01-generate-certs.sh

addresses #1

Introduce basic authentication/authorization for Prototype case

Stack Specifications

Provide basic authentication / authorization for all components

InfluxDB

Source

Environment variables:

INFLUX_USERNAME=admin
INFLUX_PASSWORD=adminInflux
INFLUXDB_HTTP_AUTH_ENABLED=true

Grafana

Source

Environment variables:

GF_SECURITY_ADMIN_USER=admin
GF_SECURITY_ADMIN_PASSWORD=adminGrafana

Mosquitto

The Broker requires a docker container to convert passwords file to encrypted information. Source

Telegraf

It is possible to leverage the Environment Variables in the telegraf.conf file Source

[Influxdb]Update Environment Variables for cases

Influxdb

Based on the Documentation for InfluxDB v1.x on Docker Hub

Environment Variables for InfluxDB to be used:

INFLUXDB_DB
INFLUXDB_HTTP_AUTH_ENABLED
INFLUXDB_ADMIN_USER
INFLUXDB_ADMIN_PASSWORD

INFLUXDB_USERNAME
INFLUXDB_PASSWORD

According to documentation:

INFLUXDB_USER
The name of a user to be created with no privileges. If INFLUXDB_DB is set, this user will be granted read and write permissions for that database.

Update Mosquitto to 2.0

Using the new Mosquitto 2.0 version should solve our issues with user mangement and topic registration as Mosquitto 2.0 also includes a management dashboard

[Telegraf] Revert back to version 1.13

[[processors.enum]] mapping has a bug for version 1.15 which does not allow string->string mapping for the sensorID with location.

Changes needed to telegraf image in:

  • prototype/docker-compose.prototype.yml
  • selfsigned/docker-compose.selfsigned.yml
  • certbot/docker-compose.certbot.yml

[telegraf] Add order key for processors in configuration file

#15 reverted telegraf from the v1.15 to v1.13

Problem

The problem is documented in the GitHub Gist

The [[processors.enum]] was not working with the v1.15 where the sensorID was enumerated to location tag.

Solution

The solution is to mention the order key to all the processors in the telegraf configuration file

  1. Regular Expression Parsing should occur first [[processors.regex]] order = 1
  2. Enumeration should occur next [[processors.enum]] order = 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.