diff --git a/api/tacticalrmm/ee/reporting/utils.py b/api/tacticalrmm/ee/reporting/utils.py index 81343f53..c709be1c 100644 --- a/api/tacticalrmm/ee/reporting/utils.py +++ b/api/tacticalrmm/ee/reporting/utils.py @@ -595,7 +595,7 @@ def generate_chart( traces: Optional[Dict[str, Any]] = None, layout: Optional[Dict[str, Any]] = None, ) -> str: - ### TODO figure out why plotly affects perf + # TODO figure out why plotly affects perf import plotly.express as px fig = getattr(px, type)(**options) diff --git a/install.sh b/install.sh index e498b4d6..b039f556 100644 --- a/install.sh +++ b/install.sh @@ -292,8 +292,8 @@ sudo make altinstall cd ~ sudo rm -rf Python-${PYTHON_VER} Python-${PYTHON_VER}.tgz -print_green 'Installing redis git and weasyprint' -sudo apt install -y redis git weasyprint +print_green 'Installing redis and git' +sudo apt install -y redis git print_green 'Installing postgresql' @@ -487,6 +487,19 @@ sudo chmod +x /usr/local/bin/nats-api print_green 'Installing the backend' +# for weasyprint +if [[ "$osname" == "debian" ]]; then + count=$(dpkg -l | grep -E "libpango-1.0-0|libpangoft2-1.0-0" | wc -l) + if ! [ "$count" -eq 2 ]; then + sudo apt install -y libpango-1.0-0 libpangoft2-1.0-0 + fi +elif [[ "$osname" == "ubuntu" ]]; then + count=$(dpkg -l | grep -E "libpango-1.0-0|libharfbuzz0b|libpangoft2-1.0-0" | wc -l) + if ! [ "$count" -eq 3 ]; then + sudo apt install -y libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0 + fi +fi + SETUPTOOLS_VER=$(grep "^SETUPTOOLS_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}') WHEEL_VER=$(grep "^WHEEL_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}') diff --git a/restore.sh b/restore.sh index 3a7efe59..49770557 100755 --- a/restore.sh +++ b/restore.sh @@ -281,8 +281,8 @@ sudo make altinstall cd ~ sudo rm -rf Python-${PYTHON_VER} Python-${PYTHON_VER}.tgz -print_green 'Installing redis, git and weasyprint' -sudo apt install -y redis git weasyprint +print_green 'Installing redis and git' +sudo apt install -y redis git print_green 'Installing postgresql' @@ -444,6 +444,19 @@ sudo -u postgres psql -c "GRANT USAGE, CREATE ON SCHEMA PUBLIC TO ${pgusername}" gzip -d $tmp_dir/postgres/db*.psql.gz PGPASSWORD=${pgpw} psql -h localhost -U ${pgusername} -d tacticalrmm -f $tmp_dir/postgres/db*.psql +# for weasyprint +if [[ "$osname" == "debian" ]]; then + count=$(dpkg -l | grep -E "libpango-1.0-0|libpangoft2-1.0-0" | wc -l) + if ! [ "$count" -eq 2 ]; then + sudo apt install -y libpango-1.0-0 libpangoft2-1.0-0 + fi +elif [[ "$osname" == "ubuntu" ]]; then + count=$(dpkg -l | grep -E "libpango-1.0-0|libharfbuzz0b|libpangoft2-1.0-0" | wc -l) + if ! [ "$count" -eq 3 ]; then + sudo apt install -y libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0 + fi +fi + SETUPTOOLS_VER=$(grep "^SETUPTOOLS_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}') WHEEL_VER=$(grep "^WHEEL_VER" "$SETTINGS_FILE" | awk -F'[= "]' '{print $5}') diff --git a/update.sh b/update.sh index 4633de20..6c98c397 100644 --- a/update.sh +++ b/update.sh @@ -171,10 +171,24 @@ EOF sudo systemctl daemon-reload fi +osname=$(lsb_release -si) +osname=${osname^} +osname=$(echo "$osname" | tr '[A-Z]' '[a-z]') + +# for weasyprint +if [[ "$osname" == "debian" ]]; then + count=$(dpkg -l | grep -E "libpango-1.0-0|libpangoft2-1.0-0" | wc -l) + if ! [ "$count" -eq 2 ]; then + sudo apt install -y libpango-1.0-0 libpangoft2-1.0-0 + fi +elif [[ "$osname" == "ubuntu" ]]; then + count=$(dpkg -l | grep -E "libpango-1.0-0|libharfbuzz0b|libpangoft2-1.0-0" | wc -l) + if ! [ "$count" -eq 3 ]; then + sudo apt install -y libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0 + fi +fi + if [ ! -f /etc/apt/sources.list.d/nginx.list ]; then - osname=$(lsb_release -si) - osname=${osname^} - osname=$(echo "$osname" | tr '[A-Z]' '[a-z]') codename=$(lsb_release -sc) nginxrepo="$( cat <