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
Installation in docker? #1428
Comments
Same here, managed to compile the syncstorage-rs with a bit of a strugle, but after that just a big black hole. No good documentation, missing a lot of parts in the documentation to get things working. Guess this documentation is build by people that forgot the parts that other people need to get things running. Don't want to use the antiquated syncserver code again. And I'm not allowed to sync my data to the cloud, specially if it's in the US. Found a docker image in the docker hub, but absolutely no data on how to use it. https://hub.docker.com/r/mozilla/syncstorage-rs As nobody has documented anything yet on how to use it with docker compile or docker cli, totally lost on what to do. I'm not a noob, but but with current documentation it's impossible to do anything. Maybe someone from the community can write something, how to use the docker container. Or point me to a page where it is described, at least better than the non information that's in the readme posted in this repository. |
I managed to get it working a few days ago. See my docker-compose.yml file down below. Don't forget to change the secrets, mysql credentials/urls and paths.
After running
Since the port configuration in the docker-compose file is not explicit, you will need to look up the tokenserver-db container port with |
Hi jakobkukla, thanks very much for that! |
Keep in mind that I have no idea what I'm doing, so not sure if this configuration is suitable/save to be used in public. Maybe someone from the dev team could chime in :). Especially the value for |
Just good to know it's really working. I will also try something a little different as I have already a working instance of MariaDB. |
@WAdama MariaDB was not working for me for some reason. Had to specifically use mysql 5.7. But if you can get it to run with MariaDB, I'd like to know how :). It should be working in theory. |
Thanks @jakobkukla! I think that's got most of the args folk should need. @ethowitz can say definitively, but I believe this comment describes what In short, it's a bit of extra thread count buffer that the TokenServer needs to talk to the FxA servers. A low count should be fine for small, stand alone installations. |
@jrconlin Thanks for the quick reply! I have one more question. Would it be possible to create the service and node entry at first startup? Using something like And maybe providing a reasonable default to |
If I try your compose file I get for the MySQL containers the following error: I use - of course - a folder which exists... Edit: Found it. Folder has to be set to executable.. (chmod +x ...) |
@jakobkukla: I think @ethowitz might be able to provide better guidance about creating the service and node entry at first start-up, since he's responsible for that code. He's currently very heads down on the crate re-org which will help a good deal in making the stand-alone side easier to build and maintain, so he may have that as a TODO item. I suspect that both of these items might be on his task list. |
@jakobkukla I now have the containers up. But I get sync errors in about:sync-log Did you add something else in the environment of the Sync container? How is your Token Server in Firefox itself formatted? |
@WAdama No, I didn't need anything else. What kind of error are you getting? My |
@jakobkukla I should have tried first without my reverse proxy inbetween... Adressing my docker instance directly worked. By the way I changed the installation to using only one mysql container. Of course I had to make the changes manually, but at least I need only one database container... Edit: The problem with the reverse proxy is also solved - more or less. I have tried a subfolder in domain. If I don't use a subfolder but only the domain it works. |
By the way, is there a reason why you used version 0.12.4 and not latest? |
Yes, because latest is for some reason an image from 3 years ago. |
Ah ok, that's a reason.. ;-) Don't want to bother you again, but after running with a test user and a test profile I now tried to change my existing Firefox profile to the new sync server and I got errors again. Have attached two error logs |
This helps a lot, but I still have some issues, although I'm close. (Running this on my synology docker until I get it working, then converting it to my Kubernetes cluster (just started with k8s), but want to get it work work first with docker.) I'm also using an Apache as reverse proxy to handle the SSL part. But connecting directly to docker gives the same error. My first mistake was to use :latest, because there is an issue where the latest version on docker hub isn't updated to the latest version available. Been open since Juli 15th, not fixed yet. #1362 Second mistake was not feeding the correct variables to docker, for some reason my node_type was set to MySQL URL. Finally figured that out. And everything seems to be working. Now with the the correct docker images I get the following error. And can't seem to figure out what goes wrong. docker-0.12.4-sync-error-last-lines.txt 1666953384868 Sync.Resource DEBUG GET fail 401 https://sync.my.domain/1.5/4/info/collections For some reason I get an 401 when accessing my collections. User data is filled in the database when logging in. Using an newer docker images (Newer then 0.12.4), always gives an database error, doesn't seem to get the database_url settings for tokenstorage. When I try to sync again I get the following errors in sync-log, still 401's |
@jakobkukla It may be a dumb question, but you're using more than one user with your sync server I guess? When I try a second user, the user doesn't register to my sync server, I tried even a totally new one. The first user register to the server and works, the second one not. |
I have the same issues as @ictabc , but i am still looking into my setup.
For the config you just need a simple .env-File next to docker-compose.yml
EDIT: Works for me now - DOMAIN in .env has to be prefixed with https:// |
@WAdama No I've only tried with one user. Could the capacity field in the nodes table be the problem? |
@jakobkukla I will have a look and test it. |
@jakobkukla You're my hero... |
@jdarmetzki I used your compose file, it worked like a charm, great work. Thanks. After having a working instance I will try to use the MariaDB on my Synology NAS. |
I got it running with MariaDB and Docker on my Synology NAS. I used jdarmetzki's work as blueprint. First I connect on command line to the database instance: CREATE DATABASE IF NOT EXISTS syncstorage_rs; GRANT ALL PRIVILEGES ON syncstorage_rs.* TO sync_rs@"172.%"; For the container I used this compose file: services: After created and started the container attach again to the database and create the nodes and service entries: I've set the capacity entry to 5 in my case. The sync was running at once. There's only one problem shown in the log. I've got several entries like The container was created with 0.12.4 but as you see I have already updated it with 0.12.5. |
Running basically the same config settings. Usually I do the following to start cleanly Keep getting: 1667554182564 Sync.Resource DEBUG GET fail 401 https://sync.my.domain/1.5/4/info/collections Very strange that it works for some and not for others. |
Hi @ictabc, The domain in Firefox and the database are the same? For example |
Hi WAdama, Yup, those are the same. Do have an Apache reverse proxy config in between. But even without the reverse proxy config, it doesn't work. Don't get the 401 now, but still an auth error, when going directly to the server. But that is without SSL, so prefer the Apache reverse proxy option. ================================================= |
Changed both to : https://sync.mydomain.de:8000/1.0/sync/1.5 in Firefox and As port 5000 is not available on a synology. |
I know, have running it on a Syno myself. Using myself a port in the higher region (xxxxx).. Did you check if the server is running correct with https://sync.mydomain.de:8000/__heartbeat__? |
{"status":"Ok","tokenserver":{"database":"Ok","status":"Ok"},"quota":{"enabled":false,"size":0},"database":"Ok","version":"0.12.5"} Looks ok. The token server works, but the collection part fails. |
Did you also change the ports in SYNC_TOKENSERVER__DATABASE_URL and SYNC_TOKENSERVER__DATABASE_URL ? Otherwise the syncserver tries to connect to the homassistant-db, which will fail |
Ah sorry. I totally misunderstood your problem haha. If you change the database urls like @jdarmetzki suggested, it should just work. |
hm, the strage thing is, that non of my entrys in the .env file are used. o the user is not created and permissions on the table not being granted and therefore the connection don't work. The docker compose file and the .env file are in the same dir, don't know why its not working. |
Been trying off and on to get things working, but through Apache reverse proxy or direct I always get an stacktrace warning, would be nice if the documentation is updated so I can finally get it to work. Got the docker container up and running, sync-log sees succesfull login to auth url, but firefox is unable to update to connect and the sync-log doesn't give me any info I can use to troubleshoot why. Would love to get this working for firefox again. I know it can work but can't get it to work on my end. And why do we need to fill de database with data, this should be done by syncstorage-rs when first starting. Hopefully there will be some progress soon to get it running correct always. Or at least better documentation and would like to know what extra steps arei needed for an apache reverseproxy config or nginx reverse proxy. |
Big thx at all! Got it running now, on Docker, behind a nginx reverse Proxy. Have modified the docker-compose.yml from jakobkukla slightly: Added Added:
to firefox-sync, so it starts right after firefox-sync-db And at least, added:
to firefox-sync-db. |
Exact same thing for me. Starting, failing badly, getting confused, leaving it, coming back...see my postings here: #1186 I have created the DB tables, applied permissions, created docker container but then my firefox sync login does not persist. I guess my db init is missing. So I am basically stuck at: I have no idea what Mozilla wants to tell me to do. Where is "/vendor"? It is nowhere in the image or here in the repository. Cargo or diesel is not installed inside the container...why being so cryptic?
As you made it, could you maybe please give instructions on this rust-sdk db migration? And also interesting for me...did someone migrate from old sync selfhosted server? How to upgrade to sync rs? Many thanks (getting crazy again) |
@godfuture: Just use provided docker compose config and .env from here: #1428 (comment) Replace the env var as described here: #1428 (comment) And it should run... |
I did not compile myself, I am using the docker image from mozilla docker hub.
My setup is slightly different. I have one mariadb instance for all my apps and databases in it and I am using portainer with stacks to set it up (no compose). I tried to insert into services table, but my tokenserver_rs database does not contain any table at all. Syncstorage_rs does. As said, I think I missed the db init somehow.
Should diesel or cargo (aka google cloud sdk, right?) be available on the mozilla image out of box? Many thanks |
make sure to use the version "0.12.4" as in all above examples. Any ideas here why its not working on latest? (currently 0.13.6) |
You can use 13.6. This is my docker compose and env file: |
Following the thread and using @WAdama 's latest compose file results for me in an error with a freshly set up database:
Any idea what I might be doing wrong? |
Looks like the error is the result of a (The UserAgent can collect up a bunch of changes and submit them as a single "batch" of changes. Since there can be a lot of records, it can break up the "batch" into multiple POST requests and then set a "commit" flag to say "Ok, I'm done. Go ahead and commit all this." It's very unusual for this to break, but there might be a few reasons:
You can up the level of logging by setting the "RUST_LOG=info" environment variable. |
Thanks for the detailed answer. I tried to look at the behavior with different Looking at the log output of mariadb, however, revealed some sort of network error. The following messages were printed while the container is in "health: starting":
This most likely seems to be a firewall/networking issue, which is weird because I have other containers working fine. |
It works perfectly for me with MardiaDB 10.11 LTS and syncstorage-rs 13.6, on windows and android. From @jdarmetzki and @WAdama : docker-compose.yml :
.env :
identity.sync.tokenserver.uri : |
Hey, small feedback: I could solve my specific issue by the |
What is this FXA thing? Does it mean we still depend on Firefox'es server for something? 🤔 |
The new image (0.14.0) seems to crash the container: |
No idea whats wrong? EDIT: Nevermind these Docker images aren't built for arm64 |
I was also successful with deploying the docker-compose from #1428 (comment) thanks for sharing! Therefor I took it and created a git repo with it and additional files like for systemd and nginx as documentation for future me here: https://github.com/jeena/fxsync-docker but it is getting quite many stars so I guess other people also appreciate the more comprehensive documentation around how to self host it. I think it would be good if we could consolidate it to one mariadb instance because it uses quite many unnecessary resources. And in long run I would like to see if we could make a PR which would add a docker-compose.yaml to this repo. |
Finally got it working. For some reason, I kept getting login errors. 1696599763276 Sync.Status DEBUG Status.login: success.status_ok => success.login Only just noticed, that is accessing sync.example.com/1.5/* instead of sync.example.com/1.0/sync/1.5/* So I added a rewrite rule for 1.5 to 1.0/sync/1.5 in my apache proxy, and I am now able to sync.
Now to find out why this is, as far as I can see I have always done everything the same as other people. |
Hi there, I've managed to setup my Firefox Sync server and use it with my Firefox Desktop PCs. With the old sync server it always worked. My Firefox on iOS shows me 'Sync is offline' and offers me a link to solve the issue via disabeling the bookmark sync to make it work. Did anybody here manage to make it run with Firefox on iOS? |
Hi @eddieirvine That's correct, the "token" has to be gone. I can only speak for Android: Have you logged of on your Firefox before changing the configuration? This is required on the mobile version. The best way I found is to reset the configuration, changing the sync server and after that log in to my Firefox account. |
I had a look at the logs and saw this error: URL is https://ffsync.example.com/1.0/sync/1.5 Could it be an issue that one is https and the other http? |
Hmm, I use the same construct over a nginx reverse proxy and it works without any problems. |
Did you add the following to your proxy config Apache:
Or if you use NGINX:
To tell to syncstorage-rs that it is encrypted, only not on the syncstorage-rs docker container. |
@ictabc Thanks for your answer. I use the reverse proxy of Synology. |
I am grateful for this project but setting this server up even when using docker is beyond painful. I have tried to do so on synology docker without success, even when using docker-compose code mentioned here and https://github.com/jeena/fxsync-docker repo. It just does not work out of box and documentation is still terrible. |
For me also the worst docker project till now... |
Hi all,
I tried to install syncstorage-rs via docker, but I can't get my head around it with this documentation.
For one it seems the prerequisite mozilla-rust-sdk is now google-cloud-rust, is that correct?
Maybe someone has already got this to run and can provide me with a more step by step documentation...
Thanks
Ingo
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: