guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 64622248cdc7eae23ff06928f516677b41c4d97d
Author: Sören Tempel <[email protected]>
AuthorDate: Sun Feb 8 07:27:24 2026 +0100

    services: web: Add go-webdav.
    
    * gnu/services/web.scm (go-webdav-service-type): New service.
    (go-webdav-account-service): New variable.
    (go-webdav-shepherd-service): New procedures.
    * gnu/tests/web.scm (%test-go-webdav): Add tests for the service.
    * doc/guix.texi (Web Services): Document it.
    
    Signed-off-by: Danny Milosavljevic <[email protected]>
---
 doc/guix.texi        | 19 +++++++++++++++++++
 gnu/services/web.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 gnu/tests/web.scm    | 22 ++++++++++++++++++++++
 3 files changed, 82 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 1bf3a566c0..cb22e612e4 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -35258,6 +35258,25 @@ its environment variables template} for the list of 
available options.
 @end table
 @end deftp
 
+@subsubheading go-wbedav
+@cindex go-webdav
+@uref{https://github.com/emersion/go-webdav, go-webdav} is a
+server for the
+@uref{https://www.rfc-editor.org/rfc/rfc4918, WebDAV} protocol.
+
+@defvar go-webdav-service-type
+This is the service type for go-webdav.  Since go-webdav does not
+have a configuration file, its value must be a list of command-line
+arguments that should be passed to the @code{webdav-server} command.
+For example, the following configuration will serve all files in
+@file{"/srv/http/"} via port 8080 on 127.0.0.1:
+
+@lisp
+(service go-webdav-service-type
+         '("-addr" "127.0.0.1:8080" "/srv/http/"))
+@end lisp
+@end defvar
+
 @subsubheading Patchwork
 @cindex Patchwork
 Patchwork is a patch tracking system.  It can collect patches sent to a
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 9d314368ff..4ba2a2268d 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -57,6 +57,7 @@
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages rsync)
   #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages golang-xyz)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages logging)
   #:use-module (gnu packages mail)
@@ -255,6 +256,8 @@
             whoogle-configuration-port
             whoogle-configuration-environment-variables
 
+            go-webdav-service-type
+
             patchwork-database-configuration
             patchwork-database-configuration?
             patchwork-database-configuration-engine
@@ -1635,6 +1638,44 @@ Whoogle."))
    (description "Set up the @code{whoogle-search} metasearch engine.")))
 
 
+;;;
+;;; go-webdav
+;;;
+
+(define (go-webdav-shepherd-service args)
+  (list (shepherd-service
+          (documentation "go-webdav daemon.")
+          (provision '(go-webdav))
+          ;; go-webdav may be bound to a particular IP address, hence
+          ;; only start it after the networking service has started.
+          (requirement '(user-processes networking))
+          (start #~(make-forkexec-constructor
+                     (list (string-append #$go-webdav "/bin/webdav-server")
+                           #$@args)))
+          (stop #~(make-kill-destructor)))))
+
+(define go-webdav-account-service
+  (list (user-group (name "go-webdav") (system? #t))
+        (user-account
+         (name "go-webdav")
+         (group "go-webdav")
+         (system? #t)
+         (comment "go-webdav daemon user")
+         (home-directory "/var/empty")
+         (shell (file-append shadow "/sbin/nologin")))))
+
+(define-public go-webdav-service-type
+  (service-type (name 'go-webdav)
+                (description "Run the go-webdav WebDAV server.")
+                (extensions
+                  (list (service-extension account-service-type
+                                           (const go-webdav-account-service))
+                        (service-extension shepherd-root-service-type
+                                           go-webdav-shepherd-service)))
+                (compose concatenate)
+                (default-value '("-addr" "127.0.0.1:8080"))))
+
+
 ;;;
 ;;; Patchwork
 ;;;
diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm
index 47879aa08f..4f07eb967a 100644
--- a/gnu/tests/web.scm
+++ b/gnu/tests/web.scm
@@ -39,6 +39,7 @@
   #:use-module (gnu packages databases)
   #:use-module (gnu packages guile-xyz)
   #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages golang-xyz)
   #:use-module (gnu packages patchutils)
   #:use-module (gnu packages python)
   #:use-module (gnu packages tls)
@@ -57,6 +58,7 @@
             %test-php-fpm
             %test-hpcguix-web
             %test-anonip
+            %test-go-webdav
             %test-patchwork
             %test-agate
             %test-miniflux-admin-string
@@ -603,6 +605,26 @@ HTTP-PORT, along with php-fpm."
    (value (run-anonip-test))))
 
 
+;;;
+;;; go-webdav
+;;;
+
+(define %go-webdav-os
+  (simple-operating-system
+    (service dhcpcd-service-type)
+    (simple-service 'make-http-root activation-service-type
+                    %make-http-root)
+    (service go-webdav-service-type
+      ;; run-webserver-test requires :8080 to be used as the port.
+      '("-addr" ":8080" "/srv/http/"))))
+
+(define %test-go-webdav
+  (system-test
+    (name "go-webdav")
+    (description "Test that go-webdav can handle HTTP requests.")
+    (value (run-webserver-test name %go-webdav-os))))
+
+
 ;;;
 ;;; Patchwork
 ;;;

Reply via email to