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