diff options
| author | Blaise Thompson <blaise@untzag.com> | 2020-11-30 13:19:59 -0600 | 
|---|---|---|
| committer | Blaise Thompson <blaise@untzag.com> | 2020-11-30 13:19:59 -0600 | 
| commit | 7efc17a2ba11681985a0c8901e39dd50daae3bfe (patch) | |
| tree | 67807b82f647153bb00c0be8ebf06d1ba3475c79 | |
| parent | 19441ae99f7967c5efbe2c303cb93c5bebcac7c0 (diff) | |
influx password
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | docker-compose.yml | 8 | ||||
| -rw-r--r-- | influxdb.env.example | 8 | ||||
| -rw-r--r-- | write-influx/write_influx.py | 4 | 
4 files changed, 17 insertions, 5 deletions
@@ -1 +1 @@ -/db +influxdb.env diff --git a/docker-compose.yml b/docker-compose.yml index d5b0812..78de83a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,19 +11,23 @@ services:        - 8086:8086      volumes:        - influxdb:/var/lib/influxdb +    env_file: +      - ./influxdb.env    write-influx:      build: ./write-influx      depends_on:        - broker        - db +    env_file: +      - ./influxdb.env    web:      build: ./web      ports: -      - 80:80 +      - 8080:80      depends_on:        - broker        - db        - write-influx  volumes: -  influxdb:
\ No newline at end of file +  influxdb: diff --git a/influxdb.env.example b/influxdb.env.example new file mode 100644 index 0000000..7e5ad8e --- /dev/null +++ b/influxdb.env.example @@ -0,0 +1,8 @@ +INFLUXDB_DB=homie +INFLUXDB_HTTP_AUTH_ENABLED=true + +INFLUXDB_ADMIN_USER=admin +INFLUXDB_ADMIN_PASSWORD=supersecurepassword + +INFLUXDB_READ_USER=user +INFLUXDB_READ_USER_PASSWORD=xtssxgxy diff --git a/write-influx/write_influx.py b/write-influx/write_influx.py index ccfb15d..b558b84 100644 --- a/write-influx/write_influx.py +++ b/write-influx/write_influx.py @@ -68,8 +68,8 @@ def on_message(client, userdata, msg):  influx_client = InfluxDBClient(host="db",                                 port=8086, -                               username="root", -                               password="root", +                               username="admin", +                               password=os.environ["INFLUXDB_ADMIN_PASSWORD"],                                 database="homie")  influx_client.create_database("homie")  | 
