From f2bee4210ff7da38696d8e49999282e27b4a6364 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 15 Jan 2018 22:04:55 +0100 Subject: services: bitlbee: Move to (gnu services messaging). * gnu/services/networking.scm () (bitlbee-shepherd-service, %bitlbee-accounts, %bitlbee-activation) (bitlbee-service-type, bitlbee-service): Move to... * gnu/services/messaging.scm: ... here. * doc/guix.texi (Networking Services): Move 'bitlbee-service' doc to... (Messaging Services): ... here. --- gnu/services/messaging.scm | 117 +++++++++++++++++++++++++++++++++++++++++++- gnu/services/networking.scm | 113 ------------------------------------------ 2 files changed, 116 insertions(+), 114 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm index a9820ed21f..c0ccdbad33 100644 --- a/gnu/services/messaging.scm +++ b/gnu/services/messaging.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Clément Lassieur ;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2015, 2017, 2018 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ #:use-module (gnu services configuration) #:use-module (gnu system shadow) #:use-module (guix gexp) + #:use-module (guix modules) #:use-module (guix records) #:use-module (guix packages) #:use-module (srfi srfi-1) @@ -42,7 +44,12 @@ ssl-configuration %default-modules-enabled - prosody-configuration-pidfile)) + prosody-configuration-pidfile + + bitlbee-configuration + bitlbee-configuration? + bitlbee-service + bitlbee-service-type)) ;;; Commentary: ;;; @@ -751,3 +758,111 @@ string, you could instantiate a prosody service like this: (opaque-prosody-configuration (prosody.cfg.lua \"\"))) @end example")) + + +;;; +;;; BitlBee. +;;; + +(define-record-type* + bitlbee-configuration make-bitlbee-configuration + bitlbee-configuration? + (bitlbee bitlbee-configuration-bitlbee + (default bitlbee)) + (interface bitlbee-configuration-interface + (default "127.0.0.1")) + (port bitlbee-configuration-port + (default 6667)) + (extra-settings bitlbee-configuration-extra-settings + (default ""))) + +(define bitlbee-shepherd-service + (match-lambda + (($ bitlbee interface port extra-settings) + (let ((conf (plain-file "bitlbee.conf" + (string-append " + [settings] + User = bitlbee + ConfigDir = /var/lib/bitlbee + DaemonInterface = " interface " + DaemonPort = " (number->string port) " +" extra-settings)))) + + (with-imported-modules (source-module-closure + '((gnu build shepherd) + (gnu system file-systems))) + (list (shepherd-service + (provision '(bitlbee)) + + ;; Note: If networking is not up, then /etc/resolv.conf + ;; doesn't get mapped in the container, hence the dependency + ;; on 'networking'. + (requirement '(user-processes networking)) + + (modules '((gnu build shepherd) + (gnu system file-systems))) + (start #~(make-forkexec-constructor/container + (list #$(file-append bitlbee "/sbin/bitlbee") + "-n" "-F" "-u" "bitlbee" "-c" #$conf) + + #:pid-file "/var/run/bitlbee.pid" + #:mappings (list (file-system-mapping + (source "/var/lib/bitlbee") + (target source) + (writable? #t))))) + (stop #~(make-kill-destructor))))))))) + +(define %bitlbee-accounts + ;; User group and account to run BitlBee. + (list (user-group (name "bitlbee") (system? #t)) + (user-account + (name "bitlbee") + (group "bitlbee") + (system? #t) + (comment "BitlBee daemon user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define %bitlbee-activation + ;; Activation gexp for BitlBee. + #~(begin + (use-modules (guix build utils)) + + ;; This directory is used to store OTR data. + (mkdir-p "/var/lib/bitlbee") + (let ((user (getpwnam "bitlbee"))) + (chown "/var/lib/bitlbee" + (passwd:uid user) (passwd:gid user))))) + +(define bitlbee-service-type + (service-type (name 'bitlbee) + (extensions + (list (service-extension shepherd-root-service-type + bitlbee-shepherd-service) + (service-extension account-service-type + (const %bitlbee-accounts)) + (service-extension activation-service-type + (const %bitlbee-activation)))) + (default-value (bitlbee-configuration)) + (description + "Run @url{http://bitlbee.org,BitlBee}, a daemon that acts as +a gateway between IRC and chat networks."))) + +(define* (bitlbee-service #:key (bitlbee bitlbee) + (interface "127.0.0.1") (port 6667) + (extra-settings "")) + "Return a service that runs @url{http://bitlbee.org,BitlBee}, a daemon that +acts as a gateway between IRC and chat networks. + +The daemon will listen to the interface corresponding to the IP address +specified in @var{interface}, on @var{port}. @code{127.0.0.1} means that only +local clients can connect, whereas @code{0.0.0.0} means that connections can +come from any networking interface. + +In addition, @var{extra-settings} specifies a string to append to the +configuration file." + (service bitlbee-service-type + (bitlbee-configuration + (bitlbee bitlbee) + (interface interface) (port port) + (extra-settings extra-settings)))) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index c3ba0787c0..5ba3c5eed6 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -74,11 +74,6 @@ tor-service tor-service-type - bitlbee-configuration - bitlbee-configuration? - bitlbee-service - bitlbee-service-type - wicd-service-type wicd-service @@ -736,114 +731,6 @@ project's documentation} for more information." (service tor-hidden-service-type (hidden-service name mapping))) - -;;; -;;; BitlBee. -;;; - -(define-record-type* - bitlbee-configuration make-bitlbee-configuration - bitlbee-configuration? - (bitlbee bitlbee-configuration-bitlbee - (default bitlbee)) - (interface bitlbee-configuration-interface - (default "127.0.0.1")) - (port bitlbee-configuration-port - (default 6667)) - (extra-settings bitlbee-configuration-extra-settings - (default ""))) - -(define bitlbee-shepherd-service - (match-lambda - (($ bitlbee interface port extra-settings) - (let ((conf (plain-file "bitlbee.conf" - (string-append " - [settings] - User = bitlbee - ConfigDir = /var/lib/bitlbee - DaemonInterface = " interface " - DaemonPort = " (number->string port) " -" extra-settings)))) - - (with-imported-modules (source-module-closure - '((gnu build shepherd) - (gnu system file-systems))) - (list (shepherd-service - (provision '(bitlbee)) - - ;; Note: If networking is not up, then /etc/resolv.conf - ;; doesn't get mapped in the container, hence the dependency - ;; on 'networking'. - (requirement '(user-processes networking)) - - (modules '((gnu build shepherd) - (gnu system file-systems))) - (start #~(make-forkexec-constructor/container - (list #$(file-append bitlbee "/sbin/bitlbee") - "-n" "-F" "-u" "bitlbee" "-c" #$conf) - - #:pid-file "/var/run/bitlbee.pid" - #:mappings (list (file-system-mapping - (source "/var/lib/bitlbee") - (target source) - (writable? #t))))) - (stop #~(make-kill-destructor))))))))) - -(define %bitlbee-accounts - ;; User group and account to run BitlBee. - (list (user-group (name "bitlbee") (system? #t)) - (user-account - (name "bitlbee") - (group "bitlbee") - (system? #t) - (comment "BitlBee daemon user") - (home-directory "/var/empty") - (shell (file-append shadow "/sbin/nologin"))))) - -(define %bitlbee-activation - ;; Activation gexp for BitlBee. - #~(begin - (use-modules (guix build utils)) - - ;; This directory is used to store OTR data. - (mkdir-p "/var/lib/bitlbee") - (let ((user (getpwnam "bitlbee"))) - (chown "/var/lib/bitlbee" - (passwd:uid user) (passwd:gid user))))) - -(define bitlbee-service-type - (service-type (name 'bitlbee) - (extensions - (list (service-extension shepherd-root-service-type - bitlbee-shepherd-service) - (service-extension account-service-type - (const %bitlbee-accounts)) - (service-extension activation-service-type - (const %bitlbee-activation)))) - (default-value (bitlbee-configuration)) - (description - "Run @url{http://bitlbee.org,BitlBee}, a daemon that acts as -a gateway between IRC and chat networks."))) - -(define* (bitlbee-service #:key (bitlbee bitlbee) - (interface "127.0.0.1") (port 6667) - (extra-settings "")) - "Return a service that runs @url{http://bitlbee.org,BitlBee}, a daemon that -acts as a gateway between IRC and chat networks. - -The daemon will listen to the interface corresponding to the IP address -specified in @var{interface}, on @var{port}. @code{127.0.0.1} means that only -local clients can connect, whereas @code{0.0.0.0} means that connections can -come from any networking interface. - -In addition, @var{extra-settings} specifies a string to append to the -configuration file." - (service bitlbee-service-type - (bitlbee-configuration - (bitlbee bitlbee) - (interface interface) (port port) - (extra-settings extra-settings)))) - ;;; ;;; Wicd. -- cgit v1.2.3 From 37af37dcc9a5d4fbb16540d5972fd5333043b413 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 15 Jan 2018 22:16:36 +0100 Subject: doc: Deprecate 'bitlbee-service' procedure. * gnu/services/messaging.scm (bitlbee-service): Mark as deprecated. * doc/guix.texi (Messaging Services): Document 'bitlbee-service-type' and 'bitlbee-configuration'. Remove 'bitlbee-service'. --- doc/guix.texi | 46 ++++++++++++++++++++++++++++++++++------------ gnu/services/messaging.scm | 2 +- 2 files changed, 35 insertions(+), 13 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index be5577c20f..2f5749cbfb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14424,23 +14424,45 @@ string, you could instantiate a prosody service like this: @subsubheading BitlBee Service +@cindex IRC (Internet Relay Chat) +@cindex IRC gateway @url{http://bitlbee.org,BitlBee} is a gateway that provides an IRC interface to a variety of messaging protocols such as XMPP. -@deffn {Scheme Procedure} bitlbee-service [#:bitlbee bitlbee] @ - [#:interface "127.0.0.1"] [#:port 6667] @ - [#:extra-settings ""] -Return a service that runs @url{http://bitlbee.org,BitlBee}, a daemon that -acts as a gateway between IRC and chat networks. +@defvr {Scheme Variable} bitlbee-service-type +This is the service type for the @url{http://bitlbee.org,BitlBee} IRC +gateway daemon. Its value is a @code{bitlbee-configuration} (see +below). -The daemon will listen to the interface corresponding to the IP address -specified in @var{interface}, on @var{port}. @code{127.0.0.1} means that only -local clients can connect, whereas @code{0.0.0.0} means that connections can -come from any networking interface. +To have BitlBee listen on port 6667 on localhost, add this line to your +services: + +@example +(service bitlbee-service-type) +@end example +@end defvr + +@deftp {Data Type} bitlbee-configuration +This is the configuration for BitlBee, with the following fields: + +@table @asis +@item @code{interface} (default: @code{"127.0.0.1"}) +@itemx @code{port} (default: @code{6667}) +Listen on the network interface corresponding to the IP address +specified in @var{interface}, on @var{port}. + +When @var{interface} is @code{127.0.0.1}, only local clients can +connect; when it is @code{0.0.0.0}, connections can come from any +networking interface. + +@item @code{package} (default: @code{bitlbee}) +The BitlBee package to use. + +@item @code{extra-settings} (default: @code{""}) +Configuration snippet added as-is to the BitlBee configuration file. +@end table +@end deftp -In addition, @var{extra-settings} specifies a string to append to the -configuration file. -@end deffn @node Telephony Services @subsubsection Telephony Services diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm index c0ccdbad33..427e2121f6 100644 --- a/gnu/services/messaging.scm +++ b/gnu/services/messaging.scm @@ -848,7 +848,7 @@ string, you could instantiate a prosody service like this: "Run @url{http://bitlbee.org,BitlBee}, a daemon that acts as a gateway between IRC and chat networks."))) -(define* (bitlbee-service #:key (bitlbee bitlbee) +(define* (bitlbee-service #:key (bitlbee bitlbee) ;deprecated (interface "127.0.0.1") (port 6667) (extra-settings "")) "Return a service that runs @url{http://bitlbee.org,BitlBee}, a daemon that -- cgit v1.2.3 From d067e4badcaa705d8cb68d81c534ba69c3fa6e13 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 12 Dec 2017 06:48:48 +0000 Subject: gnu: services: web: Add service for httpd. * gnu/services/web.scm (, , ): New record types. (%default-httpd-modules, %httpd-accounts, httpd-service-type): New variables. (httpd-shepherd-services, httpd-activation, httpd-process-extensions): New procedures. * gnu/tests/web.scm (run-httpd-test): New procedure. (%httpd-os, %tests-httpd): New variables. * doc/guix.texi (Web Services): Document the Apache HTTP Server. --- doc/guix.texi | 158 ++++++++++++++++++++++++++++++++++- gnu/services/web.scm | 229 ++++++++++++++++++++++++++++++++++++++++++++++++++- gnu/tests/web.scm | 26 +++++- 3 files changed, 409 insertions(+), 4 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index 17a9a74b2a..161d3cfb45 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14954,8 +14954,162 @@ Local accounts with lower values will silently fail to authenticate. @cindex web @cindex www @cindex HTTP -The @code{(gnu services web)} module provides the nginx web server and -also a fastcgi wrapper daemon. +The @code{(gnu services web)} module provides the Apache HTTP Server, +the nginx web server, and also a fastcgi wrapper daemon. + +@subsubheading Apache HTTP Server + +@deffn {Scheme Variable} httpd-service-type +Service type for the @uref{https://httpd.apache.org/,Apache HTTP} server +(@dfn{httpd}). The value for this service type is a +@code{https-configuration} record. + +A simple example configuration is given below. + +@example +(service httpd-service-type + (httpd-configuration + (config + (httpd-config-file + (server-name "www.example.com") + (document-root "/srv/http/www.example.com"))))) +@end example + +Other services can also extend the @code{httpd-service-type} to add to +the configuration. + +@example +(simple-service 'my-extra-server httpd-service-type + (list + (httpd-virtualhost + "*:80" + (list (string-append + "ServerName "www.example.com + DocumentRoot \"/srv/http/www.example.com\""))))) +@end example +@end deffn + +The details for the @code{httpd-configuration}, @code{httpd-module}, +@code{httpd-config-file} and @code{httpd-virtualhost} record types are +given below. + +@deffn {Data Type} httpd-configuration +This data type represents the configuration for the httpd service. + +@table @asis +@item @code{package} (default: @code{httpd}) +The httpd package to use. + +@item @code{pid-file} (default: @code{"/var/run/httpd"}) +The pid file used by the shepherd-service. + +@item @code{config} (default: @code{(httpd-config-file)}) +The configuration file to use with the httpd service. The default value +is a @code{httpd-config-file} record, but this can also be a different +G-expression that generates a file, for example a @code{plain-file}. A +file outside of the store can also be specified through a string. + +@end table +@end deffn + +@deffn {Data Type} httpd-module +This data type represents a module for the httpd service. + +@table @asis +@item @code{name} +The name of the module. + +@item @code{file} +The file for the module. This can be relative to the httpd package being +used, the absolute location of a file, or a G-expression for a file +within the store, for example @code{(file-append mod-wsgi +"/modules/mod_wsgi.so")}. + +@end table +@end deffn + +@deffn {Data Type} httpd-config-file +This data type represents a configuration file for the httpd service. + +@table @asis +@item @code{modules} (default: @code{%default-httpd-modules}) +The modules to load. Additional modules can be added here, or loaded by +additional configuration. + +@item @code{server-root} (default: @code{httpd}) +The @code{ServerRoot} in the configuration file, defaults to the httpd +package. Directives including @code{Include} and @code{LoadModule} are +taken as relative to the server root. + +@item @code{server-name} (default: @code{#f}) +The @code{ServerName} in the configuration file, used to specify the +request scheme, hostname and port that the server uses to identify +itself. + +This doesn't need to be set in the server config, and can be specifyed +in virtual hosts. The default is @code{#f} to not specify a +@code{ServerName}. + +@item @code{document-root} (default: @code{"/srv/http"}) +The @code{DocumentRoot} from which files will be served. + +@item @code{listen} (default: @code{'("80")}) +The list of values for the @code{Listen} directives in the config +file. The value should be a list of strings, when each string can +specify the port number to listen on, and optionally the IP address and +protocol to use. + +@item @code{pid-file} (default: @code{"/var/run/httpd"}) +The @code{PidFile} to use. This should match the @code{pid-file} set in +the @code{httpd-configuration} so that the Shepherd service is +configured correctly. + +@item @code{error-log} (default: @code{"/var/log/httpd/error_log"}) +The @code{ErrorLog} to which the server will log errors. + +@item @code{user} (default: @code{"httpd"}) +The @code{User} which the server will answer requests as. + +@item @code{group} (default: @code{"httpd"}) +The @code{Group} which the server will answer requests as. + +@item @code{extra-config} (default: @code{(list "TypesConfig etc/httpd/mime.types")}) +A flat list of strings and G-expressions which will be added to the end +of the configuration file. + +Any values which the service is extended with will be appended to this +list. + +@end table +@end deffn + +@deffn {Data Type} httpd-virtualhost +This data type represents a virtualhost configuration block for the httpd service. + +These should be added to the extra-config for the httpd-service. + +@example +(simple-service 'my-extra-server httpd-service-type + (list + (httpd-virtualhost + "*:80" + (list (string-append + "ServerName "www.example.com + DocumentRoot \"/srv/http/www.example.com\""))))) +@end example + +@table @asis +@item @code{addresses-and-ports} +The addresses and ports for the @code{VirtualHost} directive. + +@item @code{contents} +The contents of the @code{VirtualHost} directive, this should be a list +of strings and G-expressions. + +@end table +@end deffn + +@subsubheading NGINX @deffn {Scheme Variable} nginx-service-type Service type for the @uref{https://nginx.org/,NGinx} web server. The diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 2371ddb6d0..c1ffe3e055 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -34,8 +34,36 @@ #:use-module ((guix utils) #:select (version-major)) #:use-module ((guix packages) #:select (package-version)) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) #:use-module (ice-9 match) - #:export ( + #:export ( + httpd-configuration + httpd-configuration? + httpd-configuration-package + httpd-configuration-pid-file + httpd-configuration-config + + + httpd-virtualhost + httpd-virtualhost? + httpd-virtualhost-addresses-and-ports + httpd-virtualhost-contents + + + httpd-config-file + httpd-config-file? + httpd-config-file-modules + httpd-config-file-server-root + httpd-config-file-server-name + httpd-config-file-listen + httpd-config-file-pid-file + httpd-config-file-error-log + httpd-config-file-user + httpd-config-file-group + + httpd-service-type + + nginx-configuration nginx-configuration? nginx-configuartion-nginx @@ -133,6 +161,205 @@ ;;; ;;; Code: +(define-record-type* + httpd-module make-httpd-module + httpd-module? + (name httpd-load-module-name) + (file httpd-load-module-file)) + +;; Default modules for the httpd-service-type, taken from etc/httpd/httpd.conf +;; file in the httpd package. +(define %default-httpd-modules + (map (match-lambda + ((name file) + (httpd-module + (name name) + (file file)))) + '(("authn_file_module" "modules/mod_authn_file.so") + ("authn_core_module" "modules/mod_authn_core.so") + ("authz_host_module" "modules/mod_authz_host.so") + ("authz_groupfile_module" "modules/mod_authz_groupfile.so") + ("authz_user_module" "modules/mod_authz_user.so") + ("authz_core_module" "modules/mod_authz_core.so") + ("access_compat_module" "modules/mod_access_compat.so") + ("auth_basic_module" "modules/mod_auth_basic.so") + ("reqtimeout_module" "modules/mod_reqtimeout.so") + ("filter_module" "modules/mod_filter.so") + ("mime_module" "modules/mod_mime.so") + ("log_config_module" "modules/mod_log_config.so") + ("env_module" "modules/mod_env.so") + ("headers_module" "modules/mod_headers.so") + ("setenvif_module" "modules/mod_setenvif.so") + ("version_module" "modules/mod_version.so") + ("unixd_module" "modules/mod_unixd.so") + ("status_module" "modules/mod_status.so") + ("autoindex_module" "modules/mod_autoindex.so") + ("dir_module" "modules/mod_dir.so") + ("alias_module" "modules/mod_alias.so")))) + +(define-record-type* + httpd-config-file make-httpd-config-file + httpd-config-file? + (modules httpd-config-file-modules + (default %default-httpd-modules)) + (server-root httpd-config-file-server-root + (default httpd)) + (server-name httpd-config-file-server-name + (default #f)) + (document-root httpd-config-file-document-root + (default "/srv/http")) + (listen httpd-config-file-listen + (default '("80"))) + (pid-file httpd-config-file-pid-file + (default "/var/run/httpd")) + (error-log httpd-config-file-error-log + (default "/var/log/httpd/error_log")) + (user httpd-config-file-user + (default "httpd")) + (group httpd-config-file-group + (default "httpd")) + (extra-config httpd-config-file-extra-config + (default + (list "TypesConfig etc/httpd/mime.types")))) + +(define-gexp-compiler (httpd-config-file-compiler + (file ) system target) + (match file + (($ load-modules server-root server-name + document-root listen pid-file error-log + user group extra-config) + (gexp->derivation + "httpd.conf" + #~(call-with-output-file (ungexp output "out") + (lambda (port) + (display + (string-append + (ungexp-splicing + `(,@(append-map + (match-lambda + (($ name module) + `("LoadModule " ,name " " ,module "\n"))) + load-modules) + ,@`("ServerRoot " ,server-root "\n") + ,@(if server-name + `("ServerName " ,server-name "\n") + '()) + ,@`("DocumentRoot " ,document-root "\n") + ,@(append-map + (lambda (listen-value) + `("Listen " ,listen-value "\n")) + listen) + ,@(if pid-file + `("Pidfile " ,pid-file "\n") + '()) + ,@(if error-log + `("ErrorLog " ,error-log "\n") + '()) + ,@(if user + `("User " ,user "\n") + '()) + ,@(if group + `("Group " ,group "\n") + '()) + "\n\n" + ,@extra-config))) + port))) + #:local-build? #t)))) + +(define-record-type + (httpd-virtualhost addresses-and-ports contents) + httpd-virtualhost? + (addresses-and-ports httpd-virtualhost-addresses-and-ports) + (contents httpd-virtualhost-contents)) + +(define-record-type* + httpd-configuration make-httpd-configuration + httpd-configuration? + (package httpd-configuration-package + (default httpd)) + (pid-file httpd-configuration-pid-file + (default "/var/run/httpd")) + (config httpd-configuration-config + (default (httpd-config-file)))) + +(define %httpd-accounts + (list (user-group (name "httpd") (system? #t)) + (user-account + (name "httpd") + (group "httpd") + (system? #t) + (comment "Apache HTTPD server user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define httpd-shepherd-services + (match-lambda + (($ package pid-file config) + (list (shepherd-service + (provision '(httpd)) + (documentation "The Apache HTTP Server") + (requirement '(networking)) + (start #~(make-forkexec-constructor + `(#$(file-append package "/bin/httpd") + #$@(if config + (list "-f" config) + '())) + #:pid-file #$pid-file)) + (stop #~(make-kill-destructor))))))) + +(define httpd-activation + (match-lambda + (($ package pid-file config) + (match-record + config + + (error-log document-root) + #~(begin + (use-modules (guix build utils)) + + (mkdir-p #$(dirname error-log)) + (mkdir-p #$document-root)))))) + +(define (httpd-process-extensions original-config extension-configs) + (let ((config (httpd-configuration-config + original-config))) + (if (httpd-config-file? config) + (httpd-configuration + (inherit original-config) + (config + (httpd-config-file + (inherit config) + (extra-config + (append (httpd-config-file-extra-config config) + (append-map + (match-lambda + (($ + addresses-and-ports + contents) + `(,(string-append + "\n") + ,@contents + "\n\n")) + ((? string? x) + `("\n" ,x "\n")) + ((? list? x) + `("\n" ,@x "\n"))) + extension-configs))))))))) + +(define httpd-service-type + (service-type (name 'httpd) + (extensions + (list (service-extension shepherd-root-service-type + httpd-shepherd-services) + (service-extension activation-service-type + httpd-activation) + (service-extension account-service-type + (const %httpd-accounts)))) + (compose concatenate) + (extend httpd-process-extensions) + (default-value + (httpd-configuration)))) + (define-record-type* nginx-server-configuration make-nginx-server-configuration nginx-server-configuration? diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 5595e9ddf9..1912f8f79d 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -29,7 +29,8 @@ #:use-module (gnu services networking) #:use-module (guix gexp) #:use-module (guix store) - #:export (%test-nginx + #:export (%test-httpd + %test-nginx %test-php-fpm)) (define %index.html-contents @@ -112,6 +113,29 @@ HTTP-PORT." (gexp->derivation (string-append name "-test") test)) + +;;; +;;; HTTPD +;;; + +(define %httpd-os + (simple-operating-system + (dhcp-client-service) + (service httpd-service-type + (httpd-configuration + (config + (httpd-config-file + (listen '("8080")))))) + (simple-service 'make-http-root activation-service-type + %make-http-root))) + +(define %test-httpd + (system-test + (name "httpd") + (description "Connect to a running HTTPD server.") + (value (run-webserver-test name %httpd-os + #:log-file "/var/log/httpd/error_log")))) + ;;; ;;; NGINX -- cgit v1.2.3 From 162a13740041f907f0ce5c2aa05b52b162b4e81a Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Fri, 19 Jan 2018 16:25:13 +0100 Subject: gnu: Consistently Write ‘file system(s)’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is the GNU way. * doc/guix.texi (Build Systems, DNS Services): Write ‘file system(s)’. * gnu/build/vm.scm (create-ext-file-system, create-fat-file-system): Likewise. * gnu/packages/backup.scm (dirvish, rsnapshot)[description]: Likewise. * gnu/packages/check.scm (python-testpath)[description]: Likewise. * gnu/packages/disk.scm (pydf)[description]: Likewise. * gnu/packages/file-systems.scm (disorderfs)[synopsis, description]: Likewise. (glusterfs)[description]: Likewise. * gnu/packages/haskell.scm (ghc-directory, ghc-system-fileio-bootstrap) (ghc-system-fileio)[synopsis]: Likewise. (ghc-fsnotify)[description]: Likewise. * gnu/packages/linux.scm (proot)[description]: Likewise. (jmtpfs)[synopsis, description]: Likewise. * gnu/packages/mate.scm (caja, caja-extensions)[description]: Likewise. * gnu/packages/storage.scm (ceph)[description]: Likewise. * gnu/packages/sync.scm (lsyncd)[description]: Likewise. * gnu/packages/syncthing.scm (syncthing)[synopsis]: Likewise. (go-github-com-zillode-notify)[description]: Likewise. * gnu/services/nfs.scm (pipefs-service-type): Likewise. * guix/scripts/system.scm (perform-action): Likewise. --- doc/guix.texi | 6 +++--- gnu/build/file-systems.scm | 4 ++-- gnu/build/linux-boot.scm | 2 +- gnu/build/vm.scm | 8 ++++---- gnu/packages/backup.scm | 4 ++-- gnu/packages/check.scm | 2 +- gnu/packages/disk.scm | 2 +- gnu/packages/file-systems.scm | 8 ++++---- gnu/packages/haskell.scm | 8 ++++---- gnu/packages/linux.scm | 8 ++++---- gnu/packages/mate.scm | 4 ++-- gnu/packages/storage.scm | 2 +- gnu/packages/sync.scm | 4 ++-- gnu/packages/syncthing.scm | 4 ++-- gnu/services/nfs.scm | 2 +- gnu/system/vm.scm | 2 +- guix/build/go-build-system.scm | 10 +++++----- guix/scripts/system.scm | 4 ++-- 18 files changed, 42 insertions(+), 42 deletions(-) (limited to 'gnu/services') diff --git a/doc/guix.texi b/doc/guix.texi index feadcef9d0..1ecdcd2182 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3695,10 +3695,10 @@ Go build mechanisms}. The user is expected to provide a value for the key @code{#:import-path} and, in some cases, @code{#:unpack-path}. The @url{https://golang.org/doc/code.html#ImportPaths, import path} -corresponds to the filesystem path expected by the package's build +corresponds to the file system path expected by the package's build scripts and any referring packages, and provides a unique way to refer to a Go package. It is typically based on a combination of the -package source code's remote URI and filesystem hierarchy structure. In +package source code's remote URI and file system hierarchy structure. In some cases, you will need to unpack the package's source code to a different directory structure than the one indicated by the import path, and @code{#:unpack-path} should be used in such cases. @@ -15848,7 +15848,7 @@ The backend to store the keys in. Can be @code{'pem} or @code{'pkcs11}. @item @code{config} (default: @code{"/var/lib/knot/keys/keys"}) The configuration string of the backend. An example for the PKCS#11 is: @code{"pkcs11:token=knot;pin-value=1234 /gnu/store/.../lib/pkcs11/libsofthsm2.so"}. -For the pem backend, the string reprensents a path in the filesystem. +For the pem backend, the string reprensents a path in the file system. @end table @end deftp diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 3e516a4d3c..145b3b14e7 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -261,11 +261,11 @@ volume descriptor from ~s" "Return the raw contents of DEVICE's iso9660 primary volume descriptor as a bytevector, or #f if DEVICE does not contain an iso9660 file system." ;; Start reading at sector 16. - ;; Since we are not sure that the device contains an ISO9660 filesystem, + ;; Since we are not sure that the device contains an ISO9660 file system, ;; we have to find that out first. (if (read-superblock device (* 2048 16) 2048 iso9660-superblock?) (read-iso9660-primary-volume-descriptor device (* 2048 16)) - #f)) ; Device does not contain an iso9660 filesystem. + #f)) ; Device does not contain an iso9660 file system. (define (iso9660-superblock-uuid sblock) "Return the modification time of an iso9660 primary volume descriptor diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 997107a67a..0ab8391b0b 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -188,7 +188,7 @@ with the given MAJOR number, starting with MINOR." (lambda args (apply report-system-error name args)))) -;; Create a device node like the passed here on the filesystem. +;; Create a device node like the passed here on the file system. (define create-device-node (match-lambda (($ xname type major minor module) diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 404f324045..fe003ea458 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -262,7 +262,7 @@ actual /dev name based on DEVICE." (define* (create-ext-file-system partition type #:key label uuid) - "Create an ext-family filesystem of TYPE on PARTITION. If LABEL is true, + "Create an ext-family file system of TYPE on PARTITION. If LABEL is true, use that as the volume name. If UUID is true, use it as the partition UUID." (format #t "creating ~a partition...\n" type) (unless (zero? (apply system* (string-append "mkfs." type) @@ -277,8 +277,8 @@ use that as the volume name. If UUID is true, use it as the partition UUID." (define* (create-fat-file-system partition #:key label uuid) - "Create a FAT filesystem on PARTITION. The number of File Allocation Tables -will be determined based on filesystem size. If LABEL is true, use that as the + "Create a FAT file system on PARTITION. The number of File Allocation Tables +will be determined based on file system size. If LABEL is true, use that as the volume name." ;; FIXME: UUID is ignored! (format #t "creating FAT partition...\n") @@ -425,7 +425,7 @@ GRUB configuration and OS-DRV as the stuff in it." "run=/tmp/root/run" ;; /mnt is used as part of the installation ;; process, as the mount point for the target - ;; filesystem, so create it. + ;; file system, so create it. "mnt=/tmp/root/mnt" "--" "-volid" ,(string-upcase volume-id) diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm index 7302406c57..a494a04047 100644 --- a/gnu/packages/backup.scm +++ b/gnu/packages/backup.scm @@ -418,7 +418,7 @@ rdiff-backup is easy to use and settings have sensible defaults.") ("rsync" ,rsync))) (home-page "http://rsnapshot.org") (synopsis "Deduplicating snapshot backup utility based on rsync") - (description "rsnapshot is a filesystem snapshot utility based on rsync. + (description "rsnapshot is a file system snapshot utility based on rsync. rsnapshot makes it easy to make periodic snapshots of local machines, and remote machines over SSH. To reduce the disk space required for each backup, rsnapshot uses hard links to deduplicate identical files.") @@ -811,7 +811,7 @@ any special software, on top of SSH.") (synopsis "Fast, disk based, rotating network backup system") (description "With dirvish you can maintain a set of complete images of your -filesystems with unattended creation and expiration. A dirvish backup vault +file systems with unattended creation and expiration. A dirvish backup vault is like a time machine for your data. ") (license (license:fsf-free "file://COPYING" "Open Software License 2.0")))) diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 50675cb854..1585948b33 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -1040,7 +1040,7 @@ testing frameworks.") (synopsis "Test utilities for code working with files and commands") (description "Testpath is a collection of utilities for Python code working with files -and commands. It contains functions to check things on the filesystem, and +and commands. It contains functions to check things on the file system, and tools for mocking system commands and recording calls to those.") (license license:expat))) diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm index e4d70ff820..c01faf5069 100644 --- a/gnu/packages/disk.scm +++ b/gnu/packages/disk.scm @@ -371,7 +371,7 @@ permit managing file systems not included in libparted.") (synopsis "Colourised @command{df} clone") (description "All-singing, all-dancing, fully colourised @command{df} clone written in Python. It displays the amount of disk space available on the -mounted filesystems, using different colours for different types of file +mounted file systems, using different colours for different types of file systems. Output format is completely customizable.") (license license:public-domain))) diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm index 4a8058b520..1d73f4aef4 100644 --- a/gnu/packages/file-systems.scm +++ b/gnu/packages/file-systems.scm @@ -132,10 +132,10 @@ single file can be mounted.") ;; FIXME: Tests require 'run-parts' which is not in Guix yet. #:tests? #f)) (home-page "https://github.com/ReproducibleBuilds/disorderfs") - (synopsis "FUSE filesystem that introduces non-determinism") + (synopsis "FUSE file system that introduces non-determinism") (description - "An overlay FUSE filesystem that introduces non-determinism -into filesystem metadata. For example, it can randomize the order + "An overlay FUSE file system that introduces non-determinism +into file system metadata. For example, it can randomize the order in which directory entries are read. This is useful for detecting non-determinism in the build process.") (license license:gpl3+))) @@ -201,7 +201,7 @@ non-determinism in the build process.") ("zlib" ,zlib))) (home-page "https://www.gluster.org") (synopsis "Distributed file system") - (description "GlusterFS is a distributed scalable network filesystem + (description "GlusterFS is a distributed scalable network file system suitable for data-intensive tasks such as cloud storage and media streaming. It allows rapid provisioning of additional storage based on your storage consumption needs. It incorporates automatic failover as a primary feature. diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index e7ea2d8de1..21858e481c 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -5942,7 +5942,7 @@ supported. A module of colour names (\"Data.Colour.Names\") is provided.") "0zkqihmdfz7bzv3sxh1p9ijl4vra880kfy3qy9h96flq7d2if0f2")))) (build-system haskell-build-system) (home-page "http://hackage.haskell.org/package/directory") - (synopsis "Platform-agnostic library for filesystem operations") + (synopsis "Platform-agnostic library for file system operations") (description "This library provides a basic set of operations for manipulating files and directories in a portable way.") @@ -6203,7 +6203,7 @@ increasing type safety.") ("ghc-text" ,ghc-text) ("ghc-temporary" ,ghc-temporary))) (home-page "https://github.com/fpco/haskell-filesystem") - (synopsis "Consistent filesystem interaction across GHC versions") + (synopsis "Consistent file system interaction across GHC versions") (description "This is a small wrapper around the directory, unix, and Win32 packages, for use with system-filepath. It provides a consistent API to the various @@ -6424,7 +6424,7 @@ increasing type safety.") ("ghc-chell" ,ghc-chell) ("ghc-temporary" ,ghc-temporary))) (home-page "https://github.com/fpco/haskell-filesystem") - (synopsis "Consistent filesystem interaction across GHC versions") + (synopsis "Consistent file system interaction across GHC versions") (description "This is a small wrapper around the directory, unix, and Win32 packages, for use with system-filepath. It provides a consistent API to the various @@ -6744,7 +6744,7 @@ accessed or modified.") (synopsis "Cross platform library for file change notification.") (description "Cross platform library for file creation, modification, and deletion notification. This library builds upon existing libraries for platform -specific Windows, Mac, and Linux filesystem event notification.") +specific Windows, Mac, and Linux file system event notification.") (license license:bsd-3))) (define-public ghc-ieee754 diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 13e08f2654..c097079382 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -4304,7 +4304,7 @@ userspace queueing component and the logging subsystem.") "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind}, and @code{binfmt_misc}. This means that users don't need any privileges or setup to do things like using an arbitrary directory as the new root -filesystem, making files accessible somewhere else in the file system +file system, making files accessible somewhere else in the file system hierarchy, or executing programs built for another CPU architecture transparently through QEMU user-mode. Also, developers can use PRoot as a generic process instrumentation engine thanks to its extension mechanism. @@ -4391,10 +4391,10 @@ NexGen, Rise, and SiS CPUs.") (native-inputs `(("pkg-config" ,pkg-config))) (home-page "https://github.com/JasonFerrara/jmtpfs") - (synopsis "Use a FUSE filesystem to access data over MTP") - (description "jmtpfs uses FUSE (filesystem in userspace) to provide access + (synopsis "Use a FUSE file system to access data over MTP") + (description "jmtpfs uses FUSE (file system in userspace) to provide access to data over the Media Transfer Protocol (MTP). Unprivileged users can mount -the MTP device as a filesystem.") +the MTP device as a file system.") (license license:gpl3))) (define-public procenv diff --git a/gnu/packages/mate.scm b/gnu/packages/mate.scm index 71f9589937..51111f44b8 100644 --- a/gnu/packages/mate.scm +++ b/gnu/packages/mate.scm @@ -842,7 +842,7 @@ infamous 'Wanda the Fish'.") "Caja is the official file manager for the MATE desktop. It allows for browsing directories, as well as previewing files and launching applications associated with them. Caja is also responsible for handling the -icons on the MATE desktop. It works on local and remote filesystems.") +icons on the MATE desktop. It works on local and remote file systems.") ;; There is a note about a TRADEMARKS_NOTICE file in COPYING which ;; does not exist. It is safe to assume that this is of no concern ;; for us. @@ -900,7 +900,7 @@ icons on the MATE desktop. It works on local and remote filesystems.") "Caja is the official file manager for the MATE desktop. It allows for browsing directories, as well as previewing files and launching applications associated with them. Caja is also responsible for handling the -icons on the MATE desktop. It works on local and remote filesystems.") +icons on the MATE desktop. It works on local and remote file systems.") (license license:gpl2+))) (define-public mate-control-center diff --git a/gnu/packages/storage.scm b/gnu/packages/storage.scm index 1dca920a30..bee349f6f6 100644 --- a/gnu/packages/storage.scm +++ b/gnu/packages/storage.scm @@ -340,7 +340,7 @@ (description "Ceph is a distributed storage system designed for reliability and performance. It provides network-based block devices (RBD), a POSIX -compliant filesystem (CephFS), and offers compatibility with various +compliant file system (CephFS), and offers compatibility with various storage protocols (S3, NFS, and others) through the RADOS gateway.") ;; The Ceph libraries are LGPL2.1 and most of the utilities fall under ;; GPL2. The installed erasure code plugins are BSD-3 licensed and do diff --git a/gnu/packages/sync.scm b/gnu/packages/sync.scm index 4ed62ff966..3656f5855e 100644 --- a/gnu/packages/sync.scm +++ b/gnu/packages/sync.scm @@ -204,6 +204,6 @@ interface (inotify or fsevents). It aggregates and combines events for a few seconds and then spawns one (or more) process(es) to synchronize the changes. By default this is rsync, which must be installed on all source and target machines. Lsyncd is thus a light-weight live mirror solution that is -comparatively easy to install not requiring new filesystems or block devices -and does not hamper local filesystem performance.") +comparatively easy to install not requiring new file systems or block devices +and does not hamper local file system performance.") (license license:gpl2+))) diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm index 66c3fedfe2..3fb70d13da 100644 --- a/gnu/packages/syncthing.scm +++ b/gnu/packages/syncthing.scm @@ -160,7 +160,7 @@ ("go-github-com-zillode-notify" ,go-github-com-zillode-notify) ;; For tests ("go-github-com-d4l3k-messagediff" ,go-github-com-d4l3k-messagediff))) - (synopsis "Decentralized continuous filesystem synchronization") + (synopsis "Decentralized continuous file system synchronization") (description "Syncthing is a peer-to-peer file synchronization tool that supports a wide variety of computing platforms. It uses the Block Exchange Protocol.") @@ -1873,7 +1873,7 @@ Authentication and Privacy Infrastructure).") (propagated-inputs `(("go-golang-org-x-sys-unix" ,go-golang-org-x-sys-unix))) (synopsis "Filesystem event notification library") - (description "This package provides @code{notify}, a filesystem event + (description "This package provides @code{notify}, a file system event notification library in Go.") (home-page "https://github.com/zillode/notify") (license expat)))) diff --git a/gnu/services/nfs.scm b/gnu/services/nfs.scm index 8f58920e4a..6ed4c0eabf 100644 --- a/gnu/services/nfs.scm +++ b/gnu/services/nfs.scm @@ -88,7 +88,7 @@ (define pipefs-directory (pipefs-configuration-mount-point config)) (shepherd-service - (documentation "Mount the pipefs pseudo filesystem.") + (documentation "Mount the pipefs pseudo file system.") (provision '(rpc-pipefs)) (start #~(lambda () diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 496f2ac4e1..345cecedd8 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -346,7 +346,7 @@ the image." (label "GNU-ESP") ;cosmetic only ;; Use "vfat" here since this property is used ;; when mounting. The actual FAT-ness is based - ;; on filesystem size (16 in this case). + ;; on file system size (16 in this case). (file-system "vfat") (flags '(esp)))))))) (initialize-hard-disk "/dev/vda" diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index eaad9d8751..3114067aa9 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -37,7 +37,7 @@ ;; process for Go libraries, so we use `go install`, which preserves the ;; results. [0] -;; Go software is developed and built within a particular filesystem hierarchy +;; Go software is developed and built within a particular file system hierarchy ;; structure called a 'workspace' [1]. This workspace is found by Go ;; via the GOPATH environment variable. Typically, all Go source code ;; and compiled objects are kept in a single workspace, but it is @@ -48,7 +48,7 @@ ;; an 'import path'. The import path is based on the URL of the ;; software's source. Since most source code is provided over the ;; internet, the import path is typically a combination of the remote -;; URL and the source repository's filesystem structure. For example, +;; URL and the source repository's file system structure. For example, ;; the Go port of the common `du` command is hosted on github.com, at ;; . Thus, the import path is ;; . [3] @@ -58,12 +58,12 @@ ;; the go-build-system. ;; ;; Modules of modular Go libraries are named uniquely with their -;; filesystem paths. For example, the supplemental but "standardized" +;; file system paths. For example, the supplemental but "standardized" ;; libraries developed by the Go upstream developers are available at ;; . The Go IPv4 ;; library's import path is . The source of ;; such modular libraries must be unpacked at the top-level of the -;; filesystem structure of the library. So the IPv4 library should be +;; file system structure of the library. So the IPv4 library should be ;; unpacked to . This is handled in the ;; go-build-system with the optional #:unpack-path key. ;; @@ -72,7 +72,7 @@ ;; that all modules of modular libraries cannot be built with a single ;; command. Each module must be built individually. This complicates ;; certain cases, and these issues are currently resolved by creating a -;; filesystem union of the required modules of such libraries. I think +;; file system union of the required modules of such libraries. I think ;; this could be improved in future revisions of the go-build-system. ;; ;; [0] `go build`: diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index ebcf3e4f3b..55a02fb96d 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -709,8 +709,8 @@ and TARGET arguments." "Perform ACTION for OS. INSTALL-BOOTLOADER? specifies whether to install bootloader; BOOTLOADER-TAGET is the target for the bootloader; TARGET is the target root directory; IMAGE-SIZE is the size of the image to be built, for -the 'vm-image' and 'disk-image' actions. The root filesystem is created as a -FILE-SYSTEM-TYPE filesystem. FULL-BOOT? is used for the 'vm' action; it +the 'vm-image' and 'disk-image' actions. The root file system is created as a +FILE-SYSTEM-TYPE file system. FULL-BOOT? is used for the 'vm' action; it determines whether to boot directly to the kernel or to the bootloader. When DERIVATIONS-ONLY? is true, print the derivation file name(s) without -- cgit v1.2.3