Skip to content

Commit 477da5e

Browse files
authored
Merge branch 'wh1te909:develop' into develop
2 parents f3e0e10 + e564500 commit 477da5e

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

api/tacticalrmm/core/management/commands/initial_mesh_setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ async def websocket_call(self, mesh_settings):
1818
token = get_auth_token(mesh_settings.mesh_username, mesh_settings.mesh_token)
1919

2020
if settings.DOCKER_BUILD:
21-
site = mesh_settings.mesh_site.replace("https", "ws")
22-
uri = f"{site}:443/control.ashx?auth={token}"
21+
uri = f"{settings.MESH_WS_URL}/control.ashx?auth={token}"
2322
else:
2423
site = mesh_settings.mesh_site.replace("https", "wss")
2524
uri = f"{site}/control.ashx?auth={token}"

docker/containers/tactical-nginx/entrypoint.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ set -e
55
: "${WORKER_CONNECTIONS:=2048}"
66
: "${APP_PORT:=80}"
77
: "${API_PORT:=80}"
8+
: "${NGINX_RESOLVER:=127.0.0.11}"
9+
: "${BACKEND_SERVICE:=tactical-backend}"
10+
: "${FRONTEND_SERVICE:=tactical-frontend}"
11+
: "${MESH_SERVICE:=tactical-meshcentral}"
12+
: "${WEBSOCKETS_SERVICE:=tactical-websockets}"
813
: "${DEV:=0}"
914

1015
CERT_PRIV_PATH=${TACTICAL_DIR}/certs/privkey.pem
@@ -34,7 +39,7 @@ fi
3439
if [[ $DEV -eq 1 ]]; then
3540
API_NGINX="
3641
#Using variable to disable start checks
37-
set \$api http://tactical-backend:${API_PORT};
42+
set \$api http://${BACKEND_SERVICE}:${API_PORT};
3843
proxy_pass \$api;
3944
proxy_http_version 1.1;
4045
proxy_cache_bypass \$http_upgrade;
@@ -51,7 +56,7 @@ if [[ $DEV -eq 1 ]]; then
5156
else
5257
API_NGINX="
5358
#Using variable to disable start checks
54-
set \$api tactical-backend:${API_PORT};
59+
set \$api ${BACKEND_SERVICE}:${API_PORT};
5560
5661
include uwsgi_params;
5762
uwsgi_pass \$api;
@@ -61,7 +66,7 @@ fi
6166
nginx_config="$(cat << EOF
6267
# backend config
6368
server {
64-
resolver 127.0.0.11 valid=30s;
69+
resolver ${NGINX_RESOLVER} valid=30s;
6570
6671
server_name ${API_HOST};
6772
@@ -80,7 +85,7 @@ server {
8085
}
8186
8287
location ~ ^/ws/ {
83-
set \$api http://tactical-websockets:8383;
88+
set \$api http://${WEBSOCKETS_SERVICE}:8383;
8489
proxy_pass \$api;
8590
8691
proxy_http_version 1.1;
@@ -111,13 +116,13 @@ server {
111116
112117
# frontend config
113118
server {
114-
resolver 127.0.0.11 valid=30s;
119+
resolver ${NGINX_RESOLVER} valid=30s;
115120
116121
server_name ${APP_HOST};
117122
118123
location / {
119124
#Using variable to disable start checks
120-
set \$app http://tactical-frontend:${APP_PORT};
125+
set \$app http://${FRONTEND_SERVICE}:${APP_PORT};
121126
122127
proxy_pass \$app;
123128
proxy_http_version 1.1;
@@ -149,7 +154,7 @@ server {
149154
150155
# meshcentral config
151156
server {
152-
resolver 127.0.0.11 valid=30s;
157+
resolver ${NGINX_RESOLVER} valid=30s;
153158
154159
listen 443 ssl;
155160
proxy_send_timeout 330s;
@@ -163,7 +168,7 @@ server {
163168
164169
location / {
165170
#Using variable to disable start checks
166-
set \$meshcentral http://tactical-meshcentral:443;
171+
set \$meshcentral http://{$MESH_SERVICE}:443;
167172
168173
proxy_pass \$meshcentral;
169174
proxy_http_version 1.1;
@@ -180,7 +185,7 @@ server {
180185
}
181186
182187
server {
183-
resolver 127.0.0.11 valid=30s;
188+
resolver ${NGINX_RESOLVER} valid=30s;
184189
185190
listen 80;
186191
server_name ${MESH_HOST};

docker/containers/tactical/entrypoint.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ set -e
99
: "${POSTGRES_USER:=tactical}"
1010
: "${POSTGRES_PASS:=tactical}"
1111
: "${POSTGRES_DB:=tacticalrmm}"
12-
: "${MESH_CONTAINER:=tactical-meshcentral}"
12+
: "${MESH_SERVICE:=tactical-meshcentral}"
13+
: "${MESH_WS_URL:=ws://${MESH_SERVICE}:443}"
1314
: "${MESH_USER:=meshcentral}"
1415
: "${MESH_PASS:=meshcentralpass}"
1516
: "${MESH_HOST:=tactical-meshcentral}"
@@ -44,7 +45,7 @@ if [ "$1" = 'tactical-init' ]; then
4445
sleep 5
4546
done
4647

47-
until (echo > /dev/tcp/"${MESH_CONTAINER}"/443) &> /dev/null; do
48+
until (echo > /dev/tcp/"${MESH_SERVICE}"/443) &> /dev/null; do
4849
echo "waiting for meshcentral container to be ready..."
4950
sleep 5
5051
done
@@ -92,7 +93,7 @@ MESH_USERNAME = '${MESH_USER}'
9293
MESH_SITE = 'https://${MESH_HOST}'
9394
MESH_TOKEN_KEY = '${MESH_TOKEN}'
9495
REDIS_HOST = '${REDIS_HOST}'
95-
MESH_WS_URL = 'ws://${MESH_CONTAINER}:443'
96+
MESH_WS_URL = '${MESH_WS_URL}'
9697
ADMIN_ENABLED = False
9798
EOF
9899
)"

0 commit comments

Comments
 (0)