GNU bug report logs -
#44099
[PATCH] gnu: Add gmnisrv.
Previous Next
Full log
Message #13 received at 44099-done <at> debbugs.gnu.org (full text, mbox):
Hi,
Alexandru-Sergiu Marton <brown121407 <at> posteo.ro> skribis:
> * gnu/packages/web.scm (gmnisrv): New variable.
[...]
> + (synopsis "Simple Gemini protocol server")
> + (description "gmnisrv is a simple Gemini protocol server written in C.")
> + (license (list license:gpl3
It’s ‘gpl3+’ since there’s nothing saying “version 3 only”.
> * gnu/services/web.scm (<gmnisrv-configuration>): New record type.
> (%default-gmnisrv-config-file): New variable.
> (%gmnisrv-accounts, %gmnisrv-activation): New variables.
> (gmnisrv-shepherd-service): New procedure.
> (gmnisrv-service-type): New variable.
> * doc/guix.texi (Web Services): Document it.
Nice, applied!
> +(define %default-gmnisrv-config-file
> + (plain-file "gmnisrv.ini" "
> +listen=0.0.0.0:1965 [::]:1965
> +
> +[:tls]
> +store=/var/lib/gemini/certs
> +
> +organization=gmnisrv on Guix user
> +
> +[localhost]
> +root=/srv/gemini
> +"))
> +
> +(define-record-type* <gmnisrv-configuration>
> + gmnisrv-configuration make-gmnisrv-configuration
> + gmnisrv-configuration?
> + (package gmnisrv-configuration-package
> + (default gmnisrv))
> + (config-file gmnisrv-configuration-config-file
> + (default %default-gmnisrv-config-file)))
> +
> +(define gmnisrv-shepherd-service
> + (match-lambda
> + (($ <gmnisrv-configuration> package config-file)
> + (list (shepherd-service
> + (provision '(gmnisrv))
> + (requirement '(networking))
> + (documentation "Run the gmnisrv Gemini server.")
> + (start (let ((gmnisrv (file-append package "/bin/gmnisrv")))
> + #~(make-forkexec-constructor
> + (list #$gmnisrv "-C" #$config-file)
> + #:user "gmnisrv" #:group "gmnisrv"
> + #:log-file "/var/log/gmnisrv.log")))
Suggestions for future work. :-)
1. We could provide “bindings” to the config file, using
‘define-configuration’ for instance, which has direct mapping to
the ini file format.
2. Then we could probably use ‘make-forkexec-constructor/container’ to
run the process in a namespace that contains just what’s needed:
the root of the files to be served, and the relevant /gnu/store
bits.
Thanks!
Ludo’.
This bug report was last modified 4 years and 211 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.