From 4bbe22b1c7f4e1673c37f255fc83cee38afc809d Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 4 Oct 2023 16:51:24 +0000 Subject: [PATCH] small fixes --- install.sh | 1 - update.sh | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index fb508b9f..5bbea598 100644 --- a/install.sh +++ b/install.sh @@ -508,7 +508,6 @@ print_green 'Installing the backend' SETUPTOOLS_VER=$(grep "^SETUPTOOLS_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}') WHEEL_VER=$(grep "^WHEEL_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}') -sudo mkdir -p /opt/tactical/reporting sudo mkdir -p /opt/tactical/reporting/assets sudo mkdir -p /opt/tactical/reporting/schemas sudo chown -R ${USER}:${USER} /opt/tactical diff --git a/update.sh b/update.sh index 30e8a8bd..16d795dd 100644 --- a/update.sh +++ b/update.sh @@ -124,6 +124,7 @@ if ! [[ $CHECK_NATS_WEBSOCKET ]]; then ' $rmmconf)" | sudo tee $rmmconf >/dev/null fi +front_end=$(/rmm/api/env/bin/python /rmm/api/tacticalrmm/manage.py get_config webdomain) CHECK_ASSETS_NGINX=$(grep assets $rmmconf) if ! [[ $CHECK_ASSETS_NGINX ]]; then echo "Adding assets to nginx config" @@ -131,7 +132,7 @@ if ! [[ $CHECK_ASSETS_NGINX ]]; then /location \/ {/ { print " location /assets/ {" print " internal;" - print " add_header 'Access-Control-Allow-Origin' 'https://${APP_HOST}';" + print " add_header 'Access-Control-Allow-Origin' 'https://${front_end}';" print " alias /opt/tactical/reporting/assets/;" print " }" print "\n" @@ -391,12 +392,8 @@ else pip install -r requirements.txt fi -if [ ! -d /opt/tactical/reporting ]; then - sudo mkdir -p /opt/tactical/reporting -fi - if [ ! -d /opt/tactical/reporting/assets ]; then - sudo mkdir /opt/tactical/reporting/assets + sudo mkdir -p /opt/tactical/reporting/assets fi if [ ! -d /opt/tactical/reporting/schemas ]; then