summary refs log tree commit diff
path: root/gnu/services/web.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-04-06 08:35:02 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-04-06 08:40:50 +0200
commitf00f52a1fb5ac08f8059dffcd60d36adcda06603 (patch)
tree10daa3377f3f575838201da539bc9412e1760e79 /gnu/services/web.scm
parenta71d335832ba390a572c8b71eb685816e8e2ab1f (diff)
downloadguix-f00f52a1fb5ac08f8059dffcd60d36adcda06603.tar.gz
gnu: mumi: Update to 0.0.0-12.bb2fe92.
* gnu/packages/mail.scm (mumi): Update to 0.0.0-12.bb2fe92.
[inputs]: Add guile-gcrypt, guile-redis, guile-webutils, mailutils.
* gnu/services/web.scm (<mumi-configuration>): New record type.
(mumi-configuration, mumi-configuration?, mumi-configuration-mumi,
mumi-configuration-mailer?, mumi-configuration-sender,
mumi-configuration-smtp): New procedures.
(mumi-shepherd-services): Accept configuration; adjust start commands; add
Shepherd service for mumi mailer.
(mumi-service-type): Pass default configuration.
* doc/guix.texi (Web Services): Update documentation.
Diffstat (limited to 'gnu/services/web.scm')
-rw-r--r--gnu/services/web.scm75
1 files changed, 55 insertions, 20 deletions
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index fa5c34d5af..c73ff5ebfc 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -262,6 +262,14 @@
             patchwork-virtualhost
             patchwork-service-type
 
+            <mumi-configuration>
+            mumi-configuration
+            mumi-configuration?
+            mumi-configuration-mumi
+            mumi-configuration-mailer?
+            mumi-configuration-sender
+            mumi-configuration-smtp
+
             mumi-service-type))
 
 ;;; Commentary:
@@ -1678,6 +1686,14 @@ WSGIPassAuthorization On
 ;;; Mumi.
 ;;;
 
+(define-record-type* <mumi-configuration>
+  mumi-configuration make-mumi-configuration
+  mumi-configuration?
+  (mumi    mumi-configuration-mumi (default mumi))
+  (mailer? mumi-configuration-mailer? (default #t))
+  (sender  mumi-configuration-sender)
+  (smtp    mumi-configuration-smtp))
+
 (define %mumi-activation
   (with-imported-modules '((guix build utils))
     #~(begin
@@ -1702,25 +1718,43 @@ WSGIPassAuthorization On
          (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)))
-        (shepherd-service
-         (provision '(mumi-worker))
-         (documentation "Mumi bug-tracking web interface.")
-         (requirement '(networking))
-         (start #~(make-forkexec-constructor
-                   '(#$(file-append mumi "/bin/mumi") "--worker")
-                   #:user "mumi" #:group "mumi"
-                   #:log-file "/var/log/mumi.worker.log"))
-         (stop #~(make-kill-destructor)))))
+(define (mumi-shepherd-services config)
+  (match config
+    (($ <mumi-configuration> mumi mailer? sender smtp)
+     (list (shepherd-service
+            (provision '(mumi))
+            (documentation "Mumi bug-tracking web interface.")
+            (requirement '(networking))
+            (start #~(make-forkexec-constructor
+                      `(#$(file-append mumi "/bin/mumi") "web"
+                        ,@(if mailer? '() '("--disable-mailer")))
+                      #:user "mumi" #:group "mumi"
+                      #:log-file "/var/log/mumi.log"))
+            (stop #~(make-kill-destructor)))
+           (shepherd-service
+            (provision '(mumi-worker))
+            (documentation "Mumi bug-tracking web interface database worker.")
+            (requirement '(networking))
+            (start #~(make-forkexec-constructor
+                      '(#$(file-append mumi "/bin/mumi") "worker")
+                      #:user "mumi" #:group "mumi"
+                      #:log-file "/var/log/mumi.worker.log"))
+            (stop #~(make-kill-destructor)))
+           (shepherd-service
+            (provision '(mumi-mailer))
+            (documentation "Mumi bug-tracking web interface mailer.")
+            (requirement '(networking))
+            (start #~(make-forkexec-constructor
+                      `(#$(file-append mumi "/bin/mumi") "mailer"
+                        ,@(if sender
+                              (list (string-append "--sender=" sender))
+                              '())
+                        ,@(if smtp
+                              (list (string-append "--smtp=" smtp))
+                              '()))
+                      #:user "mumi" #:group "mumi"
+                      #:log-file "/var/log/mumi.mailer.log"))
+            (stop #~(make-kill-destructor)))))))
 
 (define mumi-service-type
   (service-type
@@ -1734,4 +1768,5 @@ WSGIPassAuthorization On
                              mumi-shepherd-services)))
    (description
     "Run Mumi, a Web interface to the Debbugs bug-tracking server.")
-   (default-value mumi)))
+   (default-value
+     (mumi-configuration))))