1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00

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 <dannym@friendly-machines.com>
This commit is contained in:
Sören Tempel
2026-02-08 07:27:24 +01:00
committed by Danny Milosavljevic
parent daca67c560
commit 64622248cd
3 changed files with 82 additions and 0 deletions

View File

@@ -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

View File

@@ -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
@@ -1634,6 +1637,44 @@ Whoogle."))
(default-value (whoogle-configuration))
(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

View File

@@ -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
@@ -602,6 +604,26 @@ HTTP-PORT, along with php-fpm."
(description "Anonymize logs via Anonip")
(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