forked from mirrors/nixpkgs
Merge pull request #54739 from Nadrieril/fix-ffsync
Fix firefox sync-server
This commit is contained in:
commit
0525fa54e8
|
@ -13,7 +13,7 @@ let
|
||||||
overrides = ${cfg.privateConfig}
|
overrides = ${cfg.privateConfig}
|
||||||
|
|
||||||
[server:main]
|
[server:main]
|
||||||
use = egg:Paste#http
|
use = egg:gunicorn
|
||||||
host = ${cfg.listen.address}
|
host = ${cfg.listen.address}
|
||||||
port = ${toString cfg.listen.port}
|
port = ${toString cfg.listen.port}
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@ let
|
||||||
audiences = ${removeSuffix "/" cfg.publicUrl}
|
audiences = ${removeSuffix "/" cfg.publicUrl}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
user = "syncserver";
|
||||||
|
group = "syncserver";
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -126,15 +128,14 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
systemd.services.syncserver = let
|
systemd.services.syncserver = {
|
||||||
syncServerEnv = pkgs.python.withPackages(ps: with ps; [ syncserver pasteScript requests ]);
|
|
||||||
user = "syncserver";
|
|
||||||
group = "syncserver";
|
|
||||||
in {
|
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
description = "Firefox Sync Server";
|
description = "Firefox Sync Server";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
path = [ pkgs.coreutils syncServerEnv ];
|
path = [
|
||||||
|
pkgs.coreutils
|
||||||
|
(pkgs.python.withPackages (ps: [ pkgs.syncserver ps.gunicorn ]))
|
||||||
|
];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = user;
|
User = user;
|
||||||
|
@ -166,14 +167,17 @@ in
|
||||||
chown ${user}:${group} ${defaultDbLocation}
|
chown ${user}:${group} ${defaultDbLocation}
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
serviceConfig.ExecStart = "${syncServerEnv}/bin/paster serve ${syncServerIni}";
|
|
||||||
|
script = ''
|
||||||
|
gunicorn --paste ${syncServerIni}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.syncserver = {
|
users.users.${user} = {
|
||||||
group = "syncserver";
|
inherit group;
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.groups.syncserver = {};
|
users.groups.${group} = {};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ stdenv
|
{ stdenv
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchgit
|
, fetchFromGitHub
|
||||||
, fetchurl
|
|
||||||
, pyramid
|
, pyramid
|
||||||
, simplejson
|
, simplejson
|
||||||
, konfig
|
, konfig
|
||||||
|
@ -9,26 +8,22 @@
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "mozsvc";
|
pname = "mozsvc";
|
||||||
version = "0.8";
|
version = "0.10";
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchFromGitHub {
|
||||||
url = https://github.com/mozilla-services/mozservices.git;
|
owner = "mozilla-services";
|
||||||
rev = "refs/tags/${version}";
|
repo = "mozservices";
|
||||||
sha256 = "1zci2ikk83mf7va88c83dr6snfh4ddjqw0lsg3y29qk5nxf80vx2";
|
rev = version;
|
||||||
|
sha256 = "0a0558g8j55pd1nnhnnf3k377jv6cah8lxb24v98rq8kxr5960cg";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = stdenv.lib.singleton (fetchurl {
|
doCheck = false; # too many dependencies and conflicting versions; I (nadrieril) gave up
|
||||||
url = https://github.com/nbp/mozservices/commit/f86c0b0b870cd8f80ce90accde9e16ecb2e88863.diff;
|
|
||||||
sha256 = "1lnghx821f6dqp3pa382ka07cncdz7hq0mkrh44d0q3grvrlrp9n";
|
|
||||||
});
|
|
||||||
|
|
||||||
doCheck = false; # lazy packager
|
|
||||||
propagatedBuildInputs = [ pyramid simplejson konfig ];
|
propagatedBuildInputs = [ pyramid simplejson konfig ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = https://github.com/mozilla-services/mozservices;
|
homepage = https://github.com/mozilla-services/mozservices;
|
||||||
description = "Various utilities for Mozilla apps";
|
description = "Various utilities for Mozilla apps";
|
||||||
license = licenses.mpl20;
|
license = licenses.mpl20;
|
||||||
|
maintainers = with maintainers; [ nadrieril ];
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{ buildPythonPackage
|
{ stdenv
|
||||||
, fetchgit
|
, buildPythonPackage
|
||||||
|
, fetchFromGitHub
|
||||||
, isPy27
|
, isPy27
|
||||||
, testfixtures
|
, testfixtures
|
||||||
, unittest2
|
, unittest2
|
||||||
|
@ -20,13 +21,14 @@
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "serversyncstorage";
|
pname = "serversyncstorage";
|
||||||
version = "1.6.11";
|
version = "1.6.14";
|
||||||
disabled = !isPy27;
|
disabled = !isPy27;
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchFromGitHub {
|
||||||
url = https://github.com/mozilla-services/server-syncstorage.git;
|
owner = "mozilla-services";
|
||||||
rev = "refs/tags/${version}";
|
repo = "server-syncstorage";
|
||||||
sha256 = "197gj2jfs2c6nzs20j37kqxwi91wabavxnfm4rqmrjwhgqjwhnm0";
|
rev = version;
|
||||||
|
sha256 = "08xclxj38rav8yay9cijiavv35jbyf6a9jzr24vgcna8pjjnbbmh";
|
||||||
};
|
};
|
||||||
|
|
||||||
checkInputs = [ testfixtures unittest2 webtest ];
|
checkInputs = [ testfixtures unittest2 webtest ];
|
||||||
|
@ -35,7 +37,10 @@ buildPythonPackage rec {
|
||||||
pymysqlsa umemcache WSGIProxy requests pybrowserid
|
pymysqlsa umemcache WSGIProxy requests pybrowserid
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
broken = true; # 2018-11-04
|
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 ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -31,5 +31,6 @@ buildPythonPackage rec {
|
||||||
description = "The Mozilla Token Server";
|
description = "The Mozilla Token Server";
|
||||||
homepage = https://github.com/mozilla-services/tokenserver;
|
homepage = https://github.com/mozilla-services/tokenserver;
|
||||||
license = licenses.mpl20;
|
license = licenses.mpl20;
|
||||||
|
maintainers = with maintainers; [ nadrieril ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
47
pkgs/servers/syncserver/default.nix
Normal file
47
pkgs/servers/syncserver/default.nix
Normal 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 ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -14049,6 +14049,8 @@ in
|
||||||
|
|
||||||
systemd-journal2gelf = callPackage ../tools/system/systemd-journal2gelf { };
|
systemd-journal2gelf = callPackage ../tools/system/systemd-journal2gelf { };
|
||||||
|
|
||||||
|
syncserver = callPackage ../servers/syncserver { };
|
||||||
|
|
||||||
inherit (callPackages ../servers/http/tomcat { })
|
inherit (callPackages ../servers/http/tomcat { })
|
||||||
tomcat7
|
tomcat7
|
||||||
tomcat8
|
tomcat8
|
||||||
|
|
|
@ -784,8 +784,6 @@ in {
|
||||||
|
|
||||||
supervise_api = callPackage ../development/python-modules/supervise_api { };
|
supervise_api = callPackage ../development/python-modules/supervise_api { };
|
||||||
|
|
||||||
syncserver = callPackage ../development/python-modules/syncserver {};
|
|
||||||
|
|
||||||
tables = callPackage ../development/python-modules/tables {
|
tables = callPackage ../development/python-modules/tables {
|
||||||
hdf5 = pkgs.hdf5.override { zlib = pkgs.zlib; };
|
hdf5 = pkgs.hdf5.override { zlib = pkgs.zlib; };
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue