undergroundwires / privacy.sexy

Open-source tool to enforce privacy & security best-practices on Windows, macOS and Linux, because privacy is sexy
https://privacy.sexy
GNU Affero General Public License v3.0
3.68k stars 159 forks source link

[BUG]: Bing (search engine) is broken #329

Closed MohamedMehrath closed 1 month ago

MohamedMehrath commented 3 months ago

Description

I used privacy.sexy (amazing tool btw) and bing isn't working well, When I click on Copilot, nothing happens. Bottom righthand side of screen shows javascript:void(0) also Bing isn't showing pictures.

OS

Windows 10 Pro

Screenshots

image image

undergroundwires commented 3 months ago

This is most likely related to a host entry under Block tracking hosts category. Try to revert those and please share if you figure out which host exactly is blocking copilot as side-effect so we can document/discourage or remove that host.

MohamedMehrath commented 3 months ago

~I reverted all Block tracking hosts and re-enabled each one, and I ended up enabling all of them again, fixing the problem.~ ~Edit: Afrer restarting my pc the bug came back.~ Edit 2: After taking a look at the scripts of Block tracking hosts, I used Ctrl + F searching for bing, I found 10 results in Block Cortana and Live Tiles hosts. I reverted Block Cortana and Live Tiles hosts script and now it's working fine.

undergroundwires commented 3 months ago

Thank you for the insights.

I cannot reproduce this. But it would be appreciated if you could test which host is causing this exactly (which bing host), so we can exclude it from privacy.sexy or document the behavior.

I cannot test this because for me, Copilot on Edge through Bing works when all hosts including "Block Cortana and Live Tiles hosts" are blocked:

image

maxysoft commented 1 month ago

There is r.bing.com that needs to be removed from hosts to make copilot works

undergroundwires commented 1 month ago

Thank you for figuring this out and reporting back @maxysoft.

r.bing.com is now excluded with the added documentation (see at the end):

image

It will be released in next patch.

joethesaint commented 1 month ago

Now that it has been excluded, how then can we that are facing the issue fix it?

undergroundwires commented 1 month ago

The fix is released since 0.13.3 🎉.

Here's the revert code for r.bing.com for those who wants to allow r.bing.com back (@joethesaint):

PowerShell -ExecutionPolicy Unrestricted -Command "$domain ='r.bing.com'; $hostsFilePath = "^""$env:WINDIR\System32\drivers\etc\hosts"^""; $comment = "^""managed by privacy.sexy"^""; $hostsFileEncoding = [System.Text.Encoding]::UTF8; $blockingHostsEntries = @(; @{ AddressType = "^""IPv4"^"";  IPAddress = '0.0.0.0'; }; @{ AddressType = "^""IPv6"^"";  IPAddress = '::1'; }; ); try {; $isHostsFilePresent = Test-Path -Path $hostsFilePath -PathType Leaf -ErrorAction Stop; } catch {; Write-Error "^""Failed to check hosts file existence. Error: $_"^""; exit 1; }; if (-Not $isHostsFilePresent) {; Write-Output 'Skipping, the hosts file does not exist.'; exit 0; }; foreach ($blockingEntry in $blockingHostsEntries) {; Write-Output "^""Processing removal for $($blockingEntry.AddressType) entry."^""; try {; $hostsFileContents = [System.IO.File]::ReadAllText($hostsFilePath, $hostsFileEncoding); } catch {; Write-Error "^""Failed to read the hosts file for removal. Error: $_"^""; continue; }; $hostsEntryLine = "^""$($blockingEntry.IPAddress)`t$domain $([char]35) $comment"^""; if ([String]::IsNullOrWhiteSpace($hostsFileContents) -Or (-Not $hostsFileContents.Contains($hostsEntryLine))) {; Write-Output 'Skipping, entry not found.'; continue; }; $hostsEntryRemovalPattern = [regex]::Escape($hostsEntryLine) + "^""(\r?\n)?"^""; $hostsFileContentAfterRemoval = $hostsFileContents -Replace $hostsEntryRemovalPattern, "^"""^""; try {; [System.IO.File]::WriteAllText($hostsFilePath, $hostsFileContentAfterRemoval, $hostsFileEncoding); Write-Output 'Successfully removed the entry.'; } catch {; Write-Error "^""Failed to remove the entry. Error: $_"^""; continue; }; }"
joethesaint commented 1 month ago

Thank you, I noticed bing is working after updating, did not get to revert at the end of the day

On Sat, 11 May 2024 at 06:30, undergroundwires @.***> wrote:

The fix is released since 0.13.3 https://github.com/undergroundwires/privacy.sexy/releases/edit/0.13.3 🎉.

Here's the revert code for r.bing.com for those who wants to allow r.bing.com back @.*** https://github.com/joethesaint):

PowerShell -ExecutionPolicy Unrestricted -Command "$domain ='r.bing.com'; $hostsFilePath = "^""$env:WINDIR\System32\drivers\etc\hosts"^""; $comment = "^""managed by privacy.sexy"^""; $hostsFileEncoding = [System.Text.Encoding]::UTF8; $blockingHostsEntries = @(; @{ AddressType = "^""IPv4"^""; IPAddress = '0.0.0.0'; }; @{ AddressType = "^""IPv6"^""; IPAddress = '::1'; }; ); try {; $isHostsFilePresent = Test-Path -Path $hostsFilePath -PathType Leaf -ErrorAction Stop; } catch {; Write-Error "^""Failed to check hosts file existence. Error: $"^""; exit 1; }; if (-Not $isHostsFilePresent) {; Write-Output 'Skipping, the hosts file does not exist.'; exit 0; }; foreach ($blockingEntry in $blockingHostsEntries) {; Write-Output "^""Processing removal for $($blockingEntry.AddressType) entry."^""; try {; $hostsFileContents = [System.IO.File]::ReadAllText($hostsFilePath, $hostsFileEncoding); } catch {; Write-Error "^""Failed to read the hosts file for removal. Error: $"^""; continue; }; $hostsEntryLine = "^""$($blockingEntry.IPAddress)`t$domain $([char]35) $comment"^""; if ([String]::IsNullOrWhiteSpace($hostsFileContents) -Or (-Not $hostsFileContents.Contains($hostsEntryLine))) {; Write-Output 'Skipping, entry not found.'; continue; }; $hostsEntryRemovalPattern = [regex]::Escape($hostsEntryLine) + "^""(\r?\n)?"^""; $hostsFileContentAfterRemoval = $hostsFileContents -Replace $hostsEntryRemovalPattern, "^"""^""; try {; [System.IO.File]::WriteAllText($hostsFilePath, $hostsFileContentAfterRemoval, $hostsFileEncoding); Write-Output 'Successfully removed the entry.'; } catch {; Write-Error "^""Failed to remove the entry. Error: $_"^""; continue; }; }"

— Reply to this email directly, view it on GitHub https://github.com/undergroundwires/privacy.sexy/issues/329#issuecomment-2105668495, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATHPJGYYCR75IZ522PFVV7TZBXXNNAVCNFSM6AAAAABEOKH22SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVGY3DQNBZGU . You are receiving this because you were mentioned.Message ID: @.***>