From b5e4615231cc3f042cf2235ffa7b5970cbbd5f08 Mon Sep 17 00:00:00 2001 From: Archan Datta Date: Thu, 22 Jan 2026 14:30:20 +0000 Subject: [PATCH 1/3] feat: update default browser to duckduckgo --- shared/chromium-policies/managed/policy.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared/chromium-policies/managed/policy.json b/shared/chromium-policies/managed/policy.json index f6f081d4..25139647 100644 --- a/shared/chromium-policies/managed/policy.json +++ b/shared/chromium-policies/managed/policy.json @@ -3,6 +3,10 @@ "AutofillCreditCardEnabled": false, "TranslateEnabled": false, "DefaultNotificationsSetting": 2, + "DefaultSearchProviderEnabled": true, + "DefaultSearchProviderName": "DuckDuckGo", + "DefaultSearchProviderSearchURL": "https://duckduckgo.com/?q={searchTerms}", + "DefaultSearchProviderSuggestURL": "https://duckduckgo.com/ac/?q={searchTerms}", "ExtensionSettings": { "*": { "allowed_types": ["extension"], From e84034ecdfdc86b96a7d98b029743ba553470e42 Mon Sep 17 00:00:00 2001 From: Archan Datta Date: Thu, 22 Jan 2026 14:41:52 +0000 Subject: [PATCH 2/3] feat: add new policy types to policy.go --- server/lib/policy/policy.go | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/server/lib/policy/policy.go b/server/lib/policy/policy.go index 3eda5332..3c62a555 100644 --- a/server/lib/policy/policy.go +++ b/server/lib/policy/policy.go @@ -12,6 +12,9 @@ import ( ) const PolicyPath = "/etc/chromium/policies/managed/policy.json" +const DefaultSearchProviderName = "DuckDuckGo" +const DefaultSearchProviderSearchURL = "https://duckduckgo.com/?q={searchTerms}" +const DefaultSearchProviderSuggestURL = "https://duckduckgo.com/ac/?q={searchTerms}" // Chrome extension IDs are 32 lowercase a-p characters var extensionIDRegex = regexp.MustCompile(`^[a-p]{32}$`) @@ -20,12 +23,16 @@ var extensionIDRegex = regexp.MustCompile(`^[a-p]{32}$`) type Policy struct { mu sync.Mutex - PasswordManagerEnabled bool `json:"PasswordManagerEnabled"` - AutofillCreditCardEnabled bool `json:"AutofillCreditCardEnabled"` - TranslateEnabled bool `json:"TranslateEnabled"` - DefaultNotificationsSetting int `json:"DefaultNotificationsSetting"` - ExtensionInstallForcelist []string `json:"ExtensionInstallForcelist,omitempty"` - ExtensionSettings map[string]ExtensionSetting `json:"ExtensionSettings"` + PasswordManagerEnabled bool `json:"PasswordManagerEnabled"` + AutofillCreditCardEnabled bool `json:"AutofillCreditCardEnabled"` + TranslateEnabled bool `json:"TranslateEnabled"` + DefaultNotificationsSetting int `json:"DefaultNotificationsSetting"` + DefaultSearchProviderEnabled bool `json:"DefaultSearchProviderEnabled,omitempty"` + DefaultSearchProviderName string `json:"DefaultSearchProviderName,omitempty"` + DefaultSearchProviderSearchURL string `json:"DefaultSearchProviderSearchURL,omitempty"` + DefaultSearchProviderSuggestURL string `json:"DefaultSearchProviderSuggestURL,omitempty"` + ExtensionInstallForcelist []string `json:"ExtensionInstallForcelist,omitempty"` + ExtensionSettings map[string]ExtensionSetting `json:"ExtensionSettings"` } // ExtensionSetting represents settings for a specific extension @@ -46,12 +53,16 @@ func (p *Policy) readPolicyUnlocked() (*Policy, error) { if os.IsNotExist(err) { // Return default policy if file doesn't exist return &Policy{ - PasswordManagerEnabled: false, - AutofillCreditCardEnabled: false, - TranslateEnabled: false, - DefaultNotificationsSetting: 2, - ExtensionInstallForcelist: []string{}, - ExtensionSettings: make(map[string]ExtensionSetting), + PasswordManagerEnabled: false, + AutofillCreditCardEnabled: false, + TranslateEnabled: false, + DefaultNotificationsSetting: 2, + DefaultSearchProviderEnabled: true, + DefaultSearchProviderName: DefaultSearchProviderName, + DefaultSearchProviderSearchURL: DefaultSearchProviderSearchURL, + DefaultSearchProviderSuggestURL: DefaultSearchProviderSuggestURL, + ExtensionInstallForcelist: []string{}, + ExtensionSettings: make(map[string]ExtensionSetting), }, nil } return nil, fmt.Errorf("failed to read policy file: %w", err) From 77b8d08f13a8c60a04c85cd6e7d9a7e31982e280 Mon Sep 17 00:00:00 2001 From: Archan Datta Date: Thu, 22 Jan 2026 14:50:53 +0000 Subject: [PATCH 3/3] fix: remove omitempty --- server/lib/policy/policy.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/lib/policy/policy.go b/server/lib/policy/policy.go index 3c62a555..8c1d3685 100644 --- a/server/lib/policy/policy.go +++ b/server/lib/policy/policy.go @@ -27,10 +27,10 @@ type Policy struct { AutofillCreditCardEnabled bool `json:"AutofillCreditCardEnabled"` TranslateEnabled bool `json:"TranslateEnabled"` DefaultNotificationsSetting int `json:"DefaultNotificationsSetting"` - DefaultSearchProviderEnabled bool `json:"DefaultSearchProviderEnabled,omitempty"` - DefaultSearchProviderName string `json:"DefaultSearchProviderName,omitempty"` - DefaultSearchProviderSearchURL string `json:"DefaultSearchProviderSearchURL,omitempty"` - DefaultSearchProviderSuggestURL string `json:"DefaultSearchProviderSuggestURL,omitempty"` + DefaultSearchProviderEnabled bool `json:"DefaultSearchProviderEnabled"` + DefaultSearchProviderName string `json:"DefaultSearchProviderName"` + DefaultSearchProviderSearchURL string `json:"DefaultSearchProviderSearchURL"` + DefaultSearchProviderSuggestURL string `json:"DefaultSearchProviderSuggestURL"` ExtensionInstallForcelist []string `json:"ExtensionInstallForcelist,omitempty"` ExtensionSettings map[string]ExtensionSetting `json:"ExtensionSettings"` }