auto updating
Robert Ismo me@robertismo.com
Thu, 25 Jun 2026 07:35:44 -0500
10 files changed,
65 insertions(+),
17 deletions(-)
M
Makefile
→
Makefile
@@ -1,11 +1,41 @@
-allplatforms := 'darwin,darwin/amd64,darwin/arm64,darwin/universal,linux,linux/amd64,linux/arm64,linux/arm,windows,windows/amd64,windows/arm64,windows/386' -supported := 'darwin,darwin/amd64,darwin/arm64,darwin/universal,linux,linux/amd64,windows,windows/amd64,windows/arm64,windows/386' +BINARY := EMessage +BUILD_FLAGS := -v 2 -tags webkit2_41,erelease,eclient +BUILD_DIR := $(CURDIR)/build/bin + +.PHONY: darwin-amd64 darwin-arm64 darwin-universal linux-amd64 linux-arm64 windows-amd64 windows-arm64 windows-386 +.PHONY: build macbuild dev clean -build: - go build -tags edev,eserver -o build/bin/server . - wails build -v 2 -tags webkit2_41,edev,eclient -platform $(supported) +build: linux-amd64 windows-amd64 +macbuild: darwin-amd64 darwin-arm64 darwin-universal +release: + scp -r public/* machinetele.com:/srv/www/updater.machinetele.com/EMessage/ + dev: - go build -tags edev,eserver -o build/bin/server . wails dev -tags webkit2_41,edev,eclient -.PHONY: build dev +darwin-amd64: + wails build $(BUILD_FLAGS) -platform darwin/amd64 -o $(BINARY)/darwin-amd64 + +darwin-arm64: + wails build $(BUILD_FLAGS) -platform darwin/arm64 -o $(BINARY)/darwin-arm64 + +darwin-universal: + wails build $(BUILD_FLAGS) -platform darwin/universal -o $(BINARY)/darwin-universal + +linux-amd64: + wails build $(BUILD_FLAGS) -platform linux/amd64 -o $(BINARY)/linux-amd64 + +linux-arm64: + wails build $(BUILD_FLAGS) -platform linux/arm64 -o $(BINARY)/linux-arm64 + +windows-amd64: + wails build $(BUILD_FLAGS) -platform windows/amd64 -o $(BINARY)/windows-amd64 + +windows-arm64: + wails build $(BUILD_FLAGS) -platform windows/arm64 -o $(BINARY)/windows-arm64 + +windows-386: + wails build $(BUILD_FLAGS) -platform windows/386 -o $(BINARY)/windows-386 + +clean: + rm -rf $(BUILD_DIR)
M
app.go
→
app.go
@@ -7,6 +7,7 @@ "github.com/adrg/xdg"
"gorm.io/driver/sqlite" "gorm.io/gorm" "gorm.io/gorm/logger" + "github.com/sanbornm/go-selfupdate/selfupdate" "gorm.io/gorm/clause" )@@ -41,6 +42,20 @@ Stdout()
defer app.Log("Startup finished."). Stdout() app.ctx = ctx + updater := &selfupdate.Updater{ + CurrentVersion: app.GetVersion(), + ApiURL: "https://updater.machinetele.com", + BinURL: "https://updater.machinetele.com", + Dir: "update/", + CmdName: app.GetTitle(), + ForceCheck: true, + CheckTime: 1, + RandomizeTime: 0, + OnSuccessfulUpdate: func() { + app.Log("Successfully updated to the newest version of EMessage.").Stdout().StatusLine() + }, + } + go updater.BackgroundRun() app.EstablishMailConnections() return }
M
conversation.go
→
conversation.go
@@ -50,10 +50,7 @@ }
if len(msg.MessageContents) > 0 { s := string(msg.MessageContents[0].Content) - runes := []rune(s) - if len(runes) > 100 { - s = string(runes[:100]) + "..." - } + // runes := []rune(s) return s } return ""
M
development.go
→
development.go
@@ -8,6 +8,6 @@
var ( EMessageRemoteServerAddress = "localhost:8080" EMessageVersionHistory = []string{ - "prerelease 1 . 1", + "dev", } )
M
frontend/src/lib/components/ConversationPreview.svelte
→
frontend/src/lib/components/ConversationPreview.svelte
@@ -45,11 +45,11 @@ <div class="h-16 flex items-center text-{color} bg-{bgColor} gap-1 p-2 rounded-md"
onclick={click_handler}> <div class="w-2 aspect-square rounded-full bg-{readColor}"></div> <DisplayImage target={conversation} /> - <div class="flex w-full place-self-start flex-col"> + <div class="flex w-full place-self-start flex-col overflow-hidden h-full"> <div class="flex justify-between text-[10px]"> <h4 class="font-bold text-ellipsis">{subject}</h4> <span class="text-nowrap">{time}</span> </div> - <p class="text-[8px]">{text}</p> + <p class="text-[8px] text-wrap text-ellipsis break-all">{text}</p> </div> </div>
M
frontend/src/lib/components/Message.svelte
→
frontend/src/lib/components/Message.svelte
@@ -6,7 +6,7 @@ const color = sent ? "text-primary" : "text-inverted";
const bg = sent ? "bg-inverted" : (message.Internal ? "bg-emessage-message" : "bg-external-message"); </script> -<div class="{side} {color} {bg} p-2 rounded-lg w-fit" hidden={message.Hidden}> +<div class="{side} {color} {bg} p-2 rounded-lg max-w-96 break-all w-fit" hidden={message.Hidden}> {#each message.MessageContents as content} {#if content.MIMEType === "text/plain"} {atob(content.Content)}
M
go.mod
→
go.mod
@@ -8,6 +8,7 @@ github.com/emersion/go-imap/v2 v2.0.0-beta.8
github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 github.com/emersion/go-smtp v0.24.0 github.com/google/uuid v1.6.0 + github.com/sanbornm/go-selfupdate v0.0.0-20230714125711-e1c03e3d6ac7 github.com/wailsapp/wails/v2 v2.12.0 github.com/zalando/go-keyring v0.2.8 gorm.io/driver/sqlite v1.6.0@@ -25,6 +26,7 @@ github.com/gorilla/websocket v1.5.3 // indirect
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect + github.com/kr/binarydist v0.1.0 // indirect github.com/labstack/echo/v4 v4.13.3 // indirect github.com/labstack/gommon v0.4.2 // indirect github.com/leaanthony/go-ansi-parser v1.6.1 // indirect
M
go.sum
→
go.sum
@@ -30,6 +30,8 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/kr/binarydist v0.1.0 h1:6kAoLA9FMMnNGSehX0s1PdjbEaACznAv/W219j2uvyo= +github.com/kr/binarydist v0.1.0/go.mod h1:DY7S//GCoz1BCd0B0EVrinCKAZN3pXe+MDaIZbXQVgM= github.com/labstack/echo/v4 v4.13.3 h1:pwhpCPrTl5qry5HRdM5FwdXnhXSLSY+WE+YQSeCaafY= github.com/labstack/echo/v4 v4.13.3/go.mod h1:o90YNEeQWjDozo584l7AwhJMHN0bOC4tAfg+Xox9q5g= github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=@@ -65,6 +67,8 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/samber/lo v1.49.1 h1:4BIFyVfuQSEpluc7Fua+j1NolZHiEHEpaSEKdsH0tew= github.com/samber/lo v1.49.1/go.mod h1:dO6KHFzUKXgP8LDhU0oI8d2hekjXnGOu0DB8Jecxd6o= +github.com/sanbornm/go-selfupdate v0.0.0-20230714125711-e1c03e3d6ac7 h1:gm8c4AGd1rHqUsWJQHCjJlAg7yEcgzwyHhWbspPk9HI= +github.com/sanbornm/go-selfupdate v0.0.0-20230714125711-e1c03e3d6ac7/go.mod h1:aCbVFjQ5FBm4o5D/JVxc8AtWfGgDYnDXgySPJf91ozU= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
M
release.go
→
release.go
@@ -7,6 +7,6 @@
var ( EMessageRemoteServerAddress = "https://emessage.machinetele.com" EMessageVersionHistory = []string{ - "v0.0.0", + "prerelease.1", } )