The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): drop the HERMES_DESKTOP_FEED_BASE_URL fallback
ethernet56d1414daf6e
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.tsindex 2e94ed26edb..7fd2dbb9c8e 100644--- a/apps/desktop/electron/main.ts+++ b/apps/desktop/electron/main.ts@@ -3400,14 +3400,11 @@ function resolveCheckoutUpdateStrategy(): UpdaterStrategy {/*** The App Installer feed base URL for a bundled MSIX install: config.yaml's- * `updates.desktop_feed_base_url`, then HERMES_DESKTOP_FEED_BASE_URL, then- * Windows' registered App Installer source when no override is set.+ * `updates.desktop_feed_base_url`, else Windows' registered App Installer+ * source.*/function resolveDesktopFeedBaseUrl(): string {- return resolveFeedBaseUrl(- readUpdatesFeedBaseFromConfig(path.join(HERMES_HOME, 'config.yaml')),- process.env.HERMES_DESKTOP_FEED_BASE_URL- )+ return resolveFeedBaseUrl(readUpdatesFeedBaseFromConfig(path.join(HERMES_HOME, 'config.yaml')))}/** The updater channel from the baked install stamp ('canary' vs 'stable'). */diff --git a/apps/desktop/electron/updater/feed-config.test.ts b/apps/desktop/electron/updater/feed-config.test.tsindex 5a64cb0a97d..f37b0c86cda 100644--- a/apps/desktop/electron/updater/feed-config.test.ts+++ b/apps/desktop/electron/updater/feed-config.test.ts@@ -57,21 +57,17 @@ it('leaves fallback selection available for missing, invalid or non-string confi}})-it('holds a configured or env feed base to the update-origin rule and refuses the rest', (): void => {- expect(resolveFeedBaseUrl('', undefined)).toBe('')- expect(resolveFeedBaseUrl('', ' ')).toBe('')- expect(resolveFeedBaseUrl('https://mirror.example/updates', 'http://evil.example/feed')).toBe(- 'https://mirror.example/updates'- )- expect(resolveFeedBaseUrl('', 'https://mirror.example/updates')).toBe('https://mirror.example/updates')- expect(resolveFeedBaseUrl('', 'http://127.0.0.1:8443/feed')).toBe('http://127.0.0.1:8443/feed')+it('holds a configured feed base to the update-origin rule and refuses the rest', (): void => {+ expect(resolveFeedBaseUrl('')).toBe('')+ expect(resolveFeedBaseUrl(' ')).toBe('')+ expect(resolveFeedBaseUrl('https://mirror.example/updates')).toBe('https://mirror.example/updates')+ expect(resolveFeedBaseUrl('http://127.0.0.1:8443/feed')).toBe('http://127.0.0.1:8443/feed')for (const bad of ['http://evil.example/feed','https://user:[email protected]/feed','https://mirror.example/../feed']) {- expect((): string => resolveFeedBaseUrl(bad, undefined)).toThrow()- expect((): string => resolveFeedBaseUrl('', bad)).toThrow()+ expect((): string => resolveFeedBaseUrl(bad)).toThrow()}})diff --git a/apps/desktop/electron/updater/feed-config.ts b/apps/desktop/electron/updater/feed-config.tsindex be1a74743b2..12bfa226b24 100644--- a/apps/desktop/electron/updater/feed-config.ts+++ b/apps/desktop/electron/updater/feed-config.ts@@ -6,16 +6,17 @@ import { channelPublicBase } from './channel-protocol'/*** The feed base a bundled install downloads its update descriptor from:- * config.yaml's `updates.desktop_feed_base_url`, then the env override,- * else '' (the OS-registered App Installer source / no feed). A configured+ * config.yaml's `updates.desktop_feed_base_url`, else '' (the OS-registered+ * App Installer source / no feed). Config is the one override: a second env+ * source would let a stray variable silently redirect updates. A configured* value is held to the same rule as every other update origin* (channelPublicBase: HTTPS or loopback, no credentials/traversal) — the* descriptor is fetched and opened unverified, so a plain-http base would* hand a network attacker the update source. Throws on a bad value rather* than silently falling back, so the misconfiguration is named.*/-export function resolveFeedBaseUrl(configured: string, envOverride: string | undefined): string {- const value: string = configured || (envOverride ?? '').trim()+export function resolveFeedBaseUrl(configured: string): string {+ const value: string = configured.trim()if (!value) {return ''@@ -45,7 +46,7 @@ export function readUpdatesFeedBaseFromConfig(configPath: string): string {return typeof value === 'string' ? value.trim() : ''} catch {- // An absent/unreadable override leaves environment and registered feeds eligible.+ // An absent/unreadable override leaves the registered feed eligible.return ''}}diff --git a/tests/install/windows-bundled-e2e.ps1 b/tests/install/windows-bundled-e2e.ps1index 72383f1c18a..569bd9f3cad 100644--- a/tests/install/windows-bundled-e2e.ps1+++ b/tests/install/windows-bundled-e2e.ps1@@ -19,7 +19,6 @@ $env:HERMES_DESKTOP_USER_DATA_DIR = Join-Path $Work 'electron-user-data'$env:HOME = Join-Path $Work 'os-home'New-Item -ItemType Directory -Path $env:HOME | Out-Null. (Join-Path $Assets 'desktop-smoke-windows.ps1')-$env:HERMES_DESKTOP_FEED_BASE_URL = ''$Node = if ($env:HERMES_E2E_NODE) { $env:HERMES_E2E_NODE } else { (Get-Command node.exe).Source }function Run-Node([string[]]$Argv) {& $Node @Argv