go-sync icon indicating copy to clipboard operation
go-sync copied to clipboard

How to make Brave use my docker as sync server? / How to self-host Brave sync?

Open tomasz-lasko opened this issue 1 year ago • 3 comments

After I run the docker based on this repo (few steps in README) e.g. on my local network, then how do I make Brave devices (both desktop and android) start syncing over my running docker instead of Brave cloud servers?

And after I manage that, I think it would be good to answer #81 to persist data - is it correct that this way I would have my self-hosted Brave Sync?

tomasz-lasko avatar May 01 '23 09:05 tomasz-lasko

For the first part

On android: enable brave://flags/#enable-command-line-on-non-rooted-devices and then create /data/local/tmp/chrome-command-line and add --sync-url=192.168.x.x:8295/v2 to it starting with in underscore over adb

adb shell

echo "_ --sync-url=192.168.1.24:8295/v2" > /data/local/tmp/chrome-command-line

For linux Mac windows you can run the brave executable with feature flags

https://www.chromium.org/developers/how-tos/run-chromium-with-flags/

For persistent storage just mounting the /db on a docker volume is not enough as the amazon/dynamodb-local uses an in-memory dynamodb

Add a command in the docker compose with the -sharedDb -dbPath directive and then mount that path

https://stackoverflow.com/a/52853294

ippocratis avatar Jun 15 '23 23:06 ippocratis

I wasn't able to switch on android to private sync server. sync-url in /data/local/tmp/chrome-command-line switches to https://clients4.google.com/chrome-sync regardles what ip is set in flag.

Verified configuration on brave://sync-internals

Correct url should contain protocol: _ --sync-url=http://192.168.1.24:8295/v2

sgflt avatar May 26 '24 10:05 sgflt

Correct url should contain protocol: _ --sync-url=http://192.168.1.24:8295/v2

Sorry if that wasnt clear.

/data/local/tmp/chrome-command-line is a file.

It should contain 2 lines.

First line is an underscore _

Second is your URL --sync-url=http://192.168.1.24:8295/v2

After changing sync URL restart brave (clear from recents) for the effect to take place.

ippocratis avatar May 28 '24 11:05 ippocratis