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

services: web: Add sogogi service.

* gnu/services/web.scm (sogogi-service-type): New services.
(sogogi-serialize-section, sogogi-serialize-field)
(sogogi-serialize-string, sogogi-serialize-list-of-strings)
(sogogi-serialize-sogogi-user, sogogi-serialize-sogogi-location)
(sogogi-serialize-list-of-sogogi-user): New procedures.
(sogogi-user, sogogi-location)
(sogogi-configuration): New record types.
(sogogi-account-service): New variable.
(sogogi-config-file, sogogi-shepherd-service): New procedures.
* gnu/tests/web.scm (%test-sogogi): Add tests for the service.
* doc/guix.texi (Web Services): Document it.

Change-Id: I5cc6dd84d6c7c8d5d13b685853b19c5d433ed7e5
This commit is contained in:
Sören Tempel
2025-12-30 16:08:16 +01:00
parent 829b7e108d
commit 3f3cec8993
3 changed files with 250 additions and 0 deletions

View File

@@ -60,6 +60,7 @@
%test-anonip
%test-go-webdav
%test-patchwork
%test-sogogi
%test-agate
%test-miniflux-admin-string
%test-miniflux-admin-file
@@ -780,6 +781,55 @@ HTTP-PORT."
(description "Connect to a running Patchwork service.")
(value (run-patchwork-test patchwork))))
;;;
;;; sogogi
;;;
(define %sogogi-os
(simple-operating-system
(service dhcpcd-service-type)
(simple-service 'make-http-root activation-service-type
%make-http-root)
(service sogogi-service-type
(sogogi-configuration
(listen ":8080")
(user
(list
(sogogi-user
(name "testuser")
(password "testpass"))))
(location
(list
(sogogi-location
(path "/")
(dir "/srv/http/")
(grant '("all ro" "user:testuser rw")))))))))
(define %test-sogogi
(system-test
(name "sogogi")
(description "Test that the sogogi can handle HTTP requests.")
(value
(let ((http-port 8080))
(run-webserver-test name %sogogi-os
#:http-port http-port
#:extra-tests
#~(begin
(use-modules (srfi srfi-11) (srfi srfi-64)
(gnu build marionette)
(web uri)
(web client)
(web response))
(test-equal "unauthenticated delete"
401
(let-values
(((response _)
(http-delete #$(simple-format
#f "http://localhost:~A/index.html" http-port))))
(response-code response)))))))))
;;;
;;; Agate