aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaise Thompson <blaise@untzag.com>2020-11-30 13:19:59 -0600
committerBlaise Thompson <blaise@untzag.com>2020-11-30 13:19:59 -0600
commit7efc17a2ba11681985a0c8901e39dd50daae3bfe (patch)
tree67807b82f647153bb00c0be8ebf06d1ba3475c79
parent19441ae99f7967c5efbe2c303cb93c5bebcac7c0 (diff)
influx password
-rw-r--r--.gitignore2
-rw-r--r--docker-compose.yml8
-rw-r--r--influxdb.env.example8
-rw-r--r--write-influx/write_influx.py4
4 files changed, 17 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index c2de89b..9333c69 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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")