guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

08/10: services: Add Mumi service.


From: guix-commits
Subject: 08/10: services: Add Mumi service.
Date: Sat, 21 Dec 2019 17:55:51 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 6ee87461e0466f8756ac01257abcae80f7fe17ca
Author: Ludovic Court├Ęs <address@hidden>
Date:   Sat Dec 21 23:43:41 2019 +0100

    services: Add Mumi service.
    
    * gnu/services/web.scm (%mumi-activation, %mumi-accounts): New variables.
    (mumi-shepherd-services): New procedure.
    (mumi-service-type): New variable.
    * doc/guix.texi (Web Services): Document it.
---
 doc/guix.texi        | 13 ++++++++++++
 gnu/services/web.scm | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 69 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 7fa1eca..efc59c1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20412,6 +20412,19 @@ The port on which to connect to the database.
 @end table
 @end deftp
 
+@subsubheading Mumi
+
+@cindex Mumi, Debbugs Web interface
+@cindex Debbugs, Mumi Web interface
+@uref{https://git.elephly.net/gitweb.cgi?p=software/mumi.git, Mumi} is a
+Web interface to the Debbugs bug tracker, by default for
+@uref{https://bugs.gnu.org, the GNU instance}.  Mumi is a Web server,
+but it also fetches and indexes mail retrieved from Debbugs.
+
+@defvr {Scheme Variable} mumi-service-type
+This is the service type for Mumi.
+@end defvr
+
 @subsubheading FastCGI
 @cindex fastcgi
 @cindex fcgiwrap
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 372f4dc..3ac7b7f 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -43,6 +43,7 @@
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages logging)
+  #:use-module (gnu packages mail)
   #:use-module (guix packages)
   #:use-module (guix records)
   #:use-module (guix modules)
@@ -256,7 +257,9 @@
             patchwork-configuration-domain
 
             patchwork-virtualhost
-            patchwork-service-type))
+            patchwork-service-type
+
+            mumi-service-type))
 
 ;;; Commentary:
 ;;;
@@ -1652,3 +1655,55 @@ WSGIPassAuthorization On
                              patchwork-getmail-configs)))
    (description
     "Patchwork patch tracking system.")))
+
+
+;;;
+;;; Mumi.
+;;;
+
+(define %mumi-activation
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+
+        (mkdir-p "/var/mumi/mails")
+        (let* ((pw  (getpwnam "mumi"))
+               (uid (passwd:uid pw))
+               (gid (passwd:gid pw)))
+          (chown "/var/mumi" uid gid)
+          (chown "/var/mumi/mails" uid gid)))))
+
+(define %mumi-accounts
+  (list (user-group (name "mumi") (system? #t))
+        (user-account
+         (name "mumi")
+         (group "mumi")
+         (system? #t)
+         (comment "Mumi web server")
+         (home-directory "/var/empty")
+         (shell (file-append shadow "/sbin/nologin")))))
+
+(define (mumi-shepherd-services mumi)
+  (list (shepherd-service
+         (provision '(mumi))
+         (documentation "Mumi bug-tracking web interface.")
+         (requirement '(networking))
+         (start #~(make-forkexec-constructor
+                   '(#$(file-append mumi "/bin/mumi"))
+                   #:user "mumi" #:group "mumi"
+                   #:log-file "/var/log/mumi.log"))
+         (stop #~(make-kill-destructor)))))
+
+(define mumi-service-type
+  (service-type
+   (name 'mumi)
+   (extensions
+    (list (service-extension activation-service-type
+                             (const %mumi-activation))
+          (service-extension account-service-type
+                             (const %mumi-accounts))
+          (service-extension shepherd-root-service-type
+                             mumi-shepherd-services)))
+   (description
+    "Run Mumi, a Web interface to the Debbugs bug-tracking server.")
+   (default-value mumi)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]