Skip to content

Commit

Permalink
Release 0.6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Apr 30, 2021
2 parents 2214181 + afb1316 commit dd8d39e
Show file tree
Hide file tree
Showing 86 changed files with 1,632 additions and 14 deletions.
19 changes: 12 additions & 7 deletions api/tacticalrmm/checks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import string
from statistics import mean
from typing import Any
from packaging import version as pyver

import pytz
from alerts.models import SEVERITY_CHOICES
Expand Down Expand Up @@ -421,16 +422,20 @@ def handle_checkv2(self, data):

# ping checks
elif self.check_type == "ping":
success = ["Reply", "bytes", "time", "TTL"]
output = data["output"]

if data["has_stdout"]:
if all(x in output for x in success):
self.status = "passing"
else:
if pyver.parse(self.agent.version) <= pyver.parse("1.5.2"):
# DEPRECATED
success = ["Reply", "bytes", "time", "TTL"]
if data["has_stdout"]:
if all(x in output for x in success):
self.status = "passing"
else:
self.status = "failing"
elif data["has_stderr"]:
self.status = "failing"
elif data["has_stderr"]:
self.status = "failing"
else:
self.status = data["status"]

self.more_info = output
self.save(update_fields=["more_info"])
Expand Down
3 changes: 3 additions & 0 deletions api/tacticalrmm/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ def version(request):

@api_view()
def dashboard_info(request):
from tacticalrmm.utils import get_latest_trmm_ver

return Response(
{
"trmm_version": settings.TRMM_VERSION,
"latest_trmm_ver": get_latest_trmm_ver(),
"dark_mode": request.user.dark_mode,
"show_community_scripts": request.user.show_community_scripts,
"dbl_click_action": request.user.agent_dblclick_action,
Expand Down
20 changes: 20 additions & 0 deletions api/tacticalrmm/scripts/community_scripts.json
Original file line number Diff line number Diff line change
Expand Up @@ -599,5 +599,25 @@
"description": "Add a task to Task Scheduler, needs editing",
"shell": "powershell",
"category": "TRMM (Win):Other"
},
{
"guid": "17040742-184a-4251-8f7b-4a1b0a1f02d1",
"filename": "Win_File_Copy_Misc.ps1",
"submittedBy": "https://github.com/tremor021",
"name": "EXAMPLE File Copying using powershell",
"description": "Reference Script: Will need manual tweaking, for copying files/folders from paths/websites to local",
"shell": "powershell",
"category": "TRMM (Win):Misc>Reference",
"default_timeout": "1"
},
{
"guid": "168037d8-78e6-4a6a-a9a9-8ec2c1dbe949",
"filename": "Win_MSI_Install.ps1",
"submittedBy": "https://github.com/silversword411",
"name": "EXAMPLE Function for running MSI install via powershell",
"description": "Reference Script: Will need manual tweaking, for running MSI from powershell",
"shell": "powershell",
"category": "TRMM (Win):Misc>Reference",
"default_timeout": "1"
}
]
6 changes: 3 additions & 3 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.6.5"
TRMM_VERSION = "0.6.6"

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

# https://github.com/wh1te909/rmmagent
LATEST_AGENT_VER = "1.5.2"
LATEST_AGENT_VER = "1.5.3"

MESH_VER = "0.8.19"

Expand Down
17 changes: 17 additions & 0 deletions api/tacticalrmm/tacticalrmm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,20 @@ def run_nats_api_cmd(mode: str, ids: list[str], timeout: int = 30) -> None:
subprocess.run(cmd, capture_output=True, timeout=timeout)
except Exception as e:
logger.error(e)


def get_latest_trmm_ver() -> str:
url = "https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/api/tacticalrmm/tacticalrmm/settings.py"
try:
r = requests.get(url, timeout=5)
except:
return "error"

try:
for line in r.text.splitlines():
if "TRMM_VERSION" in line:
return line.split(" ")[2].strip('"')
except Exception as e:
logger.error(e)

return "error"
11 changes: 11 additions & 0 deletions docs/docs/contributing_using_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,14 @@ Customize to your tastes (it doesn't need to be internet configured, just add re
127.0.0.1 mesh.example.com
```

## View mkdocks live edits in browser

Change stuff in `/docs/docs/`

mkdocs is Exposed on Port: 8005

Open: [http://rmm.example.com:8005/](http://rmm.example.com:8005/)

## View django administration

Open: [http://rmm.example.com:8000/admin/](http://rmm.example.com:8000/admin/)
42 changes: 42 additions & 0 deletions scripts/Win_File_Copy_Misc.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Requires WebClient object $webClient defined, e.g. $webClient = New-Object System.Net.WebClient
#
# Parameters:
# $source - The url of folder to copy, with trailing /, e.g. http://website/folder/structure/
# $destination - The folder to copy $source to, with trailing \ e.g. D:\CopyOfStructure\
# $recursive - True if subfolders of $source are also to be copied or False to ignore subfolders

Function Copy-Folder([string]$source, [string]$destination, [bool]$recursive) {
if (!$(Test-Path($destination))) {
New-Item $destination -type directory -Force
}

# Get the file list from the web page
$webString = $webClient.DownloadString($source)
$lines = [Regex]::Split($webString, "<br>")
# Parse each line, looking for files and folders
foreach ($line in $lines) {
if ($line.ToUpper().Contains("HREF")) {
# File or Folder
if (!$line.ToUpper().Contains("[TO PARENT DIRECTORY]")) {
# Not Parent Folder entry
$items = [Regex]::Split($line, """")
$items = [Regex]::Split($items[2], "(>|<)")
$item = $items[2]
if ($line.ToLower().Contains("&lt;dir&gt")) {
# Folder
if ($recursive) {
# Subfolder copy required
Copy-Folder "$source$item/" "$destination$item/" $recursive
}
else {
# Subfolder copy not required
}
}
else {
# File
$webClient.DownloadFile("$source$item", "$destination$item")
}
}
}
}
}
27 changes: 27 additions & 0 deletions scripts/Win_MSI_Install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Function Install-MSI {
Param (
[Parameter(Mandatory, ValueFromPipeline = $true)]
[ValidateNotNullOrEmpty()]
[System.IO.FileInfo]$File,
[String[]]$AdditionalParams,
[Switch]$OutputLog
)
$DataStamp = get-date -Format yyyyMMddTHHmmss
$logFile = "$($env:programdata)\CentraStage\MilesRMM\{0}-{1}.log" -f $file.fullname, $DataStamp
$MSIArguments = @(
"/i",
('"{0}"' -f $file.fullname),
"/qn",
"/norestart",
"/L*v",
$logFile
)
if ($additionalParams) {
$MSIArguments += $additionalParams
}
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow
if ($OutputLog.IsPresent) {
$logContents = get-content $logFile
Write-Output $logContents
}
}
6 changes: 3 additions & 3 deletions scripts/Win_ScreenConnectAIO.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<#
Requires global variables for serviceName "ScreenConnectService" and url "ScreenConnectInstaller"
Requires global variables for serviceName "ScreenConnectService" and url "ScreenConnectInstaller"'
serviceName is the name of the ScreenConnect Service once it is installed EG: "ScreenConnect Client (1327465grctq84yrtocq)"
url is the path the download the exe version of the ScreenConnect Access installer
Both variables values must start and end with "
url is the path the download the exe version of the ScreenConnect Access installer'
Both variables values must start and end with " (Prior to TRMM Version 0.6.5), remove / don't use " on TRMM Version 0.6.5 or later.
Also accepts uninstall variable to remove the installed instance if required.
#>

Expand Down
121 changes: 121 additions & 0 deletions scripts_wip/Mac_Firewall_Enable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#!/bin/sh
####################################################################################################
#
# Copyright (c) 2017, JAMF Software, LLC. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the JAMF Software, LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY JAMF SOFTWARE, LLC "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL JAMF SOFTWARE, LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
####################################################################################################
#
# ABOUT THIS PROGRAM
#
# NAME
# enableFilewall.sh -- Enables or Disables the firewall on macOS.
#
# SYNOPSIS
# sudo enableFirewall.sh
# sudo enableFirewall.sh <mountPoint> <computerName> <currentUsername> <enableFirewall>
#
# If there is a hardcoded value specified for <enableFirewall> in the script,
# or if the parameter is not passed by Jamf Pro, the hardcoded value in the script will
# be used.
#
# The data that is specified for the <enableFirewall> parameter should be specified in one of
# the following formats. PLEASE NOTE these formats are CASE-SENSITIVE:
#
# "TRUE" or "true" or "YES" or "yes" -> Turn Firewall ON
# "FALSE" or "false" or "NO" or "no" -> Turn Firewall OFF
#
# Example Usage: sudo enableFirewall.sh "mountPoint" "computerName" "currentUsername" "TRUE"
#
# DESCRIPTION
# This script enables or disables the firewall on macOS 10.7 or later.
# It can be used with a hardcoded value in the script, or read in as a parameter.
# Since Jamf Pro defines the first three parameters as (1) Mount Point, (2) Computer
# Name and (3) Username, we are using the fourth parameter ($4) as the passable parameter to
# acquire the status of <enableFirewall>. In addition, the fourth parameter is utilized to set
# the enableFirewall value.
#
####################################################################################################
#
# HISTORY
#
# Version: 1.2
#
# - Created by Nick Amundsen on August 6th, 2008
# - Updated by Nick Amundsen on January 21, 2010
# - Updated by Brandon Wenger on November 27th, 2017
# - Updated by Matthew Mitchell on March 22, 2019
#
####################################################################################################
#
# DEFINE VARIABLES & READ IN PARAMETERS
#
####################################################################################################

# HARDCODED VALUE FOR "enableFirewall" IS SET HERE
enableFirewall=""

# CHECK TO SEE IF A VALUE WAS PASSED IN PARAMETER 4 AND, IF SO, ASSIGN TO "enableFirewall"
if [ "$4" != "" ] && [ "$enableFirewall" == "" ]; then
enableFirewall=$4
fi

####################################################################################################
#
# SCRIPT CONTENTS - DO NOT MODIFY BELOW THIS LINE
#
####################################################################################################

#Check to make sure enableFirewall is not blank
if [ "$enableFirewall" == "" ]; then
echo "Error: The parameter 'enableFirewall' is blank. Please specify a value for parameter 4."
exit 1
fi

#Get the current macOS version (the major release) to check for compatibility
#This will return the 'x' in 10.x
OS=`/usr/bin/defaults read /System/Library/CoreServices/SystemVersion ProductVersion | awk '{print substr($1,1,5)}' | cut -d . -f2`

#If the macOS version is greater than or equal to 10.7
if [[ $OS -ge 7 ]]; then

#Check parameter value, if true or yes, turn the firewall on
case $enableFirewall in "true" | "TRUE" | "yes" | "YES")
echo "Enabling Firewall for macOS 10.$OS ..."
/usr/bin/defaults write /Library/Preferences/com.apple.alf globalstate -int 1;;

#If false or no, turn the firewall off
"false" | "FALSE" | "no" | "NO")
echo "Disabling Firewall for macOS 10.$OS ..."
/usr/bin/defaults write /Library/Preferences/com.apple.alf globalstate -int 0;;
esac

else

#The macOS version is not supported
echo "Unsupported macOS version - 10.7 or later is required."

fi

exit 0;
1 change: 1 addition & 0 deletions scripts_wip/Mac_Install_All_Updates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sudo softwareupdate -ia
4 changes: 4 additions & 0 deletions scripts_wip/Mac_Network_DNS_Set_to_1.1.1.1.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
networksetup -setdnsservers Wi-Fi 1.1.1.1
networksetup -setdnsservers Wi-Fi 1.0.0.1
networksetup -setdnsservers Ethernet 1.1.1.1
networksetup -setdnsservers Ethernet 1.0.0.1
2 changes: 2 additions & 0 deletions scripts_wip/Mac_SMC_and_NVRAM_Reset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pmset -a restoredefaults
nvram -c
5 changes: 5 additions & 0 deletions scripts_wip/Win_AD_Join_Computer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$domain = "myDomain"
$password = "myPassword!" | ConvertTo-SecureString -asPlainText -Force
$username = "$domain\myUserAccount"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
Add-Computer -DomainName $domain -OUPath "OU=testOU,DC=domain,DC=Domain,DC=com" -Credential $credential -Restart
4 changes: 4 additions & 0 deletions scripts_wip/Win_AD_Transfer_FSMO_Roles.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Transfer FSMO Roles to server
# Make this machine the FSMO Master role.

Move-ADDirectoryServerOperationMasterRole -Identity $env:computername -OperationMasterRole pdcemulator,ridmaster,infrastructuremaster,schemamaster,domainnamingmaster -Force
1 change: 1 addition & 0 deletions scripts_wip/Win_Bitlocker_Recover_Key.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
manage-bde -protectors C: -get
Loading

0 comments on commit dd8d39e

Please sign in to comment.