Skip to content

Commit

Permalink
fix image added FIREBASE_TENANT
Browse files Browse the repository at this point in the history
  • Loading branch information
andrealeo83 committed Aug 27, 2021
1 parent f6be72e commit 96e6b97
Show file tree
Hide file tree
Showing 9 changed files with 276 additions and 24 deletions.
3 changes: 3 additions & 0 deletions docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ EXTERNAL_BASE_URL="http://localhost" EXTERNAL_MQTT_BASE_URL="ws://localhost" doc
```
If you have a public ip specify it in the EXTERNAL_BASE_URL and EXTERNAL_MQTT_BASE_URL env parameters as follow: ```EXTERNAL_BASE_URL="http://99.88.77.66" EXTERNAL_MQTT_BASE_URL="ws://99.88.77.66" docker-compose up```

If you want to run the latest (unstable) version: ```EXTERNAL_BASE_URL="http://localhost" EXTERNAL_MQTT_BASE_URL="ws://localhost" docker-compose -f docker-compose-latest.yaml up```


4. Open the following URL in your browser to start
* Dashboard: [http://<machine_ip>/](http://localhost/)

Expand Down
192 changes: 192 additions & 0 deletions docker-compose/docker-compose-latest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
version: "3.7"

volumes:
tiledesk-datadb:
services:
dashboard:
image: tiledesk/tiledesk-dashboard
container_name: tiledesk-dashboard
environment:
- FEATURES_TOKEN=NAT:T-DEV:T
- SERVER_BASE_URL=/api/
- CHAT_BASE_URL=/chat/
- WS_URL
- WS_URL_RELATIVE=/api/
- "WIDGET_LOCATION=${EXTERNAL_BASE_URL}/widget/launch.js"
- WIDGET_TEST_LOCATION=/widget/assets/twp/index.html
- CHAT21_ENGINE=mqtt
- UPLOAD_ENGINE=native
- PUSH_ENGINE=none
- FIREBASE_APIKEY
- FIREBASE_AUTHDOMAIN
- FIREBASE_DATABASEURL
- FIREBASE_PROJECT_ID
- FIREBASE_STORAGEBUCKET
- FIREBASE_MESSAGINGSENDERID
- FIREBASE_APP_ID

ports:
- "4500:80" #use expose if you want to block external access

webwidget:
image: chat21/chat21-web-widget:latest
container_name: chat21-web-widget
ports:
- "4200:80" # specify port forewarding
environment:
- CHAT21_ENGINE=mqtt
- MQTT_APPID=tilechat
- PUSH_ENGINE=none
- LOG_LEVEL=info
- FILE_UPLOAD_ACCEPT=*/*
- "MQTT_ENDPOINT=${EXTERNAL_MQTT_BASE_URL}/mqws/ws"
- "MQTT_APIENDPOINT=${EXTERNAL_BASE_URL}/chatapi/api"
#- MQTT_LOGINSERVICE_ENDPOINT=/api/chat21/native/auth/createCustomToken
- FIREBASE_APIKEY
- FIREBASE_AUTHDOMAIN
- FIREBASE_DATABASEURL
- FIREBASE_PROJECT_ID
- FIREBASE_STORAGEBUCKET
- FIREBASE_MESSAGINGSENDERID
- FIREBASE_TENANT=tilechat
- UPLOAD_ENGINE=native
- "API_URL=${EXTERNAL_BASE_URL}/api/"
- "TRANSLATIONS_URL=${EXTERNAL_BASE_URL}/api/"
#- API_BASEIMAGE_URL=https://firebasestorage.googleapis.com/v0/b/
- "API_BASEIMAGE_URL=${EXTERNAL_BASE_URL}/api/"

ionic:
image: chat21/chat21-ionic:latest
container_name: chat21-ionic
ports:
- "8080:80" #use expose if you want to block external access
environment:
- DASHBOARD_URL=/dashboard/
- API_BASEIMAGE_URL=/api/
- API_URL=/api/
- PUSH_ENGINE=none
- LOG_LEVEL=info
- FILE_UPLOAD_ACCEPT=*/*
- CHAT21_ENGINE=mqtt
- MQTT_APPID=tilechat
- "MQTT_ENDPOINT=${EXTERNAL_MQTT_BASE_URL}/mqws/ws"
- MQTT_APIENDPOINT=/chatapi/api
#- MQTT_LOGINSERVICE_ENDPOINT=/api/chat21/native/auth/createCustomToken
- UPLOAD_ENGINE=native
- FIREBASE_APIKEY
- FIREBASE_AUTHDOMAIN
- FIREBASE_DATABASEURL
- FIREBASE_PROJECT_ID
- FIREBASE_STORAGEBUCKET
- FIREBASE_MESSAGINGSENDERID
- FIREBASE_TENANT=tilechat
proxy:
image: tiledesk/tiledesk-docker-proxy
container_name: tiledesk-docker-proxy
ports:
- "80:80" # specify port forewarding
depends_on:
- server
- dashboard
- webwidget
- chat21httpserver
- rabbitmq
command: [nginx-debug, '-g', 'daemon off;']

server:
image: tiledesk/tiledesk-server
container_name: tiledesk-server
restart: always
environment:
- LOG_LEVEL=verbose
#- LOG_LEVEL=debug
- CHAT21_ENABLED=true
- CHAT21_ENGINE=mqtt
- CHAT21_URL=http://chat21httpserver:8004
- CHAT21_JWT_SECRET=tokenKey
- CHAT21_APPID=tilechat
- RESTHOOK_ENABLED=true
- CHAT21_ADMIN_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzNDU2MTBkNy03MmYxLTQ5OWUtODQzMS0xMTNhZWJkOWVmOTgiLCJzdWIiOiIxMDAtQVBJQURNSU4iLCJzY29wZSI6WyJyYWJiaXRtcS5yZWFkOiovKi8qIiwicmFiYml0bXEud3JpdGU6Ki8qLyoiLCJyYWJiaXRtcS5jb25maWd1cmU6Ki8qLyoiXSwiY2xpZW50X2lkIjoiMTAwLUFQSUFETUlOIiwiY2lkIjoiMTAwLUFQSUFETUlOIiwiYXpwIjoiMTAwLUFQSUFETUlOIiwidXNlcl9pZCI6IjEwMC1BUElBRE1JTiIsImFwcF9pZCI6InRpbGVjaGF0IiwiaWF0IjoxNjE0OTQzNDkyLCJleHAiOjE5MjU5ODM0OTIsImF1ZCI6WyJyYWJiaXRtcSIsIjEwMC1BUElBRE1JTiJdLCJraWQiOiJ0aWxlZGVzay1rZXkiLCJ0aWxlZGVza19hcGlfcm9sZXMiOiJhZG1pbiJ9.KptGMsTKjd3wUiiP1GGSTYqW1XXK1vjSRJnetC3wjxU
- MONGODB_URI=mongodb://mongo/tiledesk
- EMAIL_ENABLED
- EMAIL_HOST
- EMAIL_USERNAME
- EMAIL_SECURE
- EMAIL_PORT
- EMAIL_PASSWORD
- EMAIL_FROM_ADDRESS
- "EMAIL_BASEURL=${EXTERNAL_BASE_URL}/dashboard"
- "WEBHOOK_ORIGIN=${EXTERNAL_BASE_URL}/api/"
- "WIDGET_LOCATION=${EXTERNAL_BASE_URL}/widget/launch.js"
- "WIDGET_TEST_LOCATION=${EXTERNAL_BASE_URL}/widget/assets/test_widget_page/index.html"
- WS_SERVER_PATH
depends_on:
- mongo
ports:
- "3000:3000"

chat21httpserver:
image: chat21/chat21-http-server
container_name: chat21httpserver
restart: always
environment:
- LOG_LEVEL=info
#- AUTO_RESTART=false
- MONGODB_URI=mongodb://mongo/chat21
- JWT_KEY=tokenKey
- RABBITMQ_URI=amqp://ignored:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2YWI3MzY1Yi1hYWRhLTRlNTktOWZjZS0yMDQwZDgyOTA4MTgiLCJzdWIiOiIxMDAtQVBJQURNSU4iLCJzY29wZSI6WyJyYWJiaXRtcS5yZWFkOiovKi8qIiwicmFiYml0bXEud3JpdGU6Ki8qLyoiLCJyYWJiaXRtcS5jb25maWd1cmU6Ki8qLyoiXSwiY2xpZW50X2lkIjoiMTAwLUFQSUFETUlOIiwiY2lkIjoiMTAwLUFQSUFETUlOIiwiYXpwIjoiMTAwLUFQSUFETUlOIiwidXNlcl9pZCI6IjEwMC1BUElBRE1JTiIsImFwcF9pZCI6InRpbGVjaGF0IiwiaWF0IjoxNTk0Mzc3OTc4LCJleHAiOjE2OTY5Njk5NzgsImF1ZCI6WyJyYWJiaXRtcSIsIjEwMC1BUElBRE1JTiJdLCJraWQiOiJ0aWxlZGVzay1rZXkiLCJ0aWxlZGVza19hcGlfcm9sZXMiOiJhZG1pbiJ9.g2YL6RZp5SuLcQyBTYf4cn9SnRIyifNb1f1-Si1inbs@rabbitmq:5672?heartbeat=60
depends_on:
- mongo
- rabbitmq
ports:
- "8004:8004"

chat21server:
image: chat21/chat21-server
container_name: chat21server
restart: always
environment:
#- AUTO_RESTART=false
- LOG_LEVEL=info
- MONGODB_URI=mongodb://mongo/chat21
- APP_ID=tilechat
- WEBHOOK_ENDPOINT=http://server:3000/chat21/requests
- WEBHOOK_ENABLED=true
- WEBHOOK_EVENTS=message-sent
- RABBITMQ_URI=amqp://ignored:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyMDI2NjU0Ni05ZGMxLTQ3MzgtOWE5OC01OTQwYWFmZWJkMjgiLCJzdWIiOiIwMS1PQlNFUlZFUiIsInNjb3BlIjpbInJhYmJpdG1xLnJlYWQ6Ki8qLyoiLCJyYWJiaXRtcS53cml0ZToqLyovKiIsInJhYmJpdG1xLmNvbmZpZ3VyZToqLyovKiJdLCJjbGllbnRfaWQiOiIwMS1PQlNFUlZFUiIsImNpZCI6IjAxLU9CU0VSVkVSIiwiYXpwIjoiMDEtT0JTRVJWRVIiLCJ1c2VyX2lkIjoiMDEtT0JTRVJWRVIiLCJhcHBfaWQiOiJ0aWxlY2hhdCIsImlhdCI6MTU5Mzg1OTgzNiwiZXhwIjoxNjk2NDUxODM2LCJhdWQiOlsicmFiYml0bXEiLCIwMS1PQlNFUlZFUiJdLCJraWQiOiJ0aWxlZGVzay1rZXkiLCJ0aWxlZGVza19hcGlfcm9sZXMiOiJ1c2VyIn0.N6bs-WXVZJTNW2jztzph4SYc9_Szs0cb0kBM9n0k8hY@rabbitmq:5672?heartbeat=60
depends_on:
- mongo
- rabbitmq
- server
rabbitmq:
image: chat21/chat21-rabbitmq
container_name: rabbitmq
environment:
RABBITMQ_ERLANG_COOKIE: ${RABBITMQ_ERLANG_COOKIE}
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
ports:
- 5672:5672
- 15672:15672
- 1883:1883
- 15675:15675
# healthcheck:
# test: [ "CMD", "nc", "-z", "localhost", "5672" ]
# interval: 5s
# timeout: 15s
# retries: 1
mongo:
container_name: mongo
image: mongo:4.0.23
#image: mongo
command: --bind_ip_all
volumes:
- tiledesk-datadb:/data/db


#ngrok:
# container_name: ngrok
# image: wernight/ngrok
# command: ngrok http server:3000
# ports:
# - '4040:4040'
22 changes: 11 additions & 11 deletions docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ volumes:
tiledesk-datadb:
services:
dashboard:
image: tiledesk/tiledesk-dashboard
image: tiledesk/tiledesk-dashboard:2.2.10-rc.10
container_name: tiledesk-dashboard
environment:
- FEATURES_TOKEN=NAT:T-DEV:T
Expand All @@ -29,16 +29,15 @@ services:
- "4500:80" #use expose if you want to block external access

webwidget:
image: chat21/chat21-web-widget:latest
image: chat21/chat21-web-widget:5.0.17-rc.3
container_name: chat21-web-widget
ports:
- "4200:80" # specify port forewarding
environment:
- CHAT21_ENGINE=mqtt
- MQTT_APPID=tilechat
- PUSH_ENGINE=none
- TENANT=tilechat
- LOG_LEVEL=2
- LOG_LEVEL=info
- FILE_UPLOAD_ACCEPT=*/*
- "MQTT_ENDPOINT=${EXTERNAL_MQTT_BASE_URL}/mqws/ws"
- "MQTT_APIENDPOINT=${EXTERNAL_BASE_URL}/chatapi/api"
Expand All @@ -49,14 +48,15 @@ services:
- FIREBASE_PROJECT_ID
- FIREBASE_STORAGEBUCKET
- FIREBASE_MESSAGINGSENDERID
- FIREBASE_TENANT=tilechat
- UPLOAD_ENGINE=native
- "API_URL=${EXTERNAL_BASE_URL}/api/"
- "TRANSLATIONS_URL=${EXTERNAL_BASE_URL}/api/"
#- API_BASEIMAGE_URL=https://firebasestorage.googleapis.com/v0/b/
- "API_BASEIMAGE_URL=${EXTERNAL_BASE_URL}/api/"

ionic:
image: chat21/chat21-ionic:latest
image: chat21/chat21-ionic:3.0.49-beta
container_name: chat21-ionic
ports:
- "8080:80" #use expose if you want to block external access
Expand All @@ -65,8 +65,7 @@ services:
- API_BASEIMAGE_URL=/api/
- API_URL=/api/
- PUSH_ENGINE=none
- TENANT=tilechat
- LOG_LEVEL=2
- LOG_LEVEL=info
- FILE_UPLOAD_ACCEPT=*/*
- CHAT21_ENGINE=mqtt
- MQTT_APPID=tilechat
Expand All @@ -79,7 +78,8 @@ services:
- FIREBASE_DATABASEURL
- FIREBASE_PROJECT_ID
- FIREBASE_STORAGEBUCKET
- FIREBASE_MESSAGINGSENDERID
- FIREBASE_MESSAGINGSENDERID
- FIREBASE_TENANT=tilechat
proxy:
image: tiledesk/tiledesk-docker-proxy
container_name: tiledesk-docker-proxy
Expand All @@ -94,7 +94,7 @@ services:
command: [nginx-debug, '-g', 'daemon off;']

server:
image: tiledesk/tiledesk-server
image: tiledesk/tiledesk-server:2.1.40.16
container_name: tiledesk-server
restart: always
environment:
Expand Down Expand Up @@ -126,7 +126,7 @@ services:
- "3000:3000"

chat21httpserver:
image: chat21/chat21-http-server
image: chat21/chat21-http-server:v-docker0.1.15
container_name: chat21httpserver
restart: always
environment:
Expand All @@ -142,7 +142,7 @@ services:
- "8004:8004"

chat21server:
image: chat21/chat21-server
image: chat21/chat21-server:0.1.14
container_name: chat21server
restart: always
environment:
Expand Down
10 changes: 8 additions & 2 deletions helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,21 @@ More info here: https://kubernetes.github.io/ingress-nginx/deploy/#using-helm

You can configure the Custom Domain passing the Ingress parameters inline without modifing the value.yaml file for the hosts as follow:


```console
helm upgrade -f ./helm/values.yaml my-tiledesk ./helm --set EXTERNAL_BASE_URL=http://console.YOUR_CUSTOM_DOMAIN --set ingress.hosts[1].enabled=true --set ingress.hosts[1].host=console.YOUR_CUSTOM_DOMAIN
```
Remember to create a DNS entry for your "console.YOUR_CUSTOM_DOMAIN" domain or add it to your /etc/hosts file (just for local testing).

Disable the first ingress host (all inbound HTTP traffic through the IP address) if you want adding : ```--set ingress.hosts[0].enabled=false```
If you want you can disable the first ingress host "all inbound HTTP traffic through the IP address" adding : ```--set ingress.hosts[0].enabled=false```. So you only have to log in using the domain name and not the ip.

Add ```--recreate-pods``` option to the above command if you want to be sure all the pods are restarted with the new values.

Complete example with console.tiledesk.local domain:

```console
helm upgrade --recreate-pods -f ./helm/values.yaml my-tiledesk ./helm --set EXTERNAL_BASE_URL=http://console.tiledesk.local --set ingress.hosts[1].enabled=true --set ingress.hosts[1].host=console.tiledesk.local --set ingress.hosts[0].enabled=false
```

## Configure TLS

See [here](https://github.com/Tiledesk/tiledesk-deployment/blob/master/helm/docs/tls.md) how to configure TLS certificate for the Tiledesk installation.
Expand Down
7 changes: 7 additions & 0 deletions helm/docs/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ Add ```--recreate-pods``` option to the above command if you want to be sure all

With the MQTT_ENDPOINT env variable we are setting an absolute secure (wss) websocket URL.


Complete example with console.tiledesk.local domain and TLS:

```console
helm upgrade --recreate-pods -f ./helm/values.yaml my-tiledesk ./helm --set ingress.tls[0].secretName=tiledesk-tls-secret --set ingress.tls[0].hosts[0]=console.tiledesk.local --set MQTT_ENDPOINT=wss://console.tiledesk.local/mqws/ws --set EXTERNAL_BASE_URL=https://console.tiledesk.local --set ingress.hosts[0].enabled=false --set ingress.hosts[1].enabled=true --set ingress.hosts[1].host=console.tiledesk.local
```

Please see [this example](https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/tls) for more information.


Expand Down
5 changes: 4 additions & 1 deletion helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ data:

MQTT_APPID: {{ .Values.MQTT_APPID | quote }}

MQTT_ENDPOINT: {{if and .Values.EXTERNAL_BASE_URL (hasPrefix "/" .Values.MQTT_ENDPOINT)}}"{{ .Values.EXTERNAL_BASE_URL }}{{ .Values.MQTT_ENDPOINT }}"{{ else }}{{ .Values.MQTT_ENDPOINT | quote }}{{ end }}
MQTT_ENDPOINT: {{if and .Values.EXTERNAL_MQTT_BASE_URL (hasPrefix "/" .Values.MQTT_ENDPOINT)}}"{{ .Values.EXTERNAL_MQTT_BASE_URL }}{{ .Values.MQTT_ENDPOINT }}"{{ else }}{{ .Values.MQTT_ENDPOINT | quote }}{{ end }}
MQTT_APIENDPOINT: {{if and .Values.EXTERNAL_BASE_URL (hasPrefix "/" .Values.MQTT_APIENDPOINT)}}"{{ .Values.EXTERNAL_BASE_URL }}{{ .Values.MQTT_APIENDPOINT }}"{{ else }}{{ .Values.MQTT_APIENDPOINT | quote }}{{ end }}

FEATURES_TOKEN: {{ .Values.FEATURES_TOKEN | quote }}
Expand All @@ -46,7 +46,10 @@ data:
WIDGET_TEST_LOCATION: {{if and .Values.EXTERNAL_BASE_URL (hasPrefix "/" .Values.WIDGET_TEST_LOCATION)}}"{{ .Values.EXTERNAL_BASE_URL }}{{ .Values.WIDGET_TEST_LOCATION }}"{{ else }}{{ .Values.WIDGET_TEST_LOCATION | quote }}{{ end }}

PUSH_ENGINE: {{ .Values.PUSH_ENGINE | quote }}
FIREBASE_TENANT: {{ .Values.FIREBASE_TENANT | quote }}

FILE_UPLOAD_ACCEPT: {{ .Values.FILE_UPLOAD_ACCEPT | quote }}

TRANSLATIONS_URL: {{if and .Values.EXTERNAL_BASE_URL (hasPrefix "/" .Values.TRANSLATIONS_URL)}}"{{ .Values.EXTERNAL_BASE_URL }}{{ .Values.TRANSLATIONS_URL }}"{{ else }}{{ .Values.TRANSLATIONS_URL | quote }}{{ end }}

DASHBOARD_URL: {{ .Values.DASHBOARD_URL | quote }}
Expand Down
20 changes: 20 additions & 0 deletions helm/templates/ionic-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,26 @@ spec:
configMapKeyRef:
name: {{ include "tiledesk.fullname" . }}-config
key: UPLOAD_ENGINE
- name: PUSH_ENGINE
valueFrom:
configMapKeyRef:
name: {{ include "tiledesk.fullname" . }}-config
key: PUSH_ENGINE
- name: FIREBASE_TENANT
valueFrom:
configMapKeyRef:
name: {{ include "tiledesk.fullname" . }}-config
key: FIREBASE_TENANT
- name: LOG_LEVEL
valueFrom:
configMapKeyRef:
name: {{ include "tiledesk.fullname" . }}-config
key: LOG_LEVEL
- name: FILE_UPLOAD_ACCEPT
valueFrom:
configMapKeyRef:
name: {{ include "tiledesk.fullname" . }}-config
key: FILE_UPLOAD_ACCEPT
- name: CHAT21_URL
valueFrom:
configMapKeyRef:
Expand Down
Loading

0 comments on commit 96e6b97

Please sign in to comment.