1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-29 13:49:28 +08:00
Arvindh fde435060c
NOISSUE - Implementation of gRPC mTLS (#1848)
Rebase with master and squash commits
add: rootCA and clientCA in grpc server
add: rootCA and client certificate in grpc client
add: docker-compose for grpc-mtls and make target for mtls cert generation
fix: typo in makefile
fix: loadCertFile function in internal/clients/grpc/connect.go
fix: env.parser test
remove: commented lines
add: make commands
update: make commands and grpc clients
fix: typo in makefile
fix: loadCertFile function in internal/clients/grpc/connect.go
remove: commented lines
update: make commands and grpc clients
update: make commands and docker-compose
add: end of line
fix: typos in makefile
add: end of line
fix: typos in makefile
revert: grafana port in .env
change: loadCertFile function
change: certficate logic
change: env name and update in compose file
fix: makefile
remove: tls env var
change: ioutil to os for ReadFile
change loadfile
remove: test which is no needed
fix: docker project name
single docker-compose file
single docker-compose file
single docker-compose file
fix space and new lines
fix makefile
add: GRPC_TLS varaible and imporved logging in gRPC Client
fix mtls and tls env vars
fix mtls and tls env vars
grpc_mtls
fix docker-compose
fix makefile
fix const name to go idomatic

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
2023-08-16 19:11:33 +02:00

93 lines
4.0 KiB
YAML

# Copyright (c) Mainflux
# SPDX-License-Identifier: Apache-2.0
# This docker-compose file contains optional InfluxDB and InfluxDB-writer services
# for the Mainflux platform. Since this services are optional, this file is dependent on the
# docker-compose.yml file from <project_root>/docker/. In order to run these services,
# core services, as well as the network from the core composition, should be already running.
version: "3.7"
networks:
mainflux-base-net:
volumes:
mainflux-smpp-notifier-volume:
services:
smpp-notifier-db:
image: postgres:10.2-alpine
container_name: mainflux-smpp-notifier-db
restart: on-failure
environment:
POSTGRES_USER: ${MF_SMPP_NOTIFIER_DB_USER}
POSTGRES_PASSWORD: ${MF_SMPP_NOTIFIER_DB_PASS}
POSTGRES_DB: ${MF_SMPP_NOTIFIER_DB_NAME}
networks:
- mainflux-base-net
volumes:
- mainflux-smpp-notifier-volume:/var/lib/postgresql/datab
smpp-notifier:
image: mainflux/smpp-notifier:latest
container_name: mainflux-smpp-notifier
depends_on:
- smpp-notifier-db
restart: on-failure
environment:
MF_SMPP_NOTIFIER_LOG_LEVEL: ${MF_SMPP_NOTIFIER_LOG_LEVEL}
MF_SMPP_NOTIFIER_FROM_ADDR: ${MF_SMPP_NOTIFIER_FROM_ADDR}]
MF_SMPP_NOTIFIER_CONFIG_PATH: ${MF_SMPP_NOTIFIER_CONFIG_PATH}
MF_SMPP_NOTIFIER_HTTP_HOST: ${MF_SMPP_NOTIFIER_HTTP_HOST}
MF_SMPP_NOTIFIER_HTTP_PORT: ${MF_SMPP_NOTIFIER_HTTP_PORT}
MF_SMPP_NOTIFIER_HTTP_SERVER_CERT: ${MF_SMPP_NOTIFIER_HTTP_SERVER_CERT}
MF_SMPP_NOTIFIER_HTTP_SERVER_KEY: ${MF_SMPP_NOTIFIER_HTTP_SERVER_KEY}
MF_SMPP_NOTIFIER_DB_HOST: ${MF_SMPP_NOTIFIER_DB_HOST}
MF_SMPP_NOTIFIER_DB_PORT: ${MF_SMPP_NOTIFIER_DB_PORT}
MF_SMPP_NOTIFIER_DB_USER: ${MF_SMPP_NOTIFIER_DB_USER}
MF_SMPP_NOTIFIER_DB_PASS: ${MF_SMPP_NOTIFIER_DB_PASS}
MF_SMPP_NOTIFIER_DB_NAME: ${MF_SMPP_NOTIFIER_DB_NAME}
MF_SMPP_NOTIFIER_DB_SSL_MODE: ${MF_SMPP_NOTIFIER_DB_SSL_MODE}
MF_SMPP_NOTIFIER_DB_SSL_CERT: ${MF_SMPP_NOTIFIER_DB_SSL_CERT}
MF_SMPP_NOTIFIER_DB_SSL_KEY: ${MF_SMPP_NOTIFIER_DB_SSL_KEY}
MF_SMPP_NOTIFIER_DB_SSL_ROOT_CERT: ${MF_SMPP_NOTIFIER_DB_SSL_ROOT_CERT}
MF_SMPP_ADDRESS: ${MF_SMPP_ADDRESS}
MF_SMPP_USERNAME: ${MF_SMPP_USERNAME}
MF_SMPP_PASSWORD: ${MF_SMPP_PASSWORD}
MF_SMPP_SYSTEM_TYPE: ${MF_SMPP_SYSTEM_TYPE}
MF_SMPP_SRC_ADDR_TON: ${MF_SMPP_SRC_ADDR_TON}
MF_SMPP_SRC_ADDR_NPI: ${MF_SMPP_SRC_ADDR_NPI}
MF_SMPP_DST_ADDR_TON: ${MF_SMPP_DST_ADDR_TON}
MF_SMPP_DST_ADDR_NPI: ${MF_SMPP_DST_ADDR_NPI}
MF_AUTH_GRPC_URL: ${MF_USERS_GRPC_URL}
MF_AUTH_GRPC_TIMEOUT : ${MF_USERS_GRPC_TIMEOUT}
MF_AUTH_GRPC_CLIENT_CERT: ${MF_USERS_GRPC_CLIENT_CERT:+/users-grpc-client.crt}
MF_AUTH_GRPC_CLIENT_KEY: ${MF_USERS_GRPC_CLIENT_KEY:+/users-grpc-client.key}
MF_AUTH_GRPC_SERVER_CA_CERTS: ${MF_USERS_GRPC_SERVER_CA_CERTS:+/users-grpc-server-ca.crt}
MF_BROKER_URL: ${MF_BROKER_URL}
MF_JAEGER_URL: ${MF_JAEGER_URL}
MF_SEND_TELEMETRY: ${MF_SEND_TELEMETRY}
MF_SMPP_NOTIFIER_INSTANCE_ID: ${MF_SMPP_NOTIFIER_INSTANCE_ID}
ports:
- ${MF_SMPP_NOTIFIER_HTTP_PORT}:${MF_SMPP_NOTIFIER_HTTP_PORT}
networks:
- mainflux-base-net
volumes:
- ./config.toml:/config.toml
# Users gRPC client certificates
- type: bind
source: ${MF_ADDONS_CERTS_PATH_PREFIX}${MF_USERS_GRPC_CLIENT_CERT:-./ssl/certs/dummy/client_cert}
target: /users-grpc-client${MF_USERS_GRPC_CLIENT_CERT:+.crt}
bind:
create_host_path: true
- type: bind
source: ${MF_ADDONS_CERTS_PATH_PREFIX}${MF_USERS_GRPC_CLIENT_KEY:-./ssl/certs/dummy/client_key}
target: /users-grpc-client${MF_USERS_GRPC_CLIENT_KEY:+.key}
bind:
create_host_path: true
- type: bind
source: ${MF_ADDONS_CERTS_PATH_PREFIX}${MF_USERS_GRPC_SERVER_CA_CERTS:-./ssl/certs/dummy/server_ca}
target: /users-grpc-server-ca${MF_USERS_GRPC_SERVER_CA_CERTS:+.crt}
bind:
create_host_path: true