Skip to content

Commit

Permalink
Use only known-good keys in InfluxDB environment template
Browse files Browse the repository at this point in the history
Following on from
[Issue 76](SensorsIot#76)
this PR:

1. Reforms the InfluxDB environment template to only use known-good keys
2. Adopts the InfluxDB documentation standard of making keys active with
their default values (in all cases this means the feature is off)
3. Groups by function and adds documentation explaining any
interrelationships between environment keys, and between keys and
database commands.

The environment keys included are those which come up most frequently
in issues and on Discord:

* Enabling flux support
* Enabling authentication
* Enabling UDP support

Environment keys removed were:

* INFLUXDB_DB=mydb (not defined)
* INFLUXDB_DATA_ENGINE (not defined)
* INFLUXDB_REPORTING_DISABLED (defined; default value is now "false" so
no longer needed; confusing because name implies local reporting function
when it is actually a "phone home" function)
* INFLUXDB_ADMIN_ENABLED (not defined)
* INFLUXDB_ADMIN_USER (not defined)
* INFLUXDB_ADMIN_PASSWORD (not defined)
* INFLUXDB_USER (not defined; probably intended to be INFLUX_USER)
* INFLUXDB_USER_PASSWORD (not defined; probably intended to be
INFLUX_PASSWORD)
* INFLUXDB_READ_USER (not defined)
* INFLUXDB_READ_USER_PASSWORD (not defined)
* INFLUXDB_WRITE_USER (not defined)
* INFLUXDB_WRITE_USER_PASSWORD (not defined)
  • Loading branch information
Paraphraser committed Oct 11, 2020
1 parent 5ffb4dd commit afb4733
Showing 1 changed file with 84 additions and 13 deletions.
97 changes: 84 additions & 13 deletions .templates/influxdb/influxdb.env
Original file line number Diff line number Diff line change
@@ -1,13 +1,84 @@
#INFLUXDB_DB=mydb
INFLUXDB_DATA_ENGINE=tsm1
INFLUXDB_REPORTING_DISABLED=false
#INFLUXDB_HTTP_AUTH_ENABLED=true
INFLUXDB_ADMIN_ENABLED=true
#INFLUXDB_ADMIN_USER=myadminuser
#INFLUXDB_ADMIN_PASSWORD=myadminpassword
INFLUXDB_USER=nodered
INFLUXDB_USER_PASSWORD=nodered
#INFLUXDB_READ_USER=myreaduser
#INFLUXDB_READ_USER_PASSWORD=myreadpassword
#INFLUXDB_WRITE_USER=mywriteuser
#INFLUXDB_WRITE_USER_PASSWORD=mywritepassword
# InfluxDB's configuration variables (including how each CONFIGURATION
# variable maps to an ENVIRONMENT variable for use in this file) can
# be found at:
#
# https://docs.influxdata.com/influxdb/latest/administration/config/#configuration-settings
#
# The URL was correct as at 2020-10-11 but is subject to change.
#
# After you make a change in this file, you bring it into effect by:
#
# $ cd ~/IOTstack
# $ docker-compose up -d influxdb


# ---------------- some selected environment variables ----------------


# enable INFLUXDB_HTTP_FLUX_ENABLED to support Flux queries

INFLUXDB_HTTP_FLUX_ENABLED=false


# ---------------------------------------------------------------------


# enable INFLUXDB_HTTP_AUTH_ENABLED to enforce authentication for access
# via HTTP and HTTPS. Node-Red, Grafana and the "influx" command line
# interface all use HTTP/S so enabling this option affects pretty much
# everything. Only enable this option AFTER you have set up credentials
# for your database administrator, like this:
#
# CREATE USER "dba" WITH PASSWORD 'supremo' WITH ALL PRIVILEGES

INFLUXDB_HTTP_AUTH_ENABLED=false


# if INFLUXDB_HTTP_AUTH_ENABLED=true then INFLUX_USERNAME and
# INFLUX_PASSWORD supply database administrator (DBA) credentials to
# the "influx" command line interface. They serve no other purpose. They
# are NOT general-purpose credentials for use in NodeRed or Grafana etc.
# If INFLUXDB_HTTP_AUTH_ENABLED is enabled but INFLUX_USERNAME &
# INFLUX_PASSWORD do not match the values on the CREATE USER statement
# then you will need to authenticate when you start the "influx" CLI.

INFLUX_USERNAME=dba
INFLUX_PASSWORD=supremo


# ---------------------------------------------------------------------


# enable UDP support

INFLUXDB_UDP_ENABLED=false


# if INFLUXDB_UDP_ENABLED=true then InfluxDB listens for line protocol
# data on UDP port 8086. In the context below, the IP address "0.0.0.0"
# means "this host"; analogous to the way "255.255.255.255" means
# "all hosts"

INFLUXDB_UDP_BIND_ADDRESS=0.0.0.0:8086

# Remember that you will need a matching "ports" definition in your
# docker-compose.yml. For example:
#
# - "8086:8086/udp"
#
# Also remember that, just because InfluxDB running inside the container
# is listening on UDP/8086, does NOT mean that the external port MUST be
# the same. It could just as easily be "8089:8086/udp". Keep that in
# mind when you set up the sending process.


# if INFLUXDB_UDP_ENABLED=true then data will be written to the
# database named "udp". You MUST create this database, by hand via
# the "influx CLI", before you start sending data, as in:
#
# CREATE DATABASE udp

INFLUXDB_UDP_DATABASE=udp


# ---------------------------------------------------------------------

0 comments on commit afb4733

Please sign in to comment.