diff options
| author | Sören Tempel <soeren+git@soeren-tempel.net> | 2026-02-08 07:27:24 +0100 |
|---|---|---|
| committer | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-02-08 23:53:58 +0100 |
| commit | 64622248cdc7eae23ff06928f516677b41c4d97d (patch) | |
| tree | cc0c265dfb92005cd63edd27c6f5ff28c716b463 | |
| parent | daca67c56004bcf2fc7abb038384e2f97215f265 (diff) | |
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>
| -rw-r--r-- | doc/guix.texi | 19 | ||||
| -rw-r--r-- | gnu/services/web.scm | 41 | ||||
| -rw-r--r-- | gnu/tests/web.scm | 22 |
3 files changed, 82 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 1bf3a566c0b..cb22e612e42 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -35258,6 +35258,25 @@ its environment variables template} for the list of available options. | |||
| 35258 | @end table | 35258 | @end table |
| 35259 | @end deftp | 35259 | @end deftp |
| 35260 | 35260 | ||
| 35261 | @subsubheading go-wbedav | ||
| 35262 | @cindex go-webdav | ||
| 35263 | @uref{https://github.com/emersion/go-webdav, go-webdav} is a | ||
| 35264 | server for the | ||
| 35265 | @uref{https://www.rfc-editor.org/rfc/rfc4918, WebDAV} protocol. | ||
| 35266 | |||
| 35267 | @defvar go-webdav-service-type | ||
| 35268 | This is the service type for go-webdav. Since go-webdav does not | ||
| 35269 | have a configuration file, its value must be a list of command-line | ||
| 35270 | arguments that should be passed to the @code{webdav-server} command. | ||
| 35271 | For example, the following configuration will serve all files in | ||
| 35272 | @file{"/srv/http/"} via port 8080 on 127.0.0.1: | ||
| 35273 | |||
| 35274 | @lisp | ||
| 35275 | (service go-webdav-service-type | ||
| 35276 | '("-addr" "127.0.0.1:8080" "/srv/http/")) | ||
| 35277 | @end lisp | ||
| 35278 | @end defvar | ||
| 35279 | |||
| 35261 | @subsubheading Patchwork | 35280 | @subsubheading Patchwork |
| 35262 | @cindex Patchwork | 35281 | @cindex Patchwork |
| 35263 | Patchwork is a patch tracking system. It can collect patches sent to a | 35282 | 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 9d314368ff9..4ba2a2268d8 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | #:use-module (gnu packages python-web) | 57 | #:use-module (gnu packages python-web) |
| 58 | #:use-module (gnu packages rsync) | 58 | #:use-module (gnu packages rsync) |
| 59 | #:use-module (gnu packages gnupg) | 59 | #:use-module (gnu packages gnupg) |
| 60 | #:use-module (gnu packages golang-xyz) | ||
| 60 | #:use-module (gnu packages guile) | 61 | #:use-module (gnu packages guile) |
| 61 | #:use-module (gnu packages logging) | 62 | #:use-module (gnu packages logging) |
| 62 | #:use-module (gnu packages mail) | 63 | #:use-module (gnu packages mail) |
| @@ -255,6 +256,8 @@ | |||
| 255 | whoogle-configuration-port | 256 | whoogle-configuration-port |
| 256 | whoogle-configuration-environment-variables | 257 | whoogle-configuration-environment-variables |
| 257 | 258 | ||
| 259 | go-webdav-service-type | ||
| 260 | |||
| 258 | patchwork-database-configuration | 261 | patchwork-database-configuration |
| 259 | patchwork-database-configuration? | 262 | patchwork-database-configuration? |
| 260 | patchwork-database-configuration-engine | 263 | patchwork-database-configuration-engine |
| @@ -1636,6 +1639,44 @@ Whoogle.")) | |||
| 1636 | 1639 | ||
| 1637 | 1640 | ||
| 1638 | ;;; | 1641 | ;;; |
| 1642 | ;;; go-webdav | ||
| 1643 | ;;; | ||
| 1644 | |||
| 1645 | (define (go-webdav-shepherd-service args) | ||
| 1646 | (list (shepherd-service | ||
| 1647 | (documentation "go-webdav daemon.") | ||
| 1648 | (provision '(go-webdav)) | ||
| 1649 | ;; go-webdav may be bound to a particular IP address, hence | ||
| 1650 | ;; only start it after the networking service has started. | ||
| 1651 | (requirement '(user-processes networking)) | ||
| 1652 | (start #~(make-forkexec-constructor | ||
| 1653 | (list (string-append #$go-webdav "/bin/webdav-server") | ||
| 1654 | #$@args))) | ||
| 1655 | (stop #~(make-kill-destructor))))) | ||
| 1656 | |||
| 1657 | (define go-webdav-account-service | ||
| 1658 | (list (user-group (name "go-webdav") (system? #t)) | ||
| 1659 | (user-account | ||
| 1660 | (name "go-webdav") | ||
| 1661 | (group "go-webdav") | ||
| 1662 | (system? #t) | ||
| 1663 | (comment "go-webdav daemon user") | ||
| 1664 | (home-directory "/var/empty") | ||
| 1665 | (shell (file-append shadow "/sbin/nologin"))))) | ||
| 1666 | |||
| 1667 | (define-public go-webdav-service-type | ||
| 1668 | (service-type (name 'go-webdav) | ||
| 1669 | (description "Run the go-webdav WebDAV server.") | ||
| 1670 | (extensions | ||
| 1671 | (list (service-extension account-service-type | ||
| 1672 | (const go-webdav-account-service)) | ||
| 1673 | (service-extension shepherd-root-service-type | ||
| 1674 | go-webdav-shepherd-service))) | ||
| 1675 | (compose concatenate) | ||
| 1676 | (default-value '("-addr" "127.0.0.1:8080")))) | ||
| 1677 | |||
| 1678 | |||
| 1679 | ;;; | ||
| 1639 | ;;; Patchwork | 1680 | ;;; Patchwork |
| 1640 | ;;; | 1681 | ;;; |
| 1641 | 1682 | ||
diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 47879aa08f7..4f07eb967a8 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #:use-module (gnu packages databases) | 39 | #:use-module (gnu packages databases) |
| 40 | #:use-module (gnu packages guile-xyz) | 40 | #:use-module (gnu packages guile-xyz) |
| 41 | #:use-module (gnu packages gnupg) | 41 | #:use-module (gnu packages gnupg) |
| 42 | #:use-module (gnu packages golang-xyz) | ||
| 42 | #:use-module (gnu packages patchutils) | 43 | #:use-module (gnu packages patchutils) |
| 43 | #:use-module (gnu packages python) | 44 | #:use-module (gnu packages python) |
| 44 | #:use-module (gnu packages tls) | 45 | #:use-module (gnu packages tls) |
| @@ -57,6 +58,7 @@ | |||
| 57 | %test-php-fpm | 58 | %test-php-fpm |
| 58 | %test-hpcguix-web | 59 | %test-hpcguix-web |
| 59 | %test-anonip | 60 | %test-anonip |
| 61 | %test-go-webdav | ||
| 60 | %test-patchwork | 62 | %test-patchwork |
| 61 | %test-agate | 63 | %test-agate |
| 62 | %test-miniflux-admin-string | 64 | %test-miniflux-admin-string |
| @@ -604,6 +606,26 @@ HTTP-PORT, along with php-fpm." | |||
| 604 | 606 | ||
| 605 | 607 | ||
| 606 | ;;; | 608 | ;;; |
| 609 | ;;; go-webdav | ||
| 610 | ;;; | ||
| 611 | |||
| 612 | (define %go-webdav-os | ||
| 613 | (simple-operating-system | ||
| 614 | (service dhcpcd-service-type) | ||
| 615 | (simple-service 'make-http-root activation-service-type | ||
| 616 | %make-http-root) | ||
| 617 | (service go-webdav-service-type | ||
| 618 | ;; run-webserver-test requires :8080 to be used as the port. | ||
| 619 | '("-addr" ":8080" "/srv/http/")))) | ||
| 620 | |||
| 621 | (define %test-go-webdav | ||
| 622 | (system-test | ||
| 623 | (name "go-webdav") | ||
| 624 | (description "Test that go-webdav can handle HTTP requests.") | ||
| 625 | (value (run-webserver-test name %go-webdav-os)))) | ||
| 626 | |||
| 627 | |||
| 628 | ;;; | ||
| 607 | ;;; Patchwork | 629 | ;;; Patchwork |
| 608 | ;;; | 630 | ;;; |
| 609 | 631 | ||
