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

« First ‹ Previous 1 2 3 4 5 6 Next › Last »

SunRed commented on 2017-02-10 19:15 (UTC)

Could you please add 'armv6h' and 'armv7h' to "arch" in the PKGBUILD? It works flawlessly with Arch Linux ARM on my Raspberry Pis.

viky commented on 2017-02-09 15:29 (UTC)

Works great on armv7h.

mqs commented on 2016-09-08 21:05 (UTC)

Is there any reason to limit the arch to i686 and x86_64? It's python and works nearly everywhere. Am I missing something?

mentatf commented on 2016-04-22 01:55 (UTC)

The service works 100% for me but my logs are filled with unicorn logs that looks inoffensive (labelled INFO). How can I decrease this log level ? I've already disabled the logs in ffsync.

Siosm commented on 2016-04-12 18:03 (UTC)

@GeoffreyFrogeye: If the dependency wasn't documented anywhere then you should file a bug upstream so that at least they mention it. I'll had a commented line suggesting installing it in the next update. The gunicorn install used to be required at some point in the past but apparently this has changed. I'll fix it. Thanks.

GeoffreyFrogeye commented on 2016-04-12 09:13 (UTC)

In order to be able to use a PostgreSQL server, I had to `local/bin/pip install psycopg2`, else the server wouldn't be able to start. I don't know if this is a upstream bug though, since it's not in the `requirements.txt` file, nor in the requirements of SQLAlchemy. Also, what is the point of the `local/bin/pip install gunicorn` since it's installed anyway and only generate a "Requirement already satisfied" message?

mentatf commented on 2016-04-05 08:49 (UTC)

Update: now everything works, my problem was unrelated, due to wrong shortcuts in the nginx config (use absolute path in ./servers-enabled). So, the config on the wiki + the mozilla doc works for me on an updated system, on https with nginx. Thank you. The bookmarks sync still seems a bit random too (working great at first sync, but i'm not sure the updates works after that).

mentatf commented on 2016-02-26 11:51 (UTC)

I've discovered the about:sync-log page. I have a lot of entries showing authentification errors.

Siosm commented on 2016-02-26 00:06 (UTC)

This is still working for me although I haven't updated the server in a while. I couldn't get it to work with https the last time I tried, but I'm gonna make another try soon. So far I've only tried with Firefox on a desktop (Linux and Windows 7). I'm going to try Android soon.

piknik commented on 2016-02-25 22:41 (UTC) (edited on 2016-02-25 22:42 (UTC) by piknik)

Having a similar issue as mentatf, though I'm using the built-in Gunicorn server. Running latest firefox 44 on android and desktop simply doesn't work. Using both the http and https protocols in public_url, set secret, sqluri, and both sync clients cannot connect at 1.0/sync/1.5. Having https in public_url doesn't work at all. When connecting to the server with http through the browser, I get "It works!", and a log entry. When going to 1.0/sync/1.5, I get "0" as output and a log message (404). On the android device in Sync preferences, it endlessly tries "Syncing". Same thing is happening on the desktop, and no log entries of either attempting to connect. Is this server compatible with the latest firefox?