feat(network): add opt-in allow local/private network setting

Add a setting that relaxes the SSRF guard so extensions and built-in network code can reach private/local/loopback targets, for users routing traffic through a local proxy or custom DNS. Disabled by default. Wired end-to-end: Go backend (SetAllowPrivateNetwork toggles isPrivateIP guard), Android/iOS platform bridge, Dart settings model/provider, and a toggle in Download settings.
This commit is contained in:
zarzet
2026-06-26 20:29:15 +07:00
parent af4e4561ec
commit f0acda0f01
8 changed files with 79 additions and 0 deletions
@@ -221,6 +221,17 @@ class _DownloadSettingsPageState extends ConsumerState<DownloadSettingsPage> {
onChanged: (value) => ref
.read(settingsProvider.notifier)
.setNetworkCompatibilityMode(value),
),
SettingsSwitchItem(
icon: Icons.lan_outlined,
title: context.l10n.downloadAllowLocalNetwork,
subtitle: settings.allowLocalNetwork
? context.l10n.downloadAllowLocalNetworkEnabled
: context.l10n.downloadAllowLocalNetworkDisabled,
value: settings.allowLocalNetwork,
onChanged: (value) => ref
.read(settingsProvider.notifier)
.setAllowLocalNetwork(value),
showDivider: false,
),
],