Merge pull request #54739 from Nadrieril/fix-ffsync

Fix firefox sync-server
This commit is contained in:
Robert Schütz 2019-01-30 16:26:31 +01:00 committed by GitHub
commit 0525fa54e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 88 additions and 69 deletions

View file

@ -13,7 +13,7 @@ let
overrides = ${cfg.privateConfig}
[server:main]
use = egg:Paste#http
use = egg:gunicorn
host = ${cfg.listen.address}
port = ${toString cfg.listen.port}
@ -30,6 +30,8 @@ let
audiences = ${removeSuffix "/" cfg.publicUrl}
'';
user = "syncserver";
group = "syncserver";
in
{
@ -126,15 +128,14 @@ in
config = mkIf cfg.enable {
systemd.services.syncserver = let
syncServerEnv = pkgs.python.withPackages(ps: with ps; [ syncserver pasteScript requests ]);
user = "syncserver";
group = "syncserver";
in {
systemd.services.syncserver = {
after = [ "network.target" ];
description = "Firefox Sync Server";
wantedBy = [ "multi-user.target" ];
path = [ pkgs.coreutils syncServerEnv ];
path = [
pkgs.coreutils
(pkgs.python.withPackages (ps: [ pkgs.syncserver ps.gunicorn ]))
];
serviceConfig = {
User = user;
@ -166,14 +167,17 @@ in
chown ${user}:${group} ${defaultDbLocation}
fi
'';
serviceConfig.ExecStart = "${syncServerEnv}/bin/paster serve ${syncServerIni}";
script = ''
gunicorn --paste ${syncServerIni}
'';
};
users.users.syncserver = {
group = "syncserver";
users.users.${user} = {
inherit group;
isSystemUser = true;
};
users.groups.syncserver = {};
users.groups.${group} = {};
};
}

View file

@ -1,7 +1,6 @@
{ stdenv
, buildPythonPackage
, fetchgit
, fetchurl
, fetchFromGitHub
, pyramid
, simplejson
, konfig
@ -9,26 +8,22 @@
buildPythonPackage rec {
pname = "mozsvc";
version = "0.8";
version = "0.10";
src = fetchgit {
url = https://github.com/mozilla-services/mozservices.git;
rev = "refs/tags/${version}";
sha256 = "1zci2ikk83mf7va88c83dr6snfh4ddjqw0lsg3y29qk5nxf80vx2";
src = fetchFromGitHub {
owner = "mozilla-services";
repo = "mozservices";
rev = version;
sha256 = "0a0558g8j55pd1nnhnnf3k377jv6cah8lxb24v98rq8kxr5960cg";
};
patches = stdenv.lib.singleton (fetchurl {
url = https://github.com/nbp/mozservices/commit/f86c0b0b870cd8f80ce90accde9e16ecb2e88863.diff;
sha256 = "1lnghx821f6dqp3pa382ka07cncdz7hq0mkrh44d0q3grvrlrp9n";
});
doCheck = false; # lazy packager
doCheck = false; # too many dependencies and conflicting versions; I (nadrieril) gave up
propagatedBuildInputs = [ pyramid simplejson konfig ];
meta = with stdenv.lib; {
homepage = https://github.com/mozilla-services/mozservices;
description = "Various utilities for Mozilla apps";
license = licenses.mpl20;
maintainers = with maintainers; [ nadrieril ];
};
}

View file

@ -1,5 +1,6 @@
{ buildPythonPackage
, fetchgit
{ stdenv
, buildPythonPackage
, fetchFromGitHub
, isPy27
, testfixtures
, unittest2
@ -20,13 +21,14 @@
buildPythonPackage rec {
pname = "serversyncstorage";
version = "1.6.11";
version = "1.6.14";
disabled = !isPy27;
src = fetchgit {
url = https://github.com/mozilla-services/server-syncstorage.git;
rev = "refs/tags/${version}";
sha256 = "197gj2jfs2c6nzs20j37kqxwi91wabavxnfm4rqmrjwhgqjwhnm0";
src = fetchFromGitHub {
owner = "mozilla-services";
repo = "server-syncstorage";
rev = version;
sha256 = "08xclxj38rav8yay9cijiavv35jbyf6a9jzr24vgcna8pjjnbbmh";
};
checkInputs = [ testfixtures unittest2 webtest ];
@ -35,7 +37,10 @@ buildPythonPackage rec {
pymysqlsa umemcache WSGIProxy requests pybrowserid
];
meta = {
broken = true; # 2018-11-04
meta = with stdenv.lib; {
description = "The SyncServer server software, as used by Firefox Sync";
homepage = https://github.com/mozilla-services/server-syncstorage;
license = licenses.mpl20;
maintainers = with maintainers; [ nadrieril ];
};
}

View file

@ -1,33 +0,0 @@
{ buildPythonPackage
, fetchgit
, isPy27
, unittest2
, cornice
, gunicorn
, pyramid
, requests
, simplejson
, sqlalchemy
, mozsvc
, tokenserver
, serversyncstorage
, configparser
}:
buildPythonPackage rec {
pname = "syncserver";
version = "1.6.0";
disabled = ! isPy27;
src = fetchgit {
url = https://github.com/mozilla-services/syncserver.git;
rev = "refs/tags/${version}";
sha256 = "1fsiwihgq3z5b5kmssxxil5g2abfvsf6wfikzyvi4sy8hnym77mb";
};
buildInputs = [ unittest2 ];
propagatedBuildInputs = [
cornice gunicorn pyramid requests simplejson sqlalchemy mozsvc tokenserver
serversyncstorage configparser
];
}

View file

@ -31,5 +31,6 @@ buildPythonPackage rec {
description = "The Mozilla Token Server";
homepage = https://github.com/mozilla-services/tokenserver;
license = licenses.mpl20;
maintainers = with maintainers; [ nadrieril ];
};
}

View file

@ -0,0 +1,47 @@
{ lib
, python2
, fetchFromGitHub
}:
let
python = python2.override {
packageOverrides = self: super: {
# Older version, used by syncserver, tokenserver and serversyncstorage
cornice = super.cornice.overridePythonAttrs (oldAttrs: rec {
version = "0.17";
src = oldAttrs.src.override {
inherit version;
sha256 = "1vvymhf6ydc885ygqiqpa39xr9v302i1l6nzirjnczqy9llyqvpj";
};
});
};
};
# buildPythonPackage is necessary for syncserver to work with gunicorn or paster scripts
in python.pkgs.buildPythonPackage rec {
pname = "syncserver";
version = "1.8.0";
src = fetchFromGitHub {
owner = "mozilla-services";
repo = "syncserver";
rev = version;
sha256 = "0hxjns9hz7a8r87iqr1yfvny4vwj1rlhwcf8bh7j6lsf92mkmgy8";
};
# There are no tests
doCheck = false;
propagatedBuildInputs = with python.pkgs; [
cornice gunicorn pyramid requests simplejson sqlalchemy mozsvc tokenserver
serversyncstorage configparser
];
meta = with lib; {
description = "Run-Your-Own Firefox Sync Server";
homepage = https://github.com/mozilla-services/syncserver;
platforms = platforms.unix;
license = licenses.mpl20;
maintainers = with maintainers; [ nadrieril ];
};
}

View file

@ -14049,6 +14049,8 @@ in
systemd-journal2gelf = callPackage ../tools/system/systemd-journal2gelf { };
syncserver = callPackage ../servers/syncserver { };
inherit (callPackages ../servers/http/tomcat { })
tomcat7
tomcat8

View file

@ -784,8 +784,6 @@ in {
supervise_api = callPackage ../development/python-modules/supervise_api { };
syncserver = callPackage ../development/python-modules/syncserver {};
tables = callPackage ../development/python-modules/tables {
hdf5 = pkgs.hdf5.override { zlib = pkgs.zlib; };
};