thingsboard-developers

Details

docker/.env 2(+1 -1)

diff --git a/docker/.env b/docker/.env
index 17f8af8..eb859b1 100644
--- a/docker/.env
+++ b/docker/.env
@@ -13,6 +13,6 @@ TB_VERSION=latest
 # Database used by ThingsBoard, can be either local (local HSQLDB), postgres (PostgreSQL), cassandra (Cassandra).
 # In case of postgres or cassandra corresponding docker service will be deployed (see docker-compose.postgres.yml, docker-compose.cassandra.yml for details).
 
-DATABASE=cassandra
+DATABASE=local
 
 KAFKA_TOPICS="js.eval.requests:100:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600,tb.transport.api.requests:30:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600,tb.rule-engine:30:1"
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index a319606..fd0c80c 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -171,6 +171,7 @@ services:
       HTTP_PORT: 80
       HTTPS_PORT: 443
       MQTT_PORT: 1883
+      FORCE_HTTPS_REDIRECT: "false"
     links:
         - tb-web-ui1
         - tb-web-ui2
diff --git a/docker/docker-upgrade-tb.sh b/docker/docker-upgrade-tb.sh
index 500b09a..c594b9d 100755
--- a/docker/docker-upgrade-tb.sh
+++ b/docker/docker-upgrade-tb.sh
@@ -46,6 +46,8 @@ ADDITIONAL_COMPOSE_ARGS=$(additionalComposeArgs) || exit $?
 
 ADDITIONAL_STARTUP_SERVICES=$(additionalStartupServices) || exit $?
 
+docker-compose -f docker-compose.yml $ADDITIONAL_COMPOSE_ARGS pull tb
+
 if [ ! -z "${ADDITIONAL_STARTUP_SERVICES// }" ]; then
     docker-compose -f docker-compose.yml $ADDITIONAL_COMPOSE_ARGS up -d $ADDITIONAL_STARTUP_SERVICES
 fi
diff --git a/docker/haproxy/config/haproxy.cfg b/docker/haproxy/config/haproxy.cfg
index cb70552..bb1062f 100644
--- a/docker/haproxy/config/haproxy.cfg
+++ b/docker/haproxy/config/haproxy.cfg
@@ -51,7 +51,7 @@ frontend http-in
 
  acl transport_http_acl path_beg /api/v1/
  acl letsencrypt_http_acl path_beg /.well-known/acme-challenge/
- redirect scheme https if !letsencrypt_http_acl !transport_http_acl
+ redirect scheme https if !letsencrypt_http_acl !transport_http_acl { env(FORCE_HTTPS_REDIRECT) -m str true }
  use_backend letsencrypt_http if letsencrypt_http_acl
  use_backend tb-http-backend if transport_http_acl
 

docker/README.md 55(+50 -5)

diff --git a/docker/README.md b/docker/README.md
index e8fd55e..769a9f9 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -2,24 +2,63 @@
 
 This folder containing scripts and Docker Compose configurations to run ThingsBoard in Microservices mode.
 
+## Prerequisites
+
+ThingsBoard Microservices are running in dockerized environment.
+Before starting please make sure [Docker CE](https://docs.docker.com/install/) and [Docker Compose](https://docs.docker.com/compose/install/) are installed in your system.
+
 ## Installation
 
-Execute the following command to run DataBase installation:
+Before performing initial installation you can configure the type of database to be used with ThinsBoard.
+In order to set database type change the value of `DATABASE` variable in `.env` file to one of the following:
+
+- `local` - use local embedded HSQLDB database;
+- `postgres` - use PostgreSQL database;
+- `cassandra` - use Cassandra database;
+ 
+**NOTE**: In case of `postgres` or `cassandra` corresponding docker service will be deployed (see `docker-compose.postgres.yml`, `docker-compose.cassandra.yml` for details).  
+
+Execute the following command to run installation:
 
 ` 
 $ ./docker-install-tb.sh --loadDemo
 ` 
 
-- `--loadDemo`              - optional argument. Whether to load additional demo data.
+Where:
+
+- `--loadDemo` - optional argument. Whether to load additional demo data.
 
 ## Running
 
-Execute the following command to run services:
+Execute the following command to start services:
 
 ` 
 $ ./docker-start-services.sh
 ` 
 
+After a while when all services will be successfully started you can open `http://{yor-host-ip}` in you browser (for ex. `http://localhost`).
+You should see ThingsBoard login page.
+
+Use the following default credentials:
+
+- **Systen Administrator**: sysadmin@thingsboard.org / sysadmin
+
+If you installed DataBase with demo data (using `--loadDemo` flag) you can also use the following credentials:
+
+- **Tenant Administrator**: tenant@thingsboard.org / tenant
+- **Customer User**: customer@thingsboard.org / customer
+
+In case of any issues you can examine service logs for errors. 
+For example to see ThingsBoard node logs execute the following command:
+
+` 
+$ docker-compose logs -f tb
+` 
+
+Or use `docker-compose ps` to see the state of all the containers.
+Use `docker-compose logs --f` to inspect the logs of all running services.
+See [docker-compose logs](https://docs.docker.com/compose/reference/logs/) command reference for details.  
+
 Execute the following command to stop services:
 
 ` 
@@ -32,12 +71,16 @@ Execute the following command to stop and completely remove deployed docker cont
 $ ./docker-remove-services.sh
 ` 
 
-Execute the following command to update particular services (pull newer docker image and rebuild container):
+Execute the following command to update particular or all services (pull newer docker image and rebuild container):
 
 ` 
 $ ./docker-update-service.sh [SERVICE...]
 ` 
 
+Where:
+
+- `[SERVICE...]` - list of services to update (defined in docker-compose configurations). If not specified all services will be updated. 
+
 ## Upgrading 
 
 In case when database upgrade is needed, execute the following commands:
@@ -48,4 +91,6 @@ $ ./docker-upgrade-tb.sh --fromVersion=[FROM_VERSION]
 $ ./docker-start-services.sh
 ```
 
-- `FROM_VERSION`              - from which version upgrade should be started.
+Where:
+
+- `FROM_VERSION` - from which version upgrade should be started. See [Upgrade Instructions](https://thingsboard.io/docs/user-guide/install/upgrade-instructions) for valid `fromVersion` values.

msa/tb/README.md 7(+5 -2)

diff --git a/msa/tb/README.md b/msa/tb/README.md
index d165fa7..4caeead 100644
--- a/msa/tb/README.md
+++ b/msa/tb/README.md
@@ -8,6 +8,7 @@ This project provides the build for the ThingsBoard single docker images.
 
 ## Running
 
+In this example `thingsboard/tb` image will be used. You can choose any other images with different databases (see above).
 Execute the following command to run this docker directly:
 
 ` 
@@ -23,9 +24,9 @@ Where:
 - `-p 5683:5683`            - connect local port 5683 to exposed internal COAP port 5683 
 - `-v ~/.mytb-data:/data`   - mounts the host's dir `~/.mytb-data` to ThingsBoard DataBase data directory
 - `--name mytb`             - friendly local name of this machine
-- `thingsboard/tb`          - docker image
+- `thingsboard/tb`          - docker image, can be also `thingsboard/tb-postgres` or `thingsboard/tb-cassandra`
     
-After executing this command you can open `http://{yor-host-ip}:9090` in you browser. You should see ThingsBoard login page.
+After executing this command you can open `http://{yor-host-ip}:9090` in you browser (for ex. `http://localhost:9090`). You should see ThingsBoard login page.
 Use the following default credentials:
 
 - **Systen Administrator**: sysadmin@thingsboard.org / sysadmin
@@ -65,4 +66,6 @@ $ docker run -it -v ~/.mytb-data:/data --rm thingsboard/tb upgrade-tb.sh
 $ docker start mytb
 ```
 
+**NOTE**: if you use different database change image name in all commands from `thingsboard/tb` to `thingsboard/tb-postgres` or `thingsboard/tb-cassandra` correspondingly.
+ 
 **NOTE**: replace host's directory `~/.mytb-data` with directory used during container creation.