-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add IPFSEnabled policy to control IPFS feature #6966
Conversation
725f654
to
4247f1c
Compare
&ipfs::ContentBrowserClientHelper::HandleIPFSURLRewrite, | ||
&ipfs::ContentBrowserClientHelper::HandleIPFSURLReverseRewrite); | ||
} | ||
handler->AddHandlerPair( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
condition checks are done in those static functions in content_browser_client_helper.cc now, remove the condition checks in this file.
4247f1c
to
7e23ed0
Compare
// Because we currently do not provide a settings switch for IPFSEnabled | ||
// preference to be overwritten by users, the policy is configured that only | ||
// a mandatory value can be set by admins. | ||
return local_state->IsManagedPreference(kIPFSEnabled) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't expose a new settings switch cuz there will be too much settings and could cause confusion.
Users are still able to set the resolve method (per-profile setting) as disabled in the settings which will be respected immediately without restarting the browser as before.
This new kIPFSEnabled pref is only for admins to add a mandatory policy to disable the whole IPFS feature for the machine and will remove the binary if already downloaded.
namespace ipfs { | ||
|
||
// Allows disabling the Ipfs client updater extension. | ||
constexpr char kDisableIpfsClientUpdaterExtension[] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command-line switch is removed because we already have a feature flag to control IPFS.
7e23ed0
to
9f83606
Compare
#if BUILDFLAG(ENABLE_TOR) | ||
// Wrap whole array definition in build flags to avoid unused variable build | ||
// error. It can happen if the platform doesn't support any of these features. | ||
#if BUILDFLAG(ENABLE_TOR) || BUILDFLAG(IPFS_ENABLED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI The only chromium_src change is this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
CI only had known rewards failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
9f83606
to
830a2df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chromium_src
changes LGTM
@yrliou How about filing an issue for group policy directory path? |
The latest windows CI build is aborted due to node is removed. |
Resolves brave/brave-browser#11565
Submitter Checklist:
npm run lint
,npm run gn_check
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).QA/Yes
orQA/No
) to the associated issuerelease-notes/include
orrelease-notes/exclude
) to the associated issueTest Plan:
On Linux or Windows:
Open brave browser and enable IPFS feature flag via brave://flags.
Go to brave://settings and search IPFS, should see
Method to resolve IPFS locations
andIPFS public gateway fallback
settings available, changeMethod to resolve IPFS locations
to Ask if not.Visit https://dweb.link/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR, ipfs infobar should be shown to ask for enabling IPFS local node support.
Accept the infobar.
Visit brave://ipfs, page should be shown and daemon should be launched.
Quit the browser
In bash, go to profile folder, for example,
~/.config/BraveSoftware/Brave-Browser-Development
on local linux build,/C/Users/yrliou/AppData/Local/BraveSoftware/Brave-Browser-Development/User Data
on local windows build.Run
find . -name *go-ipfs*
should have results, for example,./oecghfpdmkjlhnfpmmjegjacfimiafjp/1.0.2/go-ipfs_v0.6.0_linux-amd64
on linux,./lnbclahgobmjphilkalbhebakmblnbij/1.0.2/go-ipfs_v0.6.0_windows-amd64
on windows.[Linux]
(sudo is needed in this step) Go to /etc/brave/policies/managed (create folders if not exists already), create test_policy.json with content:
[Windows]
Open regedit, for 64 bit, create the following keys:
BraveSoftware\Brave under the existing key HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Policies
(for 32 bit, you can edit HKEY_LOCAL_MACHINE\SOFTWARE\Policies)
Create a DWORD value at this path called IPFSEnabled and set the value as 0
Open brave again
Go to brave://policy, should see:
Go to brave://settings and search IPFS,
Method to resolve IPFS locations
andIPFS public gateway fallback
settings should not be availableGo to brave://ipfs, should show an error page saying
This site can’t be reached
.Visit https://dweb.link/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR, no infobar is shown.
Do step 7 again, this time it should be an empty result. (no daemon binary can be found now)
Reviewer Checklist:
After-merge Checklist:
changes has landed on.