Skip to content

Commit

Permalink
Merge branch 'wh1te909:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
subzdev committed Dec 28, 2021
2 parents f3e0e10 + e564500 commit 477da5e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ async def websocket_call(self, mesh_settings):
token = get_auth_token(mesh_settings.mesh_username, mesh_settings.mesh_token)

if settings.DOCKER_BUILD:
site = mesh_settings.mesh_site.replace("https", "ws")
uri = f"{site}:443/control.ashx?auth={token}"
uri = f"{settings.MESH_WS_URL}/control.ashx?auth={token}"
else:
site = mesh_settings.mesh_site.replace("https", "wss")
uri = f"{site}/control.ashx?auth={token}"
Expand Down
23 changes: 14 additions & 9 deletions docker/containers/tactical-nginx/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ set -e
: "${WORKER_CONNECTIONS:=2048}"
: "${APP_PORT:=80}"
: "${API_PORT:=80}"
: "${NGINX_RESOLVER:=127.0.0.11}"
: "${BACKEND_SERVICE:=tactical-backend}"
: "${FRONTEND_SERVICE:=tactical-frontend}"
: "${MESH_SERVICE:=tactical-meshcentral}"
: "${WEBSOCKETS_SERVICE:=tactical-websockets}"
: "${DEV:=0}"

CERT_PRIV_PATH=${TACTICAL_DIR}/certs/privkey.pem
Expand Down Expand Up @@ -34,7 +39,7 @@ fi
if [[ $DEV -eq 1 ]]; then
API_NGINX="
#Using variable to disable start checks
set \$api http://tactical-backend:${API_PORT};
set \$api http://${BACKEND_SERVICE}:${API_PORT};
proxy_pass \$api;
proxy_http_version 1.1;
proxy_cache_bypass \$http_upgrade;
Expand All @@ -51,7 +56,7 @@ if [[ $DEV -eq 1 ]]; then
else
API_NGINX="
#Using variable to disable start checks
set \$api tactical-backend:${API_PORT};
set \$api ${BACKEND_SERVICE}:${API_PORT};
include uwsgi_params;
uwsgi_pass \$api;
Expand All @@ -61,7 +66,7 @@ fi
nginx_config="$(cat << EOF
# backend config
server {
resolver 127.0.0.11 valid=30s;
resolver ${NGINX_RESOLVER} valid=30s;
server_name ${API_HOST};
Expand All @@ -80,7 +85,7 @@ server {
}
location ~ ^/ws/ {
set \$api http://tactical-websockets:8383;
set \$api http://${WEBSOCKETS_SERVICE}:8383;
proxy_pass \$api;
proxy_http_version 1.1;
Expand Down Expand Up @@ -111,13 +116,13 @@ server {
# frontend config
server {
resolver 127.0.0.11 valid=30s;
resolver ${NGINX_RESOLVER} valid=30s;
server_name ${APP_HOST};
location / {
#Using variable to disable start checks
set \$app http://tactical-frontend:${APP_PORT};
set \$app http://${FRONTEND_SERVICE}:${APP_PORT};
proxy_pass \$app;
proxy_http_version 1.1;
Expand Down Expand Up @@ -149,7 +154,7 @@ server {
# meshcentral config
server {
resolver 127.0.0.11 valid=30s;
resolver ${NGINX_RESOLVER} valid=30s;
listen 443 ssl;
proxy_send_timeout 330s;
Expand All @@ -163,7 +168,7 @@ server {
location / {
#Using variable to disable start checks
set \$meshcentral http://tactical-meshcentral:443;
set \$meshcentral http://{$MESH_SERVICE}:443;
proxy_pass \$meshcentral;
proxy_http_version 1.1;
Expand All @@ -180,7 +185,7 @@ server {
}
server {
resolver 127.0.0.11 valid=30s;
resolver ${NGINX_RESOLVER} valid=30s;
listen 80;
server_name ${MESH_HOST};
Expand Down
7 changes: 4 additions & 3 deletions docker/containers/tactical/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ set -e
: "${POSTGRES_USER:=tactical}"
: "${POSTGRES_PASS:=tactical}"
: "${POSTGRES_DB:=tacticalrmm}"
: "${MESH_CONTAINER:=tactical-meshcentral}"
: "${MESH_SERVICE:=tactical-meshcentral}"
: "${MESH_WS_URL:=ws://${MESH_SERVICE}:443}"
: "${MESH_USER:=meshcentral}"
: "${MESH_PASS:=meshcentralpass}"
: "${MESH_HOST:=tactical-meshcentral}"
Expand Down Expand Up @@ -44,7 +45,7 @@ if [ "$1" = 'tactical-init' ]; then
sleep 5
done

until (echo > /dev/tcp/"${MESH_CONTAINER}"/443) &> /dev/null; do
until (echo > /dev/tcp/"${MESH_SERVICE}"/443) &> /dev/null; do
echo "waiting for meshcentral container to be ready..."
sleep 5
done
Expand Down Expand Up @@ -92,7 +93,7 @@ MESH_USERNAME = '${MESH_USER}'
MESH_SITE = 'https://${MESH_HOST}'
MESH_TOKEN_KEY = '${MESH_TOKEN}'
REDIS_HOST = '${REDIS_HOST}'
MESH_WS_URL = 'ws://${MESH_CONTAINER}:443'
MESH_WS_URL = '${MESH_WS_URL}'
ADMIN_ENABLED = False
EOF
)"
Expand Down

0 comments on commit 477da5e

Please sign in to comment.