From 548efa8bdfa440e95c2928c434b72b0411ed31ba Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 5 Nov 2019 14:51:57 +0200 Subject: services: patchwork: Fix typo. * gnu/services.web.scm (define-gexp-compiler): Use 'enable-rest-api?' where appropriate in place of 'enable-xmlrpc?' --- gnu/services/web.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/services/web.scm') diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 899be1c168..9320da5b17 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -1425,7 +1425,7 @@ ADMINS = [ DEBUG = " #$(if debug? "True" "False") " -ENABLE_REST_API = " #$(if enable-xmlrpc? "True" "False") " +ENABLE_REST_API = " #$(if enable-rest-api? "True" "False") " ENABLE_XMLRPC = " #$(if enable-xmlrpc? "True" "False") " FORCE_HTTPS_LINKS = " #$(if force-https-links? "True" "False") " -- cgit v1.2.3 From 00e680a411652e30d18839fa9ec86cf4068164de Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Wed, 6 Nov 2019 19:15:57 +0100 Subject: services: Make it possible to include dynamic modules in nginx. * gnu/services/web.scm (): Add modules field. (nginx-configuration-modules): New field accessor. (emit-load-module): New procedure. (default-nginx-config): Add support for the modules field. * doc/guix.texi (NGINX): Document it. --- doc/guix.texi | 11 +++++++++++ gnu/services/web.scm | 8 ++++++++ 2 files changed, 19 insertions(+) (limited to 'gnu/services/web.scm') diff --git a/doc/guix.texi b/doc/guix.texi index 3b8e5935bb..4df928e400 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19765,6 +19765,17 @@ use the size of the processors cache line. @item @code{server-names-hash-bucket-max-size} (default: @code{#f}) Maximum bucket size for the server names hash tables. +@item @code{modules} (default: @code{'()}) +List of nginx dynamic modules to load. This should be a list of file +names of loadable modules, as in this example: + +@lisp +(modules + (list + (file-append nginx-accept-language-module "\ +/etc/nginx/modules/ngx_http_accept_language_module.so"))) +@end lisp + @item @code{extra-content} (default: @code{""}) Extra content for the @code{http} block. Should be string or a string valued G-expression. diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 9320da5b17..f13e86482f 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2018 Pierre-Antoine Rouby ;;; Copyright © 2017, 2018, 2019 Christopher Baines ;;; Copyright © 2018 Marius Bakke +;;; Copyright © 2019 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; @@ -95,6 +96,7 @@ nginx-configuration-upstream-blocks nginx-configuration-server-names-hash-bucket-size nginx-configuration-server-names-hash-bucket-max-size + nginx-configuration-modules nginx-configuration-extra-content nginx-configuration-file @@ -522,6 +524,7 @@ (default #f)) (server-names-hash-bucket-max-size nginx-configuration-server-names-hash-bucket-max-size (default #f)) + (modules nginx-configuration-modules (default '())) (extra-content nginx-configuration-extra-content (default "")) (file nginx-configuration-file ;#f | string | file-like @@ -542,6 +545,9 @@ of index files." ((? string? str) (list str " "))) names)) +(define (emit-load-module module) + (list "load_module " module ";\n")) + (define emit-nginx-location-config (match-lambda (($ uri body) @@ -615,12 +621,14 @@ of index files." server-blocks upstream-blocks server-names-hash-bucket-size server-names-hash-bucket-max-size + modules extra-content) (apply mixed-text-file "nginx.conf" (flatten "user nginx nginx;\n" "pid " run-directory "/pid;\n" "error_log " log-directory "/error.log info;\n" + (map emit-load-module modules) "http {\n" " client_body_temp_path " run-directory "/client_body_temp;\n" " proxy_temp_path " run-directory "/proxy_temp;\n" -- cgit v1.2.3 From 1ce0d7e190784c709abf3346d8d94e7e143569dc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 9 Nov 2019 11:33:12 +0100 Subject: services: hpcguix-web: Explicitly import (guix build utils). * gnu/services/web.scm (%hpcguix-web-activation): Add explicit 'with-imported-modules'. --- gnu/services/web.scm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'gnu/services/web.scm') diff --git a/gnu/services/web.scm b/gnu/services/web.scm index f13e86482f..d0c9d0df2b 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 David Thompson -;;; Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès +;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2016 ng0 ;;; Copyright © 2016, 2017, 2018 Julien Lepiller ;;; Copyright © 2017 Christopher Baines @@ -1047,13 +1047,15 @@ a webserver.") (shell (file-append shadow "/sbin/nologin"))))) (define %hpcguix-web-activation - #~(begin - (use-modules (guix build utils)) - (let ((home-dir "/var/cache/guix/web") - (user (getpwnam "hpcguix-web"))) - (mkdir-p home-dir) - (chown home-dir (passwd:uid user) (passwd:gid user)) - (chmod home-dir #o755)))) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (let ((home-dir "/var/cache/guix/web") + (user (getpwnam "hpcguix-web"))) + (mkdir-p home-dir) + (chown home-dir (passwd:uid user) (passwd:gid user)) + (chmod home-dir #o755))))) (define %hpcguix-web-log-file "/var/log/hpcguix-web.log") -- cgit v1.2.3 From 7c34c62c807b357b5cdad6fde0f11c9fe93279d0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 9 Nov 2019 15:12:30 +0100 Subject: services: hpcguix-web: Delete lock files during activation. * gnu/services/web.scm (%hpcguix-web-activation): Delete ".lock" files from HOME-DIR. --- gnu/services/web.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gnu/services/web.scm') diff --git a/gnu/services/web.scm b/gnu/services/web.scm index d0c9d0df2b..3d149a105d 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -1049,13 +1049,22 @@ a webserver.") (define %hpcguix-web-activation (with-imported-modules '((guix build utils)) #~(begin - (use-modules (guix build utils)) + (use-modules (guix build utils) + (ice-9 ftw)) (let ((home-dir "/var/cache/guix/web") (user (getpwnam "hpcguix-web"))) (mkdir-p home-dir) (chown home-dir (passwd:uid user) (passwd:gid user)) - (chmod home-dir #o755))))) + (chmod home-dir #o755) + + ;; Remove stale 'packages.json.lock' file (and other lock files, if + ;; any) since that would prevent 'packages.json' from being updated. + (for-each (lambda (lock) + (delete-file (string-append home-dir "/" lock))) + (scandir home-dir + (lambda (file) + (string-suffix? ".lock" file)))))))) (define %hpcguix-web-log-file "/var/log/hpcguix-web.log") -- cgit v1.2.3