mirror of
https://github.com/mainflux/mainflux.git
synced 2025-05-11 19:29:16 +08:00

* Bring old CoAP code back Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix channel ID formatting due to type change Uncomment error handling for authorization. Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update CoAP adapter docs Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove redundant type declaration Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to the list of services Add CoAp adapter in Makefile services list and fix corresponding documentation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP code Merge multipe `const` block int single and declare consts before vars. Un-export notFound handler since there is no need to export it. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update http version endpoint This separates CoAP and HTTP APIs. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP POST method handling This PR is a part of CoAP adapter refactoring that will simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor CoAP adapter Change CoAP message handling to simplify adapter implementation. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add backoff timeout for server ping to client Update CoAP adapter to provide subset of necessary features from protocol specification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Fix leaking locked goroutine In case of the stopped ticker, its channel is NOT closed, so pinging might be left stuck waiting for the stopped ticker to send a notification. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Format code Use more meaningful name for Handlers map. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use and stop ticker from the same goroutine Stop handler Ticker from ping goroutine rather than the cancel goroutine. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Check if subscription already exists in put method Fix potential leak of handlers providing check inside of put method. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use MessageID as Observe option Since MessageID satisfies observe option behaviour, use Message ID instead of local timestamp. Remove Thicker from handler and use it on transport layer. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use name Observer insted of Handler Name `Observer` is used in protocol specification, so this naming makes code more self-documenting. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add CoAP adapter to docker-compose.yml Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add copyright headers Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove unused constants Fix service name in startup log message. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Add metrics endpoint Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Refactor code Config fields from main.go should not be exported; minor style changes. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Update authorization URI-Query option Use `authorization` value in URI-Query option instead of `key`. This mimics Authorization header in some other protocols (e.g. HTTP). Please note that this value can be replaced with simple `auth` to save space, due to constrained URI-Query option size. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
220 lines
4.7 KiB
YAML
220 lines
4.7 KiB
YAML
###
|
|
# Copyright (c) 2015-2017 Mainflux
|
|
#
|
|
# Mainflux is licensed under an Apache license, version 2.0 license.
|
|
# All rights not explicitly granted in the Apache license, version 2.0 are reserved.
|
|
# See the included LICENSE file for more details.
|
|
###
|
|
|
|
version: "3"
|
|
|
|
networks:
|
|
mainflux-base-net:
|
|
driver: bridge
|
|
|
|
services:
|
|
nginx:
|
|
image: nginx:1.13-alpine
|
|
container_name: mainflux-nginx
|
|
restart: on-failure
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf
|
|
- ./ssl/certs/mainflux-server.crt:/etc/ssl/certs/mainflux-server.crt
|
|
- ./ssl/certs/mainflux-server.key:/etc/ssl/private/mainflux-server.key
|
|
- ./ssl/dhparam.pem:/etc/ssl/certs/dhparam.pem
|
|
ports:
|
|
- 80:80
|
|
- 443:443
|
|
- 8883:8883
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
nats:
|
|
image: nats:1.3.0
|
|
container_name: mainflux-nats
|
|
restart: on-failure
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
users-db:
|
|
image: postgres:10.2-alpine
|
|
container_name: mainflux-users-db
|
|
restart: on-failure
|
|
environment:
|
|
POSTGRES_USER: mainflux
|
|
POSTGRES_PASSWORD: mainflux
|
|
POSTGRES_DB: users
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
users:
|
|
image: mainflux/users:latest
|
|
container_name: mainflux-users
|
|
depends_on:
|
|
- users-db
|
|
expose:
|
|
- 8180
|
|
- 8181
|
|
restart: on-failure
|
|
environment:
|
|
MF_USERS_DB_HOST: users-db
|
|
MF_USERS_DB_PORT: 5432
|
|
MF_USERS_DB_USER: mainflux
|
|
MF_USERS_DB_PASS: mainflux
|
|
MF_USERS_DB: users
|
|
MF_USERS_HTTP_PORT: 8180
|
|
MF_USERS_GRPC_PORT: 8181
|
|
MF_USERS_SECRET: secret
|
|
ports:
|
|
- 8180:8180
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
things-db:
|
|
image: postgres:10.2-alpine
|
|
container_name: mainflux-things-db
|
|
restart: on-failure
|
|
environment:
|
|
POSTGRES_USER: mainflux
|
|
POSTGRES_PASSWORD: mainflux
|
|
POSTGRES_DB: things
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
things-cache:
|
|
image: redis:4.0.9-alpine
|
|
container_name: mainflux-things-cache
|
|
restart: on-failure
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
things:
|
|
image: mainflux/things:latest
|
|
container_name: mainflux-things
|
|
depends_on:
|
|
- things-db
|
|
- users
|
|
expose:
|
|
- 8182
|
|
- 8183
|
|
restart: on-failure
|
|
environment:
|
|
MF_THINGS_DB_HOST: things-db
|
|
MF_THINGS_DB_PORT: 5432
|
|
MF_THINGS_DB_USER: mainflux
|
|
MF_THINGS_DB_PASS: mainflux
|
|
MF_THINGS_DB: things
|
|
MF_THINGS_CACHE_URL: things-cache:6379
|
|
MF_THINGS_HTTP_PORT: 8182
|
|
MF_THINGS_GRPC_PORT: 8183
|
|
MF_USERS_URL: users:8181
|
|
MF_THINGS_SECRET: secret
|
|
ports:
|
|
- 8182:8182
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
normalizer:
|
|
image: mainflux/normalizer:latest
|
|
container_name: mainflux-normalizer
|
|
restart: on-failure
|
|
depends_on:
|
|
- nats
|
|
expose:
|
|
- 8184
|
|
environment:
|
|
MF_NATS_URL: nats://nats:4222
|
|
MF_NORMALIZER_PORT: 8184
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
dashflux:
|
|
image: mainflux/dashflux:latest
|
|
container_name: mainflux-dashflux
|
|
restart: on-failure
|
|
ports:
|
|
- 3000:3000
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
ws-adapter:
|
|
image: mainflux/ws:latest
|
|
container_name: mainflux-ws
|
|
depends_on:
|
|
- things
|
|
- nats
|
|
expose:
|
|
- 8186
|
|
restart: on-failure
|
|
environment:
|
|
MF_WS_ADAPTER_PORT: 8186
|
|
MF_NATS_URL: nats://nats:4222
|
|
MF_THINGS_URL: things:8183
|
|
ports:
|
|
- 8186:8186
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
http-adapter:
|
|
image: mainflux/http:latest
|
|
container_name: mainflux-http
|
|
depends_on:
|
|
- things
|
|
- nats
|
|
restart: on-failure
|
|
expose:
|
|
- 8185
|
|
environment:
|
|
MF_HTTP_ADAPTER_PORT: 8185
|
|
MF_NATS_URL: nats://nats:4222
|
|
MF_THINGS_URL: things:8183
|
|
ports:
|
|
- 8185:8185
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
redis:
|
|
image: redis:4.0.9-alpine
|
|
container_name: mainflux-redis
|
|
restart: on-failure
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
mqtt-adapter:
|
|
image: mainflux/mqtt:latest
|
|
container_name: mainflux-mqtt
|
|
depends_on:
|
|
- things
|
|
- nats
|
|
- redis
|
|
restart: on-failure
|
|
environment:
|
|
MF_MQTT_ADAPTER_PORT: 1883
|
|
MF_MQTT_WS_PORT: 8880
|
|
MF_MQTT_REDIS_HOST: redis
|
|
MF_NATS_URL: nats://nats:4222
|
|
MF_THINGS_URL: things:8183
|
|
ports:
|
|
- 1883:1883
|
|
- 8880:8880
|
|
networks:
|
|
- mainflux-base-net
|
|
|
|
coap-adapter:
|
|
image: mainflux/coap:latest
|
|
container_name: mainflux-coap
|
|
depends_on:
|
|
- things
|
|
- nats
|
|
restart: on-failure
|
|
expose:
|
|
- 5683
|
|
environment:
|
|
MF_COAP_ADAPTER_PORT: 5683
|
|
MF_NATS_URL: nats://nats:4222
|
|
MF_THINGS_URL: things:8183
|
|
ports:
|
|
- 5683:5683
|
|
networks:
|
|
- mainflux-base-net
|