-
Notifications
You must be signed in to change notification settings - Fork 877
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 group policy for sync service URL #25498
Conversation
std::string value(prefs->GetString(brave_sync::kManagedBraveSyncUrl)); | ||
if (!value.empty()) { | ||
GURL custom_sync_url(value); | ||
if (custom_sync_url.is_valid()) { |
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.
Let's make sure it's an HTTPS URL too.
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.
Fixed!
8d5467b
to
15fd905
Compare
3cfde18
to
e2594f7
Compare
e2594f7
to
717da64
Compare
717da64
to
08e0234
Compare
OK pushed fixes - however, I am getting a Update: SOLVED - was missing a |
The security team is monitoring all repositories for certain keywords. This PR includes the word(s) "policy" and so security team members have been added as reviewers to take a look. |
4ac12a4
to
eaf5f78
Compare
// This has a higher priority than the --sync-url command-line param. | ||
// https://github.com/brave/brave-browser/issues/20431 | ||
if (prefs) { | ||
if (prefs->IsManagedPreference(brave_sync::kCustomSyncServiceUrl)) { |
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.
instead of 2 nested ifs:
if (prefs && prefs->IsManagedPreference(brave_sync::kCustomSyncServiceUrl) {
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.
Fixed! 😄
eaf5f78
to
f201239
Compare
|
||
#define SyncAuthManager BraveSyncAuthManager | ||
#define SyncStoppedReporter BraveSyncStoppedReporter | ||
#define GetSyncServiceURL(...) \ | ||
BraveGetSyncServiceURL(__VA_ARGS__, sync_client_->GetPrefService()) |
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.
👍
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.
Thanks again for your help here! 😄
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.
looks good
Updated to add test plan for Windows / macOS / Linux. Trying to find an Android group policy example.... |
I can't find documentation about Android administration and the build fails with sync url set. We need to find the Android equivalent of `chromium_src/components/policy/tools/generate_policy_source.py`
Fixes brave/brave-browser#20431
Security review https://github.com/brave/reviews/issues/1744
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Windows
Using regedit.exe
regedit.exe
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\
BraveSoftware\Brave\
if they don't already existREG_SZ
) with the nameBraveSyncUrl
and the valuehttps://sync-v2.brave.com/v2
.Adding using a
.reg
file (also on Windows)sync-policy.reg
sync-policy.reg
file to run it (you should get prompted)macOS
You can set via the command line.
com.brave.Browser
,com.brave.Browser.beta
, orcom.brave.Browser.nightly
(depending on your channel.BraveSyncUrl
https://sync-v2.brave.com/v2
Steps for Release channel (change bundle ID for other channels)
Run the following from command line:
Load Brave; verify it shows under brave://policy/
Linux
You can set the options via
/etc/brave/policies/managed
Basically, you will make a file with JSON matching the keys/values you'd like to set. Full overview here:
https://source.chromium.org/chromium/chromium/src/+/main:docs/website/site/administrators/linux-quick-start/index.md
Example of how to set the sync URL
create a file
paste in:
Save the file and exit (escape;
:wq
, enter)Load Brave; verify it shows under brave://policy/
Delete the file after testing is complete