GNU bug report logs - #45047
[PATCH 0/2] Add service for radicale.

Previous Next

Package: guix-patches;

Reported by: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>

Date: Sat, 5 Dec 2020 00:27:02 UTC

Severity: normal

Tags: fixed, patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45047 in the body.
You can then email your comments to 45047 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#45047; Package guix-patches. (Sat, 05 Dec 2020 00:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Brielmaier <jonathan.brielmaier <at> web.de>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 05 Dec 2020 00:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
To: guix-patches <at> gnu.org
Cc: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
Subject: [PATCH 0/2] Add service for radicale.
Date: Sat,  5 Dec 2020 01:26:07 +0100
Hi,

this is a simple version of a service for radicale, a CalDAV/CardDAV server.
Password encryption with bcrypt is not working yet.
For the future I want to add the plugin for auth via dovecot. That's for another
patch series...

With the default configuration I confirmed that the service work as expected...

Jonathan Brielmaier (2):
  gnu: radicale: Update to 3.0.6.
  services: Add radicale-service-type.

 doc/guix.texi         | 25 +++++++++++++
 gnu/packages/dav.scm  |  4 +--
 gnu/services/mail.scm | 81 ++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 107 insertions(+), 3 deletions(-)

--
2.29.2





Information forwarded to guix-patches <at> gnu.org:
bug#45047; Package guix-patches. (Sat, 05 Dec 2020 00:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 45047 <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
To: 45047 <at> debbugs.gnu.org
Cc: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
Subject: [PATCH 1/2] gnu: radicale: Update to 3.0.6.
Date: Sat,  5 Dec 2020 01:27:54 +0100
* gnu/packages/dav.scm (radicale): Update to 3.0.6.
---
 gnu/packages/dav.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/dav.scm b/gnu/packages/dav.scm
index 8692a49c50..9d18d94996 100644
--- a/gnu/packages/dav.scm
+++ b/gnu/packages/dav.scm
@@ -39,7 +39,7 @@
 (define-public radicale
   (package
     (name "radicale")
-    (version "3.0.4")
+    (version "3.0.6")
     (source
      (origin
        ;; There are no tests in the PyPI tarball.
@@ -49,7 +49,7 @@
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0hj9mmhrj32mzhxlnjcfijb7768cyjsn603nalp54clgb2gkmvw8"))))
+        (base32 "1xlsvrmx6jhi71j6j8z9sli5vwxasivzjyqf8zq8r0l5p7350clf"))))
     (build-system python-build-system)
     (native-inputs
      `(("python-pytest" ,python-pytest)
--
2.29.2





Information forwarded to guix-patches <at> gnu.org:
bug#45047; Package guix-patches. (Sat, 05 Dec 2020 00:29:02 GMT) Full text and rfc822 format available.

Message #11 received at 45047 <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
To: 45047 <at> debbugs.gnu.org
Cc: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
Subject: [PATCH 2/2] services: Add radicale-service-type.
Date: Sat,  5 Dec 2020 01:27:55 +0100
* gnu/services/mail.scm (radicale-configuration)
(radicale-configuration?): New procedures.
(%default-radicale-config-file)
(radicale-service-type): New variables.
* doc/guix.texi: Document it.
---
 doc/guix.texi         | 25 +++++++++++++
 gnu/services/mail.scm | 81 ++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 105 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index a5c9779c86..38fd468ebf 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -85,6 +85,7 @@ Copyright @copyright{} 2020 Alexandru-Sergiu Marton@*
 Copyright @copyright{} 2020 raingloom@*
 Copyright @copyright{} 2020 Daniel Brooks@*
 Copyright @copyright{} 2020 John Soo@*
+Copyright @copyright{} 2020 Jonathan Brielmaier@*

 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -21150,6 +21151,30 @@ Mailutils Manual}, for details.
 @end table
 @end deftp

+@subsubheading Radicale Service
+@cindex CalDAV
+@cindex CardDAV
+
+@deffn {Scheme Variable} radicale-service-type
+This is the type of the @uref{https://radicale.org, Radicale} CalDAV/CardDAV
+server whose value should be a @code{radicale-configuration}.
+@end deffn
+
+@deftp {Data Type} radicale-configuration
+Data type representing the configuration of @command{radicale}.
+
+@table @asis
+@item @code{package} (default: @code{radicale})
+The package that provides @command{radicale}.
+
+@item @code{config-file} (default: @code{%default-radicale-config-file})
+File-like object of the configuration file to use, by default it will listen
+on TCP port 5232 of @code{localhost} and use the @code{htpasswd} file at
+@file{/var/lib/radicale/users} with no (@code{plain}) encryption.
+
+@end table
+@end deftp
+
 @node Messaging Services
 @subsection Messaging Services

diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index 71fa975b5d..c0f6371104 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2017 Carlo Zancanaro <carlo <at> zancanaro.id.au>
 ;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2019 Kristofer Buffington <kristoferbuffington <at> gmail.com>
+;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,7 @@
   #:use-module (gnu system shadow)
   #:use-module (gnu packages mail)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages dav)
   #:use-module (gnu packages tls)
   #:use-module (guix records)
   #:use-module (guix packages)
@@ -70,7 +72,12 @@
             imap4d-configuration
             imap4d-configuration?
             imap4d-service-type
-            %default-imap4d-config-file))
+            %default-imap4d-config-file
+
+            radicale-configuration
+            radicale-configuration?
+            radicale-service-type
+            %default-radicale-config-file))

 ;;; Commentary:
 ;;;
@@ -1834,3 +1841,75 @@ exim_group = exim
     (list (service-extension
            shepherd-root-service-type imap4d-shepherd-service)))
    (default-value (imap4d-configuration))))
+
+
+;;;
+;;; Radicale.
+;;;
+
+(define-record-type* <radicale-configuration>
+  radicale-configuration make-radicale-configuration
+  radicale-configuration?
+  (package     radicale-configuration-package
+               (default radicale))
+  (config-file radicale-configuration-config-file
+               (default %default-radicale-config-file)))
+
+(define %default-radicale-config-file
+  (plain-file "radicale.conf" "
+[auth]
+type = htpasswd
+htpasswd_filename = /var/lib/radicale/users
+htpasswd_encryption = plain
+
+[server]
+hosts = localhost:5232"))
+
+(define %radicale-accounts
+  (list (user-group
+         (name "radicale")
+         (system? #t))
+        (user-account
+         (name "radicale")
+         (group "radicale")
+         (system? #t)
+         (comment "Radicale Daemon")
+         (home-directory "/var/empty")
+         (shell (file-append shadow "/sbin/nologin")))))
+
+(define radicale-shepherd-service
+  (match-lambda
+    (($ <radicale-configuration> package config-file)
+     (list (shepherd-service
+            (provision '(radicale))
+            (documentation "Run the radicale daemon.")
+            (requirement '(networking))
+            (start #~(make-forkexec-constructor
+                      (list #$(file-append package "/bin/radicale")
+                        "-C" #$config-file)
+                      #:user "radicale"
+                      #:group "radicale"))
+            (stop #~(make-kill-destructor)))))))
+
+(define radicale-activation
+  (match-lambda
+    (($ <radicale-configuration> package config-file)
+     (with-imported-modules '((guix build utils))
+       #~(begin
+           (use-modules (guix build utils))
+           (let ((uid (passwd:uid (getpw "radicale")))
+                 (gid (group:gid (getgr "radicale"))))
+             (mkdir-p "/var/lib/radicale/collections")
+             (chown "/var/lib/radicale" uid gid)
+             (chown "/var/lib/radicale/collections" uid gid)
+             (chmod "/var/lib/radicale" #o700)))))))
+
+(define radicale-service-type
+  (service-type
+   (name 'radicale)
+   (description "Run radicale, a small CalDAV and CardDAV server.")
+   (extensions
+    (list (service-extension shepherd-root-service-type radicale-shepherd-service)
+          (service-extension account-service-type (const %radicale-accounts))
+          (service-extension activation-service-type radicale-activation)))
+   (default-value (radicale-configuration))))
--
2.29.2





Added tag(s) fixed. Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 08 Jan 2021 19:56:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 45047 <at> debbugs.gnu.org and Jonathan Brielmaier <jonathan.brielmaier <at> web.de> Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 08 Jan 2021 19:56:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#45047; Package guix-patches. (Sat, 09 Jan 2021 01:04:03 GMT) Full text and rfc822 format available.

Message #18 received at 45047-done <at> debbugs.gnu.org (full text, mbox):

From: jonathan <at> brielmaier.net
Subject: Close bug
Date: Fri, 08 Jan 2021 20:04:02 +0100
Close it.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 06 Feb 2021 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 80 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.