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 »

Siosm commented on 2015-06-17 21:13 (UTC)

No, the files in /opt/mozilla-firefox-sync-server should not be owned by the ffsync user. The error you have here is the result of running it as root in the first place. When run as root, it created those .pyc files that are not part of the package and it cannot use/delete/change them now that you have switched back to running with another user. I suggest that you delete those files, either by reinstalling the package clean or by hand. May this serve as a reminder that running something as root is never the solution when something fails.

miscsstic commented on 2015-06-17 20:41 (UTC)

I'm cheking the output of strace ('strace ./local/bin/gunicorn --paste syncserver.ini'), and I see denied permissions on unlink() calls like: unlink("/opt/mozilla-firefox-sync-server/local/lib/python2.7/site.pyc") = -1 EACCES (Permission denied) Should the /opt/mozilla-firefox-sync-server be owned by the ffsync user?

miscsstic commented on 2015-06-17 20:01 (UTC)

Here I am (wasn't able to use the same account for AUR4). So, even with this package (from ARU4), the 'sudo systemctl start ffsync' doesn't work. Here is the detail of 'systemctl status ffsync' : * ffsync.service - Gunicorn server running Mozilla's Firefox Sync Server - Version 1.5 Loaded: loaded (/usr/lib/systemd/system/ffsync.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2015-06-17 21:54:36 CEST; 5min ago Process: 9918 ExecStart=/opt/mozilla-firefox-sync-server/local/bin/gunicorn --paste /opt/mozilla-firefox-sync-server/syncserver.ini (code=exited, status=3) Main PID: 9918 (code=exited, status=3) Jun 17 21:54:30 alarm systemd[1]: Started Gunicorn server running Mozilla's Firefox Sync Server - Version 1.5. Jun 17 21:54:30 alarm systemd[1]: Starting Gunicorn server running Mozilla's Firefox Sync Server - Version 1.5... Jun 17 21:54:36 alarm systemd[1]: ffsync.service: main process exited, code=exited, status=3/NOTIMPLEMENTED Jun 17 21:54:36 alarm systemd[1]: Unit ffsync.service entered failed state. Jun 17 21:54:36 alarm systemd[1]: ffsync.service failed. Is it an hint for you ?

gu1ll0me commented on 2015-01-19 14:37 (UTC)

Thanks for your tip, i will try to find why it connot be run by the ffsync user. For virtualenv, maybe you could change the Makefile line in prepare()? VIRTUALENV = virtualenv2 --python=$(SYSTEMPYTHON)

Siosm commented on 2015-01-19 10:47 (UTC)

I'll have a look at the exact python version and depedencies required to run ffsync. I can't just replace python-virtualenv by python-virtualenv2 because the Makefile explicitly calls python-virtualenv. Maybe I should had python2 as deps. Running ffsync as root as you suggest in your second comment is really bad idea. You should try to understand what problem in your setup is preventing ffsync to work before blindly running it as root.

gu1ll0me commented on 2015-01-17 19:23 (UTC)

I also commented these lines for the ffsync.service to start : /usr/lib/systemd/system/ffsync.service #User=ffsync #Group=http #UMask=007 #Restart=on-abort

gu1ll0me commented on 2015-01-17 19:06 (UTC)

Thanks for the package! 'python2-virtualenv' should replace 'python-virtualenv' in depends(). Had to add this line in prepare() to make it works : sed -i 's/configparser==3.3.0r2/configparser==3.5.0b2/' requirements.txt

Siosm commented on 2014-10-15 08:41 (UTC)

You may build it using the -A makepkg flag to ignore architecture checks. I can't find an official statement about other architectures support in AUR PKGBUILDs.

fkoehler commented on 2014-10-13 17:44 (UTC)

Can you add the armv6h architecture to the PKGBUILD? Runs nicely on my raspberry pi.