Merge pull request #91168 from dotlambda/radicale-3.0.3

radicale: 2.1.11 -> 3.0.3
This commit is contained in:
Robert Schütz
2020-06-28 12:48:56 +02:00
committed by GitHub
6 changed files with 84 additions and 14 deletions
@@ -504,6 +504,16 @@ systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/www" ];
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>. 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>.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
Radicale's default package has changed from 2.x to 3.x. An upgrade
checklist can be found
<link xlink:href="https://github.com/Kozea/Radicale/blob/3.0.x/NEWS.md#upgrade-checklist">here</link>.
You can use the newer version in the NixOS service by setting the
<literal>package</literal> to <literal>radicale3</literal>, which is done
automatically if <literal>stateVersion</literal> is 20.09 or higher.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>
@@ -8,8 +8,10 @@ let
confFile = pkgs.writeText "radicale.conf" cfg.config; confFile = pkgs.writeText "radicale.conf" cfg.config;
# This enables us to default to version 2 while still not breaking configurations of people with version 1 defaultPackage = if versionAtLeast config.system.stateVersion "20.09" then {
defaultPackage = if versionAtLeast config.system.stateVersion "17.09" then { pkg = pkgs.radicale3;
text = "pkgs.radicale3";
} else if versionAtLeast config.system.stateVersion "17.09" then {
pkg = pkgs.radicale2; pkg = pkgs.radicale2;
text = "pkgs.radicale2"; text = "pkgs.radicale2";
} else { } else {
@@ -35,8 +37,9 @@ in
defaultText = defaultPackage.text; defaultText = defaultPackage.text;
description = '' description = ''
Radicale package to use. This defaults to version 1.x if Radicale package to use. This defaults to version 1.x if
<literal>system.stateVersion &lt; 17.09</literal> and version 2.x <literal>system.stateVersion &lt; 17.09</literal>, version 2.x if
otherwise. <literal>17.09 system.stateVersion &lt; 20.09</literal>, and
version 3.x otherwise.
''; '';
}; };
+23 -5
View File
@@ -14,9 +14,6 @@ let
[storage] [storage]
filesystem_folder = /tmp/collections filesystem_folder = /tmp/collections
[logging]
debug = True
''; '';
}; };
# WARNING: DON'T DO THIS IN PRODUCTION! # WARNING: DON'T DO THIS IN PRODUCTION!
@@ -49,13 +46,18 @@ in
services.radicale.extraArgs = [ services.radicale.extraArgs = [
"--export-storage" "/tmp/collections-new" "--export-storage" "/tmp/collections-new"
]; ];
system.stateVersion = "17.03";
}; };
radicale2_verify = lib.recursiveUpdate radicale2 { radicale2_verify = lib.recursiveUpdate radicale2 {
services.radicale.extraArgs = [ "--verify-storage" ]; services.radicale.extraArgs = [ "--debug" "--verify-storage" ];
system.stateVersion = "17.09";
}; };
radicale2 = lib.recursiveUpdate (common args) { radicale2 = lib.recursiveUpdate (common args) {
system.stateVersion = "17.09"; system.stateVersion = "17.09";
}; };
radicale3 = lib.recursiveUpdate (common args) {
system.stateVersion = "20.09";
};
}; };
# This tests whether the web interface is accessible to an authenticated user # This tests whether the web interface is accessible to an authenticated user
@@ -117,6 +119,22 @@ in
retcode == 0 and "VCALENDAR" in output retcode == 0 and "VCALENDAR" in output
), "Could not read calendar from Radicale 2" ), "Could not read calendar from Radicale 2"
radicale.succeed("curl --fail http://${user}:${password}@localhost:${port}/.web/") radicale.succeed("curl --fail http://${user}:${password}@localhost:${port}/.web/")
with subtest("Check Radicale 3 functionality"):
radicale.succeed(
"${switchToConfig "radicale3"} >&2"
)
radicale.wait_for_unit("radicale.service")
radicale.wait_for_open_port(${port})
(retcode, output) = radicale.execute(
"curl --fail http://${user}:${password}@localhost:${port}/someuser/calendar.ics/"
)
assert (
retcode == 0 and "VCALENDAR" in output
), "Could not read calendar from Radicale 3"
radicale.succeed("curl --fail http://${user}:${password}@localhost:${port}/.web/")
''; '';
}) })
@@ -2,14 +2,14 @@
python3.pkgs.buildPythonApplication rec { python3.pkgs.buildPythonApplication rec {
pname = "Radicale"; pname = "Radicale";
version = "2.1.11"; version = "2.1.12";
# No tests in PyPI tarball # No tests in PyPI tarball
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Kozea"; owner = "Kozea";
repo = "Radicale"; repo = "Radicale";
rev = version; rev = version;
sha256 = "1k32iy55lnyyp1r75clarhwdqvw6w8mxb5v0l5aysga07fg2mix4"; sha256 = "14f9ql0fiwapaa4xaslwgk1ah9fzxxan2p1p2rxb4a5iqph1z0cl";
}; };
# We only want functional tests # We only want functional tests
@@ -31,7 +31,7 @@ python3.pkgs.buildPythonApplication rec {
]; ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = "https://www.radicale.org/"; homepage = "https://www.radicale.org/2.x.nix";
description = "CalDAV CardDAV server"; description = "CalDAV CardDAV server";
longDescription = '' longDescription = ''
The Radicale Project is a complete CalDAV (calendar) and CardDAV The Radicale Project is a complete CalDAV (calendar) and CardDAV
+38
View File
@@ -0,0 +1,38 @@
{ lib, python3, fetchFromGitHub }:
python3.pkgs.buildPythonApplication rec {
pname = "radicale";
version = "3.0.3";
# No tests in PyPI tarball
src = fetchFromGitHub {
owner = "Kozea";
repo = "Radicale";
rev = version;
sha256 = "170mqxlnfzx15img4wb71axq9cnxwllk5cabsv8i008q7wyjqp0n";
};
propagatedBuildInputs = with python3.pkgs; [
defusedxml
passlib
vobject
python-dateutil
setuptools
];
checkInputs = with python3.pkgs; [
pytestrunner
pytest
pytestcov
pytest-flake8
pytest-isort
waitress
];
meta = with lib; {
homepage = "https://www.radicale.org/3.0.html";
description = "CalDAV and CardDAV server";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ dotlambda ];
};
}
+3 -2
View File
@@ -16348,9 +16348,10 @@ in
}; };
radicale1 = callPackage ../servers/radicale/1.x.nix { }; radicale1 = callPackage ../servers/radicale/1.x.nix { };
radicale2 = callPackage ../servers/radicale { }; radicale2 = callPackage ../servers/radicale/2.x.nix { };
radicale3 = callPackage ../servers/radicale/3.x.nix { };
radicale = radicale2; radicale = radicale3;
rake = callPackage ../development/tools/build-managers/rake { }; rake = callPackage ../development/tools/build-managers/rake { };