Package Details: firefox-syncstorage-git 0.13.0.r10.gab5df9ba-1

Git Clone URL: https://aur.archlinux.org/firefox-syncstorage-git.git (read-only, click to copy)
Package Base: firefox-syncstorage-git
Description: Sync storage with build-in token server for running a self-hosted firefox sync server.
Upstream URL: https://github.com/mozilla-services/syncstorage-rs
Keywords: firefox morzilla sync syncserver
Licenses: MPL2
Conflicts: firefox-syncstorage
Provides: firefox-syncstorage
Submitter: jewelux
Maintainer: jewelux
Last Packager: jewelux
Votes: 10
Popularity: 0.000000
First Submitted: 2021-12-12 18:41 (UTC)
Last Updated: 2023-01-12 18:55 (UTC)

Pinned Comments

jewelux commented on 2021-12-12 19:15 (UTC) (edited on 2023-01-12 18:59 (UTC) by jewelux)

Database

To setup a fresh MySQL DB and user: (mysql -u root):

CREATE USER "sample_user"@"localhost" IDENTIFIED BY "sample_password";
CREATE DATABASE syncstorage_rs;
GRANT ALL PRIVILEGES on syncstorage_rs.* to sample_user@localhost;
Config

Open file /etc/firefox-syncstorage.toml to set your own parameters. Here is an example.

port=5000
syncstorage.database_url = "mysql://sample_user:sample_password@127.0.0.1:3306/syncstorage_rs"
# get secret with: head -c 20 /dev/urandom | sha1sum
master_secret = "my_secret"
human_logs = 1
tokenserver.enabled = true
tokenserver.node_type = "mysql"
tokenserver.database_url = "mysql://sample_user:sample_password@127.0.0.1:3306/syncstorage_rs"
tokenserver.fxa_metrics_hash_secret = "my_secret"
tokenserver.fxa_email_domain = "api.accounts.firefox.com"
tokenserver.fxa_oauth_server_url = "https://oauth.accounts.firefox.com/v1"
cors_allowed_origin = "null"
cors_max_age = 86400
Firefox

In abount:config change tokenserver url to your service url.

identity.sync.tokenserver.uri    https://mydomain.tld/1.0/sync/1.5
Run service

systemctl start firefox-syncstorage.service

Add node record

Currently it is necessary to add your node (incl. service pattern) to tokenserver database.
Your can add the node record by the following sql. Don't forget to replace the example url https://mydomain.tld with your service url.

INSERT INTO `services` (`id`, `service`, `pattern`) VALUES ('1', 'sync-1.5', '{node}/1.5/{uid}');
INSERT INTO `nodes` (`id`, `service`, `node`, `available`, `current_load`, `capacity`, `downed`, `backoff`) VALUES ('1', '1', 'https://mydomain.tld', '1', '0', '1', '0', '0');
Troubleshooting
Trouble with Apache as reverse proxy

If you use TLS you should modify the request header and set X-Forwarded-Proto to https. Here is an example of a virtual host file:

<VirtualHost *:443>
   ServerName mydomain.tld
   DocumentRoot /srv/http/webservices/
   RequestHeader set X-Forwarded-Proto https
   ProxyPreserveHost On
   ProxyPass / http://127.0.0.1:5000/
   ProxyPassReverse / http://127.0.0.1:5000/
   <Proxy *>
      AllowOverride all
      Require all granted
   </Proxy>
</VirtualHost>
Sync in Firefox Mobile Nightly is broken

Firefox Mobile client expected X-Timestamp in response header.
Here is an example to set X-Timestamp header in apache virtual host file:

Header set X-Timestamp %t
Header edit X-Timestamp t= ""

The issue is fixed and the workaround should not be necessary anymore.

Latest Comments

1 2 3 4 5 6 Next › Last »

fwillo commented on 2023-07-16 12:49 (UTC) (edited on 2023-07-16 12:49 (UTC) by fwillo)

I updated to the current version of firefox-syncstorage-git (0.13.6.r11.gef0fbfb9-1). Service is not starting due to

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ApiError { kind: Db(DbError { kind: Mysql(MysqlError { kind: DieselConnection(BadConnection("Access denied for user 'root'@'localhost'")), status: 500, backtrace:    0: <unknown>

My configuration at /etc/firefox-syncstorage.toml is the same as before the update, which was running. Also no alteration in the database whatsoever. The server tries to use root@localhost even though it is defined otherwise in my configuration.

lexaiden commented on 2023-07-12 19:58 (UTC)

I reinstalled the package today, to get the latest version and got the following error in firefox sync-log about:sync-log:

Sync.SyncAuthManager    ERROR   Non-authentication error in _fetchTokenForUser: TokenServerClientServerError...

And on the server side: journalctl -f -u firefox-syncstorage.service

Jul 12 21:45:46 hostname firefox-syncstorage[50387]: Jul 12 19:45:46.796 ERRO Internal Server Error: TokenserverError { status: "internal-error", location: Internal, name: "", description: "Server error", http_status: 500, context: "ModuleNotFoundError: No module named 'tokenlib'", backtrace:    0: <unknown>

Solution: Reinstall the python-tokenlib, because the python version also changed from python 3.10 to python 3.11.

SunRed commented on 2022-09-23 21:12 (UTC) (edited on 2022-09-23 21:13 (UTC) by SunRed)

Also, consider writing down the pinned messages on this archwiki page. With the merge/deletion of the old packages it needs an update anyway. Maybe I find time to do it but feel free to contribute it there.

Cheers.

SunRed commented on 2022-09-23 21:01 (UTC)

Also, according to this the golang make dependency can be omitted (and it also builds just fine without it in a clean chroot).

SunRed commented on 2022-09-23 20:55 (UTC)

With the recent deletion of python2 from the official archlinux repos after its long deprecation status I now filed a request to merge the mozilla-firefox-sync-server and -git package into the respective firefox-syncstorage packages to preserve the old (pre 2021) comments and votes. That also means I submitted a non-git firefox-syncstorage package with the most-recent fixed release tag based on your PKGBUILD and added you as a co-maintainer. Thanks for maintaining this package in the past. :)

Frefreak commented on 2022-09-14 14:42 (UTC) (edited on 2022-09-15 05:36 (UTC) by Frefreak)

For me the tokenserver db doesn't auto-create nodes and services table, so I need to run migration according to the readme here. Also I need to add those headers for my reverse proxy specified here. Those headers seems to be important, not sure which are the absolute necessary, didn't try (but it definitely will not work if you only have proxy_pass without the others).

Now it works and overall I'm happy about this.

jewelux commented on 2022-03-22 09:49 (UTC)

@oi_wtf: You are right. Update is coming soon...

oi_wtf commented on 2022-03-21 20:39 (UTC)

needs mariadb-libs (and/or mysql equivalent (mysql-clients?)) in makedepends, otherwise it may fail to link:

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/build/firef[...]/libmigrations_macros-b535addb8f151933.so" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro,-znow" "-nodefaultlibs"
  = note: /usr/bin/ld: cannot find -lmysqlclient: No such file or directory
          collect2: error: ld returned 1 exit status
error: could not compile `migrations_macros` due to previous error

lexaiden commented on 2022-03-19 15:28 (UTC)

@jewelux Thanks for the explanation, I got it. Now I can finally turn off my old python2 syncserver. Thank you. :-)