diff --git a/.vscode/settings.json b/.vscode/settings.json index ad5cf19db7..7292ffa362 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -58,13 +58,13 @@ "go.useLanguageServer": true, "[go]": { "editor.codeActionsOnSave": { - "source.organizeImports": false + "source.organizeImports": "never" }, "editor.snippetSuggestions": "none" }, "[go.mod]": { "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit" } }, "gopls": { diff --git a/ansible/roles/trmm_dev/files/nginx-default.conf b/ansible/roles/trmm_dev/files/nginx-default.conf index 0ab64cd944..665d25ea03 100644 --- a/ansible/roles/trmm_dev/files/nginx-default.conf +++ b/ansible/roles/trmm_dev/files/nginx-default.conf @@ -13,7 +13,7 @@ http { server_tokens off; tcp_nopush on; types_hash_max_size 2048; - server_names_hash_bucket_size 64; + server_names_hash_bucket_size 256; include /etc/nginx/mime.types; default_type application/octet-stream; ssl_protocols TLSv1.2 TLSv1.3; diff --git a/api/tacticalrmm/requirements.txt b/api/tacticalrmm/requirements.txt index 1059623dd1..3317211f8f 100644 --- a/api/tacticalrmm/requirements.txt +++ b/api/tacticalrmm/requirements.txt @@ -1,46 +1,46 @@ adrf==0.1.2 asgiref==3.7.2 -celery==5.3.5 +celery==5.3.6 certifi==2023.11.17 cffi==1.16.0 channels==4.0.0 channels_redis==4.1.0 cryptography==41.0.7 -Django==4.2.7 +Django==4.2.8 django-cors-headers==4.3.1 -django-filter==23.4 +django-filter==23.5 django-rest-knox==4.2.0 djangorestframework==3.14.0 -drf-spectacular==0.26.5 +drf-spectacular==0.27.0 hiredis==2.2.3 meshctrl==0.1.15 msgpack==1.0.7 nats-py==2.6.0 packaging==23.2 psutil==5.9.6 -psycopg[binary]==3.1.13 +psycopg[binary]==3.1.16 pycparser==2.21 pycryptodome==3.19.0 pyotp==2.9.0 pyparsing==3.1.1 -python-ipware==2.0.0 +python-ipware==2.0.1 qrcode==7.4.2 redis==4.5.5 requests==2.31.0 six==1.16.0 sqlparse==0.4.4 -twilio==8.10.2 +twilio==8.10.3 urllib3==2.1.0 uvicorn[standard]==0.23.2 -uWSGI==2.0.22 +uWSGI==2.0.23 validators==0.20.0 vine==5.1.0 websockets==12.0 zipp==3.17.0 -pandas==2.1.3 +pandas==2.1.4 kaleido==0.2.1 jinja2==3.1.2 markdown==3.5.1 plotly==5.18.0 -weasyprint==60.1 +weasyprint==60.2 ocxsect==0.1.5 \ No newline at end of file diff --git a/api/tacticalrmm/tacticalrmm/settings.py b/api/tacticalrmm/tacticalrmm/settings.py index 26b4fa0bfa..2efa5d50c3 100644 --- a/api/tacticalrmm/tacticalrmm/settings.py +++ b/api/tacticalrmm/tacticalrmm/settings.py @@ -20,27 +20,27 @@ AUTH_USER_MODEL = "accounts.User" # latest release -TRMM_VERSION = "0.17.2" +TRMM_VERSION = "0.17.3" # https://github.com/amidaware/tacticalrmm-web -WEB_VERSION = "0.101.37" +WEB_VERSION = "0.101.38" # bump this version everytime vue code is changed # to alert user they need to manually refresh their browser -APP_VER = "0.0.188" +APP_VER = "0.0.189" # https://github.com/amidaware/rmmagent -LATEST_AGENT_VER = "2.6.0" +LATEST_AGENT_VER = "2.6.1" MESH_VER = "1.1.9" -NATS_SERVER_VER = "2.10.5" +NATS_SERVER_VER = "2.10.7" # for the update script, bump when need to recreate venv -PIP_VER = "40" +PIP_VER = "41" -SETUPTOOLS_VER = "68.2.2" -WHEEL_VER = "0.41.3" +SETUPTOOLS_VER = "69.0.2" +WHEEL_VER = "0.42.0" AGENT_BASE_URL = "https://agents.tacticalrmm.com" diff --git a/install.sh b/install.sh index e416060f0a..16095a020d 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -SCRIPT_VERSION="80" +SCRIPT_VERSION="81" SCRIPT_URL="https://raw.githubusercontent.com/amidaware/tacticalrmm/master/install.sh" sudo apt install -y curl wget dirmngr gnupg lsb-release ca-certificates @@ -193,10 +193,9 @@ else done CERT_PRIV_KEY=/etc/letsencrypt/live/${rootdomain}/privkey.pem CERT_PUB_KEY=/etc/letsencrypt/live/${rootdomain}/fullchain.pem + sudo chown ${USER}:${USER} -R /etc/letsencrypt fi -sudo chown ${USER}:${USER} -R /etc/letsencrypt - print_green 'Installing Nginx' sudo mkdir -p /etc/apt/keyrings @@ -232,7 +231,7 @@ http { sendfile on; tcp_nopush on; types_hash_max_size 2048; - server_names_hash_bucket_size 64; + server_names_hash_bucket_size 256; include /etc/nginx/mime.types; default_type application/octet-stream; ssl_protocols TLSv1.2 TLSv1.3; @@ -295,25 +294,25 @@ done print_green 'Creating database for trmm' -sudo -u postgres psql -c "CREATE DATABASE tacticalrmm" -sudo -u postgres psql -c "CREATE USER ${pgusername} WITH PASSWORD '${pgpw}'" -sudo -u postgres psql -c "ALTER ROLE ${pgusername} SET client_encoding TO 'utf8'" -sudo -u postgres psql -c "ALTER ROLE ${pgusername} SET default_transaction_isolation TO 'read committed'" -sudo -u postgres psql -c "ALTER ROLE ${pgusername} SET timezone TO 'UTC'" -sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE tacticalrmm TO ${pgusername}" -sudo -u postgres psql -c "ALTER DATABASE tacticalrmm OWNER TO ${pgusername}" -sudo -u postgres psql -c "GRANT USAGE, CREATE ON SCHEMA PUBLIC TO ${pgusername}" +sudo -iu postgres psql -c "CREATE DATABASE tacticalrmm" +sudo -iu postgres psql -c "CREATE USER ${pgusername} WITH PASSWORD '${pgpw}'" +sudo -iu postgres psql -c "ALTER ROLE ${pgusername} SET client_encoding TO 'utf8'" +sudo -iu postgres psql -c "ALTER ROLE ${pgusername} SET default_transaction_isolation TO 'read committed'" +sudo -iu postgres psql -c "ALTER ROLE ${pgusername} SET timezone TO 'UTC'" +sudo -iu postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE tacticalrmm TO ${pgusername}" +sudo -iu postgres psql -c "ALTER DATABASE tacticalrmm OWNER TO ${pgusername}" +sudo -iu postgres psql -c "GRANT USAGE, CREATE ON SCHEMA PUBLIC TO ${pgusername}" print_green 'Creating database for meshcentral' -sudo -u postgres psql -c "CREATE DATABASE meshcentral" -sudo -u postgres psql -c "CREATE USER ${MESHPGUSER} WITH PASSWORD '${MESHPGPWD}'" -sudo -u postgres psql -c "ALTER ROLE ${MESHPGUSER} SET client_encoding TO 'utf8'" -sudo -u postgres psql -c "ALTER ROLE ${MESHPGUSER} SET default_transaction_isolation TO 'read committed'" -sudo -u postgres psql -c "ALTER ROLE ${MESHPGUSER} SET timezone TO 'UTC'" -sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE meshcentral TO ${MESHPGUSER}" -sudo -u postgres psql -c "ALTER DATABASE meshcentral OWNER TO ${MESHPGUSER}" -sudo -u postgres psql -c "GRANT USAGE, CREATE ON SCHEMA PUBLIC TO ${MESHPGUSER}" +sudo -iu postgres psql -c "CREATE DATABASE meshcentral" +sudo -iu postgres psql -c "CREATE USER ${MESHPGUSER} WITH PASSWORD '${MESHPGPWD}'" +sudo -iu postgres psql -c "ALTER ROLE ${MESHPGUSER} SET client_encoding TO 'utf8'" +sudo -iu postgres psql -c "ALTER ROLE ${MESHPGUSER} SET default_transaction_isolation TO 'read committed'" +sudo -iu postgres psql -c "ALTER ROLE ${MESHPGUSER} SET timezone TO 'UTC'" +sudo -iu postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE meshcentral TO ${MESHPGUSER}" +sudo -iu postgres psql -c "ALTER DATABASE meshcentral OWNER TO ${MESHPGUSER}" +sudo -iu postgres psql -c "GRANT USAGE, CREATE ON SCHEMA PUBLIC TO ${MESHPGUSER}" print_green 'Cloning repos' diff --git a/restore.sh b/restore.sh index a4cc179084..5cfb76f949 100755 --- a/restore.sh +++ b/restore.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -SCRIPT_VERSION="54" +SCRIPT_VERSION="55" SCRIPT_URL='https://raw.githubusercontent.com/amidaware/tacticalrmm/master/restore.sh' sudo apt update @@ -164,7 +164,7 @@ http { sendfile on; tcp_nopush on; types_hash_max_size 2048; - server_names_hash_bucket_size 64; + server_names_hash_bucket_size 256; include /etc/nginx/mime.types; default_type application/octet-stream; ssl_protocols TLSv1.2 TLSv1.3; @@ -353,14 +353,14 @@ fi print_green 'Creating MeshCentral DB' -sudo -u postgres psql -c "CREATE DATABASE meshcentral" -sudo -u postgres psql -c "CREATE USER ${MESH_POSTGRES_USER} WITH PASSWORD '${MESH_POSTGRES_PW}'" -sudo -u postgres psql -c "ALTER ROLE ${MESH_POSTGRES_USER} SET client_encoding TO 'utf8'" -sudo -u postgres psql -c "ALTER ROLE ${MESH_POSTGRES_USER} SET default_transaction_isolation TO 'read committed'" -sudo -u postgres psql -c "ALTER ROLE ${MESH_POSTGRES_USER} SET timezone TO 'UTC'" -sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE meshcentral TO ${MESH_POSTGRES_USER}" -sudo -u postgres psql -c "ALTER DATABASE meshcentral OWNER TO ${MESH_POSTGRES_USER}" -sudo -u postgres psql -c "GRANT USAGE, CREATE ON SCHEMA PUBLIC TO ${MESH_POSTGRES_USER}" +sudo -iu postgres psql -c "CREATE DATABASE meshcentral" +sudo -iu postgres psql -c "CREATE USER ${MESH_POSTGRES_USER} WITH PASSWORD '${MESH_POSTGRES_PW}'" +sudo -iu postgres psql -c "ALTER ROLE ${MESH_POSTGRES_USER} SET client_encoding TO 'utf8'" +sudo -iu postgres psql -c "ALTER ROLE ${MESH_POSTGRES_USER} SET default_transaction_isolation TO 'read committed'" +sudo -iu postgres psql -c "ALTER ROLE ${MESH_POSTGRES_USER} SET timezone TO 'UTC'" +sudo -iu postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE meshcentral TO ${MESH_POSTGRES_USER}" +sudo -iu postgres psql -c "ALTER DATABASE meshcentral OWNER TO ${MESH_POSTGRES_USER}" +sudo -iu postgres psql -c "GRANT USAGE, CREATE ON SCHEMA PUBLIC TO ${MESH_POSTGRES_USER}" if [ "$FROM_MONGO" = true ]; then print_green 'Converting mesh mongo to postgres' @@ -431,14 +431,14 @@ print_green 'Restoring the trmm database' pgusername=$(grep -w USER /rmm/api/tacticalrmm/tacticalrmm/local_settings.py | sed 's/^.*: //' | sed 's/.//' | sed -r 's/.{2}$//') pgpw=$(grep -w PASSWORD /rmm/api/tacticalrmm/tacticalrmm/local_settings.py | sed 's/^.*: //' | sed 's/.//' | sed -r 's/.{2}$//') -sudo -u postgres psql -c "CREATE DATABASE tacticalrmm" -sudo -u postgres psql -c "CREATE USER ${pgusername} WITH PASSWORD '${pgpw}'" -sudo -u postgres psql -c "ALTER ROLE ${pgusername} SET client_encoding TO 'utf8'" -sudo -u postgres psql -c "ALTER ROLE ${pgusername} SET default_transaction_isolation TO 'read committed'" -sudo -u postgres psql -c "ALTER ROLE ${pgusername} SET timezone TO 'UTC'" -sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE tacticalrmm TO ${pgusername}" -sudo -u postgres psql -c "ALTER DATABASE tacticalrmm OWNER TO ${pgusername}" -sudo -u postgres psql -c "GRANT USAGE, CREATE ON SCHEMA PUBLIC TO ${pgusername}" +sudo -iu postgres psql -c "CREATE DATABASE tacticalrmm" +sudo -iu postgres psql -c "CREATE USER ${pgusername} WITH PASSWORD '${pgpw}'" +sudo -iu postgres psql -c "ALTER ROLE ${pgusername} SET client_encoding TO 'utf8'" +sudo -iu postgres psql -c "ALTER ROLE ${pgusername} SET default_transaction_isolation TO 'read committed'" +sudo -iu postgres psql -c "ALTER ROLE ${pgusername} SET timezone TO 'UTC'" +sudo -iu postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE tacticalrmm TO ${pgusername}" +sudo -iu postgres psql -c "ALTER DATABASE tacticalrmm OWNER TO ${pgusername}" +sudo -iu 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 diff --git a/update.sh b/update.sh index 695265f387..945f6acc98 100644 --- a/update.sh +++ b/update.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -SCRIPT_VERSION="149" +SCRIPT_VERSION="150" SCRIPT_URL='https://raw.githubusercontent.com/amidaware/tacticalrmm/master/update.sh' LATEST_SETTINGS_URL='https://raw.githubusercontent.com/amidaware/tacticalrmm/master/api/tacticalrmm/tacticalrmm/settings.py' YELLOW='\033[1;33m' @@ -186,7 +186,7 @@ if ! [[ $CHECK_NGINX_NOLIMIT ]]; then /' $nginxdefaultconf fi -sudo sed -i 's/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/g' $nginxdefaultconf +sudo sed -i 's/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 256;/g' $nginxdefaultconf if ! sudo nginx -t >/dev/null 2>&1; then sudo nginx -t