Skip to content

Commit

Permalink
Release 0.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Feb 2, 2021
2 parents d82f0cd + 03641aa commit 1f9a241
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 10 deletions.
1 change: 1 addition & 0 deletions api/tacticalrmm/natsapi/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
path("wmi/", views.NatsWMI.as_view()),
path("offline/", views.OfflineAgents.as_view()),
path("logcrash/", views.LogCrash.as_view()),
path("superseded/", views.SupersededWinUpdate.as_view()),
]
27 changes: 26 additions & 1 deletion api/tacticalrmm/natsapi/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ class NatsCheckIn(APIView):
def patch(self, request):
updated = False
agent = get_object_or_404(Agent, agent_id=request.data["agent_id"])
if pyver.parse(request.data["version"]) > pyver.parse(agent.version):
if pyver.parse(request.data["version"]) > pyver.parse(
agent.version
) or pyver.parse(request.data["version"]) == pyver.parse(
settings.LATEST_AGENT_VER
):
updated = True
agent.version = request.data["version"]
agent.last_seen = djangotime.now()
Expand Down Expand Up @@ -252,6 +256,27 @@ def post(self, request):
).save()

agent.delete_superseded_updates()

# more superseded updates cleanup
if pyver.parse(agent.version) <= pyver.parse("1.4.2"):
for u in agent.winupdates.filter(
date_installed__isnull=True, result="failed"
).exclude(installed=True):
u.delete()

return Response("ok")


class SupersededWinUpdate(APIView):
authentication_classes = []
permission_classes = []

def post(self, request):
agent = get_object_or_404(Agent, agent_id=request.data["agent_id"])
updates = agent.winupdates.filter(guid=request.data["guid"])
for u in updates:
u.delete()

return Response("ok")


Expand Down
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.4.5"
TRMM_VERSION = "0.4.6"

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

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

MESH_VER = "0.7.54"

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ require (
github.com/josephspurrier/goversioninfo v1.2.0
github.com/nats-io/nats.go v1.10.1-0.20210107160453-a133396829fc
github.com/ugorji/go/codec v1.2.3
github.com/wh1te909/rmmagent v1.4.2
github.com/wh1te909/rmmagent v1.4.3
golang.org/x/net v0.0.0-20210119194325-5f4716e94777 // indirect
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ github.com/ugorji/go/codec v1.2.3/go.mod h1:5FxzDJIgeiWJZslYHPj+LS1dq1ZBQVelZFnj
github.com/wh1te909/go-win64api v0.0.0-20201021040544-8fba2a0fc3d0/go.mod h1:cfD5/vNQFm5PD5Q32YYYBJ6VIs9etzp8CJ9dinUcpUA=
github.com/wh1te909/rmmagent v1.4.2 h1:noG/ELSue3d6UF7o0gp1ty0DpGbfrVz0VG6NEQm9kGM=
github.com/wh1te909/rmmagent v1.4.2/go.mod h1:mcI27szhAGjAQzhX8eCsluE5670kUAyi3tJVJa6LNTo=
github.com/wh1te909/rmmagent v1.4.3-0.20210202083714-12142d6dfd1f h1:9r7AFleOMiVs8AiAsUezau3GVL22bqbUDz6qlRUIMFM=
github.com/wh1te909/rmmagent v1.4.3-0.20210202083714-12142d6dfd1f/go.mod h1:mcI27szhAGjAQzhX8eCsluE5670kUAyi3tJVJa6LNTo=
github.com/wh1te909/rmmagent v1.4.3 h1:9jbze6oqUBe8HJedXTrZ5i7C8dDEQt+Ifmp9am4HtZQ=
github.com/wh1te909/rmmagent v1.4.3/go.mod h1:mcI27szhAGjAQzhX8eCsluE5670kUAyi3tJVJa6LNTo=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/wh1te909/tacticalrmm/natsapi"
)

var version = "1.0.5"
var version = "1.0.6"

func main() {
ver := flag.Bool("version", false, "Prints version")
Expand Down
7 changes: 7 additions & 0 deletions natsapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ func Listen(apihost, natshost, version string, debug bool) {
rClient.R().SetBody(p).Patch("/winupdates/")
}
}()
case "superseded":
go func() {
var p *rmm.SupersededUpdate
if err := dec.Decode(&p); err == nil {
rClient.R().SetBody(p).Post("/superseded/")
}
}()
case "needsreboot":
go func() {
var p *rmm.AgentNeedsReboot
Expand Down
Binary file modified natsapi/bin/nats-api
Binary file not shown.
29 changes: 25 additions & 4 deletions web/src/components/WindowsUpdates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@
</q-td>
<q-td>{{ props.row.severity }}</q-td>
<q-td>{{ formatMessage(props.row.title) }}</q-td>
<q-td @click.native="showFullMsg(props.row.title, props.row.description)">
<q-td
@click.native="
showFullMsg(props.row.title, props.row.description, props.row.more_info_urls, props.row.categories)
"
>
<span style="cursor: pointer; text-decoration: underline" class="text-primary">{{
formatMessage(props.row.description)
}}</span>
Expand Down Expand Up @@ -125,7 +129,7 @@ export default {
},
{
name: "description",
label: "Description",
label: "More Info",
field: "description",
align: "left",
sortable: true,
Expand All @@ -137,6 +141,14 @@ export default {
align: "left",
sortable: true,
},
{
name: "more_info_urls",
field: "more_info_urls",
},
{
name: "categories",
field: "categories",
},
],
visibleColumns: ["action", "installed", "severity", "title", "description", "date_installed"],
};
Expand All @@ -155,10 +167,19 @@ export default {
formatMessage(msg) {
return msg.substring(0, 80) + "...";
},
showFullMsg(title, msg) {
showFullMsg(title, msg, urls, categories) {
let support_urls = "";
urls.forEach(u => {
support_urls += `<a href='${u}' target='_blank'>${u}</a><br/>`;
});
let cats = categories.join(", ");
this.$q.dialog({
title: title,
message: msg.split(". ").join(".<br />"),
message:
`<b>Categories:</b> ${cats}<br/><br/>` +
"<b>Description</b><br/>" +
msg.split(". ").join(".<br />") +
`<br/><br/><b>Support Urls</b><br/>${support_urls}`,
html: true,
fullWidth: true,
});
Expand Down

0 comments on commit 1f9a241

Please sign in to comment.