Files
brave-core/components/sync
b901ba9684 sync: Add experimental flag to configure the self-hosted sync service URL (#28463)
* sync: Add experimental flag to configure the self-hosted sync service URL.

* sync: Set the |BRAVE_SYNC_ENDPOINT| directly in kSyncServerUrl/kSyncDevServerUrl using chromium_src overrides instead of passing it via command_line

* sync: Remove the test case for checking if the BRAVE_SYNC_ENDPOINT is set via the command line.

* sync: Improve self-hosted sync URL validation and rename flag

- Enhanced validation to accept only valid HTTPS URLs or trustworthy HTTP origins (e.g., localhost)
- Renamed sync URL flag to brave-override-sync-server-url and updated its description.

* sync: fix build issue due to GN deps

* Update text desc in browser/about_flags.cc

Co-authored-by: Francois Marier <francois@fmarier.org>

* sync: Add tests for Self-host sync server URL validation

Add parameterized browser tests to verify the logic in `BraveMainDelegate` for handling the `--sync-url` command-line switch / feature flag.

The tests cover the following scenarios:
- Secure HTTPS URLs are accepted.
- Insecure HTTP URLs are rejected by default.
- HTTP URLs for localhost are accepted (as a trustworthy origin).
- Insecure HTTP URLs are accepted if the origin is explicitly marked as secure via `--unsafely-treat-insecure-origin-as-secure`.
- The absence of the `--sync-url` switch.

* sync: add a warning when the user provided sync url is invalid

* sync: address test failures likely caused by merge conflicts

* test: Filter HistoryNoticeUtilsTest.WebHistoryStates due to sync endpoint change

The test fails because it expects Google's sync server endpoint while Brave
uses a different sync server endpoint.

---------

Co-authored-by: Brian Clifton <brian@clifton.me>
Co-authored-by: Francois Marier <francois@fmarier.org>
2025-07-01 17:37:39 -07:00
..