Skip to content

The agent that grows with you

feat(desktop): Web Access settings pane to serve the Webapp on your network or your own URL

IAvecillab3261b1b90e0
diff --git a/apps/desktop/electron/connection-config.ts b/apps/desktop/electron/connection-config.ts
index 7b691bb18a1..0040eb9028f 100644
--- a/apps/desktop/electron/connection-config.ts
+++ b/apps/desktop/electron/connection-config.ts
@@ -706,7 +706,11 @@ const LOCAL_PRIMARY_SCOPED_ROUTES = new Set([
'PUT /api/dashboard/theme',
'GET /api/dashboard/font',
'PUT /api/dashboard/font',
- 'GET /api/dashboard/plugins'
+ 'GET /api/dashboard/plugins',
+ // Web Access: each handler takes `?profile=` and acts on the gateway serving it.
+ 'GET /api/webapp-access/status',
+ 'POST /api/webapp-access/start',
+ 'POST /api/webapp-access/stop'
])
function localPrimaryRequestScope(opts: ProfileRouteOptions): boolean | null {
diff --git a/apps/desktop/src/api/webapp-access.ts b/apps/desktop/src/api/webapp-access.ts
new file mode 100644
index 00000000000..38d6609eeb4
--- /dev/null
+++ b/apps/desktop/src/api/webapp-access.ts
@@ -0,0 +1,41 @@
+import { hermesApi, profileScoped } from './client'
+
+// Web access: turn on the Webapp the gateway on THIS machine serves, for other devices, behind Nous
+// sign-in. The backend owns every fact here; the pane renders /status and asks for changes.
+
+export type WebAccessMode = 'lan' | 'public'
+
+export interface WebAccessStatus {
+ /** `webapp.enabled` in the serving gateway's config: what it serves from its next start. */
+ enabled: boolean
+ /** What the gateway serves now; `stopped` when none answers. */
+ gateway: { reason: null | string; state: 'off' | 'serving' | 'stopped' | 'unavailable'; url: null | string }
+ lan_address: null | string
+ mode: null | WebAccessMode
+ nous_signed_in: boolean
+ port: number
+ public_url: string
+}
+
+/** Start/stop save the config and restart the gateway; a refused restart keeps the config. */
+export interface WebAccessChange extends WebAccessStatus {
+ restart_error?: string
+ restart_started: boolean
+}
+
+export function getWebAccessStatus(): Promise<WebAccessStatus> {
+ return hermesApi<WebAccessStatus>({ ...profileScoped(), path: '/api/webapp-access/status' })
+}
+
+export function startWebAccess(mode: WebAccessMode, publicUrl?: string): Promise<WebAccessChange> {
+ return hermesApi<WebAccessChange>({
+ ...profileScoped(),
+ body: { mode, public_url: publicUrl },
+ method: 'POST',
+ path: '/api/webapp-access/start'
+ })
+}
+
+export function stopWebAccess(): Promise<WebAccessChange> {
+ return hermesApi<WebAccessChange>({ ...profileScoped(), method: 'POST', path: '/api/webapp-access/stop' })
+}
diff --git a/apps/desktop/src/app/settings/index.tsx b/apps/desktop/src/app/settings/index.tsx
index f550dae314b..5831afbbbd8 100644
--- a/apps/desktop/src/app/settings/index.tsx
+++ b/apps/desktop/src/app/settings/index.tsx
@@ -18,6 +18,7 @@ import {
Info,
Keyboard,
KeyRound,
+ Network,
RefreshCw,
Search,
Settings2,
@@ -68,11 +69,13 @@ import { SettingsSubpageHeader } from './subpage-navigation'
import { resolveSettingsSubpage, settingsSubpageIcon, settingsSubpages } from './subpages'
import type { SettingsPageProps, SettingsView as SettingsViewId } from './types'
import { vaultOwnerKey, VaultSettings } from './vault-settings'
+import { useWebAccessAvailable, WebAccessSettings } from './web-access-settings'
const SETTINGS_VIEWS: readonly SettingsViewId[] = [
...SECTIONS.map(s => `config:${s.id}` as SettingsViewId),
'providers',
'gateway',
+ 'web-access',
// Legacy alias: the Connections page merged into Gateways. Kept in the enum
// so saved `?tab=connections` deep links still resolve (redirected below).
'connections',
@@ -241,6 +244,8 @@ export function SettingsView({ onClose, onConfigSaved, onMainModelChanged }: Set
}
}
+ const webAccessAvailable = useWebAccessAvailable()
+
const navGroups: OverlayNavGroup[] = useMemo(
() =>
(
@@ -360,6 +365,18 @@ export function SettingsView({ onClose, onConfigSaved, onMainModelChanged }: Set
label: t.settings.nav.gateway,
onSelect: () => setActiveView('gateway')
},
+ // Serving the Webapp from THIS machine: only the native app on its local connection.
+ ...(webAccessAvailable
+ ? [
+ {
+ active: activeView === 'web-access',
+ icon: Network,
+ id: 'web-access',
+ label: t.settings.gateway.webAccess.title,
+ onSelect: () => setActiveView('web-access')
+ }
+ ]
+ : []),
{
active: activeView === 'keybinds',
icon: Keyboard,
@@ -441,6 +458,7 @@ export function SettingsView({ onClose, onConfigSaved, onMainModelChanged }: Set
providerView,
subpage,
t,
+ webAccessAvailable,
setActiveView,
openProviderView,
openKeysView,
@@ -560,6 +578,8 @@ export function SettingsView({ onClose, onConfigSaved, onMainModelChanged }: Set
<KeysSettings view={keysView} />
) : activeView === 'billing' ? (
<BillingSettings />
+ ) : activeView === 'web-access' ? (
+ <WebAccessSettings />
) : activeView === 'plugins' ? (
<PluginSettingsPane
entries={plugins.entries}
diff --git a/apps/desktop/src/app/settings/types.ts b/apps/desktop/src/app/settings/types.ts
index b266cdf1afc..eafc271a4db 100644
--- a/apps/desktop/src/app/settings/types.ts
+++ b/apps/desktop/src/app/settings/types.ts
@@ -16,6 +16,7 @@ export type SettingsView =
| 'providers'
| 'sessions'
| 'vault'
+ | 'web-access'
| `config:${string}`
export type EnvPatch = Partial<Pick<EnvVarInfo, 'is_set' | 'redacted_value'>>
diff --git a/apps/desktop/src/app/settings/web-access-settings.test.tsx b/apps/desktop/src/app/settings/web-access-settings.test.tsx
new file mode 100644
index 00000000000..4753996dfb1
--- /dev/null
+++ b/apps/desktop/src/app/settings/web-access-settings.test.tsx
@@ -0,0 +1,90 @@
+vi.mock('@/store/profile', async (): Promise<object> => {
+ const { atom } = await import('nanostores')
+
+ return {
+ $activeGatewayProfile: atom<string>('default'),
+ $profiles: atom<Array<{ name: string; is_default?: boolean }>>([]),
+ normalizeProfileKey: (profile: string | null): string => profile || 'default'
+ }
+})
+vi.mock('@/hermes', () => ({
+ getProfiles: vi.fn(async () => ({ profiles: [] })),
+ getWebAccessStatus: vi.fn(),
+ setApiRequestProfile: vi.fn(),
+ startWebAccess: vi.fn(),
+ stopWebAccess: vi.fn()
+}))
+
+import { QueryClientProvider } from '@tanstack/react-query'
+import { cleanup, render, screen } from '@testing-library/react'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+
+import type { WebAccessStatus } from '@/api/webapp-access'
+import * as hermes from '@/hermes'
+import { I18nProvider } from '@/i18n'
+import { queryClient } from '@/lib/query-client'
+
+import { WebAccessSettings } from './web-access-settings'
+
+const mocked = vi.mocked(hermes)
+
+const OFF: WebAccessStatus = {
+ enabled: false,
+ gateway: { reason: null, state: 'off', url: null },
+ lan_address: '192.168.1.50',
+ mode: null,
+ nous_signed_in: true,
+ port: 9120,
+ public_url: ''
+}
+
+function renderPane(status: WebAccessStatus) {
+ mocked.getWebAccessStatus.mockResolvedValue(status)
+
+ return render(
+ <QueryClientProvider client={queryClient}>
+ <I18nProvider>
+ <WebAccessSettings />
+ </I18nProvider>
+ </QueryClientProvider>
+ )
+}
+
+beforeEach(() => queryClient.clear())
+
+afterEach(() => {
+ cleanup()
+ vi.clearAllMocks()
+})
+
+describe('WebAccessSettings', () => {
+ it('offers Start only with a Nous account to sign in with', async () => {
+ const signedOut = renderPane({ ...OFF, nous_signed_in: false })
+
+ expect((await screen.findByRole('button', { name: 'Start' })).hasAttribute('disabled')).toBe(true)
+ signedOut.unmount()
+ queryClient.clear()
+ renderPane(OFF)
+
+ expect((await screen.findByRole('button', { name: 'Start' })).hasAttribute('disabled')).toBe(false)
+ })
+
+ it('says why the gateway cannot serve a turned-on web app', async () => {
+ renderPane({
+ ...OFF,
+ enabled: true,
+ gateway: { reason: 'port 9120 is in use', state: 'unavailable', url: null },
+ mode: 'lan'
+ })
+
+ expect(await screen.findByText(/port 9120 is in use/)).toBeTruthy()
+ })
+
+ it('never reports a web app the gateway still serves as stopped', async () => {
+ // Stop saved `enabled: false`, but the gateway refused to restart: it still serves the web app.
+ renderPane({ ...OFF, gateway: { reason: null, state: 'serving', url: 'http://127.0.0.1:9120' } })
+
+ expect(await screen.findByText('Restart needed')).toBeTruthy()
+ expect(screen.queryByText('Stopped')).toBeNull()
+ })
+})
diff --git a/apps/desktop/src/app/settings/web-access-settings.tsx b/apps/desktop/src/app/settings/web-access-settings.tsx
new file mode 100644
index 00000000000..e2fa6bdcef2
--- /dev/null
+++ b/apps/desktop/src/app/settings/web-access-settings.tsx
@@ -0,0 +1,232 @@
+import { useStore } from '@nanostores/react'
+import { useQuery, useQueryClient } from '@tanstack/react-query'
+import { type ReactElement, useState } from 'react'
+
+import { $apiRequestScope } from '@/api/client'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { SegmentedControl } from '@/components/ui/segmented-control'
+import {
+ getWebAccessStatus,
+ startWebAccess,
+ stopWebAccess,
+ type WebAccessChange,
+ type WebAccessMode,
+ type WebAccessStatus
+} from '@/hermes'
+import { useI18n } from '@/i18n'
+import type { WebAccessTranslations } from '@/i18n/types_gateway_host'
+import { ExternalLink } from '@/lib/external-link'
+import { Globe, Loader2, Network } from '@/lib/icons'
+import { isBrowserHostedDesktop } from '@/lib/platform'
+import { notifyError } from '@/store/notifications'
+import { $connection } from '@/store/session'
+
+import { CONTROL_TEXT } from './constants'
+import { ListRow, Pill, SectionHeading, SettingsContent, SettingsSection, SettingsSkeleton } from './primitives'
+
+const START_POLL_MS = 1500
+const START_TIMEOUT_MS = 90_000
+
+/**
+ * The config says what the gateway serves from its next start; the gateway says what it serves now.
+ * `pendingOn`/`pendingOff`: they disagree until the gateway restarts (a refused restart, or one in flight).
+ */
+type Phase = 'off' | 'pendingOff' | 'pendingOn' | 'serving' | 'unavailable'
+
+/** The gateway serves the configured web app: it applied this config, not an earlier one's port. */
+function servesConfig(status: WebAccessStatus): boolean {
+ const { state, url } = status.gateway
+
+ return status.enabled && state === 'serving' && url !== null && new URL(url).port === String(status.port)
+}
+
+function phaseOf(status: WebAccessStatus): Phase {
+ if (!status.enabled) {
+ return status.gateway.state === 'serving' ? 'pendingOff' : 'off'
+ }
+
+ if (servesConfig(status)) {
+ return 'serving'
+ }
+
+ return status.gateway.state === 'unavailable' ? 'unavailable' : 'pendingOn'
+}
+
+/** Poll until the restarted gateway serves the web app or reports why it can't. */
+async function waitForWebApp(): Promise<WebAccessStatus> {
+ for (const deadline = Date.now() + START_TIMEOUT_MS; Date.now() < deadline; ) {
+ await new Promise(resolve => setTimeout(resolve, START_POLL_MS))
+ // The backend answering this may be the gateway being restarted.
+ const status = await getWebAccessStatus().catch(() => null)
+
+ if (status && (servesConfig(status) || status.gateway.state === 'unavailable')) {
+ return status
+ }
+ }
+
+ throw new Error('timeout')
+}
+
+/** Web access serves THIS machine: the native app on its local connection only. */
+export function useWebAccessAvailable(): boolean {
+ const connection = useStore($connection)
+
+ return !isBrowserHostedDesktop() && connection?.mode !== 'remote'
+}
+
+export function WebAccessSettings(): ReactElement {
+ const { t } = useI18n()
+ const w = t.settings.gateway.webAccess
+ const key = ['web-access', JSON.stringify(useStore($apiRequestScope))]
+ const { data: status, error } = useQuery({ queryFn: getWebAccessStatus, queryKey: key, retry: false })
+
+ if (!status) {
+ return error ? <SettingsContent>{w.failed}</SettingsContent> : <SettingsSkeleton sections={[{ rows: 2 }]} />
+ }
+
+ return <WebAccessForm queryKey={key} status={status} w={w} />
+}
+
+type FormProps = { queryKey: readonly unknown[]; status: WebAccessStatus; w: WebAccessTranslations }
+
+function WebAccessForm({ queryKey, status, w }: FormProps): ReactElement {
+ const queryClient = useQueryClient()
+ const [busy, setBusy] = useState<'start' | 'stop' | null>(null)
+ const [mode, setMode] = useState<WebAccessMode>(status.mode ?? 'lan')
+ const [publicUrl, setPublicUrl] = useState(status.public_url)
+ const phase = phaseOf(status)
+ const lanUrl = status.lan_address ? `http://${status.lan_address}:${status.port}` : null
+ const url = status.mode === 'public' ? status.public_url : (lanUrl ?? '')
+ const ready = status.nous_signed_in && (mode === 'lan' ? Boolean(lanUrl) : publicUrl.trim().startsWith('https://'))
+
+ const apply = (next: WebAccessStatus): void => {
+ queryClient.setQueryData(queryKey, next)
+ }
+
+ // Saved either way; a refused restart (a chat is running) applies when the gateway next restarts.
+ const run = async (kind: 'start' | 'stop', change: () => Promise<WebAccessChange>) => {
+ setBusy(kind)
+
+ try {
+ const result = await change()
+ apply(result)
+
+ if (!result.restart_started) {
+ throw new Error(w.restartRefused(result.restart_error ?? ''))
+ }
+
+ if (kind === 'start') {
+ apply(await waitForWebApp().catch(() => Promise.reject(new Error(w.startTimedOut))))
+ }
+ } catch (err) {
+ notifyError(err, w.failed)
+ } finally {
+ setBusy(null)
+ void queryClient.invalidateQueries({ queryKey })
+ }
+ }
+
+ const start = () => void run('start', () => startWebAccess(mode, mode === 'public' ? publicUrl.trim() : undefined))
+ const stop = () => void run('stop', stopWebAccess)
+
+ return (
+ <SettingsContent>
+ <SectionHeading icon={Network} page title={w.title} />
+ <p className="mb-4 text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">{w.intro}</p>
+ <SettingsSection aside={<Pill tone={phase === 'serving' ? 'success' : 'muted'}>{pillLabel(phase, busy, w)}</Pill>} icon={Globe} title={w.title}>
+ <WhereRow
+ lanUrl={lanUrl}
+ locked={phase !== 'off' || busy !== null}
+ mode={mode}
+ onMode={setMode}
+ onPublicUrl={setPublicUrl}
+ port={status.port}
+ publicUrl={publicUrl}
+ w={w}
+ />
+ <ListRow
+ action={
+ <Button
+ disabled={busy !== null || (phase === 'off' && !ready)}
+ onClick={phase === 'off' || phase === 'pendingOn' ? start : stop}
+ size="sm"
+ variant={phase === 'off' ? 'default' : 'outline'}
+ >
+ {busy && <Loader2 className="animate-spin" />}
+ {phase === 'off' ? w.start : phase.startsWith('pending') ? w.restartGateway : w.stop}
+ </Button>
+ }
+ description={describe(phase, status, w)}
+ title={phase === 'serving' ? <ExternalLink href={url} native showExternalIcon>{url}</ExternalLink> : url || w.title}
+ />
+ </SettingsSection>
+ </SettingsContent>
+ )
+}
+
+type WhereProps = {
+ lanUrl: null | string
+ locked: boolean
+ mode: WebAccessMode
+ onMode: (mode: WebAccessMode) => void
+ onPublicUrl: (url: string) => void
+ port: number
+ publicUrl: string
+ w: WebAccessTranslations
+}
+
+function WhereRow({ lanUrl, locked, mode, onMode, onPublicUrl, port, publicUrl, w }: WhereProps): ReactElement {
+ return (
+ <ListRow
+ action={
+ <SegmentedControl
+ disabled={locked}
+ onChange={onMode}
+ options={[
+ { id: 'lan', label: w.modeLan },
+ { id: 'public', label: w.modePublic }
+ ]}
+ value={mode}
+ />
+ }
+ below={
+ mode === 'public' && (
+ <Input
+ className={`${CONTROL_TEXT} mt-3 max-w-sm`}
+ disabled={locked}
+ onChange={event => onPublicUrl(event.target.value)}
+ placeholder="https://hermes.example.com"
+ value={publicUrl}
+ />
+ )
+ }
+ description={mode === 'lan' ? (lanUrl ? w.modeLanDetail(lanUrl) : w.noLan) : w.modePublicDetail(port)}
+ title={mode === 'lan' ? w.modeLan : w.modePublic}
+ />
+ )
+}
+
+function pillLabel(phase: Phase, busy: 'start' | 'stop' | null, w: WebAccessTranslations): string {
+ const labels: Record<Phase, string> = {
+ off: w.stopped,
+ pendingOff: w.restartNeeded,
+ pendingOn: w.restartNeeded,
+ serving: w.running,
+ unavailable: w.unavailable
+ }
+
+ return busy === 'start' ? w.starting : labels[phase]
+}
+
+function describe(phase: Phase, status: WebAccessStatus, w: WebAccessTranslations): string {
+ const descriptions: Record<Phase, string> = {
+ off: status.nous_signed_in ? w.notRunningDetail : w.needsNous,
+ pendingOff: w.pendingOff,
+ pendingOn: w.pendingOn,
+ serving: status.mode === 'public' ? w.runningPublic : w.runningLan,
+ unavailable: w.unavailableDetail(status.gateway.reason ?? '')
+ }
+
+ return descriptions[phase]
+}
diff --git a/apps/desktop/src/hermes.ts b/apps/desktop/src/hermes.ts
index 4a1fd216cab..c274d332b65 100644
--- a/apps/desktop/src/hermes.ts
+++ b/apps/desktop/src/hermes.ts
@@ -30,6 +30,7 @@ export * from './api/sessions'
export * from './api/skills'
export * from './api/system'
export * from './api/toolsets'
+export * from './api/webapp-access'
export type {
ActionResponse,
diff --git a/apps/desktop/src/i18n/ar_settings.ts b/apps/desktop/src/i18n/ar_settings.ts
index bb8d35dcc1b..c8453c54858 100644
--- a/apps/desktop/src/i18n/ar_settings.ts
+++ b/apps/desktop/src/i18n/ar_settings.ts
@@ -707,7 +707,34 @@ export const arSettings = {
signOutFailed: 'فشل تسجيل الخروج',
testFailed: 'فشل اختبار البوابة البعيدة',
applyFailed: 'تعذر تطبيق إعدادات البوابة',
- saveFailed: 'تعذر حفظ إعدادات البوابة'
+ saveFailed: 'تعذر حفظ إعدادات البوابة',
+ webAccess: {
+ title: 'الوصول عبر الويب',
+ intro: 'افتح Hermes الموجود على هذا الحاسوب من هاتفك أو من حاسوب آخر، مع تسجيل الدخول بحساب Nous. من يسجّل الدخول يمكنه تشغيل الأوامر على هذا الحاسوب.',
+ failed: 'تعذّر تغيير الوصول عبر الويب',
+ running: 'قيد التشغيل',
+ stopped: 'متوقف',
+ starting: 'جارٍ البدء',
+ restartNeeded: 'يلزم إعادة التشغيل',
+ unavailable: 'غير متاح',
+ notRunningDetail: 'شغّله لفتح Hermes من جهاز آخر.',
+ needsNous: 'سجّل الدخول إلى حساب Nous من قسم المزوّدين أولًا.',
+ runningLan: 'افتح هذا العنوان على جهاز في الشبكة نفسها.',
+ runningPublic: 'يُقدَّم عبر عنوانك.',
+ pendingOn: 'تم الحفظ. ستقدّم البوابة تطبيق الويب بعد إعادة تشغيلها.',
+ pendingOff: 'تم الإيقاف، لكن البوابة تواصل تقديم تطبيق الويب حتى إعادة تشغيلها.',
+ unavailableDetail: reason => `تعذّر على البوابة تقديم تطبيق الويب: ${reason}`,
+ restartRefused: reason => `تم الحفظ. أعد تشغيل البوابة لتطبيقه: ${reason}`,
+ startTimedOut: 'لم تقدّم البوابة تطبيق الويب خلال 90 ثانية.',
+ start: 'تشغيل',
+ stop: 'إيقاف',
+ restartGateway: 'إعادة تشغيل البوابة',
+ modeLan: 'هذه الشبكة',
+ modeLanDetail: url => `تفتح الأجهزة على شبكة Wi-Fi العنوان ${url}. استخدمه على شبكة تثق بها فقط.`,
+ noLan: 'لا يملك هذا الحاسوب عنوان شبكة يمكن للأجهزة الأخرى الوصول إليه.',
+ modePublic: 'عنواني الخاص',
+ modePublicDetail: port => `عنوان HTTPS تديره بالفعل، مثل Tailscale Serve أو نفق، يحوّل إلى http://127.0.0.1:${port}.`
+ }
},
keys: {
loading: 'جار تحميل مفاتيح API وبيانات الاعتماد...',
diff --git a/apps/desktop/src/i18n/de_gateway_host.ts b/apps/desktop/src/i18n/de_gateway_host.ts
index 68ed6da4fb8..c8b2a4b10e0 100644
--- a/apps/desktop/src/i18n/de_gateway_host.ts
+++ b/apps/desktop/src/i18n/de_gateway_host.ts
@@ -6,5 +6,32 @@ export const deGatewayHost: GatewayHostTranslations = {
unavailableDesc: 'Die Desktop-IPC-Brücke stellt keine Gateway-Einstellungen bereit.',
webappHostTitle: 'Hermes-Host',
webappHostDesc:
- 'Die Webapp nutzt immer den Hermes-Host, der sie ausliefert. Um das Gateway zu wechseln, sich bei Hermes Cloud anzumelden oder gespeicherte Verbindungen zu verwalten, verwenden Sie die Hermes-Desktop-App.'
+ 'Die Webapp nutzt immer den Hermes-Host, der sie ausliefert. Um das Gateway zu wechseln, sich bei Hermes Cloud anzumelden oder gespeicherte Verbindungen zu verwalten, verwenden Sie die Hermes-Desktop-App.',
+ webAccess: {
+ title: 'Webzugriff',
+ intro: 'Öffne Hermes auf diesem Computer vom Handy oder einem anderen Computer aus, angemeldet mit deinem Nous-Konto. Wer sich anmeldet, kann Befehle auf diesem Computer ausführen.',
+ failed: 'Der Webzugriff konnte nicht geändert werden',
+ running: 'Läuft',
+ stopped: 'Gestoppt',
+ starting: 'Wird gestartet',
+ restartNeeded: 'Neustart nötig',
+ unavailable: 'Nicht verfügbar',
+ notRunningDetail: 'Starte ihn, um Hermes von einem anderen Gerät aus zu öffnen.',
+ needsNous: 'Melde dich zuerst unter Anbieter bei deinem Nous-Konto an.',
+ runningLan: 'Öffne diese Adresse auf einem Gerät im selben Netzwerk.',
+ runningPublic: 'Über deine URL bereitgestellt.',
+ pendingOn: 'Gespeichert. Das Gateway stellt die Web-App nach seinem Neustart bereit.',
+ pendingOff: 'Ausgeschaltet, aber das Gateway stellt die Web-App bis zu seinem Neustart weiter bereit.',
+ unavailableDetail: reason => `Das Gateway konnte die Web-App nicht bereitstellen: ${reason}`,
+ restartRefused: reason => `Gespeichert. Starte das Gateway neu, um es anzuwenden: ${reason}`,
+ startTimedOut: 'Das Gateway hat die Web-App nicht innerhalb von 90 Sekunden bereitgestellt.',
+ start: 'Starten',
+ stop: 'Stoppen',
+ restartGateway: 'Gateway neu starten',
+ modeLan: 'Dieses Netzwerk',
+ modeLanDetail: url => `Geräte in deinem WLAN öffnen ${url}. Nur in einem vertrauenswürdigen Netzwerk verwenden.`,
+ noLan: 'Dieser Computer hat keine Netzwerkadresse, die andere Geräte erreichen können.',
+ modePublic: 'Eigene URL',
+ modePublicDetail: port => `Eine HTTPS-Adresse, die du bereits betreibst, etwa Tailscale Serve oder ein Tunnel, die an http://127.0.0.1:${port} weiterleitet.`
+ }
}
diff --git a/apps/desktop/src/i18n/en_gateway_host.ts b/apps/desktop/src/i18n/en_gateway_host.ts
index be00b2a3037..5ec3b9297f3 100644
--- a/apps/desktop/src/i18n/en_gateway_host.ts
+++ b/apps/desktop/src/i18n/en_gateway_host.ts
@@ -6,5 +6,32 @@ export const enGatewayHost: GatewayHostTranslations = {
unavailableDesc: 'Connection settings can only be changed from the Hermes Desktop app on the computer running it.',
webappHostTitle: 'Hermes host',
webappHostDesc:
- 'The Webapp always uses the Hermes host that serves it. To switch gateways, sign in to Hermes Cloud or manage saved connections, use the Hermes Desktop app.'
+ 'The Webapp always uses the Hermes host that serves it. To switch gateways, sign in to Hermes Cloud or manage saved connections, use the Hermes Desktop app.',
+ webAccess: {
+ title: 'Web access',
+ intro: 'Open Hermes on this computer from your phone or another computer, signed in with your Nous account. Whoever signs in can run commands on this computer.',
+ failed: "Couldn't change web access",
+ running: 'Running',
+ stopped: 'Stopped',
+ starting: 'Starting',
+ restartNeeded: 'Restart needed',
+ unavailable: 'Unavailable',
+ notRunningDetail: 'Start it to open Hermes from another device.',
+ needsNous: 'Sign in to your Nous account under Providers first.',
+ runningLan: 'Open this address on a device on the same network.',
+ runningPublic: 'Served through your URL.',
+ pendingOn: 'Saved. The gateway serves the web app once it restarts.',
+ pendingOff: 'Turned off, but the gateway keeps serving the web app until it restarts.',
+ unavailableDetail: reason => `The gateway couldn't serve the web app: ${reason}`,
+ restartRefused: reason => `Saved. Restart the gateway to apply it: ${reason}`,
+ startTimedOut: "The gateway didn't serve the web app within 90 seconds.",
+ start: 'Start',
+ stop: 'Stop',
+ restartGateway: 'Restart gateway',
+ modeLan: 'This network',
+ modeLanDetail: url => `Devices on your Wi-Fi open ${url}. Use it only on a network you trust.`,
+ noLan: 'This computer has no network address other devices can reach.',
+ modePublic: 'My own URL',
+ modePublicDetail: port => `An HTTPS address you already run, such as Tailscale Serve or a tunnel, forwarding to http://127.0.0.1:${port}.`
+ }
}
diff --git a/apps/desktop/src/i18n/es_gateway_host.ts b/apps/desktop/src/i18n/es_gateway_host.ts
index 7f0ec80a3a1..1745067dddf 100644
--- a/apps/desktop/src/i18n/es_gateway_host.ts
+++ b/apps/desktop/src/i18n/es_gateway_host.ts
@@ -7,5 +7,32 @@ export const esGatewayHost: GatewayHostTranslations = {
'Los ajustes de conexión solo se pueden cambiar desde la app Hermes Desktop en el equipo que la ejecuta.',
webappHostTitle: 'Host de Hermes',
webappHostDesc:
- 'La Webapp siempre usa el host de Hermes que la sirve. Para cambiar de gateway, iniciar sesión en Hermes Cloud o gestionar conexiones guardadas, usa la app Hermes Desktop.'
+ 'La Webapp siempre usa el host de Hermes que la sirve. Para cambiar de gateway, iniciar sesión en Hermes Cloud o gestionar conexiones guardadas, usa la app Hermes Desktop.',
+ webAccess: {
+ title: 'Acceso web',
+ intro: 'Abre Hermes de este ordenador desde tu teléfono u otro ordenador, con tu cuenta de Nous. Quien inicie sesión puede ejecutar comandos en este ordenador.',
+ failed: 'No se pudo cambiar el acceso web',
+ running: 'En ejecución',
+ stopped: 'Detenido',
+ starting: 'Iniciando',
+ restartNeeded: 'Reinicio necesario',
+ unavailable: 'No disponible',
+ notRunningDetail: 'Inícialo para abrir Hermes desde otro dispositivo.',
+ needsNous: 'Primero inicia sesión en tu cuenta de Nous en Proveedores.',
+ runningLan: 'Abre esta dirección en un dispositivo de la misma red.',
+ runningPublic: 'Servido a través de tu URL.',
+ pendingOn: 'Guardado. El gateway servirá la aplicación web cuando se reinicie.',
+ pendingOff: 'Desactivado, pero el gateway sigue sirviendo la aplicación web hasta que se reinicie.',
+ unavailableDetail: reason => `El gateway no pudo servir la aplicación web: ${reason}`,
+ restartRefused: reason => `Guardado. Reinicia el gateway para aplicarlo: ${reason}`,
+ startTimedOut: 'El gateway no sirvió la aplicación web en 90 segundos.',
+ start: 'Iniciar',
+ stop: 'Detener',
+ restartGateway: 'Reiniciar gateway',
+ modeLan: 'Esta red',
+ modeLanDetail: url => `Los dispositivos de tu wifi abren ${url}. Úsalo solo en una red de confianza.`,
+ noLan: 'Este ordenador no tiene una dirección de red a la que puedan llegar otros dispositivos.',
+ modePublic: 'Mi propia URL',
+ modePublicDetail: port => `Una dirección HTTPS que ya tengas, como Tailscale Serve o un túnel, que reenvíe a http://127.0.0.1:${port}.`
+ }
}
diff --git a/apps/desktop/src/i18n/fr_gateway_host.ts b/apps/desktop/src/i18n/fr_gateway_host.ts
index efca00f3e0a..f1b9ea3231d 100644
--- a/apps/desktop/src/i18n/fr_gateway_host.ts
+++ b/apps/desktop/src/i18n/fr_gateway_host.ts
@@ -6,5 +6,32 @@ export const frGatewayHost: GatewayHostTranslations = {
unavailableDesc: "Le pont IPC du desktop n'expose pas les paramètres du gateway.",
webappHostTitle: 'Hôte Hermes',
webappHostDesc:
- "La Webapp utilise toujours l'hôte Hermes qui la sert. Pour changer de gateway, vous connecter à Hermes Cloud ou gérer les connexions enregistrées, utilisez l'application Hermes Desktop."
+ "La Webapp utilise toujours l'hôte Hermes qui la sert. Pour changer de gateway, vous connecter à Hermes Cloud ou gérer les connexions enregistrées, utilisez l'application Hermes Desktop.",
+ webAccess: {
+ title: 'Accès web',
+ intro: "Ouvrez Hermes sur cet ordinateur depuis votre téléphone ou un autre ordinateur, avec votre compte Nous. Toute personne connectée peut exécuter des commandes sur cet ordinateur.",
+ failed: "Impossible de modifier l'accès web",
+ running: 'En cours',
+ stopped: 'Arrêté',
+ starting: 'Démarrage',
+ restartNeeded: 'Redémarrage requis',
+ unavailable: 'Indisponible',
+ notRunningDetail: 'Démarrez-le pour ouvrir Hermes depuis un autre appareil.',
+ needsNous: "Connectez-vous d'abord à votre compte Nous dans Fournisseurs.",
+ runningLan: 'Ouvrez cette adresse sur un appareil du même réseau.',
+ runningPublic: 'Servi via votre URL.',
+ pendingOn: "Enregistré. La passerelle servira l'application web après son redémarrage.",
+ pendingOff: "Désactivé, mais la passerelle continue de servir l'application web jusqu'à son redémarrage.",
+ unavailableDetail: reason => `La passerelle n'a pas pu servir l'application web : ${reason}`,
+ restartRefused: reason => `Enregistré. Redémarrez la passerelle pour l'appliquer : ${reason}`,
+ startTimedOut: "La passerelle n'a pas servi l'application web en 90 secondes.",
+ start: 'Démarrer',
+ stop: 'Arrêter',
+ restartGateway: 'Redémarrer la passerelle',
+ modeLan: 'Ce réseau',
+ modeLanDetail: url => `Les appareils de votre Wi-Fi ouvrent ${url}. À utiliser uniquement sur un réseau de confiance.`,
+ noLan: "Cet ordinateur n'a aucune adresse réseau accessible aux autres appareils.",
+ modePublic: 'Ma propre URL',
+ modePublicDetail: port => `Une adresse HTTPS que vous gérez déjà, comme Tailscale Serve ou un tunnel, redirigée vers http://127.0.0.1:${port}.`
+ }
}
diff --git a/apps/desktop/src/i18n/ja_gateway_host.ts b/apps/desktop/src/i18n/ja_gateway_host.ts
index 12cf15f3951..c849b4f895d 100644
--- a/apps/desktop/src/i18n/ja_gateway_host.ts
+++ b/apps/desktop/src/i18n/ja_gateway_host.ts
@@ -6,5 +6,32 @@ export const jaGatewayHost: GatewayHostTranslations = {
unavailableDesc: 'デスクトップ IPC ブリッジはゲートウェイ設定を公開していません。',
webappHostTitle: 'Hermes ホスト',
webappHostDesc:
- 'Webapp は常に配信元の Hermes ホストを使用します。ゲートウェイの切り替え、Hermes Cloud へのサインイン、保存済み接続の管理は Hermes Desktop アプリで行ってください。'
+ 'Webapp は常に配信元の Hermes ホストを使用します。ゲートウェイの切り替え、Hermes Cloud へのサインイン、保存済み接続の管理は Hermes Desktop アプリで行ってください。',
+ webAccess: {
+ title: 'Web アクセス',
+ intro: 'スマートフォンや別のコンピューターから、Nous アカウントでサインインしてこのコンピューターの Hermes を開きます。サインインした人はこのコンピューターでコマンドを実行できます。',
+ failed: 'Web アクセスを変更できませんでした',
+ running: '実行中',
+ stopped: '停止中',
+ starting: '起動中',
+ restartNeeded: '再起動が必要',
+ unavailable: '利用できません',
+ notRunningDetail: '起動すると、別のデバイスから Hermes を開けます。',
+ needsNous: '先に「プロバイダー」で Nous アカウントにサインインしてください。',
+ runningLan: '同じネットワーク上のデバイスでこのアドレスを開いてください。',
+ runningPublic: 'あなたの URL 経由で提供中です。',
+ pendingOn: '保存しました。ゲートウェイの再起動後に Web アプリが提供されます。',
+ pendingOff: 'オフにしましたが、ゲートウェイは再起動するまで Web アプリを提供し続けます。',
+ unavailableDetail: reason => `ゲートウェイが Web アプリを提供できませんでした: ${reason}`,
+ restartRefused: reason => `保存しました。適用するにはゲートウェイを再起動してください: ${reason}`,
+ startTimedOut: 'ゲートウェイが 90 秒以内に Web アプリを提供しませんでした。',
+ start: '開始',
+ stop: '停止',
+ restartGateway: 'ゲートウェイを再起動',
+ modeLan: 'このネットワーク',
+ modeLanDetail: url => `Wi-Fi 上のデバイスで ${url} を開きます。信頼できるネットワークでのみ使用してください。`,
+ noLan: 'このコンピューターには、他のデバイスから到達できるネットワークアドレスがありません。',
+ modePublic: '独自の URL',
+ modePublicDetail: port => `Tailscale Serve やトンネルなど、すでに運用している HTTPS アドレスで、http://127.0.0.1:${port} に転送するもの。`
+ }
}
diff --git a/apps/desktop/src/i18n/ru_gateway_host.ts b/apps/desktop/src/i18n/ru_gateway_host.ts
index 8d9c5645c54..b3c991b2f03 100644
--- a/apps/desktop/src/i18n/ru_gateway_host.ts
+++ b/apps/desktop/src/i18n/ru_gateway_host.ts
@@ -6,5 +6,32 @@ export const ruGatewayHost: GatewayHostTranslations = {
unavailableDesc: 'IPC-мост приложения не предоставляет настройки шлюза.',
webappHostTitle: 'Хост Hermes',
webappHostDesc:
- 'Webapp всегда использует хост Hermes, который его обслуживает. Чтобы сменить шлюз, войти в Hermes Cloud или управлять сохранёнными подключениями, используйте приложение Hermes Desktop.'
+ 'Webapp всегда использует хост Hermes, который его обслуживает. Чтобы сменить шлюз, войти в Hermes Cloud или управлять сохранёнными подключениями, используйте приложение Hermes Desktop.',
+ webAccess: {
+ title: 'Веб-доступ',
+ intro: 'Откройте Hermes этого компьютера с телефона или другого компьютера, войдя через аккаунт Nous. Вошедший может запускать команды на этом компьютере.',
+ failed: 'Не удалось изменить веб-доступ',
+ running: 'Работает',
+ stopped: 'Остановлен',
+ starting: 'Запускается',
+ restartNeeded: 'Нужен перезапуск',
+ unavailable: 'Недоступен',
+ notRunningDetail: 'Запустите его, чтобы открыть Hermes с другого устройства.',
+ needsNous: 'Сначала войдите в аккаунт Nous в разделе «Провайдеры».',
+ runningLan: 'Откройте этот адрес на устройстве в той же сети.',
+ runningPublic: 'Доступен через ваш URL.',
+ pendingOn: 'Сохранено. Шлюз откроет веб-приложение после перезапуска.',
+ pendingOff: 'Выключено, но шлюз продолжает открывать веб-приложение до перезапуска.',
+ unavailableDetail: reason => `Шлюзу не удалось открыть веб-приложение: ${reason}`,
+ restartRefused: reason => `Сохранено. Перезапустите шлюз, чтобы применить: ${reason}`,
+ startTimedOut: 'Шлюз не открыл веб-приложение за 90 секунд.',
+ start: 'Запустить',
+ stop: 'Остановить',
+ restartGateway: 'Перезапустить шлюз',
+ modeLan: 'Эта сеть',
+ modeLanDetail: url => `Устройства в вашей сети Wi-Fi открывают ${url}. Используйте только в доверенной сети.`,
+ noLan: 'У этого компьютера нет сетевого адреса, доступного другим устройствам.',
+ modePublic: 'Мой собственный URL',
+ modePublicDetail: port => `Уже работающий HTTPS-адрес, например Tailscale Serve или туннель, который перенаправляет на http://127.0.0.1:${port}.`
+ }
}
diff --git a/apps/desktop/src/i18n/types_gateway_host.ts b/apps/desktop/src/i18n/types_gateway_host.ts
index 779a28e31dd..fc8823c6e29 100644
--- a/apps/desktop/src/i18n/types_gateway_host.ts
+++ b/apps/desktop/src/i18n/types_gateway_host.ts
@@ -1,9 +1,39 @@
// Settings → Gateways copy for a renderer that cannot change its connection: a Desktop whose
-// bridge exposes no gateway settings, and the Webapp, bound to the host that serves it.
+// bridge exposes no gateway settings, and the Webapp, bound to the host that serves it. Plus
+// Settings → Web Access, which turns on the Webapp this machine's gateway serves.
// `Translations['settings']['gateway']` spreads this in.
export interface GatewayHostTranslations {
unavailableTitle: string
unavailableDesc: string
webappHostTitle: string
webappHostDesc: string
+ webAccess: WebAccessTranslations
+}
+
+export interface WebAccessTranslations {
+ title: string
+ intro: string
+ failed: string
+ running: string
+ stopped: string
+ starting: string
+ restartNeeded: string
+ unavailable: string
+ notRunningDetail: string
+ needsNous: string
+ runningLan: string
+ runningPublic: string
+ pendingOn: string
+ pendingOff: string
+ unavailableDetail: (reason: string) => string
+ restartRefused: (reason: string) => string
+ startTimedOut: string
+ start: string
+ stop: string
+ restartGateway: string
+ modeLan: string
+ modeLanDetail: (url: string) => string
+ noLan: string
+ modePublic: string
+ modePublicDetail: (port: number) => string
}
diff --git a/apps/desktop/src/i18n/zh-hant_settings.ts b/apps/desktop/src/i18n/zh-hant_settings.ts
index 06ed52615e6..44cb533aa11 100644
--- a/apps/desktop/src/i18n/zh-hant_settings.ts
+++ b/apps/desktop/src/i18n/zh-hant_settings.ts
@@ -974,7 +974,34 @@ export const zhHantSettings = {
sshErrUpdateRequired: '使用 Desktop SSH 連線前,請更新遠端主機上的 Hermes。',
sshErrInteractiveAuth:
'Tailscale SSH 需要互動式瀏覽器驗證。請在終端機執行 `ssh <host> true` 完成驗證後重試——Hermes 以非互動方式執行 SSH。',
- sshErrUnknown: 'SSH 連線失敗。'
+ sshErrUnknown: 'SSH 連線失敗。',
+ webAccess: {
+ title: '網頁存取',
+ intro: '用手機或其他電腦,以你的 Nous 帳戶登入並開啟這台電腦上的 Hermes。登入的人可以在這台電腦上執行指令。',
+ failed: '無法變更網頁存取',
+ running: '執行中',
+ stopped: '已停止',
+ starting: '正在啟動',
+ restartNeeded: '需要重新啟動',
+ unavailable: '無法使用',
+ notRunningDetail: '啟動後即可從其他裝置開啟 Hermes。',
+ needsNous: '請先在「供應商」中登入你的 Nous 帳戶。',
+ runningLan: '在同一網路中的裝置上開啟此網址。',
+ runningPublic: '透過你的網址提供服務。',
+ pendingOn: '已儲存。閘道重新啟動後將提供網頁應用程式。',
+ pendingOff: '已關閉,但閘道在重新啟動前仍會繼續提供網頁應用程式。',
+ unavailableDetail: reason => `閘道無法提供網頁應用程式:${reason}`,
+ restartRefused: reason => `已儲存。重新啟動閘道後生效:${reason}`,
+ startTimedOut: '閘道未能在 90 秒內提供網頁應用程式。',
+ start: '啟動',
+ stop: '停止',
+ restartGateway: '重新啟動閘道',
+ modeLan: '目前網路',
+ modeLanDetail: url => `你的 Wi-Fi 中的裝置可開啟 ${url}。僅在你信任的網路中使用。`,
+ noLan: '這台電腦沒有其他裝置可以連到的網路位址。',
+ modePublic: '我自己的網址',
+ modePublicDetail: port => `你已有的 HTTPS 網址(例如 Tailscale Serve 或通道),並轉送到 http://127.0.0.1:${port}。`
+ }
},
keys: {
loading: '正在載入 API 金鑰和憑證...',
diff --git a/apps/desktop/src/i18n/zh_gateway_host.ts b/apps/desktop/src/i18n/zh_gateway_host.ts
index bd36d12a2c2..e519261e00e 100644
--- a/apps/desktop/src/i18n/zh_gateway_host.ts
+++ b/apps/desktop/src/i18n/zh_gateway_host.ts
@@ -6,5 +6,32 @@ export const zhGatewayHost: GatewayHostTranslations = {
unavailableDesc: '桌面 IPC 桥未暴露网关设置。',
webappHostTitle: 'Hermes 主机',
webappHostDesc:
- 'Webapp 始终使用提供它的 Hermes 主机。如需切换网关、登录 Hermes Cloud 或管理已保存的连接,请使用 Hermes Desktop 应用。'
+ 'Webapp 始终使用提供它的 Hermes 主机。如需切换网关、登录 Hermes Cloud 或管理已保存的连接,请使用 Hermes Desktop 应用。',
+ webAccess: {
+ title: '网页访问',
+ intro: '用手机或其他电脑,以你的 Nous 账户登录并打开这台电脑上的 Hermes。登录的人可以在这台电脑上运行命令。',
+ failed: '无法更改网页访问',
+ running: '运行中',
+ stopped: '已停止',
+ starting: '正在启动',
+ restartNeeded: '需要重启',
+ unavailable: '不可用',
+ notRunningDetail: '启动后即可从其他设备打开 Hermes。',
+ needsNous: '请先在“提供商”中登录你的 Nous 账户。',
+ runningLan: '在同一网络中的设备上打开此地址。',
+ runningPublic: '通过你的网址提供服务。',
+ pendingOn: '已保存。网关重启后将提供网页应用。',
+ pendingOff: '已关闭,但网关在重启前仍会继续提供网页应用。',
+ unavailableDetail: reason => `网关无法提供网页应用:${reason}`,
+ restartRefused: reason => `已保存。重启网关后生效:${reason}`,
+ startTimedOut: '网关未能在 90 秒内提供网页应用。',
+ start: '启动',
+ stop: '停止',
+ restartGateway: '重启网关',
+ modeLan: '当前网络',
+ modeLanDetail: url => `你的 Wi-Fi 中的设备可打开 ${url}。仅在你信任的网络中使用。`,
+ noLan: '这台电脑没有其他设备可以访问的网络地址。',
+ modePublic: '我自己的网址',
+ modePublicDetail: port => `你已有的 HTTPS 地址(例如 Tailscale Serve 或隧道),并转发到 http://127.0.0.1:${port}。`
+ }
}
diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.json
index 346c02bd5e1..2ba0cc38e2b 100644
--- a/locales/_keys.desktop.json
+++ b/locales/_keys.desktop.json
@@ -3528,6 +3528,31 @@
"settings.gateway.tokenTitle",
"settings.gateway.unavailableDesc",
"settings.gateway.unavailableTitle",
+ "settings.gateway.webAccess.failed",
+ "settings.gateway.webAccess.intro",
+ "settings.gateway.webAccess.modeLan",
+ "settings.gateway.webAccess.modeLanDetail",
+ "settings.gateway.webAccess.modePublic",
+ "settings.gateway.webAccess.modePublicDetail",
+ "settings.gateway.webAccess.needsNous",
+ "settings.gateway.webAccess.noLan",
+ "settings.gateway.webAccess.notRunningDetail",
+ "settings.gateway.webAccess.pendingOff",
+ "settings.gateway.webAccess.pendingOn",
+ "settings.gateway.webAccess.restartGateway",
+ "settings.gateway.webAccess.restartNeeded",
+ "settings.gateway.webAccess.restartRefused",
+ "settings.gateway.webAccess.running",
+ "settings.gateway.webAccess.runningLan",
+ "settings.gateway.webAccess.runningPublic",
+ "settings.gateway.webAccess.start",
+ "settings.gateway.webAccess.startTimedOut",
+ "settings.gateway.webAccess.starting",
+ "settings.gateway.webAccess.stop",
+ "settings.gateway.webAccess.stopped",
+ "settings.gateway.webAccess.title",
+ "settings.gateway.webAccess.unavailable",
+ "settings.gateway.webAccess.unavailableDetail",
"settings.gateway.webappHostDesc",
"settings.gateway.webappHostTitle",
"settings.hudModifier.description",