Fix env configuration and documentation (#1360)

Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
This commit is contained in:
Dušan Borovčanin 2021-02-08 22:38:52 +01:00 committed by GitHub
parent 13c426c09c
commit 24b902d049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 42 deletions

15
.env
View File

@ -209,11 +209,11 @@ MF_CASSANDRA_READER_SERVER_CERT=
MF_CASSANDRA_READER_SERVER_KEY=
### InfluxDB
MF_INFLUXDB_PORT= 8086
MF_INFLUXDB_DB: mainflux
MF_INFLUXDB_ADMIN_USER: mainflux
MF_INFLUXDB_ADMIN_PASSWORD: mainfllux
MF_INFLUXDB_HTTP_AUTH_ENABLED: true
MF_INFLUXDB_PORT=8086
MF_INFLUXDB_DB=mainflux
MF_INFLUXDB_ADMIN_USER=mainflux
MF_INFLUXDB_ADMIN_PASSWORD=mainfllux
MF_INFLUXDB_HTTP_AUTH_ENABLED=true
### InfluxDB Writer
MF_INFLUX_WRITER_LOG_LEVEL=debug
@ -274,7 +274,7 @@ MF_POSTGRES_READER_DB_SSL_CERT=""
MF_POSTGRES_READER_DB_SSL_KEY=""
MF_POSTGRES_READER_DB_SSL_ROOT_CERT=""
# Twins
### Twins
MF_TWINS_LOG_LEVEL=debug
MF_TWINS_HTTP_PORT=9021
MF_TWINS_SERVER_CERT=""
@ -291,10 +291,9 @@ MF_TWINS_CACHE_URL=es-redis:6379
MF_TWINS_CACHE_PASS=
MF_TWINS_CACHE_DB=0
# SMTP Notifier
### SMTP Notifier
MF_SMTP_NOTIFIER_PORT=8906
MF_SMTP_NOTIFIER_LOG_LEVEL=debug
MF_SMTP_NOTIFIER_HTTP_PORT=8180
MF_SMTP_NOTIFIER_DB_PORT=5432
MF_SMTP_NOTIFIER_DB_USER=mainflux
MF_SMTP_NOTIFIER_DB_PASS=mainflux

View File

@ -74,12 +74,12 @@ const (
envDBUser = "MF_SMTP_NOTIFIER_DB_USER"
envDBPass = "MF_SMTP_NOTIFIER_DB_PASS"
envDB = "MF_SMTP_NOTIFIER_DB"
envConfigPath = "MF_SMTP_NOTIFIER_WRITER_CONFIG_PATH"
envConfigPath = "MF_SMTP_NOTIFIER_CONFIG_PATH"
envDBSSLMode = "MF_SMTP_NOTIFIER_DB_SSL_MODE"
envDBSSLCert = "MF_SMTP_NOTIFIER_DB_SSL_CERT"
envDBSSLKey = "MF_SMTP_NOTIFIER_DB_SSL_KEY"
envDBSSLRootCert = "MF_SMTP_NOTIFIER_DB_SSL_ROOT_CERT"
envHTTPPort = "MF_SMTP_NOTIFIER_HTTP_PORT"
envHTTPPort = "MF_SMTP_NOTIFIER_PORT"
envServerCert = "MF_SMTP_NOTIFIER_SERVER_CERT"
envServerKey = "MF_SMTP_NOTIFIER_SERVER_KEY"
envJaegerURL = "MF_JAEGER_URL"

View File

@ -8,36 +8,36 @@ The Subscription service using SMTP Notifier is configured using the environment
following table. Note that any unset variables will be replaced with their
default values.
| Variable | Description | Default |
| ----------------------------------- | ----------------------------------------------------------------------- | --------------------- |
| MF_SMTP_NOTIFIER_LOG_LEVEL | Log level for SMT Notifier (debug, info, warn, error) | error |
| MF_SMTP_NOTIFIER_DB_HOST | Database host address | localhost |
| MF_SMTP_NOTIFIER_DB_PORT | Database host port | 5432 |
| MF_SMTP_NOTIFIER_DB_USER | Database user | mainflux |
| MF_SMTP_NOTIFIER_DB_PASS | Database password | mainflux |
| MF_SMTP_NOTIFIER_DB | Name of the database used by the service | subscriptions |
| MF_SMTP_NOTIFIER_WRITER_CONFIG_PATH | Database connection SSL mode (disable, require, verify-ca, verify-full) | disable |
| MF_SMTP_NOTIFIER_DB_SSL_MODE | Path to the PEM encoded certificate file | |
| MF_SMTP_NOTIFIER_DB_SSL_CERT | Path to the PEM encoded key file | |
| MF_SMTP_NOTIFIER_DB_SSL_KEY | Path to the PEM encoded root certificate file | |
| MF_SMTP_NOTIFIER_DB_SSL_ROOT_CERT | Users service HTTP port | 8180 |
| MF_SMTP_NOTIFIER_HTTP_PORT | Path to server certificate in pem format | |
| MF_SMTP_NOTIFIER_SERVER_CERT | Path to server cert in pem format | |
| MF_SMTP_NOTIFIER_SERVER_KEY | Path to server key in pem format | |
| MF_JAEGER_URL | Jaeger server URL | localhost:6831 |
| MF_NATS_URL | NATS broker URL | nats://127.0.0.1:4222 |
| MF_EMAIL_HOST | Mail server host | localhost |
| MF_EMAIL_PORT | Mail server port | 25 |
| MF_EMAIL_USERNAME | Mail server username | |
| MF_EMAIL_PASSWORD | Mail server password for Basic authentication | |
| MF_EMAIL_SECRET | Mail server secret for CRAM-MD5 authentication | |
| MF_EMAIL_FROM_ADDRESS | Email "from" address | |
| MF_EMAIL_FROM_NAME | Email "from" name | |
| MF_EMAIL_TEMPLATE | Email template for sending notification emails | email.tmpl |
| MF_AUTH_GRPC_URL | Auth service gRPC URL | localhost:8181 |
| MF_AUTH_GRPC_TIMEOUT | Auth service gRPC request timeout in seconds | 1s |
| MF_AUTH_CLIENT_TLS | Auth client TLS flag | false |
| MF_AUTH_CA_CERTS | Path to Auth client CA certs in pem format | |
| Variable | Description | Default |
| --------------------------------- | ----------------------------------------------------------------------- | --------------------- |
| MF_SMTP_NOTIFIER_LOG_LEVEL | Log level for SMT Notifier (debug, info, warn, error) | error |
| MF_SMTP_NOTIFIER_DB_HOST | Database host address | localhost |
| MF_SMTP_NOTIFIER_DB_PORT | Database host port | 5432 |
| MF_SMTP_NOTIFIER_DB_USER | Database user | mainflux |
| MF_SMTP_NOTIFIER_DB_PASS | Database password | mainflux |
| MF_SMTP_NOTIFIER_DB | Name of the database used by the service | subscriptions |
| MF_SMTP_NOTIFIER_CONFIG_PATH | Path to the config file with NATS subjects configuration | disable |
| MF_SMTP_NOTIFIER_DB_SSL_MODE | Database connection SSL mode (disable, require, verify-ca, verify-full) | |
| MF_SMTP_NOTIFIER_DB_SSL_CERT | Path to the PEM encoded cert file | |
| MF_SMTP_NOTIFIER_DB_SSL_KEY | Path to the PEM encoded certificate key | |
| MF_SMTP_NOTIFIER_DB_SSL_ROOT_CERT | Path to the PEM encoded root certificate file | |
| MF_SMTP_NOTIFIER_PORT | HTTP server port | 8180 |
| MF_SMTP_NOTIFIER_SERVER_CERT | Path to server cert in pem format | |
| MF_SMTP_NOTIFIER_SERVER_KEY | Path to server key in pem format | |
| MF_JAEGER_URL | Jaeger server URL | localhost:6831 |
| MF_NATS_URL | NATS broker URL | nats://127.0.0.1:4222 |
| MF_EMAIL_HOST | Mail server host | localhost |
| MF_EMAIL_PORT | Mail server port | 25 |
| MF_EMAIL_USERNAME | Mail server username | |
| MF_EMAIL_PASSWORD | Mail server password for Basic authentication | |
| MF_EMAIL_SECRET | Mail server secret for CRAM-MD5 authentication | |
| MF_EMAIL_FROM_ADDRESS | Email "from" address | |
| MF_EMAIL_FROM_NAME | Email "from" name | |
| MF_EMAIL_TEMPLATE | Email template for sending notification emails | email.tmpl |
| MF_AUTH_GRPC_URL | Auth service gRPC URL | localhost:8181 |
| MF_AUTH_GRPC_TIMEOUT | Auth service gRPC request timeout in seconds | 1s |
| MF_AUTH_CLIENT_TLS | Auth client TLS flag | false |
| MF_AUTH_CA_CERTS | Path to Auth client CA certs in pem format | |
## Usage

View File

@ -42,12 +42,14 @@ services:
MF_SMTP_NOTIFIER_DB_USER: ${MF_SMTP_NOTIFIER_DB_USER}
MF_SMTP_NOTIFIER_DB_PASS: ${MF_SMTP_NOTIFIER_DB_PASS}
MF_SMTP_NOTIFIER_DB: ${MF_SMTP_NOTIFIER_DB}
MF_SMTP_NOTIFIER_PORT: ${MF_SMTP_NOTIFIER_PORT}
MF_NATS_URL: ${MF_NATS_URL}
MF_JAEGER_URL: ${MF_JAEGER_URL}
MF_AUTH_GRPC_URL: ${MF_AUTH_GRPC_URL}
MF_AUTH_GRPC_TIMEOUT: ${MF_AUTH_GRPC_TIMEOUT}
MF_EMAIL_USERNAME: ${MF_EMAIL_USERNAME}
MF_EMAIL_PASSWORD: ${MF_EMAIL_PASSWORD}
MF_EMAIL_PORT: ${MF_EMAIL_PORT}
MF_EMAIL_FROM_ADDRESS: ${MF_EMAIL_FROM_ADDRESS}
MF_EMAIL_FROM_NAME: ${MF_EMAIL_FROM_NAME}
MF_EMAIL_TEMPLATE: ${MF_EMAIL_TEMPLATE}

View File

@ -124,7 +124,6 @@ services:
MF_USERS_DB: ${MF_USERS_DB}
MF_USERS_HTTP_PORT: ${MF_USERS_HTTP_PORT}
MF_JAEGER_URL: ${MF_JAEGER_URL}
MF_EMAIL_DRIVER: ${MF_EMAIL_DRIVER}
MF_EMAIL_HOST: ${MF_EMAIL_HOST}
MF_EMAIL_PORT: ${MF_EMAIL_PORT}
MF_EMAIL_USERNAME: ${MF_EMAIL_USERNAME}

View File

@ -78,7 +78,6 @@ MF_USERS_HTTP_PORT=[Service HTTP port] \
MF_USERS_SERVER_CERT=[Path to server certificate] \
MF_USERS_SERVER_KEY=[Path to server key] \
MF_JAEGER_URL=[Jaeger server URL] \
MF_EMAIL_DRIVER=[Mail server driver smtp] \
MF_EMAIL_HOST=[Mail server host] \
MF_EMAIL_PORT=[Mail server port] \
MF_EMAIL_USERNAME=[Mail server username] \