small fixes

This commit is contained in:
wh1te909 2023-10-04 16:51:24 +00:00
parent 4747ffc08b
commit 4bbe22b1c7
2 changed files with 3 additions and 7 deletions

View File

@ -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

View File

@ -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