Skip to content

Commit fa7e987

Browse files
added env constants to docker.
1 parent 7725213 commit fa7e987

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
ca.crt
33
ca.key
44
server.crt
5-
server.key
5+
server.key
6+
server.csr

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ services:
9898
MQTT_BROKER_HOSTNAME: # Change this to the public ip/hostname of the mqtt broker
9999
ENCRYPTION_SYMMETRIC_KEY: # Change this to the symmetric key generated
100100
CA_KEY_PASSWORD: # Change this to the password of the generated CA certificate key
101+
MQTT_SUPER_USER_PASSWORD: # Change this to the password for the internal super user.
101102
volumes:
102103
- ./configuration/mosquitto-broker-os2iot/ca.crt:/tmp/os2iot/backend/dist/resources/ca.crt
103104
- ./configuration/mosquitto-broker-os2iot/ca.key:/tmp/os2iot/backend/dist/resources/ca.key

helm/charts/mosquitto-os2iot/templates/configmap.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ data:
2323
auth_opt_pg_superquery SELECT COUNT(*) FROM iot_device WHERE (mqttusername = $1 AND permissions = 'superUser')
2424
auth_opt_pg_aclquery SELECT mqttTopicName FROM iot_device WHERE (mqttUsername = $1 AND permissions = 'write') OR (9 = $2 AND mqttUsername = $1)
2525
26-
auth_opt_pg_sslmode disable
26+
auth_opt_pg_sslmode verify-ca
2727
auth_opt_hasher pbkdf2
2828
2929
auth_opt_hasher_salt_size 16
@@ -45,9 +45,12 @@ data:
4545
auth_opt_pg_user {{ .Values.deployment.env.DATABASE_USERNAME }}
4646
auth_opt_pg_password {{ .Values.deployment.env.DATABASE_PASSWORD }}
4747
auth_opt_pg_dbname {{ .Values.deployment.env.DATABASE_NAME }}
48+
auth_opt_pg_userquery SELECT mqttPassword FROM iot_device WHERE mqttUsername = $1 limit 1
4849
auth_opt_pg_superquery SELECT COUNT(*) FROM iot_device WHERE (mqttusername = $1 AND permissions = 'superUser')
4950
auth_opt_pg_aclquery SELECT mqttTopicName FROM iot_device WHERE (mqttUsername = $1 AND permissions = 'write') OR (9 = $2 AND mqttUsername = $1)
5051
52+
auth_opt_pg_sslmode verify-ca
53+
5154
cafile /etc/mosquitto/ca_certificates/ca.crt
5255
keyfile /etc/mosquitto/certs/server.key
5356
certfile /etc/mosquitto/certs/server.crt

helm/charts/os2iot-backend/templates/deployment.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ spec:
8181
value: some-login-pass
8282
- name: EMAIL_FROM
8383
84+
- name: MQTT_SUPER_USER_PASSWORD
85+
value: some-super-user-password
86+
- name: MQTT_BROKER_HOSTNAME
87+
value: some-mqtt-broker-hostname
88+
- name: ENCRYPTION_SYMMETRIC_KEY
89+
value: some-encryption-symmetric-key
90+
- name: CA_KEY_PASSWORD
91+
value: some-ca-key-password
8492
volumeMounts:
8593
- name: secret-ca-crt
8694
mountPath: /tmp/os2iot/backend/dist/resources

0 commit comments

Comments
 (0)