-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Advanced configuration options for customizing BravePurifier behavior and Brave Browser settings.
You can customize BravePurifier behavior using environment variables:
# Skip dependency installation
export SKIP_DEPS=true
# Force specific package manager
export FORCE_PM="apt"
# Custom policy directory
export POLICY_DIR="/custom/path/policies"
# Verbose output
export VERBOSE=true
# Skip user settings application
export SKIP_USER_SETTINGS=true# Show help
./brave-purifier.sh --help
# Show version
./brave-purifier.sh --version
# Dry run (show what would be done)
./brave-purifier.sh --dry-run
# Force reinstall
./brave-purifier.sh --forcePolicies are stored in /etc/brave/policies/managed/privacy-policy.json
{
"MetricsReportingEnabled": false,
"SafeBrowsingEnabled": false,
"SearchSuggestEnabled": false,
"SyncDisabled": true,
"AutofillAddressEnabled": false,
"AutofillCreditCardEnabled": false,
"PasswordManagerEnabled": false
}{
"DefaultNotificationsSetting": 2,
"DefaultGeolocationSetting": 2,
"DefaultCamerasSetting": 2,
"DefaultMicrophonesSetting": 2,
"DefaultPopupsSetting": 2,
"DefaultCookiesSetting": 4
}{
"BraveRewardsDisabled": true,
"BraveWalletDisabled": true,
"BraveVPNDisabled": true,
"BraveNewsDisabled": true,
"BraveTalkDisabled": true
}Create custom policies for specific needs:
# Create custom policy file
sudo mkdir -p /etc/brave/policies/managed/
sudo nano /etc/brave/policies/managed/custom-policy.jsonExample custom policy:
{
"HomepageLocation": "https://duckduckgo.com",
"RestoreOnStartup": 4,
"RestoreOnStartupURLs": ["https://duckduckgo.com"],
"BookmarkBarEnabled": true,
"ShowHomeButton": true
}User settings are stored in ~/.config/BraveSoftware/Brave-Browser/Default/Preferences
{
"profile": {
"default_content_setting_values": {
"geolocation": 2,
"media_stream_camera": 2,
"media_stream_mic": 2,
"notifications": 2,
"popups": 2
}
}
}{
"default_search_provider": {
"enabled": true,
"name": "DuckDuckGo",
"search_url": "https://duckduckgo.com/?q={searchTerms}&t=brave",
"suggest_url": ""
}
}Apply different settings for different users:
# Create user-specific script
sudo nano /usr/local/bin/brave-user-config.sh#!/bin/bash
USER_HOME="/home/$1"
BRAVE_DIR="$USER_HOME/.config/BraveSoftware/Brave-Browser/Default"
# Custom preferences for specific user
cat > "$BRAVE_DIR/Preferences" << 'EOF'
{
"brave": {
"new_tab_page": {
"show_background_image": true,
"show_clock": true
}
}
}
EOF
chown -R "$1:$1" "$USER_HOME/.config/BraveSoftware"For high-security environments:
{
"DeveloperToolsAvailability": 2,
"ExtensionInstallBlocklist": ["*"],
"DefaultJavaScriptSetting": 2,
"DefaultPluginsSetting": 2,
"RemoteAccessHostFirewallTraversal": false,
"EnableMediaRouter": false
}{
"WebRTCIPHandlingPolicy": "disable_non_proxied_udp",
"NetworkPredictionOptions": 2,
"DnsOverHttpsMode": "secure",
"DnsOverHttpsTemplates": "https://cloudflare-dns.com/dns-query"
}Configure alternative search engines:
{
"name": "DuckDuckGo",
"search_url": "https://duckduckgo.com/?q={searchTerms}&t=brave",
"suggest_url": ""
}{
"name": "Startpage",
"search_url": "https://www.startpage.com/sp/search?query={searchTerms}",
"suggest_url": ""
}{
"name": "Searx",
"search_url": "https://searx.org/search?q={searchTerms}",
"suggest_url": ""
}{
"brave": {
"new_tab_page": {
"hide_all_widgets": false,
"show_background_image": true,
"show_clock": true,
"show_stats": true,
"show_top_sites": false,
"show_rewards": false
}
}
}{
"bookmark_bar": {
"show_on_all_tabs": true
},
"browser": {
"show_home_button": true
}
}Create whitelist for trusted extensions:
{
"ExtensionInstallBlocklist": ["*"],
"ExtensionInstallAllowlist": [
"cjpalhdlnbpafiamejdnhcphjbkeiagm", // uBlock Origin
"gcbommkclmclpchllfjekcdonpmejbdp", // HTTPS Everywhere
"pkehgijcmpdhfbdbbnkijodmdjhbjlgp" // Privacy Badger
]
}{
"ExtensionSettings": {
"cjpalhdlnbpafiamejdnhcphjbkeiagm": {
"installation_mode": "force_installed",
"update_url": "https://clients2.google.com/service/update2/crx"
}
}
}Enable specific logging for troubleshooting:
# Enable verbose logging
brave-browser --enable-logging --log-level=0 --v=1
# Log specific components
brave-browser --enable-logging --vmodule=brave_shields*=1{
"PerformanceMonitoringEnabled": false,
"MetricsReportingEnabled": false,
"HeartbeatEnabled": false
}Control update behavior:
{
"AutoUpdateCheckPeriodMinutes": 0,
"UpdatesSuppressed": true,
"ComponentUpdatesEnabled": false
}# Disable automatic updates
sudo systemctl disable brave-browser-update.service
sudo systemctl mask brave-browser-update.serviceCreate custom launcher with specific flags:
# Create custom launcher
sudo nano /usr/local/bin/brave-private#!/bin/bash
exec /usr/bin/brave-browser \
--disable-background-networking \
--disable-background-timer-throttling \
--disable-backgrounding-occluded-windows \
--disable-renderer-backgrounding \
--disable-features=TranslateUI \
--disable-ipc-flooding-protection \
--disable-client-side-phishing-detection \
--disable-component-update \
--disable-default-apps \
--disable-domain-reliability \
--disable-extensions \
--disable-features=AutofillServerCommunication \
--disable-hang-monitor \
--disable-prompt-on-repost \
--disable-sync \
--disable-web-security \
--no-default-browser-check \
--no-first-run \
--no-pings \
--no-service-autorun \
--password-store=basic \
--use-mock-keychain \
"$@"Create isolated profiles:
# Create work profile
brave-browser --user-data-dir=/home/user/.config/brave-work
# Create personal profile
brave-browser --user-data-dir=/home/user/.config/brave-personalCheck if policies are applied correctly:
# Check system policies
ls -la /etc/brave/policies/managed/
# Verify policy content
cat /etc/brave/policies/managed/privacy-policy.json | jq .
# Check user preferences
cat ~/.config/BraveSoftware/Brave-Browser/Default/Preferences | jq .# Test with specific configuration
brave-browser --user-data-dir=/tmp/brave-test --no-first-run# Reset system policies
sudo rm -rf /etc/brave/policies/
# Reset user settings
rm -rf ~/.config/BraveSoftware/
# Rerun BravePurifier
sudo ./brave-purifier.sh# Check policy application
brave-browser --show-component-extension-options
# Verify settings
brave-browser chrome://policy/
brave-browser chrome://settings/For more troubleshooting help, see Troubleshooting page.
Brave Purifier now uses grouped debloat options for easier configuration:
- Brave Features & Services: Rewards, Wallet, VPN, News, Talk, Sync, pings, analytics, crypto, web3, etc.
- Privacy & Tracking: Telemetry, Safe Browsing, Metrics, Log Upload, Heartbeat
- Autofill & Passwords: Autofill, Password Manager
- Permissions: Camera, Microphone, Location, Notifications, Sensors, Popups, WebUSB, WebBluetooth, Serial, HID, FileSystem, etc.
- Other UI & Suggestions: Spellcheck, Home Button, Import Passwords, Import Search Engine
Prompted separately:
- Search Suggestions
- Web Store
- Background Mode
Reset to Defaults:
- At the start, you can choose to reset all Brave settings to defaults (does NOT delete bookmarks, passwords, cookies, credentials, autofill, or sync data).
Search Engine:
- At the end, you can choose to set Google as the default search engine, or keep it unchanged.
When running the script, you will be prompted for each group and these individual options. Answer 'y' to debloat all features in that group/option, or 'n' to skip.
Example:
Brave Features & Services (Rewards, Wallet, VPN, News, Talk, Sync, pings, analytics, crypto, web3, etc.)
Disables all Brave-specific services, crypto, rewards, wallet, and telemetry.
Debloat this group? [Y/n]: y
Privacy & Tracking (Telemetry, Safe Browsing, Metrics, Log Upload, Heartbeat)
Disables all tracking, telemetry, and privacy-invasive features.
Debloat this group? [Y/n]: y
Autofill & Passwords (Autofill, Password Manager)
Disables autofill and password manager features.
Debloat this group? [Y/n]: n
Permissions (Camera, Microphone, Location, Notifications, Sensors, Popups, WebUSB, WebBluetooth, Serial, HID, FileSystem, etc.)
Blocks access to sensitive device features and permissions.
Debloat this group? [Y/n]: y
Other UI & Suggestions (Spellcheck, Home Button, Import Passwords, Import Search Engine)
Disables UI suggestions and import features.
Debloat this group? [Y/n]: n
Search Suggestions (address bar autocomplete, etc.)
Disables search suggestions in the address bar.
Debloat this option? [Y/n]: y
Web Store (extension/add-on store visibility)
Hides the web store icon and blocks extension installs.
Debloat this option? [Y/n]: y
Background Mode (Brave running in background)
Prevents Brave from running in the background.
Debloat this option? [Y/n]: y
Do you want to set Google as the default search engine? (Otherwise, it will remain unchanged) [y/N]: n
- Linux: Full support for all major distributions.
- Windows: Support coming soon! Windows compatibility is a work in progress and will be available in a future release.