From 5ccf408fd60334c8b00a9bc5929f2e705c01df70 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 19 Oct 2022 23:14:45 +0000 Subject: [PATCH 01/11] back to dev [skip ci] --- api/tacticalrmm/tacticalrmm/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/tacticalrmm/tacticalrmm/settings.py b/api/tacticalrmm/tacticalrmm/settings.py index 7167de3a4f..c02c984038 100644 --- a/api/tacticalrmm/tacticalrmm/settings.py +++ b/api/tacticalrmm/tacticalrmm/settings.py @@ -20,7 +20,7 @@ AUTH_USER_MODEL = "accounts.User" # latest release -TRMM_VERSION = "0.15.1" +TRMM_VERSION = "0.15.2-dev" # https://github.com/amidaware/tacticalrmm-web WEB_VERSION = "0.101.3" From b2bc3adb3dfc90e86751fb78857d1f00b3af9b02 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 20 Oct 2022 19:03:37 +0000 Subject: [PATCH 02/11] update demo --- .../agents/management/commands/fake_agents.py | 25 ++++++--- api/tacticalrmm/tacticalrmm/demo_data.py | 51 +++++++++++++++++++ 2 files changed, 70 insertions(+), 6 deletions(-) diff --git a/api/tacticalrmm/agents/management/commands/fake_agents.py b/api/tacticalrmm/agents/management/commands/fake_agents.py index 9b7a829ff9..2adbd39f7e 100644 --- a/api/tacticalrmm/agents/management/commands/fake_agents.py +++ b/api/tacticalrmm/agents/management/commands/fake_agents.py @@ -27,6 +27,7 @@ EvtLogFailWhen, EvtLogNames, EvtLogTypes, + GoArch, PAAction, ScriptShell, TaskSyncStatus, @@ -47,10 +48,12 @@ temp_dir_stdout, wmi_deb, wmi_pi, + wmi_mac, + disks_mac, ) from winupdate.models import WinUpdate, WinUpdatePolicy -AGENTS_TO_GENERATE = 20 +AGENTS_TO_GENERATE = 100 SVCS = settings.BASE_DIR.joinpath("tacticalrmm/test_data/winsvcs.json") WMI_1 = settings.BASE_DIR.joinpath("tacticalrmm/test_data/wmi1.json") @@ -169,7 +172,7 @@ def handle(self, *args, **kwargs) -> None: for site in sites6: Site(client=client6, name=site).save() - hostnames = ( + win_hostnames = ( "DC-1", "DC-2", "FSV-1", @@ -194,6 +197,7 @@ def handle(self, *args, **kwargs) -> None: linux_deb_os = "Debian 11.2 x86_64 5.10.0-11-amd64" linux_pi_os = "Raspbian 11.2 armv7l 5.10.92-v7+" + mac_os = "Darwin 12.5.1 arm64 21.6.0" public_ips = ("65.234.22.4", "74.123.43.5", "44.21.134.45") @@ -311,20 +315,30 @@ def handle(self, *args, **kwargs) -> None: if plat_pick in (7, 11): agent.plat = AgentPlat.LINUX mode = AgentMonType.SERVER + agent.hostname = "db-aws-01" # pi arm if plat_pick == 7: - agent.goarch = "arm" + agent.goarch = GoArch.ARM32 agent.wmi_detail = wmi_pi agent.disks = disks_linux_pi agent.operating_system = linux_pi_os else: - agent.goarch = "amd64" + agent.goarch = GoArch.AMD64 agent.wmi_detail = wmi_deb agent.disks = disks_linux_deb agent.operating_system = linux_deb_os + elif plat_pick in (4, 14): + agent.plat = AgentPlat.DARWIN + agent.hostname = "Karens-MacBook-Air.local" + mode = random.choice([AgentMonType.SERVER, AgentMonType.WORKSTATION]) + agent.goarch = GoArch.ARM64 + agent.wmi_detail = wmi_mac + agent.disks = disks_mac + agent.operating_system = mac_os else: agent.plat = AgentPlat.WINDOWS - agent.goarch = "amd64" + agent.hostname = random.choice(win_hostnames) + agent.goarch = GoArch.AMD64 mode = random.choice(modes) agent.wmi_detail = random.choice(wmi_details) agent.services = services @@ -334,7 +348,6 @@ def handle(self, *args, **kwargs) -> None: else: agent.operating_system = random.choice(op_systems_workstations) - agent.hostname = random.choice(hostnames) agent.version = settings.LATEST_AGENT_VER agent.site = Site.objects.get(name=site) agent.agent_id = self.rand_string(40) diff --git a/api/tacticalrmm/tacticalrmm/demo_data.py b/api/tacticalrmm/tacticalrmm/demo_data.py index 2e283af6da..fa82446372 100644 --- a/api/tacticalrmm/tacticalrmm/demo_data.py +++ b/api/tacticalrmm/tacticalrmm/demo_data.py @@ -95,6 +95,41 @@ }, ] +disks_mac = [ + { + "free": "94.2 GB", + "used": "134.1 GB", + "total": "228.3 GB", + "device": "/dev/disk3s1s1", + "fstype": "apfs", + "percent": 58, + }, + { + "free": "481.6 MB", + "used": "18.4 MB", + "total": "500.0 MB", + "device": "/dev/disk1s3", + "fstype": "apfs", + "percent": 3, + }, + { + "free": "3.4 GB", + "used": "1.6 GB", + "total": "5.0 GB", + "device": "/dev/disk2s1", + "fstype": "apfs", + "percent": 32, + }, + { + "free": "94.2 GB", + "used": "134.1 GB", + "total": "228.3 GB", + "device": "/dev/disk3s1", + "fstype": "apfs", + "percent": 58, + }, +] + wmi_deb = { "cpus": ["AMD Ryzen 9 3900X 12-Core Processor"], "gpus": ["Cirrus Logic GD 5446"], @@ -111,6 +146,22 @@ "make_model": "Raspberry Pi 2 Model B Rev 1.1", } +wmi_mac = { + "cpus": ["Apple M1"], + "gpus": [], + "disks": [ + "Apple APPLE SSD AP0256Q SCSI SSD disk0 233.8 GB", + "Apple APPLE SSD AP0256Q SCSI SSD disk1 500.0 MB", + "Apple APPLE SSD AP0256Q SCSI SSD disk2 5.0 GB", + "Apple APPLE SSD AP0256Q SCSI SSD disk3 228.3 GB", + ], + "local_ips": [ + "192.168.45.113/24", + "fe80::476:c390:c8dc:11af/64", + ], + "make_model": "MacBookAir10,1", +} + check_network_loc_aware_ps1 = r""" $networkstatus = Get-NetConnectionProfile | Select NetworkCategory | Out-String From badfc26aed1e54bf8b6723ecd9f879d78f9ef42f Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 21 Oct 2022 16:39:55 +0000 Subject: [PATCH 03/11] fix fake agents script --- .../agents/management/commands/fake_agents.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/tacticalrmm/agents/management/commands/fake_agents.py b/api/tacticalrmm/agents/management/commands/fake_agents.py index 2adbd39f7e..7ed0145c8b 100644 --- a/api/tacticalrmm/agents/management/commands/fake_agents.py +++ b/api/tacticalrmm/agents/management/commands/fake_agents.py @@ -53,7 +53,7 @@ ) from winupdate.models import WinUpdate, WinUpdatePolicy -AGENTS_TO_GENERATE = 100 +AGENTS_TO_GENERATE = 250 SVCS = settings.BASE_DIR.joinpath("tacticalrmm/test_data/winsvcs.json") WMI_1 = settings.BASE_DIR.joinpath("tacticalrmm/test_data/wmi1.json") @@ -172,7 +172,7 @@ def handle(self, *args, **kwargs) -> None: for site in sites6: Site(client=client6, name=site).save() - win_hostnames = ( + hostnames = ( "DC-1", "DC-2", "FSV-1", @@ -180,6 +180,8 @@ def handle(self, *args, **kwargs) -> None: "WSUS", "DESKTOP-12345", "LAPTOP-55443", + "db-aws-01", + "Karens-MacBook-Air.local", ) descriptions = ("Bob's computer", "Primary DC", "File Server", "Karen's Laptop") modes = AgentMonType.values @@ -315,7 +317,6 @@ def handle(self, *args, **kwargs) -> None: if plat_pick in (7, 11): agent.plat = AgentPlat.LINUX mode = AgentMonType.SERVER - agent.hostname = "db-aws-01" # pi arm if plat_pick == 7: agent.goarch = GoArch.ARM32 @@ -329,7 +330,6 @@ def handle(self, *args, **kwargs) -> None: agent.operating_system = linux_deb_os elif plat_pick in (4, 14): agent.plat = AgentPlat.DARWIN - agent.hostname = "Karens-MacBook-Air.local" mode = random.choice([AgentMonType.SERVER, AgentMonType.WORKSTATION]) agent.goarch = GoArch.ARM64 agent.wmi_detail = wmi_mac @@ -337,7 +337,6 @@ def handle(self, *args, **kwargs) -> None: agent.operating_system = mac_os else: agent.plat = AgentPlat.WINDOWS - agent.hostname = random.choice(win_hostnames) agent.goarch = GoArch.AMD64 mode = random.choice(modes) agent.wmi_detail = random.choice(wmi_details) @@ -349,6 +348,7 @@ def handle(self, *args, **kwargs) -> None: agent.operating_system = random.choice(op_systems_workstations) agent.version = settings.LATEST_AGENT_VER + agent.hostname = random.choice(hostnames) agent.site = Site.objects.get(name=site) agent.agent_id = self.rand_string(40) agent.description = random.choice(descriptions) From 71c2519b8e27a8ad1aeaaf1544f5ff0ffa95984b Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 21 Oct 2022 16:40:11 +0000 Subject: [PATCH 04/11] fix wording --- api/tacticalrmm/checks/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/tacticalrmm/checks/views.py b/api/tacticalrmm/checks/views.py index ca2295b80e..e4b6fcd39f 100644 --- a/api/tacticalrmm/checks/views.py +++ b/api/tacticalrmm/checks/views.py @@ -169,6 +169,6 @@ def run_checks(request, agent_id): if r == "busy": return notify_error(f"Checks are already running on {agent.hostname}") elif r == "ok": - return Response(f"Checks will now be re-run on {agent.hostname}") + return Response(f"Checks will now be run on {agent.hostname}") return notify_error("Unable to contact the agent") From dd4140558e9210e19edb323c31b30f4d1f726a56 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 21 Oct 2022 16:51:52 +0000 Subject: [PATCH 05/11] fix tests --- api/tacticalrmm/checks/tests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/api/tacticalrmm/checks/tests.py b/api/tacticalrmm/checks/tests.py index aeaf07332b..dafd4f2273 100644 --- a/api/tacticalrmm/checks/tests.py +++ b/api/tacticalrmm/checks/tests.py @@ -239,7 +239,6 @@ def test_run_checks(self, nats_cmd): r = self.client.post(url) self.assertEqual(r.status_code, 200) nats_cmd.assert_called_with({"func": "runchecks"}, timeout=15) - self.assertEqual(r.json(), f"Checks will now be re-run on {agent.hostname}") nats_cmd.reset_mock() nats_cmd.return_value = "timeout" From be0c9a4d46e0794e0750e93a33ad2948804d8806 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 25 Oct 2022 05:59:14 +0000 Subject: [PATCH 06/11] add path --- api/tacticalrmm/core/mac_uninstall.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/api/tacticalrmm/core/mac_uninstall.sh b/api/tacticalrmm/core/mac_uninstall.sh index cd36d14554..0fc03c3e8f 100755 --- a/api/tacticalrmm/core/mac_uninstall.sh +++ b/api/tacticalrmm/core/mac_uninstall.sh @@ -3,6 +3,7 @@ /usr/local/mesh_services/meshagent/meshagent -fulluninstall launchctl bootout system /Library/LaunchDaemons/tacticalagent.plist rm -rf /usr/local/mesh_services +rm -rf /opt/tacticalmesh rm -f /etc/tacticalagent rm -rf /opt/tacticalagent rm -f /Library/LaunchDaemons/tacticalagent.plist \ No newline at end of file From 2c3b35293b918fcf663514288274817496b3a9cb Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 25 Oct 2022 06:32:38 +0000 Subject: [PATCH 07/11] bump versions --- api/tacticalrmm/tacticalrmm/settings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/tacticalrmm/tacticalrmm/settings.py b/api/tacticalrmm/tacticalrmm/settings.py index c02c984038..f9065a0d11 100644 --- a/api/tacticalrmm/tacticalrmm/settings.py +++ b/api/tacticalrmm/tacticalrmm/settings.py @@ -23,16 +23,16 @@ TRMM_VERSION = "0.15.2-dev" # https://github.com/amidaware/tacticalrmm-web -WEB_VERSION = "0.101.3" +WEB_VERSION = "0.101.4-dev" # bump this version everytime vue code is changed # to alert user they need to manually refresh their browser -APP_VER = "0.0.172" +APP_VER = "0.0.173" # https://github.com/amidaware/rmmagent -LATEST_AGENT_VER = "2.4.0" +LATEST_AGENT_VER = "2.4.1-dev" -MESH_VER = "1.0.85" +MESH_VER = "1.0.89" NATS_SERVER_VER = "2.9.3" From 4edc0058d379a03f5d7f3264b1c7944728801a7e Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 25 Oct 2022 06:32:51 +0000 Subject: [PATCH 08/11] update reqs --- api/tacticalrmm/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/tacticalrmm/requirements.txt b/api/tacticalrmm/requirements.txt index 5313e565b7..381855b9d2 100644 --- a/api/tacticalrmm/requirements.txt +++ b/api/tacticalrmm/requirements.txt @@ -29,9 +29,9 @@ hiredis==2.0.0 requests==2.28.1 six==1.16.0 sqlparse==0.4.3 -twilio==7.14.2 +twilio==7.15.0 urllib3==1.26.12 -uWSGI==2.0.20 +uWSGI==2.0.21 validators==0.20.0 vine==5.0.0 websockets==10.3 From b657468b62b598dd081c1097db4d6b83517f601b Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 25 Oct 2022 19:03:57 +0000 Subject: [PATCH 09/11] update uninstall for new path --- api/tacticalrmm/core/mac_uninstall.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/tacticalrmm/core/mac_uninstall.sh b/api/tacticalrmm/core/mac_uninstall.sh index 0fc03c3e8f..2cb29347af 100755 --- a/api/tacticalrmm/core/mac_uninstall.sh +++ b/api/tacticalrmm/core/mac_uninstall.sh @@ -1,6 +1,13 @@ #!/bin/bash -/usr/local/mesh_services/meshagent/meshagent -fulluninstall +if [ -f /usr/local/mesh_services/meshagent/meshagent ]; then + /usr/local/mesh_services/meshagent/meshagent -fulluninstall +fi + +if [ -f /opt/tacticalmesh/meshagent ]; then + /opt/tacticalmesh/meshagent -fulluninstall +fi + launchctl bootout system /Library/LaunchDaemons/tacticalagent.plist rm -rf /usr/local/mesh_services rm -rf /opt/tacticalmesh From df7fe3e6b47e4bf7830e23d709e8ad257c9c5c06 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 25 Oct 2022 21:39:56 +0000 Subject: [PATCH 10/11] bump mesh [skip ci] --- api/tacticalrmm/tacticalrmm/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/tacticalrmm/tacticalrmm/settings.py b/api/tacticalrmm/tacticalrmm/settings.py index f9065a0d11..7d0e5b937e 100644 --- a/api/tacticalrmm/tacticalrmm/settings.py +++ b/api/tacticalrmm/tacticalrmm/settings.py @@ -32,7 +32,7 @@ # https://github.com/amidaware/rmmagent LATEST_AGENT_VER = "2.4.1-dev" -MESH_VER = "1.0.89" +MESH_VER = "1.0.90" NATS_SERVER_VER = "2.9.3" From bf3c65778ebf2106c5e8a45745ae4e8f3f939c46 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 25 Oct 2022 22:10:50 +0000 Subject: [PATCH 11/11] bump versions [skip ci] --- api/tacticalrmm/tacticalrmm/settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/tacticalrmm/tacticalrmm/settings.py b/api/tacticalrmm/tacticalrmm/settings.py index 7d0e5b937e..30883fe3d6 100644 --- a/api/tacticalrmm/tacticalrmm/settings.py +++ b/api/tacticalrmm/tacticalrmm/settings.py @@ -20,17 +20,17 @@ AUTH_USER_MODEL = "accounts.User" # latest release -TRMM_VERSION = "0.15.2-dev" +TRMM_VERSION = "0.15.2" # https://github.com/amidaware/tacticalrmm-web -WEB_VERSION = "0.101.4-dev" +WEB_VERSION = "0.101.5" # bump this version everytime vue code is changed # to alert user they need to manually refresh their browser APP_VER = "0.0.173" # https://github.com/amidaware/rmmagent -LATEST_AGENT_VER = "2.4.1-dev" +LATEST_AGENT_VER = "2.4.1" MESH_VER = "1.0.90"