Add connect-on-launch and notarized desktop release packaging

This commit is contained in:
2026-10-30 22:25:03 +08:00
parent 87f82e2c47
commit d5689ce70d
6 changed files with 68 additions and 7 deletions
+2 -2
View File
@@ -48,7 +48,7 @@ func TestNormalizeTarget(t *testing.T) {
func TestConfigRoundTrip(t *testing.T) {
dir := t.TempDir()
path := filepath.Join(dir, "config.json")
cfg := &Config{API: "https://tunnel.example", Routes: map[string]Route{}}
cfg := &Config{API: "https://tunnel.example", AutoConnect: true, Routes: map[string]Route{}}
if err := cfg.AddRoute("api", "4096", ""); err != nil {
t.Fatal(err)
}
@@ -66,7 +66,7 @@ func TestConfigRoundTrip(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if loaded.API != cfg.API || loaded.Routes["api"].Target != "127.0.0.1:4096" {
if loaded.API != cfg.API || !loaded.AutoConnect || loaded.Routes["api"].Target != "127.0.0.1:4096" {
t.Errorf("round trip: %+v", loaded)
}
}
+1
View File
@@ -31,6 +31,7 @@ type Config struct {
Hostname string `json:"hostname,omitempty"`
Token string `json:"token,omitempty"`
CertificateExpiry string `json:"certificate_expiry,omitempty"`
AutoConnect bool `json:"auto_connect,omitempty"`
Routes map[string]Route `json:"routes,omitempty"`
}