Adding allowed private hosts for read_web_page tool to managed settings. This enables a whitelist because all other private hosts will be blocked

This commit is contained in:
Nils Kruthoff 2026-05-18 15:26:33 +02:00
parent f2c63ac4b5
commit 1f42c8ad4c
No known key found for this signature in database
GPG Key ID: A5C0151B4DDB172C
4 changed files with 20 additions and 0 deletions

View File

@ -222,6 +222,14 @@ CONFIG["SETTINGS"] = {}
-- ["get_current_weather"] = "NONE" -- ["get_current_weather"] = "NONE"
-- } -- }
-- Configure private or VPN hosts that the Read Web Page tool may access.
-- Public web pages do not need to be listed here.
-- Private hosts listed here still require a provider with HIGH confidence before any page content is sent to the model.
-- Separate host patterns with commas. Wildcards only match subdomains, so add the root domain separately if needed.
-- Examples:
-- CONFIG["SETTINGS"]["DataTools.ReadWebPageAllowedPrivateHosts"] = "dlr.de, *.dlr.de"
-- CONFIG["SETTINGS"]["DataTools.ReadWebPageAllowedPrivateHosts.AllowUserOverride"] = false
-- Example chat templates for this configuration: -- Example chat templates for this configuration:
CONFIG["CHAT_TEMPLATES"] = {} CONFIG["CHAT_TEMPLATES"] = {}

View File

@ -20,4 +20,9 @@ public sealed class DataTools(Expression<Func<Data, DataTools>>? configSelection
configSelection, configSelection,
x => x.MinimumProviderConfidenceByToolId, x => x.MinimumProviderConfidenceByToolId,
new Dictionary<string, string>(StringComparer.Ordinal)); new Dictionary<string, string>(StringComparer.Ordinal));
public string ReadWebPageAllowedPrivateHosts { get; set; } = ManagedConfiguration.Register<DataTools>(
configSelection,
x => x.ReadWebPageAllowedPrivateHosts,
string.Empty);
} }

View File

@ -136,6 +136,9 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
// Config: minimum provider confidence per tool // Config: minimum provider confidence per tool
ManagedConfiguration.TryProcessConfiguration(x => x.Tools, x => x.MinimumProviderConfidenceByToolId, this.Id, settingsTable, dryRun); ManagedConfiguration.TryProcessConfiguration(x => x.Tools, x => x.MinimumProviderConfidenceByToolId, this.Id, settingsTable, dryRun);
// Config: private hosts allowed for the read web page tool
ManagedConfiguration.TryProcessConfiguration(x => x.Tools, x => x.ReadWebPageAllowedPrivateHosts, this.Id, settingsTable, dryRun);
// Handle configured LLM providers: // Handle configured LLM providers:
PluginConfigurationObject.TryParse(PluginConfigurationObjectType.LLM_PROVIDER, x => x.Providers, x => x.NextProviderNum, mainTable, this.Id, ref this.configObjects, dryRun); PluginConfigurationObject.TryParse(PluginConfigurationObjectType.LLM_PROVIDER, x => x.Providers, x => x.NextProviderNum, mainTable, this.Id, ref this.configObjects, dryRun);

View File

@ -242,6 +242,10 @@ public static partial class PluginFactory
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.Tools, x => x.MinimumProviderConfidenceByToolId, AVAILABLE_PLUGINS)) if(ManagedConfiguration.IsConfigurationLeftOver(x => x.Tools, x => x.MinimumProviderConfidenceByToolId, AVAILABLE_PLUGINS))
wasConfigurationChanged = true; wasConfigurationChanged = true;
// Check for private hosts allowed for the read web page tool:
if(ManagedConfiguration.IsConfigurationLeftOver(x => x.Tools, x => x.ReadWebPageAllowedPrivateHosts, AVAILABLE_PLUGINS))
wasConfigurationChanged = true;
if (wasConfigurationChanged) if (wasConfigurationChanged)
{ {
await SETTINGS_MANAGER.StoreSettings(); await SETTINGS_MANAGER.StoreSettings();