Skip to content

Commit

Permalink
Release 0.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Feb 6, 2021
2 parents 1f9a241 + 71fb39d commit 1e03c62
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 27 deletions.
4 changes: 2 additions & 2 deletions api/tacticalrmm/tacticalrmm/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
AUTH_USER_MODEL = "accounts.User"

# latest release
TRMM_VERSION = "0.4.6"
TRMM_VERSION = "0.4.7"

# bump this version everytime vue code is changed
# to alert user they need to manually refresh their browser
APP_VER = "0.0.111"

# https://github.com/wh1te909/rmmagent
LATEST_AGENT_VER = "1.4.3"
LATEST_AGENT_VER = "1.4.4"

MESH_VER = "0.7.54"

Expand Down
4 changes: 4 additions & 0 deletions api/tacticalrmm/winupdate/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ def bulk_install_updates_task(pks: List[int]) -> None:
for chunk in chunks:
for agent in chunk:
agent.delete_superseded_updates()
try:
agent.approve_updates()
except:
pass
nats_data = {
"func": "installwinupdates",
"guids": agent.get_approved_update_guids(),
Expand Down
1 change: 1 addition & 0 deletions api/tacticalrmm/winupdate/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def install_updates(request, pk):
if pyver.parse(agent.version) < pyver.parse("1.3.0"):
return notify_error("Requires agent version 1.3.0 or greater")

agent.approve_updates()
nats_data = {
"func": "installwinupdates",
"guids": agent.get_approved_update_guids(),
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- script: |
cd /myagent/_work/1/s/api
source env/bin/activate
black --check tacticalrmm
black --exclude migrations/ --check tacticalrmm
if [ $? -ne 0 ]; then
exit 1
fi
Expand Down
18 changes: 9 additions & 9 deletions backup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash

SCRIPT_VERSION="7"
#####################################################

POSTGRES_USER="changeme"
POSTGRES_PW="hunter2"

#####################################################

SCRIPT_VERSION="8"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/backup.sh'

GREEN='\033[0;32m'
Expand All @@ -24,13 +31,6 @@ if [ $EUID -eq 0 ]; then
exit 1
fi

#####################################################

POSTGRES_USER="changeme"
POSTGRES_PW="hunter2"

#####################################################

if [[ "$POSTGRES_USER" == "changeme" || "$POSTGRES_PW" == "hunter2" ]]; then
printf >&2 "${RED}You must change the postgres username/password at the top of this file.${NC}\n"
printf >&2 "${RED}Check the github readme for where to find them.${NC}\n"
Expand All @@ -43,7 +43,7 @@ if [ ! -d /rmmbackups ]; then
fi

if [ -d /meshcentral/meshcentral-backup ]; then
rm -f /meshcentral/meshcentral-backup/*
rm -rf /meshcentral/meshcentral-backup/*
fi

if [ -d /meshcentral/meshcentral-coredumps ]; then
Expand Down
8 changes: 3 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SCRIPT_VERSION="36"
SCRIPT_VERSION="37"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/install.sh'

sudo apt install -y curl wget dirmngr gnupg lsb-release
Expand Down Expand Up @@ -398,19 +398,17 @@ read -n 1 -s -r -p "Press any key to continue..."

uwsgini="$(cat << EOF
[uwsgi]
# logto = /rmm/api/tacticalrmm/tacticalrmm/private/log/uwsgi.log
chdir = /rmm/api/tacticalrmm
module = tacticalrmm.wsgi
home = /rmm/api/env
master = true
processes = 6
threads = 6
enable-threads = True
enable-threads = true
socket = /rmm/api/tacticalrmm/tacticalrmm.sock
harakiri = 300
chmod-socket = 660
# clear environment on exit
buffer-size = 65535
vacuum = true
die-on-term = true
max-requests = 500
Expand Down
44 changes: 35 additions & 9 deletions restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ pgpw="hunter2"

#####################################################

SCRIPT_VERSION="14"
SCRIPT_VERSION="15"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/restore.sh'

sudo apt install -y curl wget
sudo apt install -y curl wget dirmngr gnupg lsb-release

GREEN='\033[0;32m'
YELLOW='\033[1;33m'
Expand All @@ -37,12 +37,38 @@ if [[ "$pgusername" == "changeme" || "$pgpw" == "hunter2" ]]; then
exit 1
fi

UBU20=$(grep 20.04 "/etc/"*"release")
if ! [[ $UBU20 ]]; then
echo -ne "\033[0;31mThis restore script will only work on Ubuntu 20.04\e[0m\n"
exit 1
osname=$(lsb_release -si); osname=${osname^}
osname=$(echo "$osname" | tr '[A-Z]' '[a-z]')
fullrel=$(lsb_release -sd)
codename=$(lsb_release -sc)
relno=$(lsb_release -sr | cut -d. -f1)
fullrelno=$(lsb_release -sr)

# Fallback if lsb_release -si returns anything else than Ubuntu, Debian or Raspbian
if [ ! "$osname" = "ubuntu" ] && [ ! "$osname" = "debian" ]; then
osname=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
osname=${osname^}
fi

# determine system
if ([ "$osname" = "ubuntu" ] && [ "$fullrelno" = "20.04" ]) || ([ "$osname" = "debian" ] && [ $relno -ge 10 ]); then
echo $fullrel
else
echo $fullrel
echo -ne "${RED}Only Ubuntu release 20.04 and Debian 10 and later, are supported\n"
echo -ne "Your system does not appear to be supported${NC}\n"
exit 1
fi

if ([ "$osname" = "ubuntu" ]); then
mongodb_repo="deb [arch=amd64] https://repo.mongodb.org/apt/$osname $codename/mongodb-org/4.4 multiverse"
else
mongodb_repo="deb [arch=amd64] https://repo.mongodb.org/apt/$osname $codename/mongodb-org/4.4 main"

fi

postgresql_repo="deb [arch=amd64] https://apt.postgresql.org/pub/repos/apt/ $codename-pgdg main"

if [ $EUID -eq 0 ]; then
echo -ne "\033[0;31mDo NOT run this script as root. Exiting.\e[0m\n"
exit 1
Expand Down Expand Up @@ -172,7 +198,7 @@ sudo apt install -y python3-venv python3-dev python3-pip python3-setuptools pyth

print_green 'Installing postgresql'

sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
echo "$postgresql_repo" | sudo tee /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt install -y postgresql-13
Expand All @@ -194,8 +220,8 @@ PGPASSWORD=${pgpw} psql -h localhost -U ${pgusername} -d tacticalrmm -f $tmp_dir

print_green 'Restoring MongoDB'

wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "$mongodb_repo" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt update
sudo apt install -y mongodb-org
sudo systemctl enable mongod
Expand Down
11 changes: 10 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SCRIPT_VERSION="105"
SCRIPT_VERSION="106"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/update.sh'
LATEST_SETTINGS_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/api/tacticalrmm/tacticalrmm/settings.py'
YELLOW='\033[1;33m'
Expand Down Expand Up @@ -193,6 +193,15 @@ sudo chown -R $USER:$GROUP /home/${USER}/.cache
sudo chown ${USER}:${USER} -R /etc/letsencrypt
sudo chmod 775 -R /etc/letsencrypt

CHECK_BUFF_SIZE=$(grep buffer-size /rmm/api/tacticalrmm/app.ini)
if ! [[ $CHECK_BUFF_SIZE ]]; then
setbuff="$(cat << EOF
buffer-size = 65535
EOF
)"
echo "${setbuff}" | tee --append /rmm/api/tacticalrmm/app.ini > /dev/null
fi

CHECK_REMOVE_SALT=$(grep KEEP_SALT /rmm/api/tacticalrmm/tacticalrmm/local_settings.py)
if ! [[ $CHECK_REMOVE_SALT ]]; then
printf >&2 "${YELLOW}This update removes salt from the rmm${NC}\n"
Expand Down

0 comments on commit 1e03c62

Please sign in to comment.