git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #91168 from dotlambda/radicale-3.0.3

radicale: 2.1.11 -> 3.0.3

commit595a3d14b7bf11049087d3cd5b9153548b8133c2 authorRobert Schütz <dev@schuetz-co.de> dateSun 28 Jun 2020, 12:48 (6 years ago) parent408fd63d77fb37
6 files changed+84−14
nixos/doc/manual/release-notes/rl-2009.xml+10 nixos/modules/services/networking/radicale.nix+7−4 nixos/tests/radicale.nix+23−5 pkgs/servers/radicale/default.nix → pkgs/servers/radicale/2.x.nix+3−3 pkgs/servers/radicale/3.x.nix+38 pkgs/top-level/all-packages.nix+3−2
nixos/doc/manual/release-notes/rl-2009.xml+10
@@ -504,6 +504,16 @@ systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/www" ];
504504 In the <literal>resilio</literal> module, <xref linkend="opt-services.resilio.httpListenAddr"/> has been changed to listen to <literal>[::1]</literal> instead of <literal>0.0.0.0</literal>.
505505 </para>
506506 </listitem>
507+ <listitem>
508+ <para>
509+ Radicale's default package has changed from 2.x to 3.x. An upgrade
510+ checklist can be found
511+ <link xlink:href="https://github.com/Kozea/Radicale/blob/3.0.x/NEWS.md#upgrade-checklist">here</link>.
512+ You can use the newer version in the NixOS service by setting the
513+ <literal>package</literal> to <literal>radicale3</literal>, which is done
514+ automatically if <literal>stateVersion</literal> is 20.09 or higher.
515+ </para>
516+ </listitem>
507517 </itemizedlist>
508518 </section>
509519
nixos/modules/services/networking/radicale.nix+7−4
@@ -8,8 +8,10 @@ let
88
99 confFile = pkgs.writeText "radicale.conf" cfg.config;
1010
11− # This enables us to default to version 2 while still not breaking configurations of people with version 1
12− defaultPackage = if versionAtLeast config.system.stateVersion "17.09" then {
11+ defaultPackage = if versionAtLeast config.system.stateVersion "20.09" then {
12+ pkg = pkgs.radicale3;
13+ text = "pkgs.radicale3";
14+ } else if versionAtLeast config.system.stateVersion "17.09" then {
1315 pkg = pkgs.radicale2;
1416 text = "pkgs.radicale2";
1517 } else {
@@ -35,8 +37,9 @@ in
3537 defaultText = defaultPackage.text;
3638 description = ''
3739 Radicale package to use. This defaults to version 1.x if
38− <literal>system.stateVersion &lt; 17.09</literal> and version 2.x
39− otherwise.
40+ <literal>system.stateVersion &lt; 17.09</literal>, version 2.x if
41+ <literal>17.09 ≤ system.stateVersion &lt; 20.09</literal>, and
42+ version 3.x otherwise.
4043 '';
4144 };
4245
nixos/tests/radicale.nix+23−5
@@ -14,9 +14,6 @@ let
1414
1515 [storage]
1616 filesystem_folder = /tmp/collections
17−
18− [logging]
19− debug = True
2017 '';
2118 };
2219 # WARNING: DON'T DO THIS IN PRODUCTION!
@@ -49,13 +46,18 @@ in
4946 services.radicale.extraArgs = [
5047 "--export-storage" "/tmp/collections-new"
5148 ];
49+ system.stateVersion = "17.03";
5250 };
5351 radicale2_verify = lib.recursiveUpdate radicale2 {
54− services.radicale.extraArgs = [ "--verify-storage" ];
52+ services.radicale.extraArgs = [ "--debug" "--verify-storage" ];
53+ system.stateVersion = "17.09";
5554 };
5655 radicale2 = lib.recursiveUpdate (common args) {
5756 system.stateVersion = "17.09";
5857 };
58+ radicale3 = lib.recursiveUpdate (common args) {
59+ system.stateVersion = "20.09";
60+ };
5961 };
6062
6163 # This tests whether the web interface is accessible to an authenticated user
@@ -117,6 +119,22 @@ in
117119 retcode == 0 and "VCALENDAR" in output
118120 ), "Could not read calendar from Radicale 2"
119121
120− radicale.succeed("curl --fail http://${user}:${password}@localhost:${port}/.web/")
122+ radicale.succeed("curl --fail http://${user}:${password}@localhost:${port}/.web/")
123+
124+ with subtest("Check Radicale 3 functionality"):
125+ radicale.succeed(
126+ "${switchToConfig "radicale3"} >&2"
127+ )
128+ radicale.wait_for_unit("radicale.service")
129+ radicale.wait_for_open_port(${port})
130+
131+ (retcode, output) = radicale.execute(
132+ "curl --fail http://${user}:${password}@localhost:${port}/someuser/calendar.ics/"
133+ )
134+ assert (
135+ retcode == 0 and "VCALENDAR" in output
136+ ), "Could not read calendar from Radicale 3"
137+
138+ radicale.succeed("curl --fail http://${user}:${password}@localhost:${port}/.web/")
121139 '';
122140})
pkgs/servers/radicale/default.nix → pkgs/servers/radicale/2.x.nixrenamed+3−3
@@ -2,14 +2,14 @@
22
33python3.pkgs.buildPythonApplication rec {
44 pname = "Radicale";
5− version = "2.1.11";
5+ version = "2.1.12";
66
77 # No tests in PyPI tarball
88 src = fetchFromGitHub {
99 owner = "Kozea";
1010 repo = "Radicale";
1111 rev = version;
12− sha256 = "1k32iy55lnyyp1r75clarhwdqvw6w8mxb5v0l5aysga07fg2mix4";
12+ sha256 = "14f9ql0fiwapaa4xaslwgk1ah9fzxxan2p1p2rxb4a5iqph1z0cl";
1313 };
1414
1515 # We only want functional tests
@@ -31,7 +31,7 @@ python3.pkgs.buildPythonApplication rec {
3131 ];
3232
3333 meta = with stdenv.lib; {
34− homepage = "https://www.radicale.org/";
34+ homepage = "https://www.radicale.org/2.x.nix";
3535 description = "CalDAV CardDAV server";
3636 longDescription = ''
3737 The Radicale Project is a complete CalDAV (calendar) and CardDAV
pkgs/servers/radicale/3.x.nixnew file+38
@@ -0,0 +1,38 @@
1+{ lib, python3, fetchFromGitHub }:
2+
3+python3.pkgs.buildPythonApplication rec {
4+ pname = "radicale";
5+ version = "3.0.3";
6+
7+ # No tests in PyPI tarball
8+ src = fetchFromGitHub {
9+ owner = "Kozea";
10+ repo = "Radicale";
11+ rev = version;
12+ sha256 = "170mqxlnfzx15img4wb71axq9cnxwllk5cabsv8i008q7wyjqp0n";
13+ };
14+
15+ propagatedBuildInputs = with python3.pkgs; [
16+ defusedxml
17+ passlib
18+ vobject
19+ python-dateutil
20+ setuptools
21+ ];
22+
23+ checkInputs = with python3.pkgs; [
24+ pytestrunner
25+ pytest
26+ pytestcov
27+ pytest-flake8
28+ pytest-isort
29+ waitress
30+ ];
31+
32+ meta = with lib; {
33+ homepage = "https://www.radicale.org/3.0.html";
34+ description = "CalDAV and CardDAV server";
35+ license = licenses.gpl3Plus;
36+ maintainers = with maintainers; [ dotlambda ];
37+ };
38+}
pkgs/top-level/all-packages.nix+3−2
@@ -16348,9 +16348,10 @@ in
1634816348 };
1634916349
1635016350 radicale1 = callPackage ../servers/radicale/1.x.nix { };
16351− radicale2 = callPackage ../servers/radicale { };
16351+ radicale2 = callPackage ../servers/radicale/2.x.nix { };
16352+ radicale3 = callPackage ../servers/radicale/3.x.nix { };
1635216353
16353− radicale = radicale2;
16354+ radicale = radicale3;
1635416355
1635516356 rake = callPackage ../development/tools/build-managers/rake { };
1635616357