shantanoo-desai / komponist

A Composer for your favorite IoT/ IIoT container stacks with Ansible + Jinja2 + Docker Compose v2
GNU Affero General Public License v3.0
25 stars 2 forks source link

Configuration and Setup for Node-RED #1

Closed shantanoo-desai closed 1 year ago

shantanoo-desai commented 1 year ago

Description

Node-RED provides a settings.js that has many specific sections to bring a node-RED container according to user specifications.

Generate a Jinja2 template to configure specific aspects of Node-RED.

Requirements

shantanoo-desai commented 1 year ago

Configuration YAML Structure

configuration:
    nodered:
      # Parameter: `image` (OPTIONAL)
      # Function: For Private Image Repositories that are not on DockerHub
      # Default Value: DockerHub (docker.io)
      # Acceptable Value: string (URL to your Private Repository)
      # image: <IMAGE_REPO_URL>

      # Parameter: `version` (OPTIONAL)
      # Function: Docker Image Version to be pulled from an Image Repository
      # Acceptable Values: string
      # Default Value: 'latest'
      version: '3.0.1'

      # Parameter: `disable_editor` (OPTIONAL)
      # Function: Disable Node-RED Editor
      # Default Value: false (if not set)
      # Acceptable Values: Boolean values should be strings: either 'true' or 'false'
      disable_editor: 'false'

The credentials structure in #2 will exist in a different YAML file to avoid exposing sensitive information all in one file as well as utilize the benefit of ansible-vault for data-at-rest encryption

shantanoo-desai commented 1 year ago

Configuration YAML Structure v2

komponist:
  # Parameter: `deploy_dir` (REQUIRED)
  # Function: Creates a directory in the dedicated path with the generated 
  #           settings files + docker compose files
  # Acceptable Value: Complete Path to where the directory should exist
  deploy_dir: './deploy'

  configuration:
    nodered:
      # Parameter: `image` (OPTIONAL)
      # Function: For Private Image Repositories that are not on DockerHub
      # Default Value: DockerHub (docker.io)
      # Acceptable Value: string (URL to your Private Repository including Image Name)
      # image: <IMAGE_REPO_URL>/<IMAGE_NAME>

      # Parameter: `version` (OPTIONAL)
      # Function: Docker Image Version to be pulled from an Image Repository
      # Acceptable Values: string
      # Default Value: 'latest'
      version: '3.0.1'

      # Parameter: `disable_editor` (OPTIONAL)
      # Function: Disable Node-RED Editor
      # Default Value: false (if not set)
      # Acceptable Values: Boolean values should be strings: either 'true' or 'false'
      disable_editor: 'false'

This structure pulls the configuration map into komponist which adds filesystem requirement of deploy_dir