Intial Commit

This commit is contained in:
valki
2020-10-17 18:42:50 +02:00
commit 664c6d8ca3
5892 changed files with 759183 additions and 0 deletions

153
.env Executable file
View File

@@ -0,0 +1,153 @@
## Security
#
# Set these to strong passwords to avoid intruders from impersonating a service account
# The service(s) won't start unless these are specified
# Running ./gen-passwords.sh will update .env with strong passwords
# DO NOT reuse passwords
#
# XMPP component password for Jicofo
JICOFO_COMPONENT_SECRET=c688eda873669a2c5531c54f6277a574
# XMPP password for Jicofo client connections
JICOFO_AUTH_PASSWORD=1f136e2b96c7ce0ad45cadef1ca3fd89
# XMPP password for JVB client connections
JVB_AUTH_PASSWORD=9955048acdf8f96e1ce02f7ebf5aa4a6
# XMPP password for Jigasi MUC client connections
JIGASI_XMPP_PASSWORD=a38a5e1e61d8f1a165f2e0df1807c7be
# XMPP recorder password for Jibri client connections
JIBRI_RECORDER_PASSWORD=8daea9305a240f6d5f9d01808fa5fbcf
# XMPP password for Jibri client connections
JIBRI_XMPP_PASSWORD=fe0a93e89eb6a453a06f25ca6a4ddf21
#
# Basic configuration options
#
# Directory where all configuration will be stored
CONFIG=/opt/openAger/config
# Exposed HTTP port for node red (1880)
NODE_PORT=1874
# Exposed port for mosquitto (1883)
MOSQUITTO_PORT=1884
# Exposed SSL port for node red (9001)
MOSQUITTOS_PORT=9002
# System time zone
TZ=Europe/Vienna
#
# Config for node-red
#
# in case you are using the great nginx/letsencrypt combination from jwilder
# and nginx: https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion
# Your hostname for nginx
#NODE_VIRTUAL_HOST=hostname.domain.com
# Your email
#NODE_LETSENCRYPT_EMAIL= your@mail.com
# Your hostname for letsencrypt
#NODE_LETSENCRYPT_HOST= hostname.domain.com
# This is the secret to encrypt your password storage within nodered
NODE_RED_CREDENTIAL_SECRET=enryptmysecrets
# This is the password for the frontend / ui access with username "open".
# Get a new hash by docker exec -it node-red npx node-red admin hash-pw
NODE_RED_USER_AUTH=$2b$08$XUvNWY1pmG39J1Nc1OipD.JjUoLdvfgfDJDIiY1Tma/6YZEVjAADu
# This is the password for the backend of nodered with username "admin"
NODE_RED_ADMIN_AUTH=$2b$08$XUvNWY1pmG39J1Nc1OipD.JjUoLdvfgfDJDIiY1Tma/6YZEVjAADu
#
# Config for mosquitto
#
# Note: hardcoded mqtt user is open:ager
# Change or add user? docker exec -it mosquitto mosquitto_passwd -b /mosquitto/config/passwordfile open ager
# Mosquitto URL
MQTT_URL=openager_mosquitto_1
#
# Config MariaDB
#
# Root Password for mariadb. CHANGE THAT in case you want to expose it to the
# internet
MYSQL_ROOT_PASSWORD=openager
# Username to connect
MYSQL_USER=open
#Password for the user above
MYSQL_PASSWORD=ager
# Database we are going to use
MYSQL_DATABASE=openager
# internal hostname of mariadb
MYSQL_URL=openager_mariadb_1
#
# Config phpMyAdmin
#
# Hostname of your mariadb
PMA_HOST=openager_mariadb_1
# Port of phpMyAdmin if you want to expose (8088)
PHMMYADMIN_PORT=8088
#
# Config for influxDB
#
# admin user and password for influxdb
INFLUXDB_ADMIN_USER=admin
INFLUXDB_ADMIN_PASSWORD=openager
# standard user and password for influx
INFLUXDB_USER=open
INFLUXDB_USER_PASSWORD=ager
# name of the standard db within influx
INFLUXDB_DB=openAger
# Hostname of the influx
INFLUX_URL=openager_influxdb_1
#
# Config for grafana
#
# external port of phpMyAdmin if you want to expose (3001)
GRAFANA_PORT=3003
# Your hostname for nginx
#GRAFANA_VIRTUAL_HOST=hostname.domain.com
# Your email
#GRAFANA_LETSENCRYPT_EMAIL= your@mail.com
# Your hostname for letsencrypt
#GRAFANA_LETSENCRYPT_HOST= hostname.domain.com

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*~

41
Makefile Executable file
View File

@@ -0,0 +1,41 @@
FORCE_REBUILD ?= 0
OPENAGER_RELEASE ?= stable
OPENAGER_BUILD ?= latest
OPENAGER_REPO ?= openager
OPENAGER_SERICES ?= nodered
BUILD_ARGS := --build-arg OPENAGER_REPO=$(OPENAGER_REPO)
ifeq ($(FORCE_REBUILD), 1)
BUILD_ARGS := $(BUILD_ARGS) --no-cache
endif
all: build-all
release: tag-all push-all
build:
$(MAKE) BUILD_ARGS="$(BUILD_ARGS)" OPENAGER_REPO="$(OPENAGER_REPO)" OPENAGER_RELEASE="$(OPENAGER_RELEASE)" -C $(OPENAGER_SERICE) build
tag:
docker tag $(OPENAGER_REPO)/$(OPENAGER_SERICE):latest $(OPENAGER_REPO)/$(OPENAGER_SERICE):$OPENAGER_BUILD)
push:
docker push $(OPENAGER_REPO)/$(OPENAGER_SERICE):latest
docker push $(OPENAGER_REPO)/$(OPENAGER_SERICE):$OPENAGER_BUILD)
%-all:
@$(foreach SERVICE, $(OPENAGER_SERICES), $(MAKE) --no-print-directory OPENAGER_SERICE=$(SERVICE) $(subst -all,;,$@))
clean:
docker-compose stop
docker-compose rm
docker network prune
prepare:
docker pull debian:stretch-slim
docker pull etherpad/etherpad
FORCE_REBUILD=1 $(MAKE)
.PHONY: all build tag push clean prepare

142
docker-compose.yml Executable file
View File

@@ -0,0 +1,142 @@
version: '3'
services:
# openAger nodered
nodered:
build:
context: ./nodered
args:
- MOSQUITTO_PORT=${MOSQUITTO_PORT}
- MQTT_URL=${MQTT_URL}
- MYSQL_URL=${MYSQL_URL}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- INFLUXDB_USER=${INFLUXDB_USER}
- INFLUXDB_USER_PASSWORD=${INFLUXDB_USER_PASSWORD}
- INFLUXDB_DB=${INFLUXDB_DB}
- INFLUX_URL=${INFLUX_URL}
ports:
- '${NODE_PORT}:1880/tcp'
volumes:
- node-red:/data
environment:
- NODE_VIRTUAL_HOST
- NODE_LETSENCRYPT_EMAIL
- NODE_LETSENCRYPT_HOST
- NODE_RED_CREDENTIAL_SECRET
- NODE_RED_USER_AUTH
- NODE_RED_ADMIN_AUTH
- MQTT_URL
- MOSQUITTO_PORT
- MYSQL_URL
- MYSQL_DATABASE
- TZ
- INFLUXDB_USER
- INFLUXDB_USER_PASSWORD
- INFLUXDB_DB
- INFLUX_URL
restart: always
networks:
openager.local:
# openAger mosquitto
mosquitto:
build: mosquitto/.
ports:
- '${MOSQUITTO_PORT}:1883/tcp'
- '${MOSQUITTOS_PORT}:9001/tcp'
volumes:
- mosquitto_cfg:/mosquitto
- mosquitto_data:/mosquitto/data
- mosquitto_log:/mosquitto/log
environment:
- TZ
restart: always
networks:
openager.local:
# openAger mariadb
mariadb:
build: ./mariadb
volumes:
- mariadb:/var/lib/mysql
environment:
- TZ
- MYSQL_ROOT_PASSWORD
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
restart: always
networks:
openager.local:
# openAger phpMyAdmin
phpmyadmin:
image: phpmyadmin
ports:
- '${PHMMYADMIN_PORT}:80/tcp'
environment:
- PMA_HOST
restart: always
volumes:
- phpmyadmin:/sessions
networks:
openager.local:
# openAger influxDB
influxdb:
build: ./influxdb
volumes:
- influxdb:/var/lib/influxdb
environment:
- TZ
- INFLUXDB_ADMIN_USER
- INFLUXDB_ADMIN_PASSWORD
- INFLUXDB_USER
- INFLUXDB_USER_PASSWORD
- INFLUXDB_DB
restart: always
networks:
openager.local:
# openAger grafana
grafana:
build: ./grafana
ports:
- '${GRAFANA_PORT}:3000/tcp'
volumes:
- grafana:/etc/grafana
- grafana-storage:/var/lib/grafana
environment:
- TZ
- GRAFANA_VIRTUAL_HOST
- GRAFANA_LETSENCRYPT_EMAIL
- GRAFANA_LETSENCRYPT_HOST
restart: always
networks:
openager.local:
# Volume definitions
volumes:
node-red:
driver: local
mosquitto_cfg:
driver: local
mosquitto_log:
driver: local
mosquitto_data:
driver: local
mariadb:
driver: local
phpmyadmin:
driver: local
influxdb:
driver: local
grafana:
driver: local
grafana-storage:
driver: local
# Custom network so all services can communicate using a FQDN
networks:
openager.local:

4
grafana/Dockerfile Executable file
View File

@@ -0,0 +1,4 @@
FROM grafana/grafana:latest
COPY rootfs /

4
grafana/Makefile Executable file
View File

@@ -0,0 +1,4 @@
build:
docker build $(BUILD_ARGS) -t $(OPENAGER_REPO)/grafana .
.PHONY: build

4
influxdb/Dockerfile Executable file
View File

@@ -0,0 +1,4 @@
FROM influxdb:latest
COPY rootfs /

4
influxdb/Makefile Executable file
View File

@@ -0,0 +1,4 @@
build:
docker build $(BUILD_ARGS) -t $(OPENAGER_REPO)/influxdb .
.PHONY: build

View File

@@ -0,0 +1,160 @@
reporting-disabled = false
bind-address = "127.0.0.1:8088"
[meta]
dir = "/var/lib/influxdb/meta"
retention-autocreate = true
logging-enabled = true
[data]
dir = "/var/lib/influxdb/data"
index-version = "inmem"
wal-dir = "/var/lib/influxdb/wal"
wal-fsync-delay = "0s"
validate-keys = false
query-log-enabled = true
cache-max-memory-size = 1073741824
cache-snapshot-memory-size = 26214400
cache-snapshot-write-cold-duration = "10m0s"
compact-full-write-cold-duration = "4h0m0s"
compact-throughput = 50331648
compact-throughput-burst = 50331648
max-series-per-database = 1000000
max-values-per-tag = 100000
max-concurrent-compactions = 0
max-index-log-file-size = 1048576
series-id-set-cache-size = 100
series-file-max-concurrent-snapshot-compactions = 0
trace-logging-enabled = false
tsm-use-madv-willneed = false
[coordinator]
write-timeout = "10s"
max-concurrent-queries = 0
query-timeout = "0s"
log-queries-after = "0s"
max-select-point = 0
max-select-series = 0
max-select-buckets = 0
[retention]
enabled = true
check-interval = "30m0s"
[shard-precreation]
enabled = true
check-interval = "10m0s"
advance-period = "30m0s"
[monitor]
store-enabled = true
store-database = "_internal"
store-interval = "10s"
[subscriber]
enabled = true
http-timeout = "30s"
insecure-skip-verify = false
ca-certs = ""
write-concurrency = 40
write-buffer-size = 1000
[http]
enabled = true
bind-address = ":8086"
auth-enabled = true
log-enabled = true
suppress-write-log = false
write-tracing = false
flux-enabled = false
flux-log-enabled = false
pprof-enabled = true
pprof-auth-enabled = false
debug-pprof-enabled = false
ping-auth-enabled = false
prom-read-auth-enabled = false
https-enabled = false
https-certificate = "/fullchain.pem"
https-private-key = "/key.pem"
max-row-limit = 0
max-connection-limit = 0
shared-secret = ""
realm = "InfluxDB"
unix-socket-enabled = false
unix-socket-permissions = "0777"
bind-socket = "/var/run/influxdb.sock"
max-body-size = 25000000
access-log-path = ""
max-concurrent-write-limit = 0
max-enqueued-write-limit = 0
enqueued-write-timeout = 30000000000
[logging]
format = "auto"
level = "info"
suppress-logo = false
[[graphite]]
enabled = false
bind-address = ":2003"
database = "graphite"
retention-policy = ""
protocol = "tcp"
batch-size = 5000
batch-pending = 10
batch-timeout = "1s"
consistency-level = "one"
separator = "."
udp-read-buffer = 0
[[collectd]]
enabled = false
bind-address = ":25826"
database = "collectd"
retention-policy = ""
batch-size = 5000
batch-pending = 10
batch-timeout = "10s"
read-buffer = 0
typesdb = "/usr/share/collectd/types.db"
security-level = "none"
auth-file = "/etc/collectd/auth_file"
parse-multivalue-plugin = "split"
[[opentsdb]]
enabled = false
bind-address = ":4242"
database = "opentsdb"
retention-policy = ""
consistency-level = "one"
tls-enabled = false
certificate = "/etc/ssl/influxdb.pem"
batch-size = 1000
batch-pending = 5
batch-timeout = "1s"
log-point-errors = true
[[udp]]
enabled = false
bind-address = ":8089"
database = "udp"
retention-policy = ""
batch-size = 5000
batch-pending = 10
read-buffer = 0
batch-timeout = "1s"
precision = ""
[continuous_queries]
log-enabled = true
enabled = true
query-stats-enabled = false
run-interval = "1s"
[tls]
min-version = ""
max-version = ""

5
mariadb/Dockerfile Executable file
View File

@@ -0,0 +1,5 @@
FROM mariadb:latest
#RUN chown 1000:1000 /data
COPY rootfs /

4
mariadb/Makefile Executable file
View File

@@ -0,0 +1,4 @@
build:
docker build $(BUILD_ARGS) -t $(OPENAGER_REPO)/mariadb .
.PHONY: build

View File

@@ -0,0 +1,34 @@
CREATE DATABASE IF NOT EXISTS `openager` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `openager`;
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `sensor_aggr`
--
CREATE TABLE IF NOT EXISTS `sensor_aggr` (
`epoch` bigint(20) NOT NULL,
`device` varchar(255) NOT NULL,
`sensor` varchar(255) NOT NULL,
`value` double NOT NULL,
PRIMARY KEY (`epoch`,`device`,`sensor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `sensor_data`
--
CREATE TABLE IF NOT EXISTS `sensor_data` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`device` text NOT NULL,
`sensor` text NOT NULL,
`value` double NOT NULL,
`epoch` bigint(20) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
KEY `sensor_data_idx1` (`timestamp`),
KEY `sensor_data_idx2` (`epoch`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

5
mosquitto/Dockerfile Executable file
View File

@@ -0,0 +1,5 @@
FROM eclipse-mosquitto:latest
RUN chown -R 1000:1000 /mosquitto
COPY --chown=1000:1000 rootfs /mosquitto

4
mosquitto/Makefile Executable file
View File

@@ -0,0 +1,4 @@
build:
docker build $(BUILD_ARGS) -t $(OPENAGER_REPO)/mosquitto .
.PHONY: build

View File

@@ -0,0 +1,989 @@
# Config file for mosquitto
#
# See mosquitto.conf(5) for more information.
#
# Default values are shown, uncomment to change.
#
# Use the # character to indicate a comment, but only if it is the
# very first character on the line.
# =================================================================
# General configuration
# =================================================================
# Use per listener security settings.
#
# It is recommended this option be set before any other options.
#
# If this option is set to true, then all authentication and access control
# options are controlled on a per listener basis. The following options are
# affected:
#
# password_file acl_file psk_file auth_plugin auth_opt_* allow_anonymous
# auto_id_prefix allow_zero_length_clientid
#
# Note that if set to true, then a durable client (i.e. with clean session set
# to false) that has disconnected will use the ACL settings defined for the
# listener that it was most recently connected to.
#
# The default behaviour is for this to be set to false, which maintains the
# setting behaviour from previous versions of mosquitto.
per_listener_settings true
password_file /mosquitto/config/passwordfile
# If a client is subscribed to multiple subscriptions that overlap, e.g. foo/#
# and foo/+/baz , then MQTT expects that when the broker receives a message on
# a topic that matches both subscriptions, such as foo/bar/baz, then the client
# should only receive the message once.
# Mosquitto keeps track of which clients a message has been sent to in order to
# meet this requirement. The allow_duplicate_messages option allows this
# behaviour to be disabled, which may be useful if you have a large number of
# clients subscribed to the same set of topics and are very concerned about
# minimising memory usage.
# It can be safely set to true if you know in advance that your clients will
# never have overlapping subscriptions, otherwise your clients must be able to
# correctly deal with duplicate messages even when then have QoS=2.
#allow_duplicate_messages false
# This option controls whether a client is allowed to connect with a zero
# length client id or not. This option only affects clients using MQTT v3.1.1
# and later. If set to false, clients connecting with a zero length client id
# are disconnected. If set to true, clients will be allocated a client id by
# the broker. This means it is only useful for clients with clean session set
# to true.
#allow_zero_length_clientid true
# If allow_zero_length_clientid is true, this option allows you to set a prefix
# to automatically generated client ids to aid visibility in logs.
# Defaults to 'auto-'
#auto_id_prefix auto-
# This option affects the scenario when a client subscribes to a topic that has
# retained messages. It is possible that the client that published the retained
# message to the topic had access at the time they published, but that access
# has been subsequently removed. If check_retain_source is set to true, the
# default, the source of a retained message will be checked for access rights
# before it is republished. When set to false, no check will be made and the
# retained message will always be published. This affects all listeners.
#check_retain_source true
# QoS 1 and 2 messages will be allowed inflight per client until this limit
# is exceeded. Defaults to 0. (No maximum)
# See also max_inflight_messages
#max_inflight_bytes 0
# The maximum number of QoS 1 and 2 messages currently inflight per
# client.
# This includes messages that are partway through handshakes and
# those that are being retried. Defaults to 20. Set to 0 for no
# maximum. Setting to 1 will guarantee in-order delivery of QoS 1
# and 2 messages.
#max_inflight_messages 20
# For MQTT v5 clients, it is possible to have the server send a "server
# keepalive" value that will override the keepalive value set by the client.
# This is intended to be used as a mechanism to say that the server will
# disconnect the client earlier than it anticipated, and that the client should
# use the new keepalive value. The max_keepalive option allows you to specify
# that clients may only connect with keepalive less than or equal to this
# value, otherwise they will be sent a server keepalive telling them to use
# max_keepalive. This only applies to MQTT v5 clients. The maximum value
# allowable is 65535. Do not set below 10.
#max_keepalive 65535
# For MQTT v5 clients, it is possible to have the server send a "maximum packet
# size" value that will instruct the client it will not accept MQTT packets
# with size greater than max_packet_size bytes. This applies to the full MQTT
# packet, not just the payload. Setting this option to a positive value will
# set the maximum packet size to that number of bytes. If a client sends a
# packet which is larger than this value, it will be disconnected. This applies
# to all clients regardless of the protocol version they are using, but v3.1.1
# and earlier clients will of course not have received the maximum packet size
# information. Defaults to no limit. Setting below 20 bytes is forbidden
# because it is likely to interfere with ordinary client operation, even with
# very small payloads.
#max_packet_size 0
# QoS 1 and 2 messages above those currently in-flight will be queued per
# client until this limit is exceeded. Defaults to 0. (No maximum)
# See also max_queued_messages.
# If both max_queued_messages and max_queued_bytes are specified, packets will
# be queued until the first limit is reached.
#max_queued_bytes 0
# The maximum number of QoS 1 and 2 messages to hold in a queue per client
# above those that are currently in-flight. Defaults to 100. Set
# to 0 for no maximum (not recommended).
# See also queue_qos0_messages.
# See also max_queued_bytes.
#max_queued_messages 100
#
# This option sets the maximum number of heap memory bytes that the broker will
# allocate, and hence sets a hard limit on memory use by the broker. Memory
# requests that exceed this value will be denied. The effect will vary
# depending on what has been denied. If an incoming message is being processed,
# then the message will be dropped and the publishing client will be
# disconnected. If an outgoing message is being sent, then the individual
# message will be dropped and the receiving client will be disconnected.
# Defaults to no limit.
#memory_limit 0
# This option sets the maximum publish payload size that the broker will allow.
# Received messages that exceed this size will not be accepted by the broker.
# The default value is 0, which means that all valid MQTT messages are
# accepted. MQTT imposes a maximum payload size of 268435455 bytes.
#message_size_limit 0
# This option allows persistent clients (those with clean session set to false)
# to be removed if they do not reconnect within a certain time frame.
#
# This is a non-standard option in MQTT V3.1 but allowed in MQTT v3.1.1.
#
# Badly designed clients may set clean session to false whilst using a randomly
# generated client id. This leads to persistent clients that will never
# reconnect. This option allows these clients to be removed.
#
# The expiration period should be an integer followed by one of h d w m y for
# hour, day, week, month and year respectively. For example
#
# persistent_client_expiration 2m
# persistent_client_expiration 14d
# persistent_client_expiration 1y
#
# The default if not set is to never expire persistent clients.
#persistent_client_expiration
# Write process id to a file. Default is a blank string which means
# a pid file shouldn't be written.
# This should be set to /var/run/mosquitto.pid if mosquitto is
# being run automatically on boot with an init script and
# start-stop-daemon or similar.
#pid_file
# Set to true to queue messages with QoS 0 when a persistent client is
# disconnected. These messages are included in the limit imposed by
# max_queued_messages and max_queued_bytes
# Defaults to false.
# This is a non-standard option for the MQTT v3.1 spec but is allowed in
# v3.1.1.
#queue_qos0_messages false
# Set to false to disable retained message support. If a client publishes a
# message with the retain bit set, it will be disconnected if this is set to
# false.
#retain_available true
# Disable Nagle's algorithm on client sockets. This has the effect of reducing
# latency of individual messages at the potential cost of increasing the number
# of packets being sent.
#set_tcp_nodelay false
# Time in seconds between updates of the $SYS tree.
# Set to 0 to disable the publishing of the $SYS tree.
#sys_interval 10
# The MQTT specification requires that the QoS of a message delivered to a
# subscriber is never upgraded to match the QoS of the subscription. Enabling
# this option changes this behaviour. If upgrade_outgoing_qos is set true,
# messages sent to a subscriber will always match the QoS of its subscription.
# This is a non-standard option explicitly disallowed by the spec.
#upgrade_outgoing_qos false
# When run as root, drop privileges to this user and its primary
# group.
# Set to root to stay as root, but this is not recommended.
# If run as a non-root user, this setting has no effect.
# Note that on Windows this has no effect and so mosquitto should
# be started by the user you wish it to run as.
#user mosquitto
# =================================================================
# Default listener
# =================================================================
# IP address/hostname to bind the default listener to. If not
# given, the default listener will not be bound to a specific
# address and so will be accessible to all network interfaces.
# bind_address ip-address/host name
#bind_address
# Port to use for the default listener.
#port 1883
# Bind the listener to a specific interface. This is similar to
# bind_address above but is useful when an interface has multiple addresses or
# the address may change. It is valid to use this with the bind_address option,
# but take care that the interface you are binding to contains the address you
# are binding to, otherwise you will not be able to connect.
# Example: bind_interface eth0
#bind_interface
# When a listener is using the websockets protocol, it is possible to serve
# http data as well. Set http_dir to a directory which contains the files you
# wish to serve. If this option is not specified, then no normal http
# connections will be possible.
#http_dir
# The maximum number of client connections to allow. This is
# a per listener setting.
# Default is -1, which means unlimited connections.
# Note that other process limits mean that unlimited connections
# are not really possible. Typically the default maximum number of
# connections possible is around 1024.
#max_connections -1
# Choose the protocol to use when listening.
# This can be either mqtt or websockets.
# Websockets support is currently disabled by default at compile time.
# Certificate based TLS may be used with websockets, except that
# only the cafile, certfile, keyfile and ciphers options are supported.
#protocol mqtt
# Set use_username_as_clientid to true to replace the clientid that a client
# connected with with its username. This allows authentication to be tied to
# the clientid, which means that it is possible to prevent one client
# disconnecting another by using the same clientid.
# If a client connects with no username it will be disconnected as not
# authorised when this option is set to true.
# Do not use in conjunction with clientid_prefixes.
# See also use_identity_as_username.
#use_username_as_clientid
# -----------------------------------------------------------------
# Certificate based SSL/TLS support
# -----------------------------------------------------------------
# The following options can be used to enable SSL/TLS support for
# this listener. Note that the recommended port for MQTT over TLS
# is 8883, but this must be set manually.
#
# See also the mosquitto-tls man page.
# At least one of cafile or capath must be defined. They both
# define methods of accessing the PEM encoded Certificate
# Authority certificates that have signed your server certificate
# and that you wish to trust.
# cafile defines the path to a file containing the CA certificates.
# capath defines a directory that will be searched for files
# containing the CA certificates. For capath to work correctly, the
# certificate files must have ".crt" as the file ending and you must run
# "openssl rehash <path to capath>" each time you add/remove a certificate.
#cafile
#capath
# Path to the PEM encoded server certificate.
#certfile
# Path to the PEM encoded keyfile.
#keyfile
# If you have require_certificate set to true, you can create a certificate
# revocation list file to revoke access to particular client certificates. If
# you have done this, use crlfile to point to the PEM encoded revocation file.
#crlfile
# If you wish to control which encryption ciphers are used, use the ciphers
# option. The list of available ciphers can be obtained using the "openssl
# ciphers" command and should be provided in the same format as the output of
# that command.
# If unset defaults to DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:@STRENGTH
#ciphers DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:@STRENGTH
# To allow the use of ephemeral DH key exchange, which provides forward
# security, the listener must load DH parameters. This can be specified with
# the dhparamfile option. The dhparamfile can be generated with the command
# e.g. "openssl dhparam -out dhparam.pem 2048"
#dhparamfile
# By default a TLS enabled listener will operate in a similar fashion to a
# https enabled web server, in that the server has a certificate signed by a CA
# and the client will verify that it is a trusted certificate. The overall aim
# is encryption of the network traffic. By setting require_certificate to true,
# the client must provide a valid certificate in order for the network
# connection to proceed. This allows access to the broker to be controlled
# outside of the mechanisms provided by MQTT.
#require_certificate false
# This option defines the version of the TLS protocol to use for this listener.
# The default value allows all of v1.3, v1.2 and v1.1. The valid values are
# tlsv1.3 tlsv1.2 and tlsv1.1.
#tls_version
# If require_certificate is true, you may set use_identity_as_username to true
# to use the CN value from the client certificate as a username. If this is
# true, the password_file option will not be used for this listener.
# This takes priority over use_subject_as_username.
# See also use_subject_as_username.
#use_identity_as_username false
# If require_certificate is true, you may set use_subject_as_username to true
# to use the complete subject value from the client certificate as a username.
# If this is true, the password_file option will not be used for this listener.
# See also use_identity_as_username
#use_subject_as_username false
# -----------------------------------------------------------------
# Pre-shared-key based SSL/TLS support
# -----------------------------------------------------------------
# The following options can be used to enable PSK based SSL/TLS support for
# this listener. Note that the recommended port for MQTT over TLS is 8883, but
# this must be set manually.
#
# See also the mosquitto-tls man page and the "Certificate based SSL/TLS
# support" section. Only one of certificate or PSK encryption support can be
# enabled for any listener.
# The psk_hint option enables pre-shared-key support for this listener and also
# acts as an identifier for this listener. The hint is sent to clients and may
# be used locally to aid authentication. The hint is a free form string that
# doesn't have much meaning in itself, so feel free to be creative.
# If this option is provided, see psk_file to define the pre-shared keys to be
# used or create a security plugin to handle them.
#psk_hint
# When using PSK, the encryption ciphers used will be chosen from the list of
# available PSK ciphers. If you want to control which ciphers are available,
# use the "ciphers" option. The list of available ciphers can be obtained
# using the "openssl ciphers" command and should be provided in the same format
# as the output of that command.
#ciphers
# Set use_identity_as_username to have the psk identity sent by the client used
# as its username. Authentication will be carried out using the PSK rather than
# the MQTT username/password and so password_file will not be used for this
# listener.
#use_identity_as_username false
# =================================================================
# Extra listeners
# =================================================================
# Listen on a port/ip address combination. By using this variable
# multiple times, mosquitto can listen on more than one port. If
# this variable is used and neither bind_address nor port given,
# then the default listener will not be started.
# The port number to listen on must be given. Optionally, an ip
# address or host name may be supplied as a second argument. In
# this case, mosquitto will attempt to bind the listener to that
# address and so restrict access to the associated network and
# interface. By default, mosquitto will listen on all interfaces.
# Note that for a websockets listener it is not possible to bind to a host
# name.
# listener port-number [ip address/host name]
#listener
# Bind the listener to a specific interface. This is similar to
# the [ip address/host name] part of the listener definition, but is useful
# when an interface has multiple addresses or the address may change. It is
# valid to use this with the [ip address/host name] part of the listener
# definition, but take care that the interface you are binding to contains the
# address you are binding to, otherwise you will not be able to connect.
# Only available on Linux and requires elevated privileges.
#
# Example: bind_interface eth0
#bind_interface
# When a listener is using the websockets protocol, it is possible to serve
# http data as well. Set http_dir to a directory which contains the files you
# wish to serve. If this option is not specified, then no normal http
# connections will be possible.
#http_dir
# The maximum number of client connections to allow. This is
# a per listener setting.
# Default is -1, which means unlimited connections.
# Note that other process limits mean that unlimited connections
# are not really possible. Typically the default maximum number of
# connections possible is around 1024.
#max_connections -1
# The listener can be restricted to operating within a topic hierarchy using
# the mount_point option. This is achieved be prefixing the mount_point string
# to all topics for any clients connected to this listener. This prefixing only
# happens internally to the broker; the client will not see the prefix.
#mount_point
# Choose the protocol to use when listening.
# This can be either mqtt or websockets.
# Certificate based TLS may be used with websockets, except that only the
# cafile, certfile, keyfile and ciphers options are supported.
#protocol mqtt
# Set use_username_as_clientid to true to replace the clientid that a client
# connected with with its username. This allows authentication to be tied to
# the clientid, which means that it is possible to prevent one client
# disconnecting another by using the same clientid.
# If a client connects with no username it will be disconnected as not
# authorised when this option is set to true.
# Do not use in conjunction with clientid_prefixes.
# See also use_identity_as_username.
#use_username_as_clientid
# Change the websockets headers size. This is a global option, it is not
# possible to set per listener. This option sets the size of the buffer used in
# the libwebsockets library when reading HTTP headers. If you are passing large
# header data such as cookies then you may need to increase this value. If left
# unset, or set to 0, then the default of 1024 bytes will be used.
#websockets_headers_size
# -----------------------------------------------------------------
# Certificate based SSL/TLS support
# -----------------------------------------------------------------
# The following options can be used to enable certificate based SSL/TLS support
# for this listener. Note that the recommended port for MQTT over TLS is 8883,
# but this must be set manually.
#
# See also the mosquitto-tls man page and the "Pre-shared-key based SSL/TLS
# support" section. Only one of certificate or PSK encryption support can be
# enabled for any listener.
# At least one of cafile or capath must be defined to enable certificate based
# TLS encryption. They both define methods of accessing the PEM encoded
# Certificate Authority certificates that have signed your server certificate
# and that you wish to trust.
# cafile defines the path to a file containing the CA certificates.
# capath defines a directory that will be searched for files
# containing the CA certificates. For capath to work correctly, the
# certificate files must have ".crt" as the file ending and you must run
# "openssl rehash <path to capath>" each time you add/remove a certificate.
#cafile
#capath
# Path to the PEM encoded server certificate.
#certfile
# Path to the PEM encoded keyfile.
#keyfile
# If you wish to control which encryption ciphers are used, use the ciphers
# option. The list of available ciphers can be optained using the "openssl
# ciphers" command and should be provided in the same format as the output of
# that command.
#ciphers
# If you have require_certificate set to true, you can create a certificate
# revocation list file to revoke access to particular client certificates. If
# you have done this, use crlfile to point to the PEM encoded revocation file.
#crlfile
# To allow the use of ephemeral DH key exchange, which provides forward
# security, the listener must load DH parameters. This can be specified with
# the dhparamfile option. The dhparamfile can be generated with the command
# e.g. "openssl dhparam -out dhparam.pem 2048"
#dhparamfile
# By default an TLS enabled listener will operate in a similar fashion to a
# https enabled web server, in that the server has a certificate signed by a CA
# and the client will verify that it is a trusted certificate. The overall aim
# is encryption of the network traffic. By setting require_certificate to true,
# the client must provide a valid certificate in order for the network
# connection to proceed. This allows access to the broker to be controlled
# outside of the mechanisms provided by MQTT.
#require_certificate false
# If require_certificate is true, you may set use_identity_as_username to true
# to use the CN value from the client certificate as a username. If this is
# true, the password_file option will not be used for this listener.
#use_identity_as_username false
# -----------------------------------------------------------------
# Pre-shared-key based SSL/TLS support
# -----------------------------------------------------------------
# The following options can be used to enable PSK based SSL/TLS support for
# this listener. Note that the recommended port for MQTT over TLS is 8883, but
# this must be set manually.
#
# See also the mosquitto-tls man page and the "Certificate based SSL/TLS
# support" section. Only one of certificate or PSK encryption support can be
# enabled for any listener.
# The psk_hint option enables pre-shared-key support for this listener and also
# acts as an identifier for this listener. The hint is sent to clients and may
# be used locally to aid authentication. The hint is a free form string that
# doesn't have much meaning in itself, so feel free to be creative.
# If this option is provided, see psk_file to define the pre-shared keys to be
# used or create a security plugin to handle them.
#psk_hint
# When using PSK, the encryption ciphers used will be chosen from the list of
# available PSK ciphers. If you want to control which ciphers are available,
# use the "ciphers" option. The list of available ciphers can be optained
# using the "openssl ciphers" command and should be provided in the same format
# as the output of that command.
#ciphers
# Set use_identity_as_username to have the psk identity sent by the client used
# as its username. Authentication will be carried out using the PSK rather than
# the MQTT username/password and so password_file will not be used for this
# listener.
#use_identity_as_username false
# =================================================================
# Persistence
# =================================================================
# If persistence is enabled, save the in-memory database to disk
# every autosave_interval seconds. If set to 0, the persistence
# database will only be written when mosquitto exits. See also
# autosave_on_changes.
# Note that writing of the persistence database can be forced by
# sending mosquitto a SIGUSR1 signal.
#autosave_interval 1800
# If true, mosquitto will count the number of subscription changes, retained
# messages received and queued messages and if the total exceeds
# autosave_interval then the in-memory database will be saved to disk.
# If false, mosquitto will save the in-memory database to disk by treating
# autosave_interval as a time in seconds.
#autosave_on_changes false
# Save persistent message data to disk (true/false).
# This saves information about all messages, including
# subscriptions, currently in-flight messages and retained
# messages.
# retained_persistence is a synonym for this option.
#persistence false
# The filename to use for the persistent database, not including
# the path.
#persistence_file mosquitto.db
# Location for persistent database. Must include trailing /
# Default is an empty string (current directory).
# Set to e.g. /var/lib/mosquitto/ if running as a proper service on Linux or
# similar.
#persistence_location
# =================================================================
# Logging
# =================================================================
# Places to log to. Use multiple log_dest lines for multiple
# logging destinations.
# Possible destinations are: stdout stderr syslog topic file
#
# stdout and stderr log to the console on the named output.
#
# syslog uses the userspace syslog facility which usually ends up
# in /var/log/messages or similar.
#
# topic logs to the broker topic '$SYS/broker/log/<severity>',
# where severity is one of D, E, W, N, I, M which are debug, error,
# warning, notice, information and message. Message type severity is used by
# the subscribe/unsubscribe log_types and publishes log messages to
# $SYS/broker/log/M/susbcribe or $SYS/broker/log/M/unsubscribe.
#
# The file destination requires an additional parameter which is the file to be
# logged to, e.g. "log_dest file /var/log/mosquitto.log". The file will be
# closed and reopened when the broker receives a HUP signal. Only a single file
# destination may be configured.
#
# Note that if the broker is running as a Windows service it will default to
# "log_dest none" and neither stdout nor stderr logging is available.
# Use "log_dest none" if you wish to disable logging.
#log_dest stderr
# Types of messages to log. Use multiple log_type lines for logging
# multiple types of messages.
# Possible types are: debug, error, warning, notice, information,
# none, subscribe, unsubscribe, websockets, all.
# Note that debug type messages are for decoding the incoming/outgoing
# network packets. They are not logged in "topics".
#log_type error
#log_type warning
#log_type notice
#log_type information
# If set to true, client connection and disconnection messages will be included
# in the log.
#connection_messages true
# If using syslog logging (not on Windows), messages will be logged to the
# "daemon" facility by default. Use the log_facility option to choose which of
# local0 to local7 to log to instead. The option value should be an integer
# value, e.g. "log_facility 5" to use local5.
#log_facility
# If set to true, add a timestamp value to each log message.
#log_timestamp true
# Set the format of the log timestamp. If left unset, this is the number of
# seconds since the Unix epoch.
# This is a free text string which will be passed to the strftime function. To
# get an ISO 8601 datetime, for example:
# log_timestamp_format %Y-%m-%dT%H:%M:%S
#log_timestamp_format
# Change the websockets logging level. This is a global option, it is not
# possible to set per listener. This is an integer that is interpreted by
# libwebsockets as a bit mask for its lws_log_levels enum. See the
# libwebsockets documentation for more details. "log_type websockets" must also
# be enabled.
#websockets_log_level 0
# =================================================================
# Security
# =================================================================
# If set, only clients that have a matching prefix on their
# clientid will be allowed to connect to the broker. By default,
# all clients may connect.
# For example, setting "secure-" here would mean a client "secure-
# client" could connect but another with clientid "mqtt" couldn't.
#clientid_prefixes
# Boolean value that determines whether clients that connect
# without providing a username are allowed to connect. If set to
# false then a password file should be created (see the
# password_file option) to control authenticated client access.
#
# Defaults to true if no other security options are set. If `password_file` or
# `psk_file` is set, or if an authentication plugin is loaded which implements
# username/password or TLS-PSK checks, then `allow_anonymous` defaults to
# false.
#
allow_anonymous false
# -----------------------------------------------------------------
# Default authentication and topic access control
# -----------------------------------------------------------------
# Control access to the broker using a password file. This file can be
# generated using the mosquitto_passwd utility. If TLS support is not compiled
# into mosquitto (it is recommended that TLS support should be included) then
# plain text passwords are used, in which case the file should be a text file
# with lines in the format:
# username:password
# The password (and colon) may be omitted if desired, although this
# offers very little in the way of security.
#
# See the TLS client require_certificate and use_identity_as_username options
# for alternative authentication options. If an auth_plugin is used as well as
# password_file, the auth_plugin check will be made first.
#password_file
# Access may also be controlled using a pre-shared-key file. This requires
# TLS-PSK support and a listener configured to use it. The file should be text
# lines in the format:
# identity:key
# The key should be in hexadecimal format without a leading "0x".
# If an auth_plugin is used as well, the auth_plugin check will be made first.
#psk_file
# Control access to topics on the broker using an access control list
# file. If this parameter is defined then only the topics listed will
# have access.
# If the first character of a line of the ACL file is a # it is treated as a
# comment.
# Topic access is added with lines of the format:
#
# topic [read|write|readwrite] <topic>
#
# The access type is controlled using "read", "write" or "readwrite". This
# parameter is optional (unless <topic> contains a space character) - if not
# given then the access is read/write. <topic> can contain the + or #
# wildcards as in subscriptions.
#
# The first set of topics are applied to anonymous clients, assuming
# allow_anonymous is true. User specific topic ACLs are added after a
# user line as follows:
#
# user <username>
#
# The username referred to here is the same as in password_file. It is
# not the clientid.
#
#
# If is also possible to define ACLs based on pattern substitution within the
# topic. The patterns available for substition are:
#
# %c to match the client id of the client
# %u to match the username of the client
#
# The substitution pattern must be the only text for that level of hierarchy.
#
# The form is the same as for the topic keyword, but using pattern as the
# keyword.
# Pattern ACLs apply to all users even if the "user" keyword has previously
# been given.
#
# If using bridges with usernames and ACLs, connection messages can be allowed
# with the following pattern:
# pattern write $SYS/broker/connection/%c/state
#
# pattern [read|write|readwrite] <topic>
#
# Example:
#
# pattern write sensor/%u/data
#
# If an auth_plugin is used as well as acl_file, the auth_plugin check will be
# made first.
#acl_file
# -----------------------------------------------------------------
# External authentication and topic access plugin options
# -----------------------------------------------------------------
# External authentication and access control can be supported with the
# auth_plugin option. This is a path to a loadable plugin. See also the
# auth_opt_* options described below.
#
# The auth_plugin option can be specified multiple times to load multiple
# plugins. The plugins will be processed in the order that they are specified
# here. If the auth_plugin option is specified alongside either of
# password_file or acl_file then the plugin checks will be made first.
#
#auth_plugin
# If the auth_plugin option above is used, define options to pass to the
# plugin here as described by the plugin instructions. All options named
# using the format auth_opt_* will be passed to the plugin, for example:
#
# auth_opt_db_host
# auth_opt_db_port
# auth_opt_db_username
# auth_opt_db_password
# =================================================================
# Bridges
# =================================================================
# A bridge is a way of connecting multiple MQTT brokers together.
# Create a new bridge using the "connection" option as described below. Set
# options for the bridges using the remaining parameters. You must specify the
# address and at least one topic to subscribe to.
#
# Each connection must have a unique name.
#
# The address line may have multiple host address and ports specified. See
# below in the round_robin description for more details on bridge behaviour if
# multiple addresses are used. Note that if you use an IPv6 address, then you
# are required to specify a port.
#
# The direction that the topic will be shared can be chosen by
# specifying out, in or both, where the default value is out.
# The QoS level of the bridged communication can be specified with the next
# topic option. The default QoS level is 0, to change the QoS the topic
# direction must also be given.
#
# The local and remote prefix options allow a topic to be remapped when it is
# bridged to/from the remote broker. This provides the ability to place a topic
# tree in an appropriate location.
#
# For more details see the mosquitto.conf man page.
#
# Multiple topics can be specified per connection, but be careful
# not to create any loops.
#
# If you are using bridges with cleansession set to false (the default), then
# you may get unexpected behaviour from incoming topics if you change what
# topics you are subscribing to. This is because the remote broker keeps the
# subscription for the old topic. If you have this problem, connect your bridge
# with cleansession set to true, then reconnect with cleansession set to false
# as normal.
#connection <name>
#address <host>[:<port>] [<host>[:<port>]]
#topic <topic> [[[out | in | both] qos-level] local-prefix remote-prefix]
# If a bridge has topics that have "out" direction, the default behaviour is to
# send an unsubscribe request to the remote broker on that topic. This means
# that changing a topic direction from "in" to "out" will not keep receiving
# incoming messages. Sending these unsubscribe requests is not always
# desirable, setting bridge_attempt_unsubscribe to false will disable sending
# the unsubscribe request.
#bridge_attempt_unsubscribe true
# Set the version of the MQTT protocol to use with for this bridge. Can be one
# of mqttv311 or mqttv11. Defaults to mqttv311.
#bridge_protocol_version mqttv311
# Set the clean session variable for this bridge.
# When set to true, when the bridge disconnects for any reason, all
# messages and subscriptions will be cleaned up on the remote
# broker. Note that with cleansession set to true, there may be a
# significant amount of retained messages sent when the bridge
# reconnects after losing its connection.
# When set to false, the subscriptions and messages are kept on the
# remote broker, and delivered when the bridge reconnects.
#cleansession false
# Set the amount of time a bridge using the lazy start type must be idle before
# it will be stopped. Defaults to 60 seconds.
#idle_timeout 60
# Set the keepalive interval for this bridge connection, in
# seconds.
#keepalive_interval 60
# Set the clientid to use on the local broker. If not defined, this defaults to
# 'local.<clientid>'. If you are bridging a broker to itself, it is important
# that local_clientid and clientid do not match.
#local_clientid
# If set to true, publish notification messages to the local and remote brokers
# giving information about the state of the bridge connection. Retained
# messages are published to the topic $SYS/broker/connection/<clientid>/state
# unless the notification_topic option is used.
# If the message is 1 then the connection is active, or 0 if the connection has
# failed.
# This uses the last will and testament feature.
#notifications true
# Choose the topic on which notification messages for this bridge are
# published. If not set, messages are published on the topic
# $SYS/broker/connection/<clientid>/state
#notification_topic
# Set the client id to use on the remote end of this bridge connection. If not
# defined, this defaults to 'name.hostname' where name is the connection name
# and hostname is the hostname of this computer.
# This replaces the old "clientid" option to avoid confusion. "clientid"
# remains valid for the time being.
#remote_clientid
# Set the password to use when connecting to a broker that requires
# authentication. This option is only used if remote_username is also set.
# This replaces the old "password" option to avoid confusion. "password"
# remains valid for the time being.
#remote_password
# Set the username to use when connecting to a broker that requires
# authentication.
# This replaces the old "username" option to avoid confusion. "username"
# remains valid for the time being.
#remote_username
# Set the amount of time a bridge using the automatic start type will wait
# until attempting to reconnect.
# This option can be configured to use a constant delay time in seconds, or to
# use a backoff mechanism based on "Decorrelated Jitter", which adds a degree
# of randomness to when the restart occurs.
#
# Set a constant timeout of 20 seconds:
# restart_timeout 20
#
# Set backoff with a base (start value) of 10 seconds and a cap (upper limit) of
# 60 seconds:
# restart_timeout 10 30
#
# Defaults to jitter with a base of 5 and cap of 30
#restart_timeout 5 30
# If the bridge has more than one address given in the address/addresses
# configuration, the round_robin option defines the behaviour of the bridge on
# a failure of the bridge connection. If round_robin is false, the default
# value, then the first address is treated as the main bridge connection. If
# the connection fails, the other secondary addresses will be attempted in
# turn. Whilst connected to a secondary bridge, the bridge will periodically
# attempt to reconnect to the main bridge until successful.
# If round_robin is true, then all addresses are treated as equals. If a
# connection fails, the next address will be tried and if successful will
# remain connected until it fails
#round_robin false
# Set the start type of the bridge. This controls how the bridge starts and
# can be one of three types: automatic, lazy and once. Note that RSMB provides
# a fourth start type "manual" which isn't currently supported by mosquitto.
#
# "automatic" is the default start type and means that the bridge connection
# will be started automatically when the broker starts and also restarted
# after a short delay (30 seconds) if the connection fails.
#
# Bridges using the "lazy" start type will be started automatically when the
# number of queued messages exceeds the number set with the "threshold"
# parameter. It will be stopped automatically after the time set by the
# "idle_timeout" parameter. Use this start type if you wish the connection to
# only be active when it is needed.
#
# A bridge using the "once" start type will be started automatically when the
# broker starts but will not be restarted if the connection fails.
#start_type automatic
# Set the number of messages that need to be queued for a bridge with lazy
# start type to be restarted. Defaults to 10 messages.
# Must be less than max_queued_messages.
#threshold 10
# If try_private is set to true, the bridge will attempt to indicate to the
# remote broker that it is a bridge not an ordinary client. If successful, this
# means that loop detection will be more effective and that retained messages
# will be propagated correctly. Not all brokers support this feature so it may
# be necessary to set try_private to false if your bridge does not connect
# properly.
#try_private true
# -----------------------------------------------------------------
# Certificate based SSL/TLS support
# -----------------------------------------------------------------
# Either bridge_cafile or bridge_capath must be defined to enable TLS support
# for this bridge.
# bridge_cafile defines the path to a file containing the
# Certificate Authority certificates that have signed the remote broker
# certificate.
# bridge_capath defines a directory that will be searched for files containing
# the CA certificates. For bridge_capath to work correctly, the certificate
# files must have ".crt" as the file ending and you must run "openssl rehash
# <path to capath>" each time you add/remove a certificate.
#bridge_cafile
#bridge_capath
# If the remote broker has more than one protocol available on its port, e.g.
# MQTT and WebSockets, then use bridge_alpn to configure which protocol is
# requested. Note that WebSockets support for bridges is not yet available.
#bridge_alpn
# When using certificate based encryption, bridge_insecure disables
# verification of the server hostname in the server certificate. This can be
# useful when testing initial server configurations, but makes it possible for
# a malicious third party to impersonate your server through DNS spoofing, for
# example. Use this option in testing only. If you need to resort to using this
# option in a production environment, your setup is at fault and there is no
# point using encryption.
#bridge_insecure false
# Path to the PEM encoded client certificate, if required by the remote broker.
#bridge_certfile
# Path to the PEM encoded client private key, if required by the remote broker.
#bridge_keyfile
# -----------------------------------------------------------------
# PSK based SSL/TLS support
# -----------------------------------------------------------------
# Pre-shared-key encryption provides an alternative to certificate based
# encryption. A bridge can be configured to use PSK with the bridge_identity
# and bridge_psk options. These are the client PSK identity, and pre-shared-key
# in hexadecimal format with no "0x". Only one of certificate and PSK based
# encryption can be used on one
# bridge at once.
#bridge_identity
#bridge_psk
# =================================================================
# External config files
# =================================================================
# External configuration files may be included by using the
# include_dir option. This defines a directory that will be searched
# for config files. All files that end in '.conf' will be loaded as
# a configuration file. It is best to have this as the last option
# in the main file. This option will only be processed from the main
# configuration file. The directory specified must not contain the
# main configuration file.
# Files within include_dir will be loaded sorted in case-sensitive
# alphabetical order, with capital letters ordered first. If this option is
# given multiple times, all of the files from the first instance will be
# processed before the next instance. See the man page for examples.
#include_dir

View File

@@ -0,0 +1 @@
open:$6$Pb+KcS4nr9+8PRaJ$yVc9n7GDolYbuv3Yaszf/OfN6P3QGWs2VD37Q8euZsUp7cfO/fOy7uKcRw9zJ0HJRYP5KVs7DXt/otgZvGP0pQ==

27
nodered/Dockerfile Executable file
View File

@@ -0,0 +1,27 @@
FROM nodered/node-red:latest
ARG MQTT_URL
ARG MYSQL_URL
ARG MYSQL_DATABASE
ARG INFLUXDB_USER
ARG INFLUXDB_USER_PASSWORD
ARG INFLUXDB_DB
ARG INFLUX_URL
ENV MQTT_URL $MQTT_URL
ENV MYSQL_URL $MYSQL_URL
ENV MYSQL_DATABASE $MYSQL_DATABASE
ENV INFLUXDB_USER $INFLUXDB_USER
ENV INFLUXDB_USER_PASSWORD $INFLUXDB_USER_PASSWORD
ENV INFLUXDB_DB $INFLUXDB_DB
ENV INFLUX_URL $INFLUX_URL
RUN chown 1000:1000 /data
COPY --chown=1000:1000 rootfs/data /data
RUN sed -i 's/iot.valki.com/'"$MQTT_URL"'/g' /data/flows.json
RUN sed -i 's/\"db.valki.com\"/\"'"$MYSQL_URL"\"'/g' /data/flows.json
RUN sed -i 's/nodered/'"$MYSQL_DATABASE"'/g' /data/flows.json
RUN sed -i 's/influxdb.valki.com/'"$INFLUX_URL"'/g' /data/flows.json
RUN sed -i 's/\"database\":\"openAger\"/\"database\":\"'"$INFLUXDB_DB"\"'/g' /data/flows.json

4
nodered/Makefile Executable file
View File

@@ -0,0 +1,4 @@
build:
docker build $(BUILD_ARGS) -t $(OPENAGER_REPO)/nodered .
.PHONY: build

805
nodered/rootfs/data/.config.json Executable file
View File

@@ -0,0 +1,805 @@
{
"nodes": {
"node-red": {
"name": "node-red",
"version": "1.1.3",
"local": false,
"nodes": {
"inject": {
"name": "inject",
"types": [
"inject"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/20-inject.js"
},
"debug": {
"name": "debug",
"types": [
"debug"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/21-debug.js"
},
"complete": {
"name": "complete",
"types": [
"complete"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/24-complete.js"
},
"catch": {
"name": "catch",
"types": [
"catch"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/25-catch.js"
},
"status": {
"name": "status",
"types": [
"status"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/25-status.js"
},
"link": {
"name": "link",
"types": [
"link in",
"link out"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/60-link.js"
},
"comment": {
"name": "comment",
"types": [
"comment"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/90-comment.js"
},
"unknown": {
"name": "unknown",
"types": [
"unknown"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/98-unknown.js"
},
"function": {
"name": "function",
"types": [
"function"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/10-function.js"
},
"switch": {
"name": "switch",
"types": [
"switch"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/10-switch.js"
},
"change": {
"name": "change",
"types": [
"change"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/15-change.js"
},
"range": {
"name": "range",
"types": [
"range"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/16-range.js"
},
"template": {
"name": "template",
"types": [
"template"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/80-template.js"
},
"delay": {
"name": "delay",
"types": [
"delay"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/89-delay.js"
},
"trigger": {
"name": "trigger",
"types": [
"trigger"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/89-trigger.js"
},
"exec": {
"name": "exec",
"types": [
"exec"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/90-exec.js"
},
"tls": {
"name": "tls",
"types": [
"tls-config"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/05-tls.js"
},
"httpproxy": {
"name": "httpproxy",
"types": [
"http proxy"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/06-httpproxy.js"
},
"mqtt": {
"name": "mqtt",
"types": [
"mqtt in",
"mqtt out",
"mqtt-broker"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/10-mqtt.js"
},
"httpin": {
"name": "httpin",
"types": [
"http in",
"http response"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/21-httpin.js"
},
"httprequest": {
"name": "httprequest",
"types": [
"http request"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/21-httprequest.js"
},
"websocket": {
"name": "websocket",
"types": [
"websocket in",
"websocket out",
"websocket-listener",
"websocket-client"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/22-websocket.js"
},
"tcpin": {
"name": "tcpin",
"types": [
"tcp in",
"tcp out",
"tcp request"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/31-tcpin.js"
},
"udp": {
"name": "udp",
"types": [
"udp in",
"udp out"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/32-udp.js"
},
"CSV": {
"name": "CSV",
"types": [
"csv"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/parsers/70-CSV.js"
},
"HTML": {
"name": "HTML",
"types": [
"html"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/parsers/70-HTML.js"
},
"JSON": {
"name": "JSON",
"types": [
"json"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/parsers/70-JSON.js"
},
"XML": {
"name": "XML",
"types": [
"xml"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/parsers/70-XML.js"
},
"YAML": {
"name": "YAML",
"types": [
"yaml"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/parsers/70-YAML.js"
},
"split": {
"name": "split",
"types": [
"split",
"join"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/sequence/17-split.js"
},
"sort": {
"name": "sort",
"types": [
"sort"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/sequence/18-sort.js"
},
"batch": {
"name": "batch",
"types": [
"batch"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/sequence/19-batch.js"
},
"file": {
"name": "file",
"types": [
"file",
"file in"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/storage/10-file.js"
},
"watch": {
"name": "watch",
"types": [
"watch"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/storage/23-watch.js"
}
}
},
"node-red-node-rbe": {
"name": "node-red-node-rbe",
"version": "0.2.9",
"local": false,
"nodes": {
"rbe": {
"name": "rbe",
"types": [
"rbe"
],
"enabled": true,
"local": false,
"module": "node-red-node-rbe",
"file": "/usr/src/node-red/node_modules/node-red-node-rbe/rbe.js"
}
}
},
"node-red-node-tail": {
"name": "node-red-node-tail",
"version": "0.1.1",
"local": true,
"nodes": {
"tail": {
"name": "tail",
"types": [
"tail"
],
"enabled": true,
"local": true,
"module": "node-red-node-tail",
"file": "/data/node_modules/node-red-node-tail/28-tail.js"
}
}
},
"node-red-node-email": {
"name": "node-red-node-email",
"version": "1.7.3",
"local": true,
"nodes": {
"email": {
"name": "email",
"types": [
"e-mail",
"e-mail in"
],
"enabled": true,
"local": true,
"module": "node-red-node-email",
"file": "/data/node_modules/node-red-node-email/61-email.js"
}
}
},
"node-red-dashboard": {
"name": "node-red-dashboard",
"version": "2.19.3",
"local": true,
"nodes": {
"ui_base": {
"name": "ui_base",
"types": [
"ui_base"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_base.js"
},
"ui_button": {
"name": "ui_button",
"types": [
"ui_button"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_button.js"
},
"ui_dropdown": {
"name": "ui_dropdown",
"types": [
"ui_dropdown"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_dropdown.js"
},
"ui_switch": {
"name": "ui_switch",
"types": [
"ui_switch"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_switch.js"
},
"ui_slider": {
"name": "ui_slider",
"types": [
"ui_slider"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_slider.js"
},
"ui_numeric": {
"name": "ui_numeric",
"types": [
"ui_numeric"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_numeric.js"
},
"ui_text_input": {
"name": "ui_text_input",
"types": [
"ui_text_input"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_text_input.js"
},
"ui_date_picker": {
"name": "ui_date_picker",
"types": [
"ui_date_picker"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_date_picker.js"
},
"ui_colour_picker": {
"name": "ui_colour_picker",
"types": [
"ui_colour_picker"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_colour_picker.js"
},
"ui_form": {
"name": "ui_form",
"types": [
"ui_form"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_form.js"
},
"ui_text": {
"name": "ui_text",
"types": [
"ui_text"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_text.js"
},
"ui_gauge": {
"name": "ui_gauge",
"types": [
"ui_gauge"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_gauge.js"
},
"ui_chart": {
"name": "ui_chart",
"types": [
"ui_chart"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_chart.js"
},
"ui_audio": {
"name": "ui_audio",
"types": [
"ui_audio"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_audio.js"
},
"ui_toast": {
"name": "ui_toast",
"types": [
"ui_toast"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_toast.js"
},
"ui_ui_control": {
"name": "ui_ui_control",
"types": [
"ui_ui_control"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_ui_control.js"
},
"ui_template": {
"name": "ui_template",
"types": [
"ui_template"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_template.js"
},
"ui_link": {
"name": "ui_link",
"types": [
"ui_link"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_link.js"
},
"ui_tab": {
"name": "ui_tab",
"types": [
"ui_tab"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_tab.js"
},
"ui_group": {
"name": "ui_group",
"types": [
"ui_group"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_group.js"
},
"ui_spacer": {
"name": "ui_spacer",
"types": [
"ui_spacer"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_spacer.js"
}
}
},
"node-red-node-mysql": {
"name": "node-red-node-mysql",
"version": "0.0.19",
"local": true,
"nodes": {
"mysql": {
"name": "mysql",
"types": [
"MySQLdatabase",
"mysql"
],
"enabled": true,
"local": true,
"module": "node-red-node-mysql",
"file": "/data/node_modules/node-red-node-mysql/68-mysql.js"
}
}
},
"node-red-contrib-moment": {
"name": "node-red-contrib-moment",
"version": "3.0.3",
"local": true,
"nodes": {
"moment": {
"name": "moment",
"types": [
"moment"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-moment",
"file": "/data/node_modules/node-red-contrib-moment/moment/nrmoment.js"
},
"humanizer": {
"name": "humanizer",
"types": [
"humanizer"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-moment",
"file": "/data/node_modules/node-red-contrib-moment/moment/nrhumanizer.js"
}
}
},
"node-red-contrib-throttle": {
"name": "node-red-contrib-throttle",
"version": "0.1.6",
"local": true,
"nodes": {
"throttle": {
"name": "throttle",
"types": [
"throttle"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-throttle",
"file": "/data/node_modules/node-red-contrib-throttle/throttle.js"
}
}
},
"node-red-contrib-msg-speed": {
"name": "node-red-contrib-msg-speed",
"version": "0.0.5",
"local": true,
"nodes": {
"msg-speed": {
"name": "msg-speed",
"types": [
"msg-speed"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-msg-speed",
"file": "/data/node_modules/node-red-contrib-msg-speed/msg_speed.js"
}
}
},
"node-red-contrib-telegrambot": {
"name": "node-red-contrib-telegrambot",
"version": "7.1.1",
"local": true,
"nodes": {
"telegrambot": {
"name": "telegrambot",
"types": [
"telegram bot",
"telegram receiver",
"telegram command",
"telegram event",
"telegram sender",
"telegram reply"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot",
"file": "/data/node_modules/node-red-contrib-telegrambot/telegrambot/99-telegrambot.js"
}
}
},
"node-red-contrib-telegrambot-home": {
"name": "node-red-contrib-telegrambot-home",
"version": "0.5.2",
"local": true,
"nodes": {
"bot": {
"name": "bot",
"types": [
"telegrambot-config"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot-home",
"file": "/data/node_modules/node-red-contrib-telegrambot-home/nodes/bot-config/bot-config.js"
},
"command": {
"name": "command",
"types": [
"telegrambot-command"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot-home",
"file": "/data/node_modules/node-red-contrib-telegrambot-home/nodes/command/command.js"
},
"switch": {
"name": "switch",
"types": [
"telegrambot-switch"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot-home",
"file": "/data/node_modules/node-red-contrib-telegrambot-home/nodes/switch/switch.js"
},
"notify": {
"name": "notify",
"types": [
"telegrambot-notify"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot-home",
"file": "/data/node_modules/node-red-contrib-telegrambot-home/nodes/notify/notify.js"
},
"payload": {
"name": "payload",
"types": [
"telegrambot-payload"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot-home",
"file": "/data/node_modules/node-red-contrib-telegrambot-home/nodes/payload/payload.js"
}
}
}
},
"users": {
"admin": {
"editor": {
"view": {
"view-show-grid": true,
"view-snap-grid": true,
"view-grid-size": "20",
"view-node-status": true,
"view-node-show-label": true,
"view-show-tips": true
}
},
"menu-menu-item-sidebar": true
}
}
}

View File

@@ -0,0 +1,808 @@
{
"node-red": {
"name": "node-red",
"version": "1.2.1",
"local": false,
"nodes": {
"inject": {
"name": "inject",
"types": [
"inject"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/20-inject.js"
},
"debug": {
"name": "debug",
"types": [
"debug"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/21-debug.js"
},
"complete": {
"name": "complete",
"types": [
"complete"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/24-complete.js"
},
"catch": {
"name": "catch",
"types": [
"catch"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/25-catch.js"
},
"status": {
"name": "status",
"types": [
"status"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/25-status.js"
},
"link": {
"name": "link",
"types": [
"link in",
"link out"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/60-link.js"
},
"comment": {
"name": "comment",
"types": [
"comment"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/90-comment.js"
},
"unknown": {
"name": "unknown",
"types": [
"unknown"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/common/98-unknown.js"
},
"function": {
"name": "function",
"types": [
"function"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/10-function.js"
},
"switch": {
"name": "switch",
"types": [
"switch"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/10-switch.js"
},
"change": {
"name": "change",
"types": [
"change"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/15-change.js"
},
"range": {
"name": "range",
"types": [
"range"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/16-range.js"
},
"template": {
"name": "template",
"types": [
"template"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/80-template.js"
},
"delay": {
"name": "delay",
"types": [
"delay"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/89-delay.js"
},
"trigger": {
"name": "trigger",
"types": [
"trigger"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/89-trigger.js"
},
"exec": {
"name": "exec",
"types": [
"exec"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/function/90-exec.js"
},
"tls": {
"name": "tls",
"types": [
"tls-config"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/05-tls.js"
},
"httpproxy": {
"name": "httpproxy",
"types": [
"http proxy"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/06-httpproxy.js"
},
"mqtt": {
"name": "mqtt",
"types": [
"mqtt in",
"mqtt out",
"mqtt-broker"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/10-mqtt.js"
},
"httpin": {
"name": "httpin",
"types": [
"http in",
"http response"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/21-httpin.js"
},
"httprequest": {
"name": "httprequest",
"types": [
"http request"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/21-httprequest.js"
},
"websocket": {
"name": "websocket",
"types": [
"websocket in",
"websocket out",
"websocket-listener",
"websocket-client"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/22-websocket.js"
},
"tcpin": {
"name": "tcpin",
"types": [
"tcp in",
"tcp out",
"tcp request"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/31-tcpin.js"
},
"udp": {
"name": "udp",
"types": [
"udp in",
"udp out"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/network/32-udp.js"
},
"CSV": {
"name": "CSV",
"types": [
"csv"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/parsers/70-CSV.js"
},
"HTML": {
"name": "HTML",
"types": [
"html"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/parsers/70-HTML.js"
},
"JSON": {
"name": "JSON",
"types": [
"json"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/parsers/70-JSON.js"
},
"XML": {
"name": "XML",
"types": [
"xml"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/parsers/70-XML.js"
},
"YAML": {
"name": "YAML",
"types": [
"yaml"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/parsers/70-YAML.js"
},
"split": {
"name": "split",
"types": [
"split",
"join"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/sequence/17-split.js"
},
"sort": {
"name": "sort",
"types": [
"sort"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/sequence/18-sort.js"
},
"batch": {
"name": "batch",
"types": [
"batch"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/sequence/19-batch.js"
},
"file": {
"name": "file",
"types": [
"file",
"file in"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/storage/10-file.js"
},
"watch": {
"name": "watch",
"types": [
"watch"
],
"enabled": true,
"local": false,
"module": "node-red",
"file": "/usr/src/node-red/node_modules/@node-red/nodes/core/storage/23-watch.js"
}
}
},
"node-red-node-rbe": {
"name": "node-red-node-rbe",
"version": "0.2.9",
"local": false,
"nodes": {
"rbe": {
"name": "rbe",
"types": [
"rbe"
],
"enabled": true,
"local": false,
"module": "node-red-node-rbe",
"file": "/usr/src/node-red/node_modules/node-red-node-rbe/rbe.js"
}
}
},
"node-red-node-tail": {
"name": "node-red-node-tail",
"version": "0.1.1",
"local": true,
"nodes": {
"tail": {
"name": "tail",
"types": [
"tail"
],
"enabled": true,
"local": true,
"module": "node-red-node-tail",
"file": "/data/node_modules/node-red-node-tail/28-tail.js"
}
}
},
"node-red-node-email": {
"name": "node-red-node-email",
"version": "1.7.3",
"local": true,
"nodes": {
"email": {
"name": "email",
"types": [
"e-mail",
"e-mail in"
],
"enabled": true,
"local": true,
"module": "node-red-node-email",
"file": "/data/node_modules/node-red-node-email/61-email.js"
}
}
},
"node-red-dashboard": {
"name": "node-red-dashboard",
"version": "2.19.3",
"local": true,
"nodes": {
"ui_base": {
"name": "ui_base",
"types": [
"ui_base"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_base.js"
},
"ui_button": {
"name": "ui_button",
"types": [
"ui_button"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_button.js"
},
"ui_dropdown": {
"name": "ui_dropdown",
"types": [
"ui_dropdown"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_dropdown.js"
},
"ui_switch": {
"name": "ui_switch",
"types": [
"ui_switch"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_switch.js"
},
"ui_slider": {
"name": "ui_slider",
"types": [
"ui_slider"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_slider.js"
},
"ui_numeric": {
"name": "ui_numeric",
"types": [
"ui_numeric"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_numeric.js"
},
"ui_text_input": {
"name": "ui_text_input",
"types": [
"ui_text_input"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_text_input.js"
},
"ui_date_picker": {
"name": "ui_date_picker",
"types": [
"ui_date_picker"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_date_picker.js"
},
"ui_colour_picker": {
"name": "ui_colour_picker",
"types": [
"ui_colour_picker"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_colour_picker.js"
},
"ui_form": {
"name": "ui_form",
"types": [
"ui_form"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_form.js"
},
"ui_text": {
"name": "ui_text",
"types": [
"ui_text"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_text.js"
},
"ui_gauge": {
"name": "ui_gauge",
"types": [
"ui_gauge"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_gauge.js"
},
"ui_chart": {
"name": "ui_chart",
"types": [
"ui_chart"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_chart.js"
},
"ui_audio": {
"name": "ui_audio",
"types": [
"ui_audio"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_audio.js"
},
"ui_toast": {
"name": "ui_toast",
"types": [
"ui_toast"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_toast.js"
},
"ui_ui_control": {
"name": "ui_ui_control",
"types": [
"ui_ui_control"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_ui_control.js"
},
"ui_template": {
"name": "ui_template",
"types": [
"ui_template"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_template.js"
},
"ui_link": {
"name": "ui_link",
"types": [
"ui_link"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_link.js"
},
"ui_tab": {
"name": "ui_tab",
"types": [
"ui_tab"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_tab.js"
},
"ui_group": {
"name": "ui_group",
"types": [
"ui_group"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_group.js"
},
"ui_spacer": {
"name": "ui_spacer",
"types": [
"ui_spacer"
],
"enabled": true,
"local": true,
"module": "node-red-dashboard",
"file": "/data/node_modules/node-red-dashboard/nodes/ui_spacer.js"
}
}
},
"node-red-node-mysql": {
"name": "node-red-node-mysql",
"version": "0.0.19",
"local": true,
"nodes": {
"mysql": {
"name": "mysql",
"types": [
"MySQLdatabase",
"mysql"
],
"enabled": true,
"local": true,
"module": "node-red-node-mysql",
"file": "/data/node_modules/node-red-node-mysql/68-mysql.js"
}
}
},
"node-red-contrib-moment": {
"name": "node-red-contrib-moment",
"version": "3.0.3",
"local": true,
"nodes": {
"moment": {
"name": "moment",
"types": [
"moment"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-moment",
"file": "/data/node_modules/node-red-contrib-moment/moment/nrmoment.js"
},
"humanizer": {
"name": "humanizer",
"types": [
"humanizer"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-moment",
"file": "/data/node_modules/node-red-contrib-moment/moment/nrhumanizer.js"
}
}
},
"node-red-contrib-throttle": {
"name": "node-red-contrib-throttle",
"version": "0.1.6",
"local": true,
"nodes": {
"throttle": {
"name": "throttle",
"types": [
"throttle"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-throttle",
"file": "/data/node_modules/node-red-contrib-throttle/throttle.js"
}
}
},
"node-red-contrib-msg-speed": {
"name": "node-red-contrib-msg-speed",
"version": "0.0.5",
"local": true,
"nodes": {
"msg-speed": {
"name": "msg-speed",
"types": [
"msg-speed"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-msg-speed",
"file": "/data/node_modules/node-red-contrib-msg-speed/msg_speed.js"
}
}
},
"node-red-contrib-telegrambot": {
"name": "node-red-contrib-telegrambot",
"version": "7.1.1",
"local": true,
"nodes": {
"telegrambot": {
"name": "telegrambot",
"types": [
"telegram bot",
"telegram receiver",
"telegram command",
"telegram event",
"telegram sender",
"telegram reply"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot",
"file": "/data/node_modules/node-red-contrib-telegrambot/telegrambot/99-telegrambot.js"
}
}
},
"node-red-contrib-telegrambot-home": {
"name": "node-red-contrib-telegrambot-home",
"version": "0.5.2",
"local": true,
"nodes": {
"bot": {
"name": "bot",
"types": [
"telegrambot-config"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot-home",
"file": "/data/node_modules/node-red-contrib-telegrambot-home/nodes/bot-config/bot-config.js"
},
"command": {
"name": "command",
"types": [
"telegrambot-command"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot-home",
"file": "/data/node_modules/node-red-contrib-telegrambot-home/nodes/command/command.js"
},
"switch": {
"name": "switch",
"types": [
"telegrambot-switch"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot-home",
"file": "/data/node_modules/node-red-contrib-telegrambot-home/nodes/switch/switch.js"
},
"notify": {
"name": "notify",
"types": [
"telegrambot-notify"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot-home",
"file": "/data/node_modules/node-red-contrib-telegrambot-home/nodes/notify/notify.js"
},
"payload": {
"name": "payload",
"types": [
"telegrambot-payload"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-telegrambot-home",
"file": "/data/node_modules/node-red-contrib-telegrambot-home/nodes/payload/payload.js"
}
}
},
"node-red-contrib-influxdb": {
"name": "node-red-contrib-influxdb",
"version": "0.4.1",
"local": true,
"nodes": {
"influxdb": {
"name": "influxdb",
"types": [
"influxdb",
"influxdb out",
"influxdb batch",
"influxdb in"
],
"enabled": true,
"local": true,
"module": "node-red-contrib-influxdb",
"file": "/data/node_modules/node-red-contrib-influxdb/influxdb.js"
}
}
}
}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1,17 @@
{
"admin": {
"editor": {
"view": {
"view-show-grid": true,
"view-snap-grid": true,
"view-grid-size": "20",
"view-node-status": true,
"view-node-show-label": true,
"view-show-tips": true
}
},
"menu-menu-item-sidebar": true,
"menu-deploymenu-item-flow": false,
"menu-deploymenu-item-full": true
}
}

1
nodered/rootfs/data/flows.json Executable file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"$":"6b8144bb714d2abddb78dc7121c530f1632yZEmvh1wvEtcjFtQr6CCI+qy4z5VYW0/a9VLqbLIh+/za/aai8vo/w39OhPaCSHzSLFT0QIl/FV5leWyWOhZoo9yIzGEMsqN1w6WcXG4cVYrLm5PBMUUB52xcV9LhvmV38lZfkwg="}

1
nodered/rootfs/data/node_modules/.bin/electron generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../electron/cli.js

1
nodered/rootfs/data/node_modules/.bin/electron-download generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../electron-download/build/cli.js

1
nodered/rootfs/data/node_modules/.bin/extract-zip generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../extract-zip/cli.js

1
nodered/rootfs/data/node_modules/.bin/he generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../he/bin/he

1
nodered/rootfs/data/node_modules/.bin/html-to-text generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../html-to-text/bin/cli.js

1
nodered/rootfs/data/node_modules/.bin/mathjs generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../mathjs/bin/cli.js

1
nodered/rootfs/data/node_modules/.bin/mime generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../mime/cli.js

1
nodered/rootfs/data/node_modules/.bin/nugget generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../nugget/bin.js

1
nodered/rootfs/data/node_modules/.bin/pretty-bytes generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../pretty-bytes/cli.js

1
nodered/rootfs/data/node_modules/.bin/rc generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../rc/cli.js

1
nodered/rootfs/data/node_modules/.bin/semver generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../semver/bin/semver

1
nodered/rootfs/data/node_modules/.bin/sshpk-conv generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../sshpk/bin/sshpk-conv

1
nodered/rootfs/data/node_modules/.bin/sshpk-sign generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../sshpk/bin/sshpk-sign

1
nodered/rootfs/data/node_modules/.bin/sshpk-verify generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../sshpk/bin/sshpk-verify

1
nodered/rootfs/data/node_modules/.bin/strip-indent generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../strip-indent/cli.js

1
nodered/rootfs/data/node_modules/.bin/tlds generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../tlds/bin.js

1
nodered/rootfs/data/node_modules/.bin/uuid generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../uuid/bin/uuid

1
nodered/rootfs/data/node_modules/.bin/which generated vendored Symbolic link
View File

@@ -0,0 +1 @@
../which/bin/which

236
nodered/rootfs/data/node_modules/accepts/HISTORY.md generated vendored Normal file
View File

@@ -0,0 +1,236 @@
1.3.7 / 2019-04-29
==================
* deps: negotiator@0.6.2
- Fix sorting charset, encoding, and language with extra parameters
1.3.6 / 2019-04-28
==================
* deps: mime-types@~2.1.24
- deps: mime-db@~1.40.0
1.3.5 / 2018-02-28
==================
* deps: mime-types@~2.1.18
- deps: mime-db@~1.33.0
1.3.4 / 2017-08-22
==================
* deps: mime-types@~2.1.16
- deps: mime-db@~1.29.0
1.3.3 / 2016-05-02
==================
* deps: mime-types@~2.1.11
- deps: mime-db@~1.23.0
* deps: negotiator@0.6.1
- perf: improve `Accept` parsing speed
- perf: improve `Accept-Charset` parsing speed
- perf: improve `Accept-Encoding` parsing speed
- perf: improve `Accept-Language` parsing speed
1.3.2 / 2016-03-08
==================
* deps: mime-types@~2.1.10
- Fix extension of `application/dash+xml`
- Update primary extension for `audio/mp4`
- deps: mime-db@~1.22.0
1.3.1 / 2016-01-19
==================
* deps: mime-types@~2.1.9
- deps: mime-db@~1.21.0
1.3.0 / 2015-09-29
==================
* deps: mime-types@~2.1.7
- deps: mime-db@~1.19.0
* deps: negotiator@0.6.0
- Fix including type extensions in parameters in `Accept` parsing
- Fix parsing `Accept` parameters with quoted equals
- Fix parsing `Accept` parameters with quoted semicolons
- Lazy-load modules from main entry point
- perf: delay type concatenation until needed
- perf: enable strict mode
- perf: hoist regular expressions
- perf: remove closures getting spec properties
- perf: remove a closure from media type parsing
- perf: remove property delete from media type parsing
1.2.13 / 2015-09-06
===================
* deps: mime-types@~2.1.6
- deps: mime-db@~1.18.0
1.2.12 / 2015-07-30
===================
* deps: mime-types@~2.1.4
- deps: mime-db@~1.16.0
1.2.11 / 2015-07-16
===================
* deps: mime-types@~2.1.3
- deps: mime-db@~1.15.0
1.2.10 / 2015-07-01
===================
* deps: mime-types@~2.1.2
- deps: mime-db@~1.14.0
1.2.9 / 2015-06-08
==================
* deps: mime-types@~2.1.1
- perf: fix deopt during mapping
1.2.8 / 2015-06-07
==================
* deps: mime-types@~2.1.0
- deps: mime-db@~1.13.0
* perf: avoid argument reassignment & argument slice
* perf: avoid negotiator recursive construction
* perf: enable strict mode
* perf: remove unnecessary bitwise operator
1.2.7 / 2015-05-10
==================
* deps: negotiator@0.5.3
- Fix media type parameter matching to be case-insensitive
1.2.6 / 2015-05-07
==================
* deps: mime-types@~2.0.11
- deps: mime-db@~1.9.1
* deps: negotiator@0.5.2
- Fix comparing media types with quoted values
- Fix splitting media types with quoted commas
1.2.5 / 2015-03-13
==================
* deps: mime-types@~2.0.10
- deps: mime-db@~1.8.0
1.2.4 / 2015-02-14
==================
* Support Node.js 0.6
* deps: mime-types@~2.0.9
- deps: mime-db@~1.7.0
* deps: negotiator@0.5.1
- Fix preference sorting to be stable for long acceptable lists
1.2.3 / 2015-01-31
==================
* deps: mime-types@~2.0.8
- deps: mime-db@~1.6.0
1.2.2 / 2014-12-30
==================
* deps: mime-types@~2.0.7
- deps: mime-db@~1.5.0
1.2.1 / 2014-12-30
==================
* deps: mime-types@~2.0.5
- deps: mime-db@~1.3.1
1.2.0 / 2014-12-19
==================
* deps: negotiator@0.5.0
- Fix list return order when large accepted list
- Fix missing identity encoding when q=0 exists
- Remove dynamic building of Negotiator class
1.1.4 / 2014-12-10
==================
* deps: mime-types@~2.0.4
- deps: mime-db@~1.3.0
1.1.3 / 2014-11-09
==================
* deps: mime-types@~2.0.3
- deps: mime-db@~1.2.0
1.1.2 / 2014-10-14
==================
* deps: negotiator@0.4.9
- Fix error when media type has invalid parameter
1.1.1 / 2014-09-28
==================
* deps: mime-types@~2.0.2
- deps: mime-db@~1.1.0
* deps: negotiator@0.4.8
- Fix all negotiations to be case-insensitive
- Stable sort preferences of same quality according to client order
1.1.0 / 2014-09-02
==================
* update `mime-types`
1.0.7 / 2014-07-04
==================
* Fix wrong type returned from `type` when match after unknown extension
1.0.6 / 2014-06-24
==================
* deps: negotiator@0.4.7
1.0.5 / 2014-06-20
==================
* fix crash when unknown extension given
1.0.4 / 2014-06-19
==================
* use `mime-types`
1.0.3 / 2014-06-11
==================
* deps: negotiator@0.4.6
- Order by specificity when quality is the same
1.0.2 / 2014-05-29
==================
* Fix interpretation when header not in request
* deps: pin negotiator@0.4.5
1.0.1 / 2014-01-18
==================
* Identity encoding isn't always acceptable
* deps: negotiator@~0.4.0
1.0.0 / 2013-12-27
==================
* Genesis

23
nodered/rootfs/data/node_modules/accepts/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,23 @@
(The MIT License)
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

142
nodered/rootfs/data/node_modules/accepts/README.md generated vendored Normal file
View File

@@ -0,0 +1,142 @@
# accepts
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator).
Extracted from [koa](https://www.npmjs.com/package/koa) for general use.
In addition to negotiator, it allows:
- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])`
as well as `('text/html', 'application/json')`.
- Allows type shorthands such as `json`.
- Returns `false` when no types match
- Treats non-existent headers as `*`
## Installation
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```sh
$ npm install accepts
```
## API
<!-- eslint-disable no-unused-vars -->
```js
var accepts = require('accepts')
```
### accepts(req)
Create a new `Accepts` object for the given `req`.
#### .charset(charsets)
Return the first accepted charset. If nothing in `charsets` is accepted,
then `false` is returned.
#### .charsets()
Return the charsets that the request accepts, in the order of the client's
preference (most preferred first).
#### .encoding(encodings)
Return the first accepted encoding. If nothing in `encodings` is accepted,
then `false` is returned.
#### .encodings()
Return the encodings that the request accepts, in the order of the client's
preference (most preferred first).
#### .language(languages)
Return the first accepted language. If nothing in `languages` is accepted,
then `false` is returned.
#### .languages()
Return the languages that the request accepts, in the order of the client's
preference (most preferred first).
#### .type(types)
Return the first accepted type (and it is returned as the same text as what
appears in the `types` array). If nothing in `types` is accepted, then `false`
is returned.
The `types` array can contain full MIME types or file extensions. Any value
that is not a full MIME types is passed to `require('mime-types').lookup`.
#### .types()
Return the types that the request accepts, in the order of the client's
preference (most preferred first).
## Examples
### Simple type negotiation
This simple example shows how to use `accepts` to return a different typed
respond body based on what the client wants to accept. The server lists it's
preferences in order and will get back the best match between the client and
server.
```js
var accepts = require('accepts')
var http = require('http')
function app (req, res) {
var accept = accepts(req)
// the order of this list is significant; should be server preferred order
switch (accept.type(['json', 'html'])) {
case 'json':
res.setHeader('Content-Type', 'application/json')
res.write('{"hello":"world!"}')
break
case 'html':
res.setHeader('Content-Type', 'text/html')
res.write('<b>hello, world!</b>')
break
default:
// the fallback is text/plain, so no need to specify it above
res.setHeader('Content-Type', 'text/plain')
res.write('hello, world!')
break
}
res.end()
}
http.createServer(app).listen(3000)
```
You can test this out with the cURL program:
```sh
curl -I -H'Accept: text/html' http://localhost:3000/
```
## License
[MIT](LICENSE)
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master
[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master
[node-version-image]: https://badgen.net/npm/node/accepts
[node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/accepts
[npm-url]: https://npmjs.org/package/accepts
[npm-version-image]: https://badgen.net/npm/v/accepts
[travis-image]: https://badgen.net/travis/jshttp/accepts/master
[travis-url]: https://travis-ci.org/jshttp/accepts

238
nodered/rootfs/data/node_modules/accepts/index.js generated vendored Normal file
View File

@@ -0,0 +1,238 @@
/*!
* accepts
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
* @private
*/
var Negotiator = require('negotiator')
var mime = require('mime-types')
/**
* Module exports.
* @public
*/
module.exports = Accepts
/**
* Create a new Accepts object for the given req.
*
* @param {object} req
* @public
*/
function Accepts (req) {
if (!(this instanceof Accepts)) {
return new Accepts(req)
}
this.headers = req.headers
this.negotiator = new Negotiator(req)
}
/**
* Check if the given `type(s)` is acceptable, returning
* the best match when true, otherwise `undefined`, in which
* case you should respond with 406 "Not Acceptable".
*
* The `type` value may be a single mime type string
* such as "application/json", the extension name
* such as "json" or an array `["json", "html", "text/plain"]`. When a list
* or array is given the _best_ match, if any is returned.
*
* Examples:
*
* // Accept: text/html
* this.types('html');
* // => "html"
*
* // Accept: text/*, application/json
* this.types('html');
* // => "html"
* this.types('text/html');
* // => "text/html"
* this.types('json', 'text');
* // => "json"
* this.types('application/json');
* // => "application/json"
*
* // Accept: text/*, application/json
* this.types('image/png');
* this.types('png');
* // => undefined
*
* // Accept: text/*;q=.5, application/json
* this.types(['html', 'json']);
* this.types('html', 'json');
* // => "json"
*
* @param {String|Array} types...
* @return {String|Array|Boolean}
* @public
*/
Accepts.prototype.type =
Accepts.prototype.types = function (types_) {
var types = types_
// support flattened arguments
if (types && !Array.isArray(types)) {
types = new Array(arguments.length)
for (var i = 0; i < types.length; i++) {
types[i] = arguments[i]
}
}
// no types, return all requested types
if (!types || types.length === 0) {
return this.negotiator.mediaTypes()
}
// no accept header, return first given type
if (!this.headers.accept) {
return types[0]
}
var mimes = types.map(extToMime)
var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))
var first = accepts[0]
return first
? types[mimes.indexOf(first)]
: false
}
/**
* Return accepted encodings or best fit based on `encodings`.
*
* Given `Accept-Encoding: gzip, deflate`
* an array sorted by quality is returned:
*
* ['gzip', 'deflate']
*
* @param {String|Array} encodings...
* @return {String|Array}
* @public
*/
Accepts.prototype.encoding =
Accepts.prototype.encodings = function (encodings_) {
var encodings = encodings_
// support flattened arguments
if (encodings && !Array.isArray(encodings)) {
encodings = new Array(arguments.length)
for (var i = 0; i < encodings.length; i++) {
encodings[i] = arguments[i]
}
}
// no encodings, return all requested encodings
if (!encodings || encodings.length === 0) {
return this.negotiator.encodings()
}
return this.negotiator.encodings(encodings)[0] || false
}
/**
* Return accepted charsets or best fit based on `charsets`.
*
* Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
* an array sorted by quality is returned:
*
* ['utf-8', 'utf-7', 'iso-8859-1']
*
* @param {String|Array} charsets...
* @return {String|Array}
* @public
*/
Accepts.prototype.charset =
Accepts.prototype.charsets = function (charsets_) {
var charsets = charsets_
// support flattened arguments
if (charsets && !Array.isArray(charsets)) {
charsets = new Array(arguments.length)
for (var i = 0; i < charsets.length; i++) {
charsets[i] = arguments[i]
}
}
// no charsets, return all requested charsets
if (!charsets || charsets.length === 0) {
return this.negotiator.charsets()
}
return this.negotiator.charsets(charsets)[0] || false
}
/**
* Return accepted languages or best fit based on `langs`.
*
* Given `Accept-Language: en;q=0.8, es, pt`
* an array sorted by quality is returned:
*
* ['es', 'pt', 'en']
*
* @param {String|Array} langs...
* @return {Array|String}
* @public
*/
Accepts.prototype.lang =
Accepts.prototype.langs =
Accepts.prototype.language =
Accepts.prototype.languages = function (languages_) {
var languages = languages_
// support flattened arguments
if (languages && !Array.isArray(languages)) {
languages = new Array(arguments.length)
for (var i = 0; i < languages.length; i++) {
languages[i] = arguments[i]
}
}
// no languages, return all requested languages
if (!languages || languages.length === 0) {
return this.negotiator.languages()
}
return this.negotiator.languages(languages)[0] || false
}
/**
* Convert extnames to mime.
*
* @param {String} type
* @return {String}
* @private
*/
function extToMime (type) {
return type.indexOf('/') === -1
? mime.lookup(type)
: type
}
/**
* Check if mime is valid.
*
* @param {String} type
* @return {String}
* @private
*/
function validMime (type) {
return typeof type === 'string'
}