, Error> {
let pde = db
.as_public()
.as_package_data()
- .as_idx(&context.seed.id)
- .or_not_found(&context.seed.id)?;
+ .as_idx(package_id)
+ .or_not_found(package_id)?;
let current_dependencies = pde.as_current_dependencies().de()?;
let tasks = pde.as_tasks().de()?;
let package_dependency_info: Vec<_> = package_ids
@@ -529,16 +546,19 @@ pub async fn check_dependencies(
let mut results = Vec::with_capacity(package_dependency_info.len());
for (package_id, dependency_info) in package_dependency_info {
- let title = dependency_info.title.clone();
+ let title = dependency_info
+ .title
+ .clone()
+ .map(|title| title.localized(default_locale));
+ let tasks = tasks
+ .iter()
+ .filter(|(_, v)| v.task.package_id == package_id)
+ .map(|(k, v)| (k.clone(), v.clone()))
+ .collect();
let Some(package) = db.as_public().as_package_data().as_idx(&package_id) else {
- let tasks = tasks
- .iter()
- .filter(|(_, v)| v.task.package_id == package_id)
- .map(|(k, v)| (k.clone(), v.clone()))
- .collect();
results.push(CheckDependenciesResult {
package_id,
- title: title.map(|t| t.localized()),
+ title,
installed_version: None,
satisfies: BTreeSet::new(),
is_running: false,
@@ -557,14 +577,9 @@ pub async fn check_dependencies(
.transpose_ref()
.is_some();
let health_checks = package.as_status_info().as_health().de()?;
- let tasks = tasks
- .iter()
- .filter(|(_, v)| v.task.package_id == package_id)
- .map(|(k, v)| (k.clone(), v.clone()))
- .collect();
results.push(CheckDependenciesResult {
package_id,
- title: title.map(|t| t.localized()),
+ title,
installed_version,
satisfies,
is_running,
@@ -627,6 +642,46 @@ pub async fn get_service_manifest(
mod test {
use super::*;
+ #[test]
+ fn dependency_titles_use_the_declaring_package_default_with_or_without_the_dependency() {
+ let db = Model::from_value(imbl_value::json!({
+ "public": { "packageData": {
+ "caller": {
+ "currentDependencies": {
+ "installed": {
+ "title": { "de_DE": "Deutsch", "pl_PL": "Polski" },
+ "kind": "exists", "versionRange": "*",
+ },
+ "missing": {
+ "title": { "de_DE": "Deutsch", "pl_PL": "Polski" },
+ "kind": "exists", "versionRange": "*",
+ },
+ },
+ "tasks": {},
+ },
+ "installed": {
+ "stateInfo": {
+ "state": "installed",
+ "manifest": {
+ "version": "1.0.0:0", "satisfies": [], "defaultLocale": "pl_PL",
+ },
+ },
+ "statusInfo": { "started": null, "health": {} },
+ },
+ }},
+ }));
+ let caller = "caller".parse().unwrap();
+ let results = dependency_statuses(&db, &caller, Some("de_DE"), None).unwrap();
+ assert_eq!(results.len(), 2);
+ for result in results {
+ assert_eq!(result.title.as_deref(), Some("Deutsch"));
+ assert_eq!(
+ result.installed_version.is_some(),
+ &*result.package_id == "installed"
+ );
+ }
+ }
+
#[test]
fn required_manifest_requirement_is_the_static_fallback() {
let base: crate::dependencies::DepInfo = serde_json::from_str(
diff --git a/shared-libs/crates/start-core/src/version/release_notes.rs b/shared-libs/crates/start-core/src/version/release_notes.rs
index 332b6acccf..bdebc76d85 100644
--- a/shared-libs/crates/start-core/src/version/release_notes.rs
+++ b/shared-libs/crates/start-core/src/version/release_notes.rs
@@ -45,7 +45,7 @@ async fn read_update_notes(
if ¬es.version != version {
return Ok(None);
}
- let notes = without_pre_update(¬es.release_notes.localized_for(locale));
+ let notes = without_pre_update(¬es.release_notes.localized_for(Some(locale), None));
Ok((!notes.trim().is_empty()).then_some(notes))
}
diff --git a/shared-libs/ts-modules/marketplace/src/components/about.component.ts b/shared-libs/ts-modules/marketplace/src/components/about.component.ts
index 819807f50d..73f1e9a5ce 100644
--- a/shared-libs/ts-modules/marketplace/src/components/about.component.ts
+++ b/shared-libs/ts-modules/marketplace/src/components/about.component.ts
@@ -73,7 +73,9 @@ import { MarketplaceVersionsComponent } from './versions.component'
}
{{ 'Description' | i18n }}
-
+
`,
styles: `
diff --git a/shared-libs/ts-modules/marketplace/src/components/dependency.component.ts b/shared-libs/ts-modules/marketplace/src/components/dependency.component.ts
index 1b00a60df4..a8c227b380 100644
--- a/shared-libs/ts-modules/marketplace/src/components/dependency.component.ts
+++ b/shared-libs/ts-modules/marketplace/src/components/dependency.component.ts
@@ -31,7 +31,9 @@ import { MarketplaceIconDirective } from './icon.directive'
({{ 'Required' | i18n }})
}
@if (dep().value.description; as description) {
- {{ description | localize }}
+
+ {{ description | localize: pkg().defaultLocale }}
+
}
`,
@@ -54,6 +56,8 @@ export class MarketplaceDependencyComponent {
getTitle(key: string): string {
const title = this.pkg().dependencyMetadata[key]?.title
- return title ? this.i18nService.localize(title) : key
+ return title
+ ? this.i18nService.localize(title, this.pkg().defaultLocale)
+ : key
}
}
diff --git a/shared-libs/ts-modules/marketplace/src/components/marketplace.component.ts b/shared-libs/ts-modules/marketplace/src/components/marketplace.component.ts
index 35381c1101..7e565a6885 100644
--- a/shared-libs/ts-modules/marketplace/src/components/marketplace.component.ts
+++ b/shared-libs/ts-modules/marketplace/src/components/marketplace.component.ts
@@ -91,7 +91,11 @@ const ICONS: Record = {
type="button"
(click)="onCategory(cat.key)"
>
- {{ cat.value.name ? (cat.value.name | localize) : cat.key }}
+ {{
+ cat.value.name
+ ? (cat.value.name | localize: current()?.info?.defaultLocale)
+ : cat.key
+ }}
}
@@ -123,7 +127,12 @@ const ICONS: Record = {
appearance="info"
class="g-markdown"
safeLinks
- [innerHTML]="description | localize | markdown | dompurify"
+ [innerHTML]="
+ description
+ | localize: current()?.info?.defaultLocale
+ | markdown
+ | dompurify
+ "
>
}
@if (warning(); as warning) {
@@ -135,7 +144,7 @@ const ICONS: Record = {
@if (current()) {
- {{ name() | localize }}
+ {{ name() | localize: current()?.info?.defaultLocale }}
}
diff --git a/shared-libs/ts-modules/marketplace/src/components/release-notes.component.ts b/shared-libs/ts-modules/marketplace/src/components/release-notes.component.ts
index eb1ba8175d..f0aff8c72b 100644
--- a/shared-libs/ts-modules/marketplace/src/components/release-notes.component.ts
+++ b/shared-libs/ts-modules/marketplace/src/components/release-notes.component.ts
@@ -9,7 +9,12 @@ import { MarketplacePkgBase } from '../types'
template: `
New in {{ pkg().version }}
`,
styles: `
diff --git a/shared-libs/ts-modules/marketplace/src/components/tile.component.ts b/shared-libs/ts-modules/marketplace/src/components/tile.component.ts
index cf726c3649..c6926752b8 100644
--- a/shared-libs/ts-modules/marketplace/src/components/tile.component.ts
+++ b/shared-libs/ts-modules/marketplace/src/components/tile.component.ts
@@ -30,7 +30,9 @@ import { MarketplacePreviewComponent } from './preview.component'
{{ pkg().version }}
- {{ pkg().description.short | localize }}
+
+ {{ pkg().description.short | localize: pkg().defaultLocale }}
+
{
+ const text = { de_DE: 'Deutsch', en_GB: 'English', pl_PL: 'Polski' }
+ assert.equal(localizeFor(text, 'pl_PL', 'de_DE'), 'Polski')
+ assert.equal(localizeFor(text, 'en_US', 'de_DE'), 'English')
+ assert.equal(localizeFor(text, 'fr_FR', 'pl_PL'), 'Polski')
+ assert.equal(localizeFor(text, 'fr_FR', 'de_DE'), 'Deutsch')
+ assert.ok(Object.values(text).includes(localizeFor(text, 'fr_FR', 'ja_JP')))
+ assert.ok(Object.values(text).includes(localizeFor(text, 'fr_FR')))
+ assert.equal(localizeFor({}, 'en_US', 'de_DE'), '')
+ assert.equal(localizeFor('Plain', 'pl_PL', 'de_DE'), 'Plain')
+})
diff --git a/shared-libs/ts-modules/shared/src/i18n/i18n.service.ts b/shared-libs/ts-modules/shared/src/i18n/i18n.service.ts
index 6abc72a76d..0e623f0bb6 100644
--- a/shared-libs/ts-modules/shared/src/i18n/i18n.service.ts
+++ b/shared-libs/ts-modules/shared/src/i18n/i18n.service.ts
@@ -1,6 +1,7 @@
import { inject, Injectable, signal } from '@angular/core'
import { TuiLanguageName, TuiLanguageSwitcherService } from '@taiga-ui/i18n'
import { I18N, I18N_LOADER, I18N_STORAGE } from './i18n.providers'
+import { localizeFor } from './localize'
import { T } from '@start9labs/start-core'
export const languages = ['en_US', 'es_ES', 'de_DE', 'fr_FR', 'pl_PL'] as const
@@ -38,12 +39,8 @@ export class i18nService extends TuiLanguageSwitcherService {
)
}
- localize(string: T.LocaleString): string {
- if (typeof string === 'string') return string
-
- return (
- string[this.lang] ?? string['en_US'] ?? Object.values(string)[0] ?? ''
- )
+ localize(string: T.LocaleString, defaultLocale?: string | null): string {
+ return localizeFor(string, this.lang, defaultLocale)
}
setLangLocal(language: Languages = 'en_US'): void {
diff --git a/shared-libs/ts-modules/shared/src/i18n/localize.pipe.ts b/shared-libs/ts-modules/shared/src/i18n/localize.pipe.ts
index 5a0efcedae..a089d139db 100644
--- a/shared-libs/ts-modules/shared/src/i18n/localize.pipe.ts
+++ b/shared-libs/ts-modules/shared/src/i18n/localize.pipe.ts
@@ -12,8 +12,9 @@ export class LocalizePipe implements PipeTransform {
private readonly i18nService = inject(i18nService)
private readonly i18n = inject(I18N)
- transform(string: T.LocaleString): string {
+ /** Takes the owning package's or registry's `defaultLocale`. */
+ transform(string: T.LocaleString, defaultLocale?: string | null): string {
this.i18n() // read signal to trigger change detection on language switch
- return this.i18nService.localize(string)
+ return this.i18nService.localize(string, defaultLocale)
}
}
diff --git a/shared-libs/ts-modules/shared/src/i18n/localize.ts b/shared-libs/ts-modules/shared/src/i18n/localize.ts
new file mode 100644
index 0000000000..bdb07a6d87
--- /dev/null
+++ b/shared-libs/ts-modules/shared/src/i18n/localize.ts
@@ -0,0 +1,25 @@
+import type { T } from '@start9labs/start-core'
+
+/**
+ * The requested locale's exact or same-language translation, else the owner's
+ * declared default, else an arbitrary stored one.
+ * Matches the backend's `LocaleString::localize_for`.
+ */
+export function localizeFor(
+ string: T.LocaleString,
+ lang: string,
+ defaultLocale?: string | null,
+): string {
+ if (typeof string === 'string') return string
+
+ const language = lang.split('_')[0] + '_'
+ return (
+ string[lang] ??
+ Object.entries(string).find(([locale]) =>
+ locale.startsWith(language),
+ )?.[1] ??
+ (defaultLocale ? string[defaultLocale] : undefined) ??
+ Object.values(string)[0] ??
+ ''
+ )
+}
diff --git a/shared-libs/ts-modules/start-core/lib/osBindings/rpc/effects.schemas.ts b/shared-libs/ts-modules/start-core/lib/osBindings/rpc/effects.schemas.ts
index b5d322f237..8d63856935 100644
--- a/shared-libs/ts-modules/start-core/lib/osBindings/rpc/effects.schemas.ts
+++ b/shared-libs/ts-modules/start-core/lib/osBindings/rpc/effects.schemas.ts
@@ -2350,6 +2350,10 @@ export const NamedHealthCheckResult: z.ZodCodec<
})
export const PackageMetadata: z.ZodObject<{
title: z.ZodString
+ /**
+ * Locale this package's `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: z.ZodOptional>
description: typeof Description
releaseNotes: typeof LocaleString
preDownloadAlert: z.ZodOptional>
@@ -2396,6 +2400,13 @@ export const PackageMetadata: z.ZodObject<{
>
}> = /* @__PURE__ */ object({
title: z.string(),
+ /**
+ * Locale this package's `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: z.string().nullable().optional().meta({
+ description:
+ "Locale this package's `LocaleString`s fall back to when a requested one is missing.",
+ }),
description: Description,
releaseNotes: LocaleString,
preDownloadAlert: PreDownloadAlert.nullable().optional(),
diff --git a/shared-libs/ts-modules/start-core/lib/osBindings/rpc/registry.schemas.ts b/shared-libs/ts-modules/start-core/lib/osBindings/rpc/registry.schemas.ts
index 8c7773978f..449334f180 100644
--- a/shared-libs/ts-modules/start-core/lib/osBindings/rpc/registry.schemas.ts
+++ b/shared-libs/ts-modules/start-core/lib/osBindings/rpc/registry.schemas.ts
@@ -578,6 +578,11 @@ export const ReplaceOperation: z.ZodObject<{
id: 'ReplaceOperation',
description: "JSON Patch 'replace' operation representation",
})
+export const SetDefaultLocaleParams: z.ZodObject<{
+ defaultLocale: z.ZodNullable
+}> = /* @__PURE__ */ object({ defaultLocale: z.string().nullable() }).meta({
+ id: 'SetDefaultLocaleParams',
+})
export const SetNameParams: z.ZodObject<{ name: z.ZodString }> =
/* @__PURE__ */ object({ name: z.string() }).meta({
id: 'SetNameParams',
@@ -1099,7 +1104,19 @@ export const PackageIcon: z.ZodUnion =
})
export const PackageInfoShort: z.ZodObject<{
releaseNotes: typeof LocaleString
-}> = /* @__PURE__ */ object({ releaseNotes: LocaleString }).meta({
+ /**
+ * `PackageMetadata::default_locale`.
+ */
+ defaultLocale: z.ZodOptional>
+}> = /* @__PURE__ */ object({
+ releaseNotes: LocaleString,
+ /**
+ * `PackageMetadata::default_locale`.
+ */
+ defaultLocale: z.string().nullable().optional().meta({
+ description: '`PackageMetadata::default_locale`.',
+ }),
+}).meta({
id: 'PackageInfoShort',
})
export const PackageReaderParams: z.ZodObject<{
@@ -1378,6 +1395,13 @@ export const SubscribeIndexParams: z.ZodIntersection<
z.ZodOptional>,
z.ZodNullable
>
+ /**
+ * Locale to resolve localized text to; one the index lacks gets the fallback. Omission keeps every translation.
+ */
+ language: z.ZodCodec<
+ z.ZodOptional>,
+ z.ZodNullable
+ >
}>,
typeof ReaderParams
> = /* @__PURE__ */ z
@@ -1394,6 +1418,16 @@ export const SubscribeIndexParams: z.ZodIntersection<
description:
'Client StartOS version. Omission preserves the canonical index format.',
}),
+ /**
+ * Locale to resolve localized text to; one the index lacks gets the fallback. Omission keeps every translation.
+ */
+ language: wire(
+ z.string().nullable().optional(),
+ z.string().nullable(),
+ ).meta({
+ description:
+ 'Locale to resolve localized text to; one the index lacks gets the fallback. Omission keeps every translation.',
+ }),
}),
ReaderParams,
)
@@ -1467,6 +1501,10 @@ export const PackageAccess: z.ZodObject<{
})
export const PackageMetadata: z.ZodObject<{
title: z.ZodString
+ /**
+ * Locale this package's `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: z.ZodOptional>
description: typeof Description
releaseNotes: typeof LocaleString
preDownloadAlert: z.ZodOptional>
@@ -1513,6 +1551,13 @@ export const PackageMetadata: z.ZodObject<{
>
}> = /* @__PURE__ */ object({
title: z.string(),
+ /**
+ * Locale this package's `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: z.string().nullable().optional().meta({
+ description:
+ "Locale this package's `LocaleString`s fall back to when a requested one is missing.",
+ }),
description: Description,
releaseNotes: LocaleString,
preDownloadAlert: PreDownloadAlert.nullable().optional(),
@@ -1575,6 +1620,13 @@ export const RegistryInfo: z.ZodObject<{
z.ZodOptional>,
z.ZodNullable
>
+ /**
+ * `FullIndex::default_locale`.
+ */
+ defaultLocale: z.ZodCodec<
+ z.ZodOptional>,
+ z.ZodNullable
+ >
categories: z.ZodRecord
/**
* Registry-selected signers, not an assertion of trust.
@@ -1595,6 +1647,15 @@ export const RegistryInfo: z.ZodObject<{
).meta({
description: "Markdown, shown above the registry's services.",
}),
+ /**
+ * `FullIndex::default_locale`.
+ */
+ defaultLocale: wire(
+ z.string().nullable().optional(),
+ z.string().nullable(),
+ ).meta({
+ description: '`FullIndex::default_locale`.',
+ }),
categories: z.record(z.string(), Category),
/**
* Registry-selected signers, not an assertion of trust.
@@ -1755,6 +1816,13 @@ export const FullIndex: z.ZodObject<{
z.ZodOptional>,
z.ZodNullable
>
+ /**
+ * Locale registry-owned `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: z.ZodCodec<
+ z.ZodOptional>,
+ z.ZodNullable
+ >
package: typeof PackageIndex
os: typeof OsIndex
signers: z.ZodRecord
@@ -1769,6 +1837,16 @@ export const FullIndex: z.ZodObject<{
LocaleString.nullable().optional(),
LocaleString.nullable(),
),
+ /**
+ * Locale registry-owned `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: wire(
+ z.string().nullable().optional(),
+ z.string().nullable(),
+ ).meta({
+ description:
+ 'Locale registry-owned `LocaleString`s fall back to when a requested one is missing.',
+ }),
package: PackageIndex,
os: OsIndex,
signers: z.record(z.string(), SignerInfo),
@@ -1901,6 +1979,23 @@ export const Api = {
_ITEM: /* @__PURE__ */ z.never(),
_FINAL: /* @__PURE__ */ z.null(),
_CHILDREN: {
+ 'set-default-locale': {
+ _PARAMS: /* @__PURE__ */ z.intersection(
+ z.intersection(
+ object({
+ format: wire(
+ IoFormat.nullable().optional(),
+ IoFormat.nullable(),
+ ),
+ }),
+ empty,
+ ),
+ SetDefaultLocaleParams,
+ ),
+ _RETURN: /* @__PURE__ */ z.null(),
+ _ITEM: /* @__PURE__ */ z.never(),
+ _FINAL: /* @__PURE__ */ z.null(),
+ },
'set-description': {
_PARAMS: /* @__PURE__ */ z.intersection(
z.intersection(
diff --git a/shared-libs/ts-modules/start-core/lib/osBindings/rpc/registry.ts b/shared-libs/ts-modules/start-core/lib/osBindings/rpc/registry.ts
index cc61192907..9beb699acf 100644
--- a/shared-libs/ts-modules/start-core/lib/osBindings/rpc/registry.ts
+++ b/shared-libs/ts-modules/start-core/lib/osBindings/rpc/registry.ts
@@ -194,6 +194,9 @@ export type RemoveVersionParamsInput = z.input<
* JSON Patch 'replace' operation representation
*/
export type ReplaceOperation = z.output
+export type SetDefaultLocaleParamsInput = z.input<
+ typeof schemas.SetDefaultLocaleParams
+>
export type SetNameParamsInput = z.input
/**
diff --git a/shared-libs/ts-modules/start-core/lib/osBindings/rpc/start-os.schemas.ts b/shared-libs/ts-modules/start-core/lib/osBindings/rpc/start-os.schemas.ts
index c10f2075ac..959346efe8 100644
--- a/shared-libs/ts-modules/start-core/lib/osBindings/rpc/start-os.schemas.ts
+++ b/shared-libs/ts-modules/start-core/lib/osBindings/rpc/start-os.schemas.ts
@@ -1435,6 +1435,11 @@ export const SetCountryParams: z.ZodObject<{ country: z.ZodString }> =
/* @__PURE__ */ object({ country: z.string() }).meta({
id: 'SetCountryParams',
})
+export const SetDefaultLocaleParams: z.ZodObject<{
+ defaultLocale: z.ZodNullable
+}> = /* @__PURE__ */ object({ defaultLocale: z.string().nullable() }).meta({
+ id: 'SetDefaultLocaleParams',
+})
export const SetEchoipUrlsParams: z.ZodObject<{
urls: z.ZodArray
}> = /* @__PURE__ */ object({ urls: z.array(z.string()) }).meta({
@@ -3585,7 +3590,19 @@ export const PackageIdParams: z.ZodObject<{ id: typeof PackageId }> =
})
export const PackageInfoShort: z.ZodObject<{
releaseNotes: typeof LocaleString
-}> = /* @__PURE__ */ object({ releaseNotes: LocaleString }).meta({
+ /**
+ * `PackageMetadata::default_locale`.
+ */
+ defaultLocale: z.ZodOptional>
+}> = /* @__PURE__ */ object({
+ releaseNotes: LocaleString,
+ /**
+ * `PackageMetadata::default_locale`.
+ */
+ defaultLocale: z.string().nullable().optional().meta({
+ description: '`PackageMetadata::default_locale`.',
+ }),
+}).meta({
id: 'PackageInfoShort',
})
export const PackageReaderParams: z.ZodObject<{
@@ -4413,6 +4430,13 @@ export const SubscribeIndexParams: z.ZodIntersection<
z.ZodOptional>,
z.ZodNullable
>
+ /**
+ * Locale to resolve localized text to; one the index lacks gets the fallback. Omission keeps every translation.
+ */
+ language: z.ZodCodec<
+ z.ZodOptional>,
+ z.ZodNullable
+ >
}>,
typeof ReaderParams
> = /* @__PURE__ */ z
@@ -4429,6 +4453,16 @@ export const SubscribeIndexParams: z.ZodIntersection<
description:
'Client StartOS version. Omission preserves the canonical index format.',
}),
+ /**
+ * Locale to resolve localized text to; one the index lacks gets the fallback. Omission keeps every translation.
+ */
+ language: wire(
+ z.string().nullable().optional(),
+ z.string().nullable(),
+ ).meta({
+ description:
+ 'Locale to resolve localized text to; one the index lacks gets the fallback. Omission keeps every translation.',
+ }),
}),
ReaderParams,
)
@@ -5177,6 +5211,10 @@ export const PackageAccess: z.ZodObject<{
})
export const PackageMetadata: z.ZodObject<{
title: z.ZodString
+ /**
+ * Locale this package's `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: z.ZodOptional>
description: typeof Description
releaseNotes: typeof LocaleString
preDownloadAlert: z.ZodOptional>
@@ -5223,6 +5261,13 @@ export const PackageMetadata: z.ZodObject<{
>
}> = /* @__PURE__ */ object({
title: z.string(),
+ /**
+ * Locale this package's `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: z.string().nullable().optional().meta({
+ description:
+ "Locale this package's `LocaleString`s fall back to when a requested one is missing.",
+ }),
description: Description,
releaseNotes: LocaleString,
preDownloadAlert: PreDownloadAlert.nullable().optional(),
@@ -5362,6 +5407,13 @@ export const RegistryInfo: z.ZodObject<{
z.ZodOptional>,
z.ZodNullable
>
+ /**
+ * `FullIndex::default_locale`.
+ */
+ defaultLocale: z.ZodCodec<
+ z.ZodOptional>,
+ z.ZodNullable
+ >
categories: z.ZodRecord
/**
* Registry-selected signers, not an assertion of trust.
@@ -5382,6 +5434,15 @@ export const RegistryInfo: z.ZodObject<{
).meta({
description: "Markdown, shown above the registry's services.",
}),
+ /**
+ * `FullIndex::default_locale`.
+ */
+ defaultLocale: wire(
+ z.string().nullable().optional(),
+ z.string().nullable(),
+ ).meta({
+ description: '`FullIndex::default_locale`.',
+ }),
categories: z.record(z.string(), Category),
/**
* Registry-selected signers, not an assertion of trust.
@@ -6313,6 +6374,13 @@ export const FullIndex: z.ZodObject<{
z.ZodOptional>,
z.ZodNullable
>
+ /**
+ * Locale registry-owned `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: z.ZodCodec<
+ z.ZodOptional>,
+ z.ZodNullable
+ >
package: typeof PackageIndex
os: typeof OsIndex
signers: z.ZodRecord
@@ -6327,6 +6395,16 @@ export const FullIndex: z.ZodObject<{
LocaleString.nullable().optional(),
LocaleString.nullable(),
),
+ /**
+ * Locale registry-owned `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: wire(
+ z.string().nullable().optional(),
+ z.string().nullable(),
+ ).meta({
+ description:
+ 'Locale registry-owned `LocaleString`s fall back to when a requested one is missing.',
+ }),
package: PackageIndex,
os: OsIndex,
signers: z.record(z.string(), SignerInfo),
@@ -7753,6 +7831,26 @@ export const Api = {
_ITEM: /* @__PURE__ */ z.never(),
_FINAL: /* @__PURE__ */ z.null(),
_CHILDREN: {
+ 'set-default-locale': {
+ _PARAMS: /* @__PURE__ */ z.intersection(
+ z.intersection(
+ z.intersection(empty, RegistryUrlParams),
+ z.intersection(
+ object({
+ format: wire(
+ IoFormat.nullable().optional(),
+ IoFormat.nullable(),
+ ),
+ }),
+ empty,
+ ),
+ ),
+ SetDefaultLocaleParams,
+ ),
+ _RETURN: /* @__PURE__ */ z.null(),
+ _ITEM: /* @__PURE__ */ z.never(),
+ _FINAL: /* @__PURE__ */ z.null(),
+ },
'set-description': {
_PARAMS: /* @__PURE__ */ z.intersection(
z.intersection(
diff --git a/shared-libs/ts-modules/start-core/lib/osBindings/rpc/start-os.ts b/shared-libs/ts-modules/start-core/lib/osBindings/rpc/start-os.ts
index d97d40132a..4f89447946 100644
--- a/shared-libs/ts-modules/start-core/lib/osBindings/rpc/start-os.ts
+++ b/shared-libs/ts-modules/start-core/lib/osBindings/rpc/start-os.ts
@@ -378,6 +378,9 @@ export type ServiceInterfaceId = z.output
export type ServiceInterfaceType = z.output
export type Session = z.output
export type SetCountryParamsInput = z.input
+export type SetDefaultLocaleParamsInput = z.input<
+ typeof schemas.SetDefaultLocaleParams
+>
export type SetEchoipUrlsParamsInput = z.input<
typeof schemas.SetEchoipUrlsParams
>
diff --git a/shared-libs/ts-modules/start-core/lib/osBindings/types.schemas.ts b/shared-libs/ts-modules/start-core/lib/osBindings/types.schemas.ts
index ae2ad80ca6..97f5bb262c 100644
--- a/shared-libs/ts-modules/start-core/lib/osBindings/types.schemas.ts
+++ b/shared-libs/ts-modules/start-core/lib/osBindings/types.schemas.ts
@@ -1574,6 +1574,11 @@ export const SetDataVersionParams: z.ZodObject<{
}).meta({
id: 'SetDataVersionParams',
})
+export const SetDefaultLocaleParams: z.ZodObject<{
+ defaultLocale: z.ZodNullable
+}> = /* @__PURE__ */ object({ defaultLocale: z.string().nullable() }).meta({
+ id: 'SetDefaultLocaleParams',
+})
export const SetLanguageParams: z.ZodObject<{ language: z.ZodString }> =
/* @__PURE__ */ object({ language: z.string() }).meta({
id: 'SetLanguageParams',
@@ -4032,7 +4037,19 @@ export const PackageIcon: z.ZodUnion =
})
export const PackageInfoShort: z.ZodObject<{
releaseNotes: typeof LocaleString
-}> = /* @__PURE__ */ object({ releaseNotes: LocaleString }).meta({
+ /**
+ * `PackageMetadata::default_locale`.
+ */
+ defaultLocale: z.ZodOptional>
+}> = /* @__PURE__ */ object({
+ releaseNotes: LocaleString,
+ /**
+ * `PackageMetadata::default_locale`.
+ */
+ defaultLocale: z.string().nullable().optional().meta({
+ description: '`PackageMetadata::default_locale`.',
+ }),
+}).meta({
id: 'PackageInfoShort',
})
export const PackageReaderParams: z.ZodObject<{
@@ -5669,6 +5686,13 @@ export const NutConfig: z.ZodObject<{
export const OsUpdateCache: z.ZodObject<{
registry: z.ZodString
versions: z.ZodRecord
+ /**
+ * Tracks the source registry's cached `RegistryInfo::default_locale`.
+ */
+ defaultLocale: z.ZodCodec<
+ z.ZodOptional>,
+ z.ZodNullable
+ >
status: z.ZodCodec<
z.ZodOptional,
typeof RegistryStatus
@@ -5680,6 +5704,16 @@ export const OsUpdateCache: z.ZodObject<{
}> = /* @__PURE__ */ object({
registry: z.string(),
versions: z.record(z.string(), OsVersionInfo),
+ /**
+ * Tracks the source registry's cached `RegistryInfo::default_locale`.
+ */
+ defaultLocale: wire(
+ z.string().nullable().optional(),
+ z.string().nullable(),
+ ).meta({
+ description:
+ "Tracks the source registry's cached `RegistryInfo::default_locale`.",
+ }),
status: wire(RegistryStatus.optional(), RegistryStatus),
/**
* Failure of the latest synchronization attempt; absent while connecting or connected.
@@ -5707,6 +5741,10 @@ export const PackageAccess: z.ZodObject<{
})
export const PackageMetadata: z.ZodObject<{
title: z.ZodString
+ /**
+ * Locale this package's `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: z.ZodOptional>
description: typeof Description
releaseNotes: typeof LocaleString
preDownloadAlert: z.ZodOptional>
@@ -5753,6 +5791,13 @@ export const PackageMetadata: z.ZodObject<{
>
}> = /* @__PURE__ */ object({
title: z.string(),
+ /**
+ * Locale this package's `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: z.string().nullable().optional().meta({
+ description:
+ "Locale this package's `LocaleString`s fall back to when a requested one is missing.",
+ }),
description: Description,
releaseNotes: LocaleString,
preDownloadAlert: PreDownloadAlert.nullable().optional(),
@@ -5935,6 +5980,13 @@ export const RegistryInfo: z.ZodObject<{
z.ZodOptional>,
z.ZodNullable
>
+ /**
+ * `FullIndex::default_locale`.
+ */
+ defaultLocale: z.ZodCodec<
+ z.ZodOptional>,
+ z.ZodNullable
+ >
categories: z.ZodRecord
/**
* Registry-selected signers, not an assertion of trust.
@@ -5955,6 +6007,15 @@ export const RegistryInfo: z.ZodObject<{
).meta({
description: "Markdown, shown above the registry's services.",
}),
+ /**
+ * `FullIndex::default_locale`.
+ */
+ defaultLocale: wire(
+ z.string().nullable().optional(),
+ z.string().nullable(),
+ ).meta({
+ description: '`FullIndex::default_locale`.',
+ }),
categories: z.record(z.string(), Category),
/**
* Registry-selected signers, not an assertion of trust.
@@ -7345,6 +7406,13 @@ export const FullIndex: z.ZodObject<{
z.ZodOptional>,
z.ZodNullable
>
+ /**
+ * Locale registry-owned `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: z.ZodCodec<
+ z.ZodOptional>,
+ z.ZodNullable
+ >
package: typeof PackageIndex
os: typeof OsIndex
signers: z.ZodRecord
@@ -7359,6 +7427,16 @@ export const FullIndex: z.ZodObject<{
LocaleString.nullable().optional(),
LocaleString.nullable(),
),
+ /**
+ * Locale registry-owned `LocaleString`s fall back to when a requested one is missing.
+ */
+ defaultLocale: wire(
+ z.string().nullable().optional(),
+ z.string().nullable(),
+ ).meta({
+ description:
+ 'Locale registry-owned `LocaleString`s fall back to when a requested one is missing.',
+ }),
package: PackageIndex,
os: OsIndex,
signers: z.record(z.string(), SignerInfo),
diff --git a/shared-libs/ts-modules/start-core/lib/osBindings/types.ts b/shared-libs/ts-modules/start-core/lib/osBindings/types.ts
index 07086d3c4d..62ce329bc4 100644
--- a/shared-libs/ts-modules/start-core/lib/osBindings/types.ts
+++ b/shared-libs/ts-modules/start-core/lib/osBindings/types.ts
@@ -460,6 +460,12 @@ export type SetDataVersionParams = z.output
export type SetDataVersionParamsInput = z.input<
typeof schemas.SetDataVersionParams
>
+export type SetDefaultLocaleParams = z.output<
+ typeof schemas.SetDefaultLocaleParams
+>
+export type SetDefaultLocaleParamsInput = z.input<
+ typeof schemas.SetDefaultLocaleParams
+>
export type SetLanguageParams = z.output
export type SetLanguageParamsInput = z.input
export type SetMainStatusStatus = z.output
From a323e31a592106e1855e561da0bf90dcd7a336f8 Mon Sep 17 00:00:00 2001
From: StuPleb
Date: Wed, 18 Nov 2026 19:10:28 +0100
Subject: [PATCH 02/38] fix(web): show release notes in full and open their
links in a new tab (#4768)
The release-notes card capped itself at 30rem and hid its own scrollbar,
so longer notes looked cut off inside a drawer that already scrolls. It
now grows to fit, like the Description card above it.
The notes render with the shared g-markdown styles, so a wide code block
scrolls on its own instead of being clipped by the card, and long URLs
wrap. They also gain safeLinks, as every other rendered-markdown surface
has, so an external link opens in a new tab instead of replacing the UI.
Co-authored-by: Claude Opus 5.5
Co-authored-by: helix-red <355572797+helix-red@users.noreply.github.com>
---
.../patch-fixed-release-notes-height.md | 5 +++++
.../src/components/release-notes.component.ts | 22 ++++++++++++++-----
2 files changed, 21 insertions(+), 6 deletions(-)
create mode 100644 projects/start-os/changelog/patch-fixed-release-notes-height.md
diff --git a/projects/start-os/changelog/patch-fixed-release-notes-height.md b/projects/start-os/changelog/patch-fixed-release-notes-height.md
new file mode 100644
index 0000000000..5089bf52c4
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-release-notes-height.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Show a package's release notes in full in the marketplace and Updates sidebars and on the sideload page, and open their links in a new tab.
diff --git a/shared-libs/ts-modules/marketplace/src/components/release-notes.component.ts b/shared-libs/ts-modules/marketplace/src/components/release-notes.component.ts
index f0aff8c72b..d99ddf29fb 100644
--- a/shared-libs/ts-modules/marketplace/src/components/release-notes.component.ts
+++ b/shared-libs/ts-modules/marketplace/src/components/release-notes.component.ts
@@ -1,5 +1,9 @@
import { Component, input } from '@angular/core'
-import { LocalizePipe, MarkdownPipe } from '@start9labs/shared'
+import {
+ LocalizePipe,
+ MarkdownPipe,
+ SafeLinksDirective,
+} from '@start9labs/shared'
import { NgDompurifyPipe } from '@taiga-ui/dompurify'
import { TuiCardLarge, TuiHeader } from '@taiga-ui/layout'
import { MarketplacePkgBase } from '../types'
@@ -9,6 +13,8 @@ import { MarketplacePkgBase } from '../types'
template: `
New in {{ pkg().version }}
`,
styles: `
- :host {
- max-block-size: 30rem;
- scrollbar-width: none;
- overflow: auto;
+ .g-markdown {
+ overflow-wrap: anywhere;
}
`,
hostDirectives: [TuiCardLarge],
- imports: [NgDompurifyPipe, MarkdownPipe, LocalizePipe, TuiHeader],
+ imports: [
+ NgDompurifyPipe,
+ MarkdownPipe,
+ LocalizePipe,
+ SafeLinksDirective,
+ TuiHeader,
+ ],
})
export class MarketplaceReleaseNotesComponent {
readonly pkg = input.required()
From 32faac85c99098a3c27453f7d24dfa2236911720 Mon Sep 17 00:00:00 2001
From: Helix the Red <355572797+helix-red@users.noreply.github.com>
Date: Wed, 18 Nov 2026 12:30:56 -0700
Subject: [PATCH 03/38] fix(start-os): stop NetworkManager publishing VPN DNS
to systemd-resolved (#4789)
fix(start-os): stop NetworkManager publishing per-link DNS to systemd-resolved
dns=none disables NetworkManager's resolv.conf management but not its
separate systemd-resolved integration, so VPN gateway DNS and a catch-all
routing domain reached resolved and bypassed the StartOS resolver.
StartOS still reads connection DNS from NetworkManager over D-Bus.
Closes #4785
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
---
projects/start-os/build/tests/dns-config-test.sh | 1 +
projects/start-os/changelog/patch-fixed-vpn-dns-bypass.md | 5 +++++
projects/start-os/debian/postinst | 2 ++
3 files changed, 8 insertions(+)
create mode 100644 projects/start-os/changelog/patch-fixed-vpn-dns-bypass.md
diff --git a/projects/start-os/build/tests/dns-config-test.sh b/projects/start-os/build/tests/dns-config-test.sh
index ea534e3030..2d38f52169 100755
--- a/projects/start-os/build/tests/dns-config-test.sh
+++ b/projects/start-os/build/tests/dns-config-test.sh
@@ -20,6 +20,7 @@ assert.equal(values.DNS, undefined, 'resolved must read the OS stub from resolv.
const postinst = read(base + 'debian/postinst')
const nm = postinst.match(/cat << EOF > \/etc\/NetworkManager\/NetworkManager.conf\n([\s\S]*?)\nEOF/)[1]
assert.match(nm, /^dns=none$/m)
+assert.match(nm, /^systemd-resolved=false$/m, 'NetworkManager must not publish per-link DNS to systemd-resolved')
for (const [script, server] of [['debian/postinst', '127.0.0.1'], ['container-runtime/deb-install.sh', '10.0.3.1']]) {
const source = read(base + script)
assert.deepEqual([...source.matchAll(/echo "nameserver ([^"]+)"/g)].map(match => match[1]), [server])
diff --git a/projects/start-os/changelog/patch-fixed-vpn-dns-bypass.md b/projects/start-os/changelog/patch-fixed-vpn-dns-bypass.md
new file mode 100644
index 0000000000..89b8dd41e1
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-vpn-dns-bypass.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- DNS servers supplied by a VPN gateway no longer bypass the StartOS resolver for host lookups such as clock synchronization.
diff --git a/projects/start-os/debian/postinst b/projects/start-os/debian/postinst
index f9794c5c67..9248c679c1 100755
--- a/projects/start-os/debian/postinst
+++ b/projects/start-os/debian/postinst
@@ -143,10 +143,12 @@ rm -f "$resolv_conf"
echo "nameserver 127.0.0.1" > "$resolv_conf"
echo "#" > /etc/network/interfaces
+# The StartOS resolver is the only host DNS path; NetworkManager publishes no resolver config.
cat << EOF > /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
dns=none
+systemd-resolved=false
[ifupdown]
managed=true
From 09ed246ef38196b36c485f6fabeaadbad9f6ed86 Mon Sep 17 00:00:00 2001
From: Dominion5254
Date: Wed, 18 Nov 2026 12:42:30 -0700
Subject: [PATCH 04/38] fix(start-os): keep streams a re-addressed vhost target
still accepts (#4764)
A vhost target's identity includes the addresses it accepts on, so any
change to that set (a gateway added or removed, an address switched off)
replaced the target, and replacing a target cancelled every stream
proxied through it. Deleting a WireGuard gateway therefore cut the admin
UI's own connection while the deletion RPC was still in flight. The
browser resent the signed POST on a fresh connection, the nonce cache
rejected the resend, and a delete that had succeeded reported "replay
attack detected".
A target that differs from its predecessor only in what it accepts now
takes over the predecessor's entry in place. Each stream records where
it arrived, and the takeover cancels only the streams the new target
rejects. Streams that register afterwards, such as a TLS handshake
already in flight, are checked against the new target as well, so
switching an address off still ends its streams immediately. The
plaintext proxy is retargeted the same way. A change to how streams are
relayed, or an entry another owner shares, still replaces the target
and cancels its streams.
---
...xed-connections-survive-address-changes.md | 5 +
.../start-core/src/net/net_controller.rs | 63 +--
.../crates/start-core/src/net/vhost.rs | 370 ++++++++++++++----
.../src/net/vhost/plain_http_tests.rs | 44 +++
4 files changed, 381 insertions(+), 101 deletions(-)
create mode 100644 projects/start-os/changelog/patch-fixed-connections-survive-address-changes.md
diff --git a/projects/start-os/changelog/patch-fixed-connections-survive-address-changes.md b/projects/start-os/changelog/patch-fixed-connections-survive-address-changes.md
new file mode 100644
index 0000000000..60adf13911
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-connections-survive-address-changes.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- Adding, removing or reconfiguring a gateway, or switching an address off, no longer disconnects open sessions on the addresses that remain enabled. Deleting a gateway no longer reports an error after it succeeds.
diff --git a/shared-libs/crates/start-core/src/net/net_controller.rs b/shared-libs/crates/start-core/src/net/net_controller.rs
index f9c1412815..5b88a3139c 100644
--- a/shared-libs/crates/start-core/src/net/net_controller.rs
+++ b/shared-libs/crates/start-core/src/net/net_controller.rs
@@ -505,8 +505,8 @@ fn retired_hosts<'a>(held: impl Iterator- , current: &Hosts) ->
#[derive(Debug)]
enum ProxyHandle {
- Tls { _owner: Arc<()> },
- Plaintext { _server: PlainHttpProxy },
+ Tls { owner: Arc<()> },
+ Plaintext { server: PlainHttpProxy },
}
#[derive(Default, Debug)]
@@ -988,32 +988,43 @@ impl NetServiceData {
.cloned()
.collect::>();
for key in all {
- let mut prev = binds.vhosts.remove(&key);
+ let prev = binds.vhosts.remove(&key);
if let Some(target) = vhosts.remove(&key) {
- prev = prev.filter(|(t, _)| t == &target);
- binds.vhosts.insert(
- key.clone(),
- if let Some(prev) = prev {
- prev
- } else {
- (
- target.clone(),
- if http_ports.contains(&key.1) {
- ProxyHandle::Plaintext {
- _server: ctrl.vhost.plaintext_proxy(key.1, target),
- }
- } else {
- ProxyHandle::Tls {
- _owner: ctrl.vhost.add(
- key.0,
- key.1,
- DynVHostTarget::new(target),
- )?,
- }
- },
- )
+ let plaintext = http_ports.contains(&key.1);
+ let handle = match prev {
+ Some((prev, handle)) if prev == target => handle,
+ Some((prev, ProxyHandle::Tls { owner })) if !plaintext => ProxyHandle::Tls {
+ owner: ctrl.vhost.replace(
+ key.0.clone(),
+ key.1,
+ &DynVHostTarget::new(prev),
+ owner,
+ DynVHostTarget::new(target.clone()),
+ )?,
},
- );
+ Some((_, ProxyHandle::Plaintext { server }))
+ if plaintext && server.retarget(&target) =>
+ {
+ ProxyHandle::Plaintext { server }
+ }
+ prev => {
+ drop(prev);
+ if plaintext {
+ ProxyHandle::Plaintext {
+ server: ctrl.vhost.plaintext_proxy(key.1, target.clone()),
+ }
+ } else {
+ ProxyHandle::Tls {
+ owner: ctrl.vhost.add(
+ key.0.clone(),
+ key.1,
+ DynVHostTarget::new(target.clone()),
+ )?,
+ }
+ }
+ }
+ };
+ binds.vhosts.insert(key, (target, handle));
} else {
if let Some((_, handle)) = prev {
let tls = matches!(handle, ProxyHandle::Tls { .. });
diff --git a/shared-libs/crates/start-core/src/net/vhost.rs b/shared-libs/crates/start-core/src/net/vhost.rs
index 8b8ac56805..c308e01b21 100644
--- a/shared-libs/crates/start-core/src/net/vhost.rs
+++ b/shared-libs/crates/start-core/src/net/vhost.rs
@@ -57,7 +57,7 @@ use crate::util::collections::EqSet;
use crate::util::future::NonDetachingJoinHandle;
use crate::util::io::ReadWriter;
use crate::util::serde::{HandlerExtSerde, MaybeUtf8String, display_serializable};
-use crate::util::sync::{SyncMutex, Watch};
+use crate::util::sync::{SyncMutex, SyncRwLock, Watch};
use crate::{GatewayId, HOST_IP, HostId, PackageId, ResultExt};
/// Identifies which service+host contributed a set of SNI hostname mappings, so
@@ -337,6 +337,28 @@ impl VHostController {
})
}
+ /// The owner must be the one `add` returned for the replaced target.
+ #[instrument(skip_all)]
+ pub fn replace(
+ &self,
+ hostname: Option,
+ external: u16,
+ prev: &DynVHostTarget,
+ owner: Arc<()>,
+ next: DynVHostTarget,
+ ) -> Result, Error> {
+ self.servers.mutate(|writable| {
+ let server = if let Some(server) = writable.remove(&external) {
+ server
+ } else {
+ self.create_server(external)
+ };
+ let rc = server.replace(hostname, prev, owner, next, self.max_proxy_conns_per_target);
+ writable.insert(external, server);
+ Ok(rc?)
+ })
+ }
+
/// Once per name until a certificate lands: the address refuses
/// connections meanwhile, and nothing else would say why.
fn report_acme_failure(&self) -> ReportOrderFailure {
@@ -935,6 +957,16 @@ pub trait VHostTarget: std::fmt::Debug + Eq {
fn filter_private(&self, metadata: &::Metadata) -> bool {
false
}
+ /// Whether an established stream may stay on this target.
+ #[allow(unused_variables)]
+ fn admits(&self, arrival: &Arrival) -> bool {
+ true
+ }
+ /// Whether the two relay a stream identically.
+ #[allow(unused_variables)]
+ fn routes_like(&self, other: &Self) -> bool {
+ false
+ }
fn acme(&self) -> Option<&AcmeProvider> {
None
}
@@ -963,6 +995,8 @@ pub trait VHostTarget: std::fmt::Debug + Eq {
pub trait DynVHostTargetT: std::fmt::Debug + Any {
fn filter(&self, metadata: &::Metadata) -> bool;
fn filter_private(&self, metadata: &::Metadata) -> bool;
+ fn admits(&self, arrival: &Arrival) -> bool;
+ fn routes_like(&self, other: &dyn DynVHostTargetT) -> bool;
fn acme(&self) -> Option<&AcmeProvider>;
fn bind_requirements(&self) -> (BTreeSet, BTreeSet);
fn is_passthrough(&self) -> bool;
@@ -990,6 +1024,14 @@ impl + 'static> DynVHostTargetT for T {
fn filter_private(&self, metadata: &::Metadata) -> bool {
VHostTarget::filter_private(self, metadata)
}
+ fn admits(&self, arrival: &Arrival) -> bool {
+ >::admits(self, arrival)
+ }
+ fn routes_like(&self, other: &dyn DynVHostTargetT) -> bool {
+ (other as &dyn Any)
+ .downcast_ref()
+ .is_some_and(|other| >::routes_like(self, other))
+ }
fn acme(&self) -> Option<&AcmeProvider> {
VHostTarget::acme(self)
}
@@ -1116,19 +1158,11 @@ pub struct ProxyTarget {
}
impl PartialEq for ProxyTarget {
fn eq(&self, other: &Self) -> bool {
- self.public_v4 == other.public_v4
+ self.same_route(other)
+ && self.public_v4 == other.public_v4
&& self.public_v6 == other.public_v6
&& self.public_v6_gateways == other.public_v6_gateways
&& self.private == other.private
- && self.acme == other.acme
- && self.addr == other.addr
- && self.addr_v6 == other.addr_v6
- && self.proxy == other.proxy
- && self.passthrough == other.passthrough
- && self.preserve_source_ip == other.preserve_source_ip
- && self.alpn == other.alpn
- && self.connect_ssl.as_ref().map(Arc::as_ptr)
- == other.connect_ssl.as_ref().map(Arc::as_ptr)
}
}
impl Eq for ProxyTarget {}
@@ -1192,6 +1226,23 @@ impl ProxyTarget {
wan || self.accepts_as_private(subnets, src, dst)
}
+ fn accepts_arrival(&self, at: &Arrival) -> bool {
+ self.accepts(&at.gateway, &at.subnets, at.src, at.dst)
+ }
+
+ /// Whether the two differ at most in which arrivals they accept.
+ fn same_route(&self, other: &Self) -> bool {
+ self.acme == other.acme
+ && self.addr == other.addr
+ && self.addr_v6 == other.addr_v6
+ && self.proxy == other.proxy
+ && self.passthrough == other.passthrough
+ && self.preserve_source_ip == other.preserve_source_ip
+ && self.alpn == other.alpn
+ && self.connect_ssl.as_ref().map(Arc::as_ptr)
+ == other.connect_ssl.as_ref().map(Arc::as_ptr)
+ }
+
/// A dial of one of our own private addresses from that address's network.
/// On IPv4 the source is all that separates it from a forwarded one.
fn accepts_as_private(&self, subnets: &OrdSet, src: IpAddr, dst: IpAddr) -> bool {
@@ -1351,7 +1402,8 @@ impl ProxyTarget {
}
}
-struct Arrival {
+#[derive(Debug)]
+pub struct Arrival {
gateway: GatewayId,
subnets: OrdSet,
src: IpAddr,
@@ -1390,10 +1442,7 @@ where
{
type PreprocessRes = (AcceptStream, Option);
fn filter(&self, metadata: &::Metadata) -> bool {
- let Some(at) = arrival::(metadata) else {
- return false;
- };
- self.accepts(&at.gateway, &at.subnets, at.src, at.dst)
+ arrival::(metadata).is_some_and(|at| self.accepts_arrival(&at))
}
fn filter_private(&self, metadata: &::Metadata) -> bool {
let Some(at) = arrival::(metadata) else {
@@ -1401,6 +1450,12 @@ where
};
self.accepts_as_private(&at.subnets, at.src, at.dst)
}
+ fn admits(&self, arrival: &Arrival) -> bool {
+ self.accepts_arrival(arrival)
+ }
+ fn routes_like(&self, other: &Self) -> bool {
+ self.same_route(other)
+ }
fn acme(&self) -> Option<&AcmeProvider> {
self.acme.as_ref()
}
@@ -1501,7 +1556,8 @@ where
ctx: ProxyContext,
) {
let target = self.clone();
- let (stream, registration, conn_cancel) = ctx.track_with(stream);
+ let (stream, registration, conn_cancel) =
+ ctx.track_with(stream, arrival::(&metadata.inner));
tokio::spawn(async move {
let _registration = registration;
let _origin_registration = origin_registration;
@@ -1604,30 +1660,56 @@ impl AsyncWrite for ActivityStream
{
struct ConnEntry {
last_active: Arc,
cancel: CancellationToken,
+ arrival: Option,
+}
+
+type Admission = Arc bool + Send + Sync>;
+
+#[derive(Default)]
+struct Conns {
+ entries: HashMap,
+ admission: Option,
}
/// Per-target proxy-task registry with LRU eviction at the cap.
-#[derive(Debug)]
pub struct ConnRegistry {
cap: usize,
next_id: AtomicU64,
- entries: SyncMutex>,
+ conns: SyncMutex,
+}
+impl fmt::Debug for ConnRegistry {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ f.debug_struct("ConnRegistry")
+ .field("cap", &self.cap)
+ .finish_non_exhaustive()
+ }
}
impl ConnRegistry {
pub fn new(cap: usize) -> Arc {
Arc::new(Self {
cap,
next_id: AtomicU64::new(0),
- entries: SyncMutex::new(HashMap::new()),
+ conns: SyncMutex::new(Conns::default()),
})
}
fn register(
self: &Arc,
last_active: Arc,
cancel: CancellationToken,
+ arrival: Option,
) -> ConnRegHandle {
let id = self.next_id.fetch_add(1, Ordering::Relaxed);
- self.entries.mutate(|m| {
+ self.conns.mutate(|conns| {
+ let admitted = match (&conns.admission, &arrival) {
+ (None, _) => true,
+ (Some(admits), Some(at)) => admits(at),
+ (Some(_), None) => false,
+ };
+ if !admitted {
+ cancel.cancel();
+ return;
+ }
+ let m = &mut conns.entries;
if m.len() >= self.cap {
if let Some((victim_id, victim)) = m
.iter()
@@ -1643,6 +1725,7 @@ impl ConnRegistry {
ConnEntry {
last_active,
cancel,
+ arrival,
},
);
});
@@ -1651,9 +1734,22 @@ impl ConnRegistry {
registry: Arc::downgrade(self),
}
}
+ /// Cancels each stream the predicate rejects, including streams registered later.
+ fn readmit(&self, admits: Admission) {
+ self.conns.mutate(|conns| {
+ conns.entries.retain(|_, entry| {
+ let kept = entry.arrival.as_ref().is_some_and(|at| admits(at));
+ if !kept {
+ entry.cancel.cancel();
+ }
+ kept
+ });
+ conns.admission = Some(admits);
+ });
+ }
#[cfg(test)]
fn len(&self) -> usize {
- self.entries.peek(|m| m.len())
+ self.conns.peek(|c| c.entries.len())
}
}
@@ -1664,8 +1760,8 @@ pub struct ConnRegHandle {
impl Drop for ConnRegHandle {
fn drop(&mut self) {
if let Some(r) = self.registry.upgrade() {
- r.entries.mutate(|m| {
- m.remove(&self.id);
+ r.conns.mutate(|c| {
+ c.entries.remove(&self.id);
});
}
}
@@ -1687,18 +1783,19 @@ impl ProxyContext {
let last_active = Arc::new(AtomicU64::new(monotonic_millis()));
let handle = self
.registry
- .register(last_active.clone(), self.cancel.child_token());
+ .register(last_active.clone(), self.cancel.child_token(), None);
(ActivityStream::new(stream, last_active), handle)
}
pub fn track_with(
&self,
stream: AcceptStream,
+ arrival: Option,
) -> (AcceptStream, ConnRegHandle, CancellationToken) {
let last_active = Arc::new(AtomicU64::new(monotonic_millis()));
let conn_cancel = self.cancel.child_token();
let handle = self
.registry
- .register(last_active.clone(), conn_cancel.clone());
+ .register(last_active.clone(), conn_cancel.clone(), arrival);
let wrapped: Pin> =
Box::pin(ActivityStream::new(stream, last_active));
(wrapped, handle, conn_cancel)
@@ -1706,7 +1803,9 @@ impl ProxyContext {
}
pub struct PlainHttpProxy {
- cancel: CancellationToken,
+ target: Arc>,
+ requirements: Watch,
+ ctx: ProxyContext,
_thread: NonDetachingJoinHandle<()>,
}
@@ -1725,12 +1824,7 @@ impl PlainHttpProxy {
target: ProxyTarget,
max_connections: usize,
) -> Self {
- let (public_gateways, private_ips) =
- VHostTarget::::bind_requirements(&target);
- let requirements = Watch::new(VHostBindRequirements {
- public_gateways,
- private_ips,
- });
+ let requirements = Watch::new(Self::requirements(&target));
Self::serve(
VHostBindListener::new(interfaces, port, requirements),
target,
@@ -1738,10 +1832,38 @@ impl PlainHttpProxy {
)
}
+ fn requirements(target: &ProxyTarget) -> VHostBindRequirements {
+ let (public_gateways, private_ips) =
+ VHostTarget::::bind_requirements(target);
+ VHostBindRequirements {
+ public_gateways,
+ private_ips,
+ }
+ }
+
+ /// Swaps in a target that routes like the current one, cancelling the
+ /// streams it does not accept. Any other target is refused.
+ pub fn retarget(&self, next: &ProxyTarget) -> bool {
+ if !self.target.peek(|target| target.same_route(next)) {
+ return false;
+ }
+ self.target.replace(next.clone());
+ self.requirements.send(Self::requirements(next));
+ let admits = next.clone();
+ self.ctx
+ .registry
+ .readmit(Arc::new(move |at| admits.accepts_arrival(at)));
+ true
+ }
+
fn serve(mut listener: VHostBindListener, target: ProxyTarget, max_connections: usize) -> Self {
let ctx = ProxyContext::new(max_connections);
- let cancel = ctx.cancel.clone();
+ let requirements = listener.bind_reqs.clone();
+ let target = Arc::new(SyncRwLock::new(target));
+ let current = target.clone();
+ let accepting = ctx.clone();
let thread = tokio::spawn(async move {
+ let ctx = accepting;
loop {
let accepted = futures::future::poll_fn(|cx| listener.poll_accept(cx)).await;
let (metadata, stream) = match accepted {
@@ -1751,11 +1873,14 @@ impl PlainHttpProxy {
continue;
}
};
- if !VHostTarget::::filter(&target, &metadata) {
+ let Some(target) = current.peek(|target| {
+ VHostTarget::::filter(target, &metadata)
+ .then(|| target.clone())
+ }) else {
continue;
- }
- let target = target.clone();
- let (stream, registration, conn_cancel) = ctx.track_with(stream);
+ };
+ let (stream, registration, conn_cancel) =
+ ctx.track_with(stream, arrival::(&metadata));
tokio::spawn(async move {
let _registration = registration;
let work = async {
@@ -1781,7 +1906,9 @@ impl PlainHttpProxy {
}
});
Self {
- cancel,
+ target,
+ requirements,
+ ctx,
_thread: thread.into(),
}
}
@@ -1789,7 +1916,7 @@ impl PlainHttpProxy {
impl Drop for PlainHttpProxy {
fn drop(&mut self) {
- self.cancel.cancel();
+ self.ctx.cancel.cancel();
}
}
@@ -2269,6 +2396,50 @@ impl VHostServer {
))
}
}
+ /// Keeps the streams the new target admits when it routes like a solely
+ /// owned entry; otherwise drops the owner, then adds the new target.
+ fn replace(
+ &self,
+ hostname: Option,
+ prev: &DynVHostTarget,
+ owner: Arc<()>,
+ next: DynVHostTarget,
+ max_proxy_conns_per_target: usize,
+ ) -> Result, Error> {
+ if prev == &next {
+ return Ok(owner);
+ }
+ let moved = self.mapping.watcher_count() > 1
+ && Arc::strong_count(&owner) == 1
+ && prev.0.routes_like(&*next.0)
+ && self.mapping.send_if_modified(|writable| {
+ let Some(targets) = writable.get_mut(&hostname) else {
+ return false;
+ };
+ let owned = targets
+ .get(prev)
+ .is_some_and(|entry| Weak::ptr_eq(&entry.rc, &Arc::downgrade(&owner)));
+ if !owned || targets.contains_key(&next) {
+ return false;
+ }
+ let Some(entry) = targets.remove(prev) else {
+ return false;
+ };
+ let admits = next.clone();
+ entry
+ .ctx
+ .registry
+ .readmit(Arc::new(move |at| admits.0.admits(at)));
+ targets.insert(next.clone(), entry);
+ self.update_bind_reqs(writable);
+ true
+ });
+ if moved {
+ return Ok(owner);
+ }
+ drop(owner);
+ self.add(hostname, next, max_proxy_conns_per_target)
+ }
fn gc(&self, hostname: Option) {
self.mapping.send_if_modified(|writable| {
let mut targets = writable.remove(&hostname).unwrap_or_default();
@@ -2823,6 +2994,7 @@ mod accept_filter_tests {
#[cfg(test)]
mod conn_cap_tests {
+ use std::net::Ipv4Addr;
use std::time::Duration;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
@@ -2834,11 +3006,11 @@ mod conn_cap_tests {
let registry = ConnRegistry::new(2);
let cancel1 = CancellationToken::new();
- let _h1 = registry.register(Arc::new(AtomicU64::new(100)), cancel1.clone());
+ let _h1 = registry.register(Arc::new(AtomicU64::new(100)), cancel1.clone(), None);
let cancel2 = CancellationToken::new();
- let _h2 = registry.register(Arc::new(AtomicU64::new(200)), cancel2.clone());
+ let _h2 = registry.register(Arc::new(AtomicU64::new(200)), cancel2.clone(), None);
let cancel3 = CancellationToken::new();
- let _h3 = registry.register(Arc::new(AtomicU64::new(300)), cancel3.clone());
+ let _h3 = registry.register(Arc::new(AtomicU64::new(300)), cancel3.clone(), None);
assert!(cancel1.is_cancelled());
assert!(!cancel2.is_cancelled());
@@ -2853,11 +3025,12 @@ mod conn_cap_tests {
let _stale = registry.register(
Arc::new(AtomicU64::new(monotonic_millis())),
stale_cancel.clone(),
+ None,
);
let busy_active = Arc::new(AtomicU64::new(monotonic_millis()));
let busy_cancel = CancellationToken::new();
- let _busy = registry.register(busy_active.clone(), busy_cancel.clone());
+ let _busy = registry.register(busy_active.clone(), busy_cancel.clone(), None);
let (a, mut b) = tokio::io::duplex(64);
let mut wrapped = ActivityStream::new(a, busy_active.clone());
@@ -2870,6 +3043,7 @@ mod conn_cap_tests {
let _new = registry.register(
Arc::new(AtomicU64::new(monotonic_millis())),
new_cancel.clone(),
+ None,
);
assert!(stale_cancel.is_cancelled());
@@ -2883,12 +3057,48 @@ mod conn_cap_tests {
let _h = registry.register(
Arc::new(AtomicU64::new(monotonic_millis())),
CancellationToken::new(),
+ None,
);
assert_eq!(registry.len(), 1);
}
assert_eq!(registry.len(), 0);
}
+ #[tokio::test]
+ async fn readmission_cancels_rejected_streams_including_later_ones() {
+ let registry = ConnRegistry::new(8);
+ let arrival = |dst: [u8; 4]| Arrival {
+ gateway: "eth0".parse().unwrap(),
+ subnets: OrdSet::new(),
+ src: Ipv4Addr::new(192, 168, 1, 9).into(),
+ dst: Ipv4Addr::from(dst).into(),
+ };
+ let track = |arrival: Option| {
+ let cancel = CancellationToken::new();
+ let handle = registry.register(
+ Arc::new(AtomicU64::new(monotonic_millis())),
+ cancel.clone(),
+ arrival,
+ );
+ (cancel, handle)
+ };
+ let (earlier_kept, _h1) = track(Some(arrival([192, 168, 1, 2])));
+ let (earlier_dropped, _h2) = track(Some(arrival([10, 0, 0, 2])));
+
+ let kept: IpAddr = Ipv4Addr::new(192, 168, 1, 2).into();
+ registry.readmit(Arc::new(move |at| at.dst == kept));
+ assert!(!earlier_kept.is_cancelled());
+ assert!(earlier_dropped.is_cancelled());
+
+ let (later_kept, _h3) = track(Some(arrival([192, 168, 1, 2])));
+ let (later_dropped, _h4) = track(Some(arrival([10, 0, 0, 2])));
+ let (unknown, _h5) = track(None);
+ assert!(!later_kept.is_cancelled());
+ assert!(later_dropped.is_cancelled());
+ assert!(unknown.is_cancelled());
+ assert_eq!(registry.len(), 2);
+ }
+
#[tokio::test]
async fn target_cancel_wakes_idle_proxy_task() {
let ctx = ProxyContext::new(MAX_PROXY_CONNS_PER_TARGET);
@@ -3264,7 +3474,7 @@ mod upstream_alpn_tests {
}
#[tokio::test]
- async fn disabling_an_address_disconnects_its_stream_and_gates_new_arrivals() {
+ async fn disabling_an_address_disconnects_only_its_streams_and_gates_new_arrivals() {
tokio::time::timeout(Duration::from_secs(10), async {
let backend = TcpListener::bind((Ipv4Addr::LOCALHOST, 0)).await.unwrap();
let backend_addr = backend.local_addr().unwrap();
@@ -3341,41 +3551,51 @@ mod upstream_alpn_tests {
let owner = server
.add(None, DynVHostTarget::new(before.clone()), 4)
.unwrap();
- let connector =
- TlsConnector::from(Arc::new(client_config_no_verify(provider()).unwrap()));
- let name = ServerName::IpAddress(Ipv4Addr::LOCALHOST.into());
- let mut established = connector
- .connect(name.clone(), TcpStream::connect(old_addr).await.unwrap())
- .await
- .unwrap();
- established.write_all(b"a").await.unwrap();
- established.flush().await.unwrap();
- let mut byte = [0];
- established.read_exact(&mut byte).await.unwrap();
- assert_eq!(&byte, b"a");
- let mut after = before;
+ let mut disabled = dial(old_addr).await.unwrap();
+ let mut kept = dial(new_addr).await.unwrap();
+ assert!(echoes(&mut disabled, b'a').await);
+ assert!(echoes(&mut kept, b'b').await);
+ let mut after = before.clone();
after.private = BTreeSet::from([new_addr.ip()]);
- drop(owner);
- let _replacement_owner = server.add(None, DynVHostTarget::new(after), 4).unwrap();
+ let _owner = server
+ .replace(
+ None,
+ &DynVHostTarget::new(before),
+ owner,
+ DynVHostTarget::new(after),
+ 4,
+ )
+ .unwrap();
assert!(
- established.read_exact(&mut byte).await.is_err(),
- "disabling an address ends the established stream"
+ !echoes(&mut disabled, b'c').await,
+ "disabling an address ends its established stream"
);
- let refused = TcpStream::connect(old_addr)
- .await
- .expect("the old address remains bound");
- assert!(connector.connect(name.clone(), refused).await.is_err());
- let mut fresh = connector
- .connect(name, TcpStream::connect(new_addr).await.unwrap())
- .await
- .unwrap();
- fresh.write_all(b"c").await.unwrap();
- fresh.flush().await.unwrap();
- fresh.read_exact(&mut byte).await.unwrap();
- assert_eq!(&byte, b"c");
+ assert!(
+ echoes(&mut kept, b'd').await,
+ "a stream on a still-enabled address survives"
+ );
+ assert!(dial(old_addr).await.is_err());
+ assert!(echoes(&mut dial(new_addr).await.unwrap(), b'e').await);
})
.await
- .expect("address disable disconnects the stream and gates arrivals within 10s");
+ .expect("address disable disconnects its stream and gates arrivals within 10s");
+ }
+
+ async fn dial(addr: SocketAddr) -> std::io::Result> {
+ let tcp = TcpStream::connect(addr)
+ .await
+ .expect("the address remains bound");
+ TlsConnector::from(Arc::new(client_config_no_verify(provider()).unwrap()))
+ .connect(ServerName::IpAddress(Ipv4Addr::LOCALHOST.into()), tcp)
+ .await
+ }
+
+ async fn echoes(stream: &mut (impl AsyncRead + AsyncWrite + Unpin), byte: u8) -> bool {
+ let mut echoed = [0];
+ stream.write_all(&[byte]).await.is_ok()
+ && stream.flush().await.is_ok()
+ && stream.read_exact(&mut echoed).await.is_ok()
+ && echoed == [byte]
}
#[tokio::test]
diff --git a/shared-libs/crates/start-core/src/net/vhost/plain_http_tests.rs b/shared-libs/crates/start-core/src/net/vhost/plain_http_tests.rs
index 6615d0f5b0..b69c9f578e 100644
--- a/shared-libs/crates/start-core/src/net/vhost/plain_http_tests.rs
+++ b/shared-libs/crates/start-core/src/net/vhost/plain_http_tests.rs
@@ -280,6 +280,50 @@ async fn dropping_a_plaintext_proxy_cancels_existing_streams_and_releases_its_li
.unwrap();
}
+#[tokio::test]
+async fn retargeting_a_plaintext_proxy_keeps_only_the_streams_it_still_accepts() {
+ tokio::time::timeout(Duration::from_secs(10), async {
+ let (upstream, mut requests, _backend) = backend().await;
+ let (addr, server) = proxy(
+ "127.0.0.1".parse().unwrap(),
+ upstream,
+ ProxyOptions::Http {
+ add_x_forwarded_headers: false,
+ auth: None,
+ },
+ 4,
+ )
+ .await;
+ let (mut client, _connection) = client(addr).await;
+ assert_eq!(
+ client.send_request(request(None)).await.unwrap().status(),
+ StatusCode::OK
+ );
+ requests.recv().await.unwrap();
+
+ let mut widened = server.target.read();
+ widened.private.insert("127.0.0.3".parse().unwrap());
+ assert!(server.retarget(&widened));
+ assert_eq!(
+ client.send_request(request(None)).await.unwrap().status(),
+ StatusCode::OK,
+ "a stream the new target accepts survives"
+ );
+ requests.recv().await.unwrap();
+
+ let mut rerouted = widened.clone();
+ rerouted.addr = "127.0.0.1:1".parse().unwrap();
+ assert!(!server.retarget(&rerouted));
+
+ let mut narrowed = widened;
+ narrowed.private.remove(&addr.ip());
+ assert!(server.retarget(&narrowed));
+ assert!(client.send_request(request(None)).await.is_err());
+ })
+ .await
+ .unwrap();
+}
+
#[tokio::test]
async fn plaintext_connection_cap_evicts_an_idle_connection() {
tokio::time::timeout(Duration::from_secs(10), async {
From f09a25521fc6a0fe059e8f65e775d5642a49e8c4 Mon Sep 17 00:00:00 2001
From: Helix the Red <355572797+helix-red@users.noreply.github.com>
Date: Wed, 18 Nov 2026 13:05:36 -0700
Subject: [PATCH 05/38] fix(gateway): honor WireGuard MTU on gateway import and
update (#4791)
* fix(gateway): honor WireGuard MTU on gateway import and update
WgConfig dropped `MTU =` from [Interface], so imported gateways ran at
NetworkManager's automatic MTU (the kernel's 1420). Parse and validate
it, and emit `wireguard.mtu` in the NM settings used by both add and
update.
NetworkManager 1.52 refuses a Device.Reapply that changes
`wireguard.mtu` (nm-device-wireguard.c can_reapply_change), so the
update path reapplies with the applied connection's MTU and sets the
new link MTU directly; Update2 still persists the new value for the
next activation.
Closes #4786
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
* fix(gateway): reactivate WireGuard gateways whose MTU changes
NetworkManager rejects a Reapply that changes wireguard.mtu, and its
deferred post-Reapply MTU commit restores the applied MTU, so a direct
link write could be reverted and an applied MTU that never changed made
later comparisons stale. An update that changes the MTU now reactivates
the connection: NM restores the original link MTU on deactivation and
applies the saved profile's MTU on activation. Other updates still
Reapply in place.
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
* fix(gateway): wait for WireGuard reactivation to complete
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
---------
Co-authored-by: helix-white <267227783+helix-a@users.noreply.github.com>
---
.../patch-fixed-wireguard-gateway-mtu.md | 5 +
.../crates/start-core/src/net/gateway.rs | 142 +++++++++++++++++-
.../crates/start-core/src/net/tunnel.rs | 8 +-
3 files changed, 144 insertions(+), 11 deletions(-)
create mode 100644 projects/start-os/changelog/patch-fixed-wireguard-gateway-mtu.md
diff --git a/projects/start-os/changelog/patch-fixed-wireguard-gateway-mtu.md b/projects/start-os/changelog/patch-fixed-wireguard-gateway-mtu.md
new file mode 100644
index 0000000000..eb0a187c55
--- /dev/null
+++ b/projects/start-os/changelog/patch-fixed-wireguard-gateway-mtu.md
@@ -0,0 +1,5 @@
+---
+release-notes: false
+---
+
+- WireGuard gateways now honor the `MTU` setting in their configuration, both when added and when their configuration is updated. Configurations without it still use the automatic MTU. Updating a gateway's configuration to a different MTU briefly reconnects it.
diff --git a/shared-libs/crates/start-core/src/net/gateway.rs b/shared-libs/crates/start-core/src/net/gateway.rs
index 2e0962a208..8d071a2f2f 100644
--- a/shared-libs/crates/start-core/src/net/gateway.rs
+++ b/shared-libs/crates/start-core/src/net/gateway.rs
@@ -248,6 +248,8 @@ pub(crate) async fn wireguard_psk(interface: &str) -> Result