update tm bundle fetch, fix desktop joiners

This commit is contained in:
kulikov0 committed 2026-06-25 22:34:30 +02:00
1 parent 6afdbd901a
commit c62aa89d4c
8 files changed
+49 -4

No files matched your search

@@ -0,0 +1,4 @@
kotlin version: 2.0.21
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready
+11 -3
View File
@@ -57,10 +57,18 @@ func fetchConfig() (TMConfig, error) {
return cfg, fmt.Errorf("failed to fetch bundle: %w", err) return cfg, fmt.Errorf("failed to fetch bundle: %w", err)
} }
sdkVerRe := regexp.MustCompile(`goloom-sdk\.(\d+\.\d+\.\d+)\.js`) sdkVerPatterns := []*regexp.Regexp{
if m := sdkVerRe.FindSubmatch(bundle); m != nil { regexp.MustCompile(`goloom_sdk_version:"(\d+\.\d+\.\d+)"`),
regexp.MustCompile(`"@yandex-video-platform/goloom-sdk":"(\d+\.\d+\.\d+)"`),
regexp.MustCompile(`goloom-sdk\.(\d+\.\d+\.\d+)\.js`),
}
for _, re := range sdkVerPatterns {
if m := re.FindSubmatch(bundle); m != nil {
cfg.SDKVersion = string(m[1]) cfg.SDKVersion = string(m[1])
} else { break
}
}
if cfg.SDKVersion == "" {
return cfg, fmt.Errorf("goloom SDK version not found in bundle") return cfg, fmt.Errorf("goloom SDK version not found in bundle")
} }
+11
View File
@@ -170,6 +170,10 @@ func (t *Tunnel) AddBypassIP(ip net.IP) error {
} }
addr := v4.String() addr := v4.String()
t.mu.Lock() t.mu.Lock()
if t.stopped {
t.mu.Unlock()
return nil
}
if _, dup := t.bypass[addr]; dup { if _, dup := t.bypass[addr]; dup {
t.mu.Unlock() t.mu.Unlock()
return nil return nil
@@ -183,6 +187,13 @@ func (t *Tunnel) AddBypassIP(ip net.IP) error {
return fmt.Errorf("desktoptun: add bypass %s via %s: %w", addr, gw, err) return fmt.Errorf("desktoptun: add bypass %s via %s: %w", addr, gw, err)
} }
t.mu.Lock() t.mu.Lock()
if t.stopped {
t.mu.Unlock()
if _, err := runCmd("route", "-n", "delete", "-host", addr); err != nil {
t.log("[desktoptun] remove orphaned bypass %s: %v", addr, err)
}
return nil
}
t.bypass[addr] = struct{}{} t.bypass[addr] = struct{}{}
t.mu.Unlock() t.mu.Unlock()
t.log("[desktoptun] bypass %s -> %s", addr, gw) t.log("[desktoptun] bypass %s -> %s", addr, gw)
+11
View File
@@ -168,6 +168,10 @@ func (t *Tunnel) AddBypassIP(ip net.IP) error {
} }
addr := v4.String() addr := v4.String()
t.mu.Lock() t.mu.Lock()
if t.stopped {
t.mu.Unlock()
return nil
}
if _, dup := t.bypass[addr]; dup { if _, dup := t.bypass[addr]; dup {
t.mu.Unlock() t.mu.Unlock()
return nil return nil
@@ -182,6 +186,13 @@ func (t *Tunnel) AddBypassIP(ip net.IP) error {
return fmt.Errorf("desktoptun: add bypass %s via %s: %w", addr, gw, err) return fmt.Errorf("desktoptun: add bypass %s via %s: %w", addr, gw, err)
} }
t.mu.Lock() t.mu.Lock()
if t.stopped {
t.mu.Unlock()
if _, err := runCmd("ip", "route", "del", addr+"/32"); err != nil {
t.log("[desktoptun] remove orphaned bypass %s: %v", addr, err)
}
return nil
}
t.bypass[addr] = struct{}{} t.bypass[addr] = struct{}{}
t.mu.Unlock() t.mu.Unlock()
t.log("[desktoptun] bypass %s -> %s", addr, gw) t.log("[desktoptun] bypass %s -> %s", addr, gw)
+11
View File
@@ -192,6 +192,10 @@ func (t *Tunnel) AddBypassIP(ip net.IP) error {
} }
addr := v4.String() addr := v4.String()
t.mu.Lock() t.mu.Lock()
if t.stopped {
t.mu.Unlock()
return nil
}
if _, dup := t.bypass[addr]; dup { if _, dup := t.bypass[addr]; dup {
t.mu.Unlock() t.mu.Unlock()
return nil return nil
@@ -205,6 +209,13 @@ func (t *Tunnel) AddBypassIP(ip net.IP) error {
return fmt.Errorf("desktoptun: add bypass %s via %s: %w", addr, gw, err) return fmt.Errorf("desktoptun: add bypass %s via %s: %w", addr, gw, err)
} }
t.mu.Lock() t.mu.Lock()
if t.stopped {
t.mu.Unlock()
if err := deleteHostRoute(addr); err != nil {
t.log("[desktoptun] remove orphaned bypass %s: %v", addr, err)
}
return nil
}
t.bypass[addr] = struct{}{} t.bypass[addr] = struct{}{}
t.mu.Unlock() t.mu.Unlock()
t.log("[desktoptun] bypass %s -> %s", addr, gw) t.log("[desktoptun] bypass %s -> %s", addr, gw)
@@ -398,7 +398,7 @@ func (j *TelemostHeadlessJoiner) sendHello() {
"participantId": j.peerID, "roomId": j.roomID, "participantId": j.peerID, "roomId": j.roomID,
"serviceName": j.serviceName, "credentials": j.credentials, "serviceName": j.serviceName, "credentials": j.credentials,
"capabilitiesOffer": tmapi.CapabilitiesOffer, "capabilitiesOffer": tmapi.CapabilitiesOffer,
"sdkInfo": map[string]interface{}{"implementation": "browser", "version": "5.27.0", "userAgent": common.UserAgent, "hwConcurrency": 8}, "sdkInfo": map[string]interface{}{"implementation": "browser", "version": "6.0.0", "userAgent": common.UserAgent, "hwConcurrency": 8},
"sdkInitializationId": uuid.New().String(), "sdkInitializationId": uuid.New().String(),
"disablePublisher": false, "disableSubscriber": false, "disableSubscriberAudio": false, "disablePublisher": false, "disableSubscriber": false, "disableSubscriberAudio": false,
}, },