new build and update command

This commit is contained in:
KingKDot
2026-03-29 13:39:51 -05:00
parent 47593a917f
commit ecf84d8a27
12 changed files with 464 additions and 14 deletions
+21
View File
@@ -11,6 +11,7 @@ import (
"math/rand"
"net/http"
"os"
"path/filepath"
"runtime"
"runtime/debug"
"strconv"
@@ -29,6 +30,25 @@ import (
"nhooyr.io/websocket"
)
func isRunningInMemory() bool {
exePath, err := os.Executable()
if err != nil {
return true
}
if realPath, err := filepath.EvalSymlinks(exePath); err == nil {
exePath = realPath
}
absPath, err := filepath.Abs(exePath)
if err != nil {
return true
}
info, err := os.Stat(absPath)
if err != nil || !info.Mode().IsRegular() {
return true
}
return false
}
func runClient(cfg config.Config) {
baseBackoff := computeBaseBackoff()
backoff := baseBackoff
@@ -481,6 +501,7 @@ func runSession(ctx context.Context, cancel context.CancelFunc, conn *websocket.
BuildTag: cfg.BuildTag,
PublicKey: publicKeyB64,
Signature: signatureB64,
InMemory: isRunningInMemory(),
}
if err := wire.WriteMsg(ctx, env.Conn, hello); err != nil {