add assets

This commit is contained in:
wh1te909 2023-10-20 20:25:43 +00:00
parent ca5df24b6d
commit d438f71bbb
2 changed files with 16 additions and 0 deletions

View File

@ -68,6 +68,7 @@ mkdir ${tmp_dir}/nginx
mkdir ${tmp_dir}/systemd
mkdir ${tmp_dir}/rmm
mkdir ${tmp_dir}/confd
mkdir ${tmp_dir}/opt
POSTGRES_USER=$(/rmm/api/env/bin/python /rmm/api/tacticalrmm/manage.py get_config dbuser)
POSTGRES_PW=$(/rmm/api/env/bin/python /rmm/api/tacticalrmm/manage.py get_config dbpw)
@ -93,6 +94,10 @@ if [ -d /etc/letsencrypt ]; then
sudo tar -czvf ${tmp_dir}/certs/etc-letsencrypt.tar.gz -C /etc/letsencrypt .
fi
if [ -d /opt/tactical ]; then
sudo tar -czvf ${tmp_dir}/opt/opt-tactical.tar.gz -C /opt/tactical .
fi
local_settings='/rmm/api/tacticalrmm/tacticalrmm/local_settings.py'
if grep -q CERT_FILE "$local_settings"; then

View File

@ -220,6 +220,17 @@ elif [ -d "${tmp_dir}/certs/selfsigned" ]; then
cp -p ${tmp_dir}/certs/selfsigned/cert.pem $certdir
fi
print_green 'Restoring assets'
if [ -f "$tmp_dir/opt/opt-tactical.tar.gz" ]; then
sudo mkdir -p /opt/tactical
sudo tar -xzf $tmp_dir/opt/opt-tactical.tar.gz -C /opt/tactical
sudo chown ${USER}:${USER} -R /opt/tactical
else
sudo mkdir -p /opt/tactical/reporting/assets
sudo mkdir -p /opt/tactical/reporting/schemas
sudo chown -R ${USER}:${USER} /opt/tactical
fi
print_green 'Restoring celery configs'
sudo mkdir /etc/conf.d