diff --git a/nixos/modules/services/networking/firefox/sync-server.nix b/nixos/modules/services/networking/firefox/sync-server.nix index 97d223a56cab..6842aa735617 100644 --- a/nixos/modules/services/networking/firefox/sync-server.nix +++ b/nixos/modules/services/networking/firefox/sync-server.nix @@ -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} = {}; }; } diff --git a/pkgs/development/python-modules/mozsvc/default.nix b/pkgs/development/python-modules/mozsvc/default.nix index b7fed9e6ad98..a7b3984b912e 100644 --- a/pkgs/development/python-modules/mozsvc/default.nix +++ b/pkgs/development/python-modules/mozsvc/default.nix @@ -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 ]; }; - } diff --git a/pkgs/development/python-modules/serversyncstorage/default.nix b/pkgs/development/python-modules/serversyncstorage/default.nix index 0e4b6cfa1e47..7342a729e292 100644 --- a/pkgs/development/python-modules/serversyncstorage/default.nix +++ b/pkgs/development/python-modules/serversyncstorage/default.nix @@ -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 ]; }; } diff --git a/pkgs/development/python-modules/syncserver/default.nix b/pkgs/development/python-modules/syncserver/default.nix deleted file mode 100644 index 7a93d64a89f5..000000000000 --- a/pkgs/development/python-modules/syncserver/default.nix +++ /dev/null @@ -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 - ]; -} diff --git a/pkgs/development/python-modules/tokenserver/default.nix b/pkgs/development/python-modules/tokenserver/default.nix index a07da568dca4..08f3f87321fe 100644 --- a/pkgs/development/python-modules/tokenserver/default.nix +++ b/pkgs/development/python-modules/tokenserver/default.nix @@ -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 ]; }; } diff --git a/pkgs/servers/syncserver/default.nix b/pkgs/servers/syncserver/default.nix new file mode 100644 index 000000000000..d41923758017 --- /dev/null +++ b/pkgs/servers/syncserver/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7b372412533b..4d6ac1fe71be 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14049,6 +14049,8 @@ in systemd-journal2gelf = callPackage ../tools/system/systemd-journal2gelf { }; + syncserver = callPackage ../servers/syncserver { }; + inherit (callPackages ../servers/http/tomcat { }) tomcat7 tomcat8 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6587ea86d3c9..8fbddff342a2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -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; }; };