From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 29 17:16:47 2017 Received: (at submit) by debbugs.gnu.org; 29 Aug 2017 21:16:47 +0000 Received: from localhost ([127.0.0.1]:32940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmnsN-0004wU-It for submit@debbugs.gnu.org; Tue, 29 Aug 2017 17:16:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmnsL-0004wG-4R for submit@debbugs.gnu.org; Tue, 29 Aug 2017 17:16:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmnsE-0008NV-Ua for submit@debbugs.gnu.org; Tue, 29 Aug 2017 17:16:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55847) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dmnsE-0008NH-QN for submit@debbugs.gnu.org; Tue, 29 Aug 2017 17:16:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmnsD-0005NL-JS for guix-patches@gnu.org; Tue, 29 Aug 2017 17:16:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmns8-0008HV-Kz for guix-patches@gnu.org; Tue, 29 Aug 2017 17:16:37 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:33229) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmns8-0008FV-DS for guix-patches@gnu.org; Tue, 29 Aug 2017 17:16:32 -0400 Received: by mail-lf0-x241.google.com with SMTP id y15so2855283lfd.0 for ; Tue, 29 Aug 2017 14:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version:content-disposition :content-description; bh=WtzLuFabpENcqtXAxQcBB8TOXF2Lz97ElmcBSABqUEM=; b=kV0qk/Ucm2k6k70US21zP4rRnHb9d0NDM2U8/5TFC9UMeCoZP/H78yOKPWebb7aC8z fNOKn+q4dc8m+ooengwzFxW+JoQGT/d72UFBFh1cfuc8nOagrafWr8XuV2SGZJZtbclQ Q5gz1pDSxn1lI3u+AOEBlRnx7a/8ykkCw7g4WACVey31AZNP1I3plpQhaoEMu7ibNlnq U/RRlEKbk5qgd13EWKRD1zJi40kCuFWlWxINM9ebZmUh+YJp2zpMEhTZ8HOVvgocafoK EQF+UpZ4a9h7aJx1iYvrwxo/4bTKobTsMSvsGrvjN8aZOsHnwrwRhjExAxyBw37/ulDu LzaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-disposition:content-description; bh=WtzLuFabpENcqtXAxQcBB8TOXF2Lz97ElmcBSABqUEM=; b=Vx0wwH340zY2DyVRY0SNmtgv2ua7EcSnXDgabTD5Z9QTXSqfvrECYApwT55yziwENc TC21a8vsvO4+IH0RfdzWPTBAQTrk0JoCDgh56A2kHD/NHSl6XVYxGqyzDn4AiOpacuJl V1nbwyBjAaTgxTqkx2HbJVsKny4wRwFQG/U4xOgBLd3pBn6bboss6DrVYINtQAY/fsQp Wn9IKotPTvQFwYMO+bk4Quam5FFqbQyfeP40eI5iI33iNx1NOp04DBJzVjFnUj4YLWwg 2RH8exBTY+Zc3kNwZLhyhLLq4OVmb77b799vIzlAlIiRHoGrlZgpPQJB4QMODq34sp43 0HPw== X-Gm-Message-State: AHYfb5hZw3orWWlBOY1RM2m9C4fFiTcVm8iqEyODwL3fxDNeizs157ux vodRdWH0xQ6Vprrh X-Received: by 10.46.25.24 with SMTP id p24mr670397lje.38.1504041389395; Tue, 29 Aug 2017 14:16:29 -0700 (PDT) Received: from magnolia (ppp78-37-186-77.pppoe.avangarddsl.ru. [78.37.186.77]) by smtp.gmail.com with ESMTPSA id f95sm681058lfi.24.2017.08.29.14.16.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2017 14:16:28 -0700 (PDT) From: Oleg Pykhalov To: guix-patches@gnu.org Subject: [PATCH 0/1] gnu: services: version-control: Add cgit. Date: Wed, 30 Aug 2017 00:16:27 +0300 Message-ID: <87h8wq2hxw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/x-patch Content-Disposition: inline; filename=0000-cover-letter.patch Content-Description: [PATCH 0/1] gnu: services: version-control: Add cgit. X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) >From 65fa66cd761f3a9f8c6e84f8b5f7d8c643fe9731 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Wed, 30 Aug 2017 00:06:43 +0300 Subject: [PATCH 0/1] gnu: services: version-control: Add cgit. Hello Guix, Here is cgit based on nginx service. <#part type="text/plain" filename="~/dotfiles/guix/system-cgit.scm" disposition=attachment description=system-cgit.scm> <#/part> I tested with --8<---------------cut here---------------start------------->8--- mkdir /tmp/cgit $(./pre-inst-env guix system vm system-cgit.scm --share=/tmp/cgit=/srv/git) -daemonize -net nic,model=virtio -net user,hostfwd=tcp::10080-:80 icecat localhost:10080 --8<---------------cut here---------------end--------------->8--- Oleg Pykhalov (1): gnu: services: version-control: Add cgit. doc/guix.texi | 63 +++++++++++++++++++++++ gnu/services/version-control.scm | 108 ++++++++++++++++++++++++++++++++++++++- gnu/services/web.scm | 4 ++ 3 files changed, 174 insertions(+), 1 deletion(-) -- 2.14.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 29 17:18:30 2017 Received: (at 28283) by debbugs.gnu.org; 29 Aug 2017 21:18:30 +0000 Received: from localhost ([127.0.0.1]:32945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmnu1-0004zi-Vo for submit@debbugs.gnu.org; Tue, 29 Aug 2017 17:18:30 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:36907) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmnu0-0004zT-BP for 28283@debbugs.gnu.org; Tue, 29 Aug 2017 17:18:29 -0400 Received: by mail-lf0-f44.google.com with SMTP id y128so12357790lfd.4 for <28283@debbugs.gnu.org>; Tue, 29 Aug 2017 14:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:in-reply-to:message-id:user-agent:mime-version :content-disposition:content-description; bh=hSb8ADqGnNLOxEJ/ydFbN1dqwgBlS0H/SnMDXN4PxnA=; b=M1Z5aVBvAt0cdSQLU55+F87+4trdrH60PMxa03DUKCDasNQkOW7ITDe+Ma1vUn+32U X0rAlirrnyfXglFECy85hEoqGLdZJKBs0pVic0fEY812pl3nw3gBG5FZvTMkBJ9I3M+Z WN5JleHBIz9qpxhELH/rpxereCSj77G7/3t44/rQcrJI7X3pQZqDkJ1gWPU7s1sJJ3DJ NRLbiX6susJVFirWYiHnxY7MbIpjF+EfDqr8Lc7MdAV68ww9gI7sW1rZ7LQxO1zfrZUD E4lReYedm0pYHWNW6lit4dBT4tKzy08xyuNZPS9zI9XDi4f3a/9ZKLFlWQ7ljKSADZPz ilKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:in-reply-to:message-id :user-agent:mime-version:content-disposition:content-description; bh=hSb8ADqGnNLOxEJ/ydFbN1dqwgBlS0H/SnMDXN4PxnA=; b=PluSxlH5v5RGRYV725Zb9JTrS1iAQoFHAIGr6S34vhiIXSnbfftmBIql1BKJL3Jy6k yif5nTa/vOp+hOznggP/DoNNFCnME4pnAl4B8ku76a/2K4qBML6f6q/ri4oqBDaLqd9F anaAU/UAfgEM1Ev/PhiIR2X2bMqrkxRqUwHnHKcgRW0dw4J/kNGFNTYSh/EwuS5yUIdc 03zeq/5JIKn1ca8arsP9tkgQw5UidSyDKEPEzHwPu8vd5bZVD5aBss/tWwiteUUD+RkD ZNqJNt6l/YhB1lucYrGW5efr/JKvwM1PyzZTUp6eXmSa1CS7hal2RGyS4EmI2aRhewah ANyQ== X-Gm-Message-State: AHYfb5ibJrsQ6HJR848lw2z4lXleFCC2ZsDQWdFRSVxnER72PI28uDUx KTsRl/pwpWSCt4co X-Received: by 10.46.33.72 with SMTP id h69mr780471ljh.16.1504041501982; Tue, 29 Aug 2017 14:18:21 -0700 (PDT) Received: from magnolia (ppp78-37-186-77.pppoe.avangarddsl.ru. [78.37.186.77]) by smtp.gmail.com with ESMTPSA id c83sm790600ljd.13.2017.08.29.14.18.20 for <28283@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2017 14:18:21 -0700 (PDT) From: Oleg Pykhalov To: bug#28283 <28283@debbugs.gnu.org> Subject: Re: Status: [PATCH 1/1] gnu: services: version-control: Add cgit. Date: Wed, 30 Aug 2017 00:18:20 +0300 In-Reply-To: bug's message of "Tue\, 29 Aug 2017 21\:17\:16 +0000" Message-ID: <87a82i2hur.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-services-version-control-Add-cgit.patch Content-Description: [PATCH 1/1] gnu: services: version-control: Add cgit. X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28283 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) >From 65fa66cd761f3a9f8c6e84f8b5f7d8c643fe9731 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Tue, 29 Aug 2017 23:40:05 +0300 Subject: [PATCH 1/1] gnu: services: version-control: Add cgit. * gnu/services/version-control.scm (, ): New record types. (cgit-configuration-robots-string, cgit-activation, cgit-configuration-nginx-config): New procedures. (%cgit-configuration-nginx, cgit-service-type): New variables. * doc/guix.texi (Version Control): Document the cgit service. * gnu/services/web.scm (): Add nginx-server-configuration-try-files. (emit-nginx-server-config): Add this. --- doc/guix.texi | 63 +++++++++++++++++++++++ gnu/services/version-control.scm | 108 ++++++++++++++++++++++++++++++++++++++- gnu/services/web.scm | 4 ++ 3 files changed, 174 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 6293ad48b..2a7663276 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16788,6 +16788,69 @@ Extra options will be passed to @code{git daemon}, please run @end table @end deftp +@subsubheading cgit service + +@uref{https://git.zx2c4.com/cgit/, cgit} is a hyperfast web +frontend for git repositories written in C. + +The following example will configure the service with default values. +By default, cgit can be accessed on port 80 (@code{http://localhost:80}). + +@example +(service nginx-service-type) +(service fcgiwrap-service-type) +(service cgit-service-type) +@end example + +@deftp {Data Type} cgit-configuration +Data type representing the configuration of cgit. +This type has the following parameters: + +@table @asis +@item @code{config-file} (default: @code{(cgit-configuration-file)}) +The configuration file to use for Cgit. This can be set to a +@dfn{cgit-configuration-file} record value, or any gexp +(@pxref{G-Expressions}). + +For example, to instead use a local file, the @code{local-file} function +can be used: + +@example +(service cgit-service-type + (cgit-configuration + (config-file (local-file "./my-cgitrc.conf")))) +@end example + +@item @code{package} (default: @code{cgit}) +The cgit package to use. + +@end table +@end deftp + +@deftp {Data Type} cgit-configuration-file +Data type representing the configuration options for Cgit. +This type has the following parameters: + +@table @asis +@item @code{css} (default: @code{"/share/cgit/cgit.css"}) +Url which specifies the css document to include in all cgit pages. + +@item @code{logo} (default: @code{"/share/cgit/cgit.png"}) +Url which specifies the source of an image which will be used as a logo +on all cgit pages. + +@item @code{virtual-root} (default: @code{"/"}) +Url which, if specified, will be used as root for all cgit links. + +@item @code{scan-path} (default: @code{"/srv/git"}) +A path which will be scanned for repositories. + +@item @code{robots} (default: @code{(list "noindex" "nofollow")}) +Text used as content for the "robots" meta-tag. + +@end table +@end deftp + @subsubsection Incremental file transfer The @code{(gnu services rsync)} module provides the following services: diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm index 107bc8e77..a2688163a 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -21,18 +21,40 @@ #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services shepherd) + #:use-module (gnu services web) #:use-module (gnu system shadow) #:use-module (gnu packages version-control) #:use-module (gnu packages admin) #:use-module (guix records) #:use-module (guix gexp) + #:use-module (guix store) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 match) #:export (git-daemon-service git-daemon-service-type git-daemon-configuration - git-daemon-configuration?)) + git-daemon-configuration? + + + cgit-configuration-file + cgit-configuration-file? + cgit-configuration-file-css + cgit-configuration-file-logo + cgit-configuration-file-robots + cgit-configuration-file-virtual-root + cgit-configuration-file-scan-path + + + cgit-configuration + cgit-configuration? + cgit-configuration-config-file + cgit-configuration-package + + %cgit-configuration-nginx + cgit-configuration-nginx-config + + cgit-service-type)) ;;; Commentary: ;;; @@ -139,3 +161,87 @@ The optional @var{config} argument should be a @code{} object, by default it allows read-only access to exported repositories under @file{/srv/git}." (service git-daemon-service-type config)) + + +;;; +;;; Cgit +;;; + +(define-record-type* + cgit-configuration-file make-cgit-configuration-file + cgit-configuration-file? + (css cgit-configuration-file-css + (default "/share/cgit/cgit.css")) + (logo cgit-configuration-file-logo + (default "/share/cgit/cgit.png")) + (robots cgit-configuration-file-robots + (default '("noindex" "nofollow"))) + (virtual-root cgit-configuration-file-virtual-root + (default "/")) + (scan-path cgit-configuration-file-scan-path + (default "/srv/git"))) + +(define (cgit-configuration-robots-string robots) + (string-join robots ", ")) + +(define-gexp-compiler (cgit-configuration-file-compiler + (file ) system target) + (match file + (($ css logo robots virtual-root scan-path) + (text-file + "cgitrc" + (string-concatenate + (filter-map + (match-lambda + ((key . #f) #f) + ((key . value) (string-append key "=" value "\n"))) + `(("css" . ,css) + ("logo" . ,logo) + ("robots" . ,(cgit-configuration-robots-string robots)) + ("virtual-root" . ,virtual-root) + ("scan-path" . ,scan-path)))))))) + +(define %cgit-configuration-nginx + (list + (nginx-server-configuration + (root cgit) + (locations + (list + (nginx-location-configuration + (uri "@cgit") + (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;" + "fastcgi_param PATH_INFO $uri;" + "fastcgi_param QUERY_STRING $args;" + "fastcgi_param HTTP_HOST $server_name;" + "fastcgi_pass 127.0.0.1:9000;"))))) + (try-files (list "$uri" "@cgit")) + (https-port #f) + (ssl-certificate #f) + (ssl-certificate-key #f)))) + +(define-record-type* + cgit-configuration make-cgit-configuration + cgit-configuration? + (config-file cgit-configuration-config-file + (default (cgit-configuration-file))) + (package cgit-configuration-package + (default cgit)) + (nginx cgit-configuration-nginx + (default %cgit-configuration-nginx))) + +(define (cgit-activation config) + ;; cgit compiled with default configuration path + #~(copy-file #$(cgit-configuration-config-file config) "/etc/cgitrc")) + +(define (cgit-configuration-nginx-config config) + (cgit-configuration-nginx config)) + +(define cgit-service-type + (service-type + (name 'cgit) + (extensions + (list (service-extension activation-service-type + cgit-activation) + (service-extension nginx-service-type + cgit-configuration-nginx-config))) + (default-value (cgit-configuration)))) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 18278502e..f3c5ca528 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -99,6 +99,8 @@ (default '())) (index nginx-server-configuration-index (default (list "index.html"))) + (try-files nginx-server-configuration-try-files + (default #f)) (ssl-certificate nginx-server-configuration-ssl-certificate (default "/etc/nginx/cert.pem")) (ssl-certificate-key nginx-server-configuration-ssl-certificate-key @@ -179,6 +181,7 @@ of index files." (nginx-server-configuration-ssl-certificate-key server)) (root (nginx-server-configuration-root server)) (index (nginx-server-configuration-index server)) + (try-files (nginx-server-configuration-try-files server)) (server-tokens? (nginx-server-configuration-server-tokens? server)) (locations (nginx-server-configuration-locations server))) (define-syntax-parameter <> (syntax-rules ())) @@ -207,6 +210,7 @@ of index files." (and/l ssl-certificate-key " ssl_certificate_key " <> ";\n") " root " root ";\n" " index " (config-index-strings index) ";\n" + " try_files " (config-index-strings try-files) ";\n" " server_tokens " (if server-tokens? "on" "off") ";\n" "\n" (map emit-nginx-location-config locations) -- 2.14.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 29 17:53:17 2017 Received: (at 28283) by debbugs.gnu.org; 29 Aug 2017 21:53:17 +0000 Received: from localhost ([127.0.0.1]:32977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmoRg-0005um-Mn for submit@debbugs.gnu.org; Tue, 29 Aug 2017 17:53:16 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:33879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmoRe-0005uY-B2 for 28283@debbugs.gnu.org; Tue, 29 Aug 2017 17:53:14 -0400 Received: by mail-lf0-f43.google.com with SMTP id d17so18236691lfe.1 for <28283@debbugs.gnu.org>; Tue, 29 Aug 2017 14:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=9ueUiUifG9k+xhyZuBey9+CK59sKOIessT+1AR0RkkI=; b=DmXrL+CaCzW/IiTVlqdVuiP/HsKOdawFnqeHSSIUX4i9Or2bMjtT9YAJHD/3cjmznM 3ce0JjfE/uNLXclPDaHfF4TmG1HpxipMCY6mlNH6RkmCagqrvoWN0GVpMZ21ENjhAJjq geWDnhnrBF/YqTg285ShP2gzEBZvTUdztpDrL1KSrJgSyeyKteKAYukrrU/fJkrP6RYV xK1vcDkN7sPIRqKcPagIixHRa6YDbPvXx4vahBLodn6ju6Gp4GpwgNlROwZP9fAGZQea +ApW/E4+cd2+ne1tSvxEKWYwJUpOajbEpNTW/ntO73vHMT5JBJgxxTOGxlsREIphEX0m 71uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=9ueUiUifG9k+xhyZuBey9+CK59sKOIessT+1AR0RkkI=; b=SzSTYUX5v1bIIvJ99B5mnfK5fpxpc3zKmVurtlMNTVpbXmAgA9yi9IO2urNwYFq+rL shImIMxIpDdjJ4SjvGn4lpZ31SE5sjB9jPPC1gD6g2hxlqpcXfrxbSZRpCTrgo3YSjg4 +INZp5FvoeOOaKV2WUWZ4qu8QKMfXp/8Z98gCmiWEAH/hC+uhfZMZq1/4UGz/a9Rbb0h BV8AKgB4rEyvtWpFFwyH6C910q115QdB1pj7IiqH/aYLAPCABiThZvFOJJqVXeCCTMaP peWj1Toj96fAshBMrDv8o4NdASp0fXIIAGo/vNzV2xQLSU66DzmjMuH+R7WvE4QmsFFR eeRA== X-Gm-Message-State: AHPjjUiTxD2nKp9Hvf3w8L4zF2yrrP9wO7FcwS93Lv03EAKZCYW7m7qO toxegdqyVt47yMLI X-Received: by 10.25.40.147 with SMTP id o141mr90023lfo.147.1504043588073; Tue, 29 Aug 2017 14:53:08 -0700 (PDT) Received: from magnolia (ppp78-37-186-77.pppoe.avangarddsl.ru. [78.37.186.77]) by smtp.gmail.com with ESMTPSA id h11sm93123ljb.84.2017.08.29.14.53.07 for <28283@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2017 14:53:07 -0700 (PDT) From: Oleg Pykhalov To: bug#28283 <28283@debbugs.gnu.org> Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> Date: Wed, 30 Aug 2017 00:53:06 +0300 In-Reply-To: <87a82i2hur.fsf@gmail.com> (Oleg Pykhalov's message of "Wed, 30 Aug 2017 00:18:20 +0300") Message-ID: <8760d611od.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28283 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) nginx-server-configuration-try-files probably needs to be '() by default. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 09:39:46 2017 Received: (at 28283) by debbugs.gnu.org; 31 Aug 2017 13:39:46 +0000 Received: from localhost ([127.0.0.1]:36567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnPhC-0001Et-KK for submit@debbugs.gnu.org; Thu, 31 Aug 2017 09:39:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41327) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnPhA-0001Eg-QK for 28283@debbugs.gnu.org; Thu, 31 Aug 2017 09:39:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnPh2-0000r1-Is for 28283@debbugs.gnu.org; Thu, 31 Aug 2017 09:39:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnPh2-0000qw-FK; Thu, 31 Aug 2017 09:39:36 -0400 Received: from [193.50.110.184] (port=46512 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dnPh1-0006YF-U5; Thu, 31 Aug 2017 09:39:36 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 14 Fructidor an 225 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Thu, 31 Aug 2017 15:39:33 +0200 In-Reply-To: <87a82i2hur.fsf@gmail.com> (Oleg Pykhalov's message of "Wed, 30 Aug 2017 00:18:20 +0300") Message-ID: <873787rh4a.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28283 Cc: bug#28283 <28283@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi Oleg, Oleg Pykhalov skribis: > From 65fa66cd761f3a9f8c6e84f8b5f7d8c643fe9731 Mon Sep 17 00:00:00 2001 > From: Oleg Pykhalov > Date: Tue, 29 Aug 2017 23:40:05 +0300 > Subject: [PATCH 1/1] gnu: services: version-control: Add cgit. > > * gnu/services/version-control.scm > (, ): New record types. > (cgit-configuration-robots-string, cgit-activation, > cgit-configuration-nginx-config): New procedures. > (%cgit-configuration-nginx, cgit-service-type): New variables. > * doc/guix.texi (Version Control): Document the cgit service. > * gnu/services/web.scm (): Add > nginx-server-configuration-try-files. > (emit-nginx-server-config): Add this. That looks nice and useful! Minor issues: > +@subsubheading cgit service Please capitalize titles: =E2=80=9CCgit Service=E2=80=9D > +@uref{https://git.zx2c4.com/cgit/, cgit} is a hyperfast web > +frontend for git repositories written in C. =E2=80=9CGit=E2=80=9D, not =E2=80=9Cgit=E2=80=9D. Also, not hypersuperlati= ves please. :-) So what about this: @uref{https://git.zx2c4.com/cgit/, cgit} is a Web interface to Git repositories, written in C. It allows users to look at Git repository contents and history through their Web browsers. > +The following example will configure the service with default values. > +By default, cgit can be accessed on port 80 (@code{http://localhost:80}). > + > +@example > +(service nginx-service-type) > +(service fcgiwrap-service-type) > +(service cgit-service-type) > +@end example Please add a sentence above or below the example like =E2=80=9CThis example shows =E2=80=A6=E2=80=9D. > +@table @asis > +@item @code{css} (default: @code{"/share/cgit/cgit.css"}) > +Url which specifies the css document to include in all cgit pages. > + > +@item @code{logo} (default: @code{"/share/cgit/cgit.png"}) > +Url which specifies the source of an image which will be used as a logo > +on all cgit pages. > + > +@item @code{virtual-root} (default: @code{"/"}) > +Url which, if specified, will be used as root for all cgit links. s/Url/URL/ > +@item @code{scan-path} (default: @code{"/srv/git"}) > +A path which will be scanned for repositories. Rather: =E2=80=9CName of the directory to scan for repositories.=E2=80=9D Can you also rename =E2=80=98scan-path=E2=80=99 to =E2=80=98repository-dire= ctory=E2=80=99 or something like that? (Not =E2=80=9Cpath.=E2=80=9D) > +@item @code{robots} (default: @code{(list "noindex" "nofollow")}) > +Text used as content for the "robots" meta-tag. Write ``robots'' (literally) so that Texinfo typesets things correctly. > --- a/gnu/services/web.scm > +++ b/gnu/services/web.scm > @@ -99,6 +99,8 @@ > (default '())) > (index nginx-server-configuration-index > (default (list "index.html"))) > + (try-files nginx-server-configuration-try-files > + (default #f)) > (ssl-certificate nginx-server-configuration-ssl-certificate > (default "/etc/nginx/cert.pem")) > (ssl-certificate-key nginx-server-configuration-ssl-certificate-key > @@ -179,6 +181,7 @@ of index files." > (nginx-server-configuration-ssl-certificate-key server)) > (root (nginx-server-configuration-root server)) > (index (nginx-server-configuration-index server)) > + (try-files (nginx-server-configuration-try-files server)) > (server-tokens? (nginx-server-configuration-server-tokens? serve= r)) > (locations (nginx-server-configuration-locations server))) > (define-syntax-parameter <> (syntax-rules ())) > @@ -207,6 +210,7 @@ of index files." > (and/l ssl-certificate-key " ssl_certificate_key " <> ";\n") > " root " root ";\n" > " index " (config-index-strings index) ";\n" > + " try_files " (config-index-strings try-files) ";\n" > " server_tokens " (if server-tokens? "on" "off") ";\n" > "\n" > (map emit-nginx-location-config locations) Could you submit these nginx changes separately for discussion? We=E2=80= =99ll also need to document them. Maybe Cc Chris Baines and other nginx people. Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 19 17:28:08 2017 Received: (at 28283) by debbugs.gnu.org; 19 Sep 2017 21:28:08 +0000 Received: from localhost ([127.0.0.1]:48732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duQ3r-000709-Hr for submit@debbugs.gnu.org; Tue, 19 Sep 2017 17:28:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duQ3p-0006ze-1S for 28283@debbugs.gnu.org; Tue, 19 Sep 2017 17:28:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duQ3i-0006pR-MQ for 28283@debbugs.gnu.org; Tue, 19 Sep 2017 17:27:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duQ3i-0006pL-J5; Tue, 19 Sep 2017 17:27:58 -0400 Received: from vpn-0-27.aquilenet.fr ([2a01:474:4:27::]:50932 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1duQ3i-0000lz-1t; Tue, 19 Sep 2017 17:27:58 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> Date: Tue, 19 Sep 2017 23:27:56 +0200 In-Reply-To: <873787rh4a.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 31 Aug 2017 15:39:33 +0200") Message-ID: <87d16mv0o3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28283 Cc: 28283@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello Oleg, This patch fell through the cracks. :-) Could you look into the comments I made below and send updated patches? We=E2=80=99re almost there! Ludo=E2=80=99. ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > Hi Oleg, > > Oleg Pykhalov skribis: > >> From 65fa66cd761f3a9f8c6e84f8b5f7d8c643fe9731 Mon Sep 17 00:00:00 2001 >> From: Oleg Pykhalov >> Date: Tue, 29 Aug 2017 23:40:05 +0300 >> Subject: [PATCH 1/1] gnu: services: version-control: Add cgit. >> >> * gnu/services/version-control.scm >> (, ): New record types. >> (cgit-configuration-robots-string, cgit-activation, >> cgit-configuration-nginx-config): New procedures. >> (%cgit-configuration-nginx, cgit-service-type): New variables. >> * doc/guix.texi (Version Control): Document the cgit service. >> * gnu/services/web.scm (): Add >> nginx-server-configuration-try-files. >> (emit-nginx-server-config): Add this. > > That looks nice and useful! > > Minor issues: > >> +@subsubheading cgit service > > Please capitalize titles: =E2=80=9CCgit Service=E2=80=9D > >> +@uref{https://git.zx2c4.com/cgit/, cgit} is a hyperfast web >> +frontend for git repositories written in C. > > =E2=80=9CGit=E2=80=9D, not =E2=80=9Cgit=E2=80=9D. Also, not hypersuperla= tives please. :-) > > So what about this: > > @uref{https://git.zx2c4.com/cgit/, cgit} is a Web interface to Git > repositories, written in C. It allows users to look at Git > repository contents and history through their Web browsers. > >> +The following example will configure the service with default values. >> +By default, cgit can be accessed on port 80 (@code{http://localhost:80}= ). >> + >> +@example >> +(service nginx-service-type) >> +(service fcgiwrap-service-type) >> +(service cgit-service-type) >> +@end example > > Please add a sentence above or below the example like =E2=80=9CThis examp= le > shows =E2=80=A6=E2=80=9D. > >> +@table @asis >> +@item @code{css} (default: @code{"/share/cgit/cgit.css"}) >> +Url which specifies the css document to include in all cgit pages. >> + >> +@item @code{logo} (default: @code{"/share/cgit/cgit.png"}) >> +Url which specifies the source of an image which will be used as a logo >> +on all cgit pages. >> + >> +@item @code{virtual-root} (default: @code{"/"}) >> +Url which, if specified, will be used as root for all cgit links. > > s/Url/URL/ > >> +@item @code{scan-path} (default: @code{"/srv/git"}) >> +A path which will be scanned for repositories. > > Rather: =E2=80=9CName of the directory to scan for repositories.=E2=80=9D > > Can you also rename =E2=80=98scan-path=E2=80=99 to =E2=80=98repository-di= rectory=E2=80=99 or something > like that? (Not =E2=80=9Cpath.=E2=80=9D) > >> +@item @code{robots} (default: @code{(list "noindex" "nofollow")}) >> +Text used as content for the "robots" meta-tag. > > Write ``robots'' (literally) so that Texinfo typesets things correctly. > >> --- a/gnu/services/web.scm >> +++ b/gnu/services/web.scm >> @@ -99,6 +99,8 @@ >> (default '())) >> (index nginx-server-configuration-index >> (default (list "index.html"))) >> + (try-files nginx-server-configuration-try-files >> + (default #f)) >> (ssl-certificate nginx-server-configuration-ssl-certificate >> (default "/etc/nginx/cert.pem")) >> (ssl-certificate-key nginx-server-configuration-ssl-certificate-key >> @@ -179,6 +181,7 @@ of index files." >> (nginx-server-configuration-ssl-certificate-key server)) >> (root (nginx-server-configuration-root server)) >> (index (nginx-server-configuration-index server)) >> + (try-files (nginx-server-configuration-try-files server)) >> (server-tokens? (nginx-server-configuration-server-tokens? serv= er)) >> (locations (nginx-server-configuration-locations server))) >> (define-syntax-parameter <> (syntax-rules ())) >> @@ -207,6 +210,7 @@ of index files." >> (and/l ssl-certificate-key " ssl_certificate_key " <> ";\n") >> " root " root ";\n" >> " index " (config-index-strings index) ";\n" >> + " try_files " (config-index-strings try-files) ";\n" >> " server_tokens " (if server-tokens? "on" "off") ";\n" >> "\n" >> (map emit-nginx-location-config locations) > > Could you submit these nginx changes separately for discussion? We=E2=80= =99ll > also need to document them. Maybe Cc Chris Baines and other nginx > people. > > Thanks! > > Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 20 18:20:22 2017 Received: (at 28283) by debbugs.gnu.org; 20 Sep 2017 22:20:22 +0000 Received: from localhost ([127.0.0.1]:50649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dunLx-00086B-Oo for submit@debbugs.gnu.org; Wed, 20 Sep 2017 18:20:22 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dunLv-00085w-ID for 28283@debbugs.gnu.org; Wed, 20 Sep 2017 18:20:20 -0400 Received: by mail-lf0-f66.google.com with SMTP id h80so2068077lfe.1 for <28283@debbugs.gnu.org>; Wed, 20 Sep 2017 15:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=pam5CXmboKmB+9WLtsoxNflXcqjtxAjoeZlbdW7UT0g=; b=Ff8BSFodGvSN/WtAuhimY9R5IYyEJ1FTo1Q8DmA8lRtIzT7bghcDdDMfNTN9MdwSud Nl6fhnkDyFfll/FVeuwdzEP/Xw8NTU3owKSXLUprJYXtlnqLOvYcS2V+cmcXBQXTpTOg lIdr0DMf2qTyLsNDnxcSUZSjJ8ReLT/XwJNrEBG+3gh2Y3IG2DcpClYAkd37EWKH9puB HGoiPQqecwMssFvFpPlPMtw+V6bAeJjAEnnZoY3dRmU3b8E16GzxboLXH3ukpdlOSk4P WQug9aXjYXuaODnZzBabRx3jIE2ko6F3ExNBrDNtGUfV/ONp1oExve81pvd61OTaZrWv RnTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=pam5CXmboKmB+9WLtsoxNflXcqjtxAjoeZlbdW7UT0g=; b=mgeuvb1xkxa2pUkfUXBgKQZQrdA4yDWKqBQigbQ1LQBXG1FKNmeWPOU4HdDlikp+Md 3MGTxEtxOIaZUMG/BZZVJ7gDqmUkWhRZm2BVE+TK6GfhpVTRvcFLvH4NLOQTVdaXRgLx Zckzy7Fx/IjXdEg3yMe4IpAx2sAf8rhL3oo2kUXY0Gsh7DpMqFvKlW/D16Pnp+m71k15 8HKSW1M6vx0z5lpBHlsV64D8uPee2v3zdJ7BlktpA19t9yRnoW0F4QMOjfmqRSaGrp4X Bm0cUzgu16BItdP7AoYIks5Q12fGhO0KByy9PQ3PAi8N68jmOEmItm7Vw4vj1O4ojnqG FlSQ== X-Gm-Message-State: AHPjjUiu7MmBeELV14rkwReT4LOReHeLgRp7loCLbqpDAedX7sgm0i5w kD/gWxfMTCIoIut5vjd3t78XxQ== X-Google-Smtp-Source: AOwi7QB/fmZvXWsbiAYwofBEE4y6e9GRhtFPkJOvQB4elcVEFGp23FpJEwy2x44PtBeM4qt7MDuiUQ== X-Received: by 10.46.2.139 with SMTP id y11mr69315lje.183.1505946013172; Wed, 20 Sep 2017 15:20:13 -0700 (PDT) Received: from magnolia ([178.69.60.22]) by smtp.gmail.com with ESMTPSA id t84sm469941lfi.21.2017.09.20.15.20.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Sep 2017 15:20:12 -0700 (PDT) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> <87d16mv0o3.fsf@gnu.org> Date: Thu, 21 Sep 2017 01:20:11 +0300 In-Reply-To: <87d16mv0o3.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 19 Sep 2017 23:27:56 +0200") Message-ID: <87efr19fms.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28283 Cc: 28283@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Ludovic, apologies for long responce. ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hello Oleg, > > This patch fell through the cracks. :-) > > Could you look into the comments I made below and send updated patches? > We=E2=80=99re almost there! Yes, I looked them already few days ago. Your last comment was about nginx changes. I'm working on it. But I have issue with stucture when I try to test. --8<---------------cut here---------------start------------->8--- natsu@magnolia ~/src/guix$ guix environment guix -- make check-system TESTS= =3Dnginx ;;; note: source file /home/natsu/src/guix-wigust/wigust/packages/emacs.scm ;;; newer than compiled /home/natsu/.cache/guile/ccache/2.2-LE-8-3.A/= home/natsu/src/guix-wigust/wigust/packages/emacs.scm.go substitute: updating list of substitutes from 'https://berlin.guixsd.org'..= . 100.0% Compiling Scheme modules... warning: failed to load '(gnu tests web)': ERROR: In procedure allocate-struct: Wrong type argument in position 2: 9 Running 0 system tests... TOTAL: 0 --8<---------------cut here---------------end--------------->8--- --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 4aa6fd501..3063bd549 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -99,6 +99,8 @@ (default '())) (index nginx-server-configuration-index (default (list "index.html"))) + (try-files nginx-server-configuration-try-files + (default '())) (ssl-certificate nginx-server-configuration-ssl-certificate (default "/etc/nginx/cert.pem")) (ssl-certificate-key nginx-server-configuration-ssl-certificate-key @@ -179,6 +181,7 @@ of index files." (nginx-server-configuration-ssl-certificate-key server)) (root (nginx-server-configuration-root server)) (index (nginx-server-configuration-index server)) + ;; (try-files (nginx-server-configuration-try-files server)) (server-tokens? (nginx-server-configuration-server-tokens? server)) (locations (nginx-server-configuration-locations server))) (define-syntax-parameter <> (syntax-rules ())) @@ -207,6 +210,10 @@ of index files." (and/l ssl-certificate-key " ssl_certificate_key " <> ";\n") " root " root ";\n" " index " (config-index-strings index) ";\n" + ;; (if (nil? (pk 'try-files try-files)) + ;; "" + ;; (string append " try_files " + ;; (config-index-strings try-files) ";\n")) " server_tokens " (if server-tokens? "on" "off") ";\n" "\n" (map emit-nginx-location-config locations) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > Ludo=E2=80=99. > > ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > >> Hi Oleg, >> >> Oleg Pykhalov skribis: >> >>> From 65fa66cd761f3a9f8c6e84f8b5f7d8c643fe9731 Mon Sep 17 00:00:00 2001 >>> From: Oleg Pykhalov >>> Date: Tue, 29 Aug 2017 23:40:05 +0300 >>> Subject: [PATCH 1/1] gnu: services: version-control: Add cgit. >>> >>> * gnu/services/version-control.scm >>> (, ): New record types. >>> (cgit-configuration-robots-string, cgit-activation, >>> cgit-configuration-nginx-config): New procedures. >>> (%cgit-configuration-nginx, cgit-service-type): New variables. >>> * doc/guix.texi (Version Control): Document the cgit service. >>> * gnu/services/web.scm (): Add >>> nginx-server-configuration-try-files. >>> (emit-nginx-server-config): Add this. >> >> That looks nice and useful! >> >> Minor issues: >> >>> +@subsubheading cgit service >> >> Please capitalize titles: =E2=80=9CCgit Service=E2=80=9D >> >>> +@uref{https://git.zx2c4.com/cgit/, cgit} is a hyperfast web >>> +frontend for git repositories written in C. >> >> =E2=80=9CGit=E2=80=9D, not =E2=80=9Cgit=E2=80=9D. Also, not hypersuperl= atives please. :-) >> >> So what about this: >> >> @uref{https://git.zx2c4.com/cgit/, cgit} is a Web interface to Git >> repositories, written in C. It allows users to look at Git >> repository contents and history through their Web browsers. >> >>> +The following example will configure the service with default values. >>> +By default, cgit can be accessed on port 80 (@code{http://localhost:80= }). >>> + >>> +@example >>> +(service nginx-service-type) >>> +(service fcgiwrap-service-type) >>> +(service cgit-service-type) >>> +@end example >> >> Please add a sentence above or below the example like =E2=80=9CThis exam= ple >> shows =E2=80=A6=E2=80=9D. >> >>> +@table @asis >>> +@item @code{css} (default: @code{"/share/cgit/cgit.css"}) >>> +Url which specifies the css document to include in all cgit pages. >>> + >>> +@item @code{logo} (default: @code{"/share/cgit/cgit.png"}) >>> +Url which specifies the source of an image which will be used as a logo >>> +on all cgit pages. >>> + >>> +@item @code{virtual-root} (default: @code{"/"}) >>> +Url which, if specified, will be used as root for all cgit links. >> >> s/Url/URL/ >> >>> +@item @code{scan-path} (default: @code{"/srv/git"}) >>> +A path which will be scanned for repositories. >> >> Rather: =E2=80=9CName of the directory to scan for repositories.=E2=80=9D >> >> Can you also rename =E2=80=98scan-path=E2=80=99 to =E2=80=98repository-d= irectory=E2=80=99 or something >> like that? (Not =E2=80=9Cpath.=E2=80=9D) >> >>> +@item @code{robots} (default: @code{(list "noindex" "nofollow")}) >>> +Text used as content for the "robots" meta-tag. >> >> Write ``robots'' (literally) so that Texinfo typesets things correctly. >> >>> --- a/gnu/services/web.scm >>> +++ b/gnu/services/web.scm >>> @@ -99,6 +99,8 @@ >>> (default '())) >>> (index nginx-server-configuration-index >>> (default (list "index.html"))) >>> + (try-files nginx-server-configuration-try-files >>> + (default #f)) >>> (ssl-certificate nginx-server-configuration-ssl-certificate >>> (default "/etc/nginx/cert.pem")) >>> (ssl-certificate-key nginx-server-configuration-ssl-certificate-key >>> @@ -179,6 +181,7 @@ of index files." >>> (nginx-server-configuration-ssl-certificate-key server)) >>> (root (nginx-server-configuration-root server)) >>> (index (nginx-server-configuration-index server)) >>> + (try-files (nginx-server-configuration-try-files server)) >>> (server-tokens? (nginx-server-configuration-server-tokens? ser= ver)) >>> (locations (nginx-server-configuration-locations server))) >>> (define-syntax-parameter <> (syntax-rules ())) >>> @@ -207,6 +210,7 @@ of index files." >>> (and/l ssl-certificate-key " ssl_certificate_key " <> ";\n") >>> " root " root ";\n" >>> " index " (config-index-strings index) ";\n" >>> + " try_files " (config-index-strings try-files) ";\n" >>> " server_tokens " (if server-tokens? "on" "off") ";\n" >>> "\n" >>> (map emit-nginx-location-config locations) >> >> Could you submit these nginx changes separately for discussion? We=E2= =80=99ll >> also need to document them. Maybe Cc Chris Baines and other nginx >> people. >> >> Thanks! >> >> Ludo=E2=80=99. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 22 09:40:49 2017 Received: (at 28283) by debbugs.gnu.org; 22 Sep 2017 13:40:49 +0000 Received: from localhost ([127.0.0.1]:52397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvOCH-0000BI-KG for submit@debbugs.gnu.org; Fri, 22 Sep 2017 09:40:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvOCF-0000B1-P8 for 28283@debbugs.gnu.org; Fri, 22 Sep 2017 09:40:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvOC6-0006wB-AJ for 28283@debbugs.gnu.org; Fri, 22 Sep 2017 09:40:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvOC6-0006w5-6D; Fri, 22 Sep 2017 09:40:38 -0400 Received: from [193.50.110.164] (port=53344 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dvOC5-00013m-Lq; Fri, 22 Sep 2017 09:40:37 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> <87d16mv0o3.fsf@gnu.org> <87efr19fms.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 1 =?utf-8?Q?Vend=C3=A9miaire?= an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Fri, 22 Sep 2017 15:40:34 +0200 In-Reply-To: <87efr19fms.fsf@gmail.com> (Oleg Pykhalov's message of "Thu, 21 Sep 2017 01:20:11 +0300") Message-ID: <87ingasvfx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28283 Cc: 28283@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi Oleg, Oleg Pykhalov skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Hello Oleg, >> >> This patch fell through the cracks. :-) >> >> Could you look into the comments I made below and send updated patches? >> We=E2=80=99re almost there! > > Yes, I looked them already few days ago. Your last comment was about > nginx changes. I'm working on it. But I have issue with stucture when > I try to test. > > natsu@magnolia ~/src/guix$ guix environment guix -- make check-system TES= TS=3Dnginx > ;;; note: source file /home/natsu/src/guix-wigust/wigust/packages/emacs.s= cm > ;;; newer than compiled /home/natsu/.cache/guile/ccache/2.2-LE-8-3.= A/home/natsu/src/guix-wigust/wigust/packages/emacs.scm.go > substitute: updating list of substitutes from 'https://berlin.guixsd.org'= ... 100.0% > Compiling Scheme modules... > warning: failed to load '(gnu tests web)': > ERROR: In procedure allocate-struct: Wrong type argument in position 2: 9 > Running 0 system tests... > TOTAL: 0 This (admittedly obscure) error is the symptom of an ABI breakage: specifically, commit b714395a39fffc60f75408504a23dfe27ad13fc2 introduced a couple of new fields to the record type, hence this error. The solution in this case is to =E2=80=9Crm -f gnu/*.go gnu/s*/*g.o && make= =E2=80=9D. HTH! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 22 13:57:44 2017 Received: (at 28283) by debbugs.gnu.org; 22 Sep 2017 17:57:44 +0000 Received: from localhost ([127.0.0.1]:53187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvSCt-000279-TU for submit@debbugs.gnu.org; Fri, 22 Sep 2017 13:57:44 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:44535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvSCs-00026u-JY for 28283@debbugs.gnu.org; Fri, 22 Sep 2017 13:57:42 -0400 Received: by mail-lf0-f49.google.com with SMTP id l196so1849951lfl.1 for <28283@debbugs.gnu.org>; Fri, 22 Sep 2017 10:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=ZuuI5ob65aZ0dz1uGRM3LSUplRIDrwz54WmmxB8KUJ4=; b=qFQttOxp/FcsGUGkpV8y4hkcamCTijb6QOAapd3tjZ8EH+h5Nndybt/qVgbd+R+e59 RO8rPxkPkp6U1hMw1/XG18tTTFkkuWkxklBK9yvGss535fXI7C7Tayfk2QPf1LjnAXzO DJ6fzraxc0asdAeOrlBGcFHn0p9EAfZfHQi3H4zbvmutG3vWFag5opmihYrckGHU3BJ6 a7z3nAAwMz6cgbhfKYOWN8dX0MebJphsy97L2/Xf/TUlaTD2uc2UNIXwfPfM+m+LBVbo zgFNKhWuGfngto1XJGA3YLDjugmuOApQReZGwHw9cgytnPlDAlt6i85uwdmEEhqzRVO9 o1Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=ZuuI5ob65aZ0dz1uGRM3LSUplRIDrwz54WmmxB8KUJ4=; b=pBNkLJ7wGDm2WaLX0RBlnU271werN5IKSuErcr1/x24z2rsQGMKvy9hclVH0NlQKIC g3mDtvSBvbhIfIKyujzeGHoGfIoxtfIJGvt6GL4SHHI5MLS9VjvGI2uNpTXfWFdkoOQ8 4IkxCwAelAoEDHakJ5FMWuAZyI8pP++9HSQ6f8H4a96ncXRu/MHS5xSmTAgU7KrLOM7w /BEcA4aHXtiTkYwFi2pef8JHn68sVrBvwsxDENr0/nSBlfeSYNUJPq/IDqhElOZU+Iob hbdILIeol7gUKSbePOGcjOX9y7CZxc+UXoIMDBlaTiQyEox/FMFRsd8pjQ25WtO7ddLY BmMw== X-Gm-Message-State: AHPjjUhw/nAHkfoUaACDRg3REW1fFu20f8ZKhHtlSJcTlj9vZqX+HPb/ hZYISKSInk81ZCEhO2kRnhhzqQ== X-Google-Smtp-Source: AOwi7QDyumlXQk24QHSy9lt1PA3vrc4lpm/HfBnaJOdSsSauVOzLflcm+rS3dSHcAQ5oHbzpIWpmog== X-Received: by 10.25.39.202 with SMTP id n193mr2554191lfn.131.1506103055967; Fri, 22 Sep 2017 10:57:35 -0700 (PDT) Received: from magnolia ([94.142.26.165]) by smtp.gmail.com with ESMTPSA id 65sm60405ljb.69.2017.09.22.10.57.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Sep 2017 10:57:34 -0700 (PDT) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> <87d16mv0o3.fsf@gnu.org> <87efr19fms.fsf@gmail.com> <87ingasvfx.fsf@gnu.org> Date: Fri, 22 Sep 2017 20:57:33 +0300 In-Reply-To: <87ingasvfx.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 22 Sep 2017 15:40:34 +0200") Message-ID: <87h8vuehv6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28283 Cc: 28283@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Hello Ludovic, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi Oleg, > > Oleg Pykhalov skribis: > >> ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> >>> Hello Oleg, >>> >>> This patch fell through the cracks. :-) >>> >>> Could you look into the comments I made below and send updated patches? >>> We=E2=80=99re almost there! >> >> Yes, I looked them already few days ago. Your last comment was about >> nginx changes. I'm working on it. But I have issue with stucture when >> I try to test. >> >> natsu@magnolia ~/src/guix$ guix environment guix -- make check-system TE= STS=3Dnginx >> ;;; note: source file /home/natsu/src/guix-wigust/wigust/packages/emacs.= scm >> ;;; newer than compiled /home/natsu/.cache/guile/ccache/2.2-LE-8-3= .A/home/natsu/src/guix-wigust/wigust/packages/emacs.scm.go >> substitute: updating list of substitutes from 'https://berlin.guixsd.org= '... 100.0% >> Compiling Scheme modules... >> warning: failed to load '(gnu tests web)': >> ERROR: In procedure allocate-struct: Wrong type argument in position 2: 9 >> Running 0 system tests... >> TOTAL: 0 > > This (admittedly obscure) error is the symptom of an ABI breakage: > specifically, commit b714395a39fffc60f75408504a23dfe27ad13fc2 introduced > a couple of new fields to the record type, hence this > error. Yes, I thought I did this. But I made this again today. Same error. > The solution in this case is to =E2=80=9Crm -f gnu/*.go gnu/s*/*g.o && ma= ke=E2=80=9D. > > HTH! > > Ludo=E2=80=99. After I made another Git working tree with Magit. --8<---------------cut here---------------start------------->8--- natsu@magnolia ~/src/guix-devel-nginx-test$ ./bootstrap=20 =E2=80=A6 natsu@magnolia ~/src/guix-devel-nginx-test$ ./configure --localstatedir=3D/= var --prefix=3D'' =E2=80=A6 natsu@magnolia ~/src/guix-devel-nginx-test$ guix environment guix --ad-hoc = help2man -- make =E2=80=A6 --8<---------------cut here---------------end--------------->8--- Then I added new field to record: --8<---------------cut here---------------start------------->8--- (define-record-type* =E2=80=A6 (try-files nginx-server-configuration-try-files (default '()))) --8<---------------cut here---------------end--------------->8--- Testing: --8<---------------cut here---------------start------------->8--- natsu@magnolia ~/src/guix-devel-nginx-test$ guix environment guix -- make c= heck-system TESTS=3Dnginx ;;; note: source file /home/natsu/src/guix-wigust/wigust/packages/emacs.scm ;;; newer than compiled /home/natsu/.cache/guile/ccache/2.2-LE-8-3.A/= home/natsu/src/guix-wigust/wigust/packages/emacs.scm.go Compiling Scheme modules... LOAD (gnu services web) ;;; note: source file ./gnu/services/web.scm ;;; newer than compiled /home/natsu/src/guix-devel-nginx-test/gnu/ser= vices/web.go GUILEC gnu/services/web.go warning: failed to load '(gnu tests web)': ERROR: In procedure allocate-struct: Wrong type argument in position 2: 9 Running 0 system tests... TOTAL: 0 --8<---------------cut here---------------end--------------->8--- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 22 17:38:28 2017 Received: (at 28283) by debbugs.gnu.org; 22 Sep 2017 21:38:28 +0000 Received: from localhost ([127.0.0.1]:53304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvVeV-0007Ev-TT for submit@debbugs.gnu.org; Fri, 22 Sep 2017 17:38:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvVeT-0007Ee-KE for 28283@debbugs.gnu.org; Fri, 22 Sep 2017 17:38:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvVeN-0006EM-DE for 28283@debbugs.gnu.org; Fri, 22 Sep 2017 17:38:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvVeN-0006EF-9V; Fri, 22 Sep 2017 17:38:19 -0400 Received: from [2a01:e0a:1d:7270:6a6c:dc17:fc02:cfda] (port=46300 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dvVeM-0003HP-NO; Fri, 22 Sep 2017 17:38:19 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> <87d16mv0o3.fsf@gnu.org> <87efr19fms.fsf@gmail.com> <87ingasvfx.fsf@gnu.org> <87h8vuehv6.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 1 =?utf-8?Q?Vend=C3=A9miaire?= an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 22 Sep 2017 23:38:16 +0200 In-Reply-To: <87h8vuehv6.fsf@gmail.com> (Oleg Pykhalov's message of "Fri, 22 Sep 2017 20:57:33 +0300") Message-ID: <87d16ibeif.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28283 Cc: 28283@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Oleg Pykhalov skribis: > Then I added new field to record: > > (define-record-type* > =E2=80=A6 > (try-files nginx-server-configuration-try-files > (default '()))) > > > Testing: > > natsu@magnolia ~/src/guix-devel-nginx-test$ guix environment guix -- make= check-system TESTS=3Dnginx > ;;; note: source file /home/natsu/src/guix-wigust/wigust/packages/emacs.s= cm > ;;; newer than compiled /home/natsu/.cache/guile/ccache/2.2-LE-8-3.= A/home/natsu/src/guix-wigust/wigust/packages/emacs.scm.go > Compiling Scheme modules... > LOAD (gnu services web) > ;;; note: source file ./gnu/services/web.scm > ;;; newer than compiled /home/natsu/src/guix-devel-nginx-test/gnu/s= ervices/web.go > GUILEC gnu/services/web.go > warning: failed to load '(gnu tests web)': > ERROR: In procedure allocate-struct: Wrong type argument in position 2: 9 > Running 0 system tests... It=E2=80=99s also a case where the ABI breaks, and thus dependent modules n= eed to be recompiled: =E2=80=9Crm gnu/tests/web.go && make=E2=80=9D. Does that make sense? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 29 10:05:29 2017 Received: (at 28283) by debbugs.gnu.org; 29 Sep 2017 14:05:29 +0000 Received: from localhost ([127.0.0.1]:39356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxvuy-0004ri-2a for submit@debbugs.gnu.org; Fri, 29 Sep 2017 10:05:29 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:45571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxvuv-0004rS-Ck for 28283@debbugs.gnu.org; Fri, 29 Sep 2017 10:05:26 -0400 Received: by mail-lf0-f44.google.com with SMTP id d17so286645lfe.2 for <28283@debbugs.gnu.org>; Fri, 29 Sep 2017 07:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version; bh=G5WjGlOOpQZqThJ5dtarCBycIRkdij69lNHckFjjOsE=; b=Px69+c5iUkSvALJMAQqNyQV/dqCYP6qubPlDEqaaHCEDag+KHNsEIkH3uCqTQr3ySu IVn40kaAdaCwRf0SpxTIJJMN4jZ0YD8x+9f0rhL7h7mDLJldGgjmw2xJbqZcYYwfXm+3 rSRPV2jjgu7Qv2wuI+k7ExxgvibkXAWrv8aFxcx6DeW7yMebqd+RZW0e6zEEi0d0vleI H+skNwuc3Od6XxtS2SFRZVXYd3AlNFKyiso2qqQRJCv4Lw/xCiLU3eDi8gYoGsEALPGp v+Fvf7EkLUq6x3Hm18Lhpa0rLrQBb+MK8YWTAiwhv3qsQyvofSGMlYNsH3zdeHxeXzJ3 pNpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :user-agent:mime-version; bh=G5WjGlOOpQZqThJ5dtarCBycIRkdij69lNHckFjjOsE=; b=DhMPXo0AOmVSya5a8gbFNyEUF3sH1koTJ19FRaaIcpnkdCC8Sl8+X+RHEsoJGNuXKC OC1NqKkHkTSZYm1H9ZILlNUNxy6ziPqKJYVHTGEKlnxH+fAB7MsNbNSodJFMrPqxCw3O CXGylwYdsfS4wPIvdPyRmQDVMgbqgPJk/sx9KbR8G3XQaz10EH87pYBz14WkbdCuvr+l VEKmTEN0j1Fn08PV64smTWeCkk/MbCrjCXOM+FQ6blihTABvwhgDcRcCxhGuUmMCD8KE 0QDQFxwCNVUXNyJnlorlSdcZOn8xT1h1vIpXmPRoqzDsScYz5+MdwiFEQEWFI1sNCNlz 8UwQ== X-Gm-Message-State: AMCzsaVt5O/EPbpc16Rn8ldzqR2D3y/mtr9sX+fq2iHWHOXCh2ckP1bh Pun18tIzk2ogWP3m0WrGyL8/cA== X-Google-Smtp-Source: AOwi7QApAygEEGtUinAhHNbMXEogYnOSlS5V2bjJdRUBn1FdSXlomFkqGGAbxkmpLjTME68dBtVOFQ== X-Received: by 10.25.211.205 with SMTP id k196mr1309719lfg.210.1506693918500; Fri, 29 Sep 2017 07:05:18 -0700 (PDT) Received: from magnolia (ppp91-122-126-162.pppoe.avangarddsl.ru. [91.122.126.162]) by smtp.gmail.com with ESMTPSA id p9sm796989lja.65.2017.09.29.07.05.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Sep 2017 07:05:17 -0700 (PDT) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> <87d16mv0o3.fsf@gnu.org> <87efr19fms.fsf@gmail.com> <87ingasvfx.fsf@gnu.org> <87h8vuehv6.fsf@gmail.com> <87d16ibeif.fsf@gnu.org> Date: Fri, 29 Sep 2017 17:05:16 +0300 Message-ID: <874lrlr46b.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28283 Cc: 28283@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Ludovic, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Oleg Pykhalov skribis: > >> Then I added new field to record: >> >> (define-record-type* >> =E2=80=A6 >> (try-files nginx-server-configuration-try-files >> (default '()))) >> >> >> Testing: >> >> natsu@magnolia ~/src/guix-devel-nginx-test$ guix environment guix -- mak= e check-system TESTS=3Dnginx >> ;;; note: source file /home/natsu/src/guix-wigust/wigust/packages/emacs.= scm >> ;;; newer than compiled /home/natsu/.cache/guile/ccache/2.2-LE-8-3= .A/home/natsu/src/guix-wigust/wigust/packages/emacs.scm.go >> Compiling Scheme modules... >> LOAD (gnu services web) >> ;;; note: source file ./gnu/services/web.scm >> ;;; newer than compiled /home/natsu/src/guix-devel-nginx-test/gnu/= services/web.go >> GUILEC gnu/services/web.go >> warning: failed to load '(gnu tests web)': >> ERROR: In procedure allocate-struct: Wrong type argument in position 2: 9 >> Running 0 system tests... > > It=E2=80=99s also a case where the ABI breaks, and thus dependent modules= need > to be recompiled: =E2=80=9Crm gnu/tests/web.go && make=E2=80=9D. > > Does that make sense? It does make, but doesn't work for me. Probably there were other *.go files which needed to delete. So, I made =E2=80=98make clean-go=E2=80=99 a= nd =E2=80=98make=E2=80=99. It was overkill of course. =E2=80=98try-files=E2=80=99 are in =E2=80=98=E2= =80=99 in origin/master now, https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D4d14808af4c01b4fb0a= 4564584aa68f0e53c4ef4 > Minor issues: > >> +@subsubheading cgit service > > Please capitalize titles: =E2=80=9CCgit Service=E2=80=9D Done. >> +@uref{https://git.zx2c4.com/cgit/, cgit} is a hyperfast web >> +frontend for git repositories written in C. > > =E2=80=9CGit=E2=80=9D, not =E2=80=9Cgit=E2=80=9D.=20=20 Done. > Also, not hypersuperlatives please. :-) Done. > So what about this: > > @uref{https://git.zx2c4.com/cgit/, cgit} is a Web interface to Git > repositories, written in C. It allows users to look at Git > repository contents and history through their Web browsers. > >> +The following example will configure the service with default values. >> +By default, cgit can be accessed on port 80 (@code{http://localhost:80}= ). >> + >> +@example >> +(service nginx-service-type) >> +(service fcgiwrap-service-type) >> +(service cgit-service-type) >> +@end example > > Please add a sentence above or below the example like =E2=80=9CThis examp= le > shows =E2=80=A6=E2=80=9D. Sorry, I don't understand what do you mean. There is a sentence above example that answers a question =E2=80=9CWhat does example do?=E2=80=9D and= I guess =E2=80=9CWhat does example show?=E2=80=9D. >> +@table @asis >> +@item @code{css} (default: @code{"/share/cgit/cgit.css"}) >> +Url which specifies the css document to include in all cgit pages. >> + >> +@item @code{logo} (default: @code{"/share/cgit/cgit.png"}) >> +Url which specifies the source of an image which will be used as a logo >> +on all cgit pages. >> + >> +@item @code{virtual-root} (default: @code{"/"}) >> +Url which, if specified, will be used as root for all cgit links. > > s/Url/URL/ Done. >> +@item @code{scan-path} (default: @code{"/srv/git"}) >> +A path which will be scanned for repositories. > > Rather: =E2=80=9CName of the directory to scan for repositories.=E2=80=9D Done. > Can you also rename =E2=80=98scan-path=E2=80=99 to =E2=80=98repository-di= rectory=E2=80=99 or something > like that? (Not =E2=80=9Cpath.=E2=80=9D) Done. >> +@item @code{robots} (default: @code{(list "noindex" "nofollow")}) >> +Text used as content for the "robots" meta-tag. > > Write ``robots'' (literally) so that Texinfo typesets things correctly. Done. >> --- a/gnu/services/web.scm >> +++ b/gnu/services/web.scm >> @@ -99,6 +99,8 @@ >> (default '())) >> (index nginx-server-configuration-index >> (default (list "index.html"))) >> + (try-files nginx-server-configuration-try-files >> + (default #f)) >> (ssl-certificate nginx-server-configuration-ssl-certificate >> (default "/etc/nginx/cert.pem")) >> (ssl-certificate-key nginx-server-configuration-ssl-certificate-key >> @@ -179,6 +181,7 @@ of index files." >> (nginx-server-configuration-ssl-certificate-key server)) >> (root (nginx-server-configuration-root server)) >> (index (nginx-server-configuration-index server)) >> + (try-files (nginx-server-configuration-try-files server)) >> (server-tokens? (nginx-server-configuration-server-tokens? serv= er)) >> (locations (nginx-server-configuration-locations server))) >> (define-syntax-parameter <> (syntax-rules ())) >> @@ -207,6 +210,7 @@ of index files." >> (and/l ssl-certificate-key " ssl_certificate_key " <> ";\n") >> " root " root ";\n" >> " index " (config-index-strings index) ";\n" >> + " try_files " (config-index-strings try-files) ";\n" >> " server_tokens " (if server-tokens? "on" "off") ";\n" >> "\n" >> (map emit-nginx-location-config locations) > > Could you submit these nginx changes separately for discussion? We=E2=80= =99ll > also need to document them. Maybe Cc Chris Baines and other nginx > people. Done with Julien Lepiller. Attached a new patch. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-services-version-control-Add-cgit.patch Content-Description: gnu/services/version-control.scm >From 64b328c90fbaedca4b081fb33af6e3dbae27eeb6 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Thu, 28 Sep 2017 20:02:35 +0300 Subject: [PATCH] gnu: services: version-control: Add cgit. * gnu/services/version-control.scm (, ): New record types. (cgit-configuration-robots-string, cgit-activation, cgit-configuration-nginx-config): New procedures. (%cgit-configuration-nginx, cgit-service-type): New variables. * doc/guix.texi (Version Control): Document the cgit service. --- doc/guix.texi | 63 ++++++++++++++++++++++ gnu/services/version-control.scm | 109 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 171 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 1b329d255..4bdbe4b70 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17000,6 +17000,69 @@ Extra options will be passed to @code{git daemon}, please run @end table @end deftp +@subsubheading Cgit service + +@uref{https://git.zx2c4.com/cgit/, Cgit} is a web frontend for Git +repositories written in C. + +The following example will configure the service with default values. +By default, Cgit can be accessed on port 80 (@code{http://localhost:80}). + +@example +(service nginx-service-type) +(service fcgiwrap-service-type) +(service cgit-service-type) +@end example + +@deftp {Data Type} cgit-configuration +Data type representing the configuration of Cgit. +This type has the following parameters: + +@table @asis +@item @code{config-file} (default: @code{(cgit-configuration-file)}) +The configuration file to use for Cgit. This can be set to a +@dfn{cgit-configuration-file} record value, or any gexp +(@pxref{G-Expressions}). + +For example, to instead use a local file, the @code{local-file} function +can be used: + +@example +(service cgit-service-type + (cgit-configuration + (config-file (local-file "./my-cgitrc.conf")))) +@end example + +@item @code{package} (default: @code{cgit}) +The Cgit package to use. + +@end table +@end deftp + +@deftp {Data Type} cgit-configuration-file +Data type representing the configuration options for Cgit. +This type has the following parameters: + +@table @asis +@item @code{css} (default: @code{"/share/cgit/cgit.css"}) +URL which specifies the css document to include in all Cgit pages. + +@item @code{logo} (default: @code{"/share/cgit/cgit.png"}) +URL which specifies the source of an image which will be used as a logo +on all Cgit pages. + +@item @code{virtual-root} (default: @code{"/"}) +URL which, if specified, will be used as root for all Cgit links. + +@item @code{repository-directory} (default: @code{"/srv/git"}) +Name of the directory to scan for repositories. + +@item @code{robots} (default: @code{(list "noindex" "nofollow")}) +Text used as content for the ``robots'' meta-tag. + +@end table +@end deftp + @node Setuid Programs @subsection Setuid Programs diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm index 107bc8e77..50b09c0ce 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -21,18 +21,40 @@ #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services shepherd) + #:use-module (gnu services web) #:use-module (gnu system shadow) #:use-module (gnu packages version-control) #:use-module (gnu packages admin) #:use-module (guix records) #:use-module (guix gexp) + #:use-module (guix store) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 match) #:export (git-daemon-service git-daemon-service-type git-daemon-configuration - git-daemon-configuration?)) + git-daemon-configuration? + + + cgit-configuration-file + cgit-configuration-file? + cgit-configuration-file-css + cgit-configuration-file-logo + cgit-configuration-file-robots + cgit-configuration-file-virtual-root + cgit-configuration-file-scan-path + + + cgit-configuration + cgit-configuration? + cgit-configuration-config-file + cgit-configuration-package + + %cgit-configuration-nginx + cgit-configuration-nginx-config + + cgit-service-type)) ;;; Commentary: ;;; @@ -139,3 +161,88 @@ The optional @var{config} argument should be a @code{} object, by default it allows read-only access to exported repositories under @file{/srv/git}." (service git-daemon-service-type config)) + + +;;; +;;; Cgit +;;; + +(define-record-type* + cgit-configuration-file make-cgit-configuration-file + cgit-configuration-file? + (css cgit-configuration-file-css + (default "/share/cgit/cgit.css")) + (logo cgit-configuration-file-logo + (default "/share/cgit/cgit.png")) + (robots cgit-configuration-file-robots + (default '("noindex" "nofollow"))) + (virtual-root cgit-configuration-file-virtual-root + (default "/")) + (repository-directory cgit-configuration-file-repository-directory + (default "/srv/git"))) + +(define (cgit-configuration-robots-string robots) + (string-join robots ", ")) + +(define-gexp-compiler (cgit-configuration-file-compiler + (file ) system target) + (match file + (($ css logo + robots virtual-root repository-directory) + (text-file + "cgitrc" + (string-concatenate + (filter-map + (match-lambda + ((key . #f) #f) + ((key . value) (string-append key "=" value "\n"))) + `(("css" . ,css) + ("logo" . ,logo) + ("robots" . ,(cgit-configuration-robots-string robots)) + ("virtual-root" . ,virtual-root) + ("repository-directory" . ,repository-directory)))))))) + +(define %cgit-configuration-nginx + (list + (nginx-server-configuration + (root cgit) + (locations + (list + (nginx-location-configuration + (uri "@cgit") + (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;" + "fastcgi_param PATH_INFO $uri;" + "fastcgi_param QUERY_STRING $args;" + "fastcgi_param HTTP_HOST $server_name;" + "fastcgi_pass 127.0.0.1:9000;"))))) + (try-files (list "$uri" "@cgit")) + (https-port #f) + (ssl-certificate #f) + (ssl-certificate-key #f)))) + +(define-record-type* + cgit-configuration make-cgit-configuration + cgit-configuration? + (config-file cgit-configuration-config-file + (default (cgit-configuration-file))) + (package cgit-configuration-package + (default cgit)) + (nginx cgit-configuration-nginx + (default %cgit-configuration-nginx))) + +(define (cgit-activation config) + ;; Cgit compiled with default configuration path + #~(copy-file #$(cgit-configuration-config-file config) "/etc/cgitrc")) + +(define (cgit-configuration-nginx-config config) + (cgit-configuration-nginx config)) + +(define cgit-service-type + (service-type + (name 'cgit) + (extensions + (list (service-extension activation-service-type + cgit-activation) + (service-extension nginx-service-type + cgit-configuration-nginx-config))) + (default-value (cgit-configuration)))) -- 2.14.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I also wrote a test, but I don't understand why Cgit cannot find test repository. ;;; (response (404 "=E2=80=A6No repositories found=E2=80=A6")) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=version-control.scm Content-Transfer-Encoding: quoted-printable Content-Description: gnu/tests/version-control.scm ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2017 Oleg Pykhalov ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu tests version-control) #:use-module (gnu tests) #:use-module (gnu system) #:use-module (gnu system file-systems) #:use-module (gnu system shadow) #:use-module (gnu system vm) #:use-module (gnu services) #:use-module (gnu services version-control) #:use-module (gnu services web) #:use-module (gnu services networking) #:use-module (gnu packages version-control) #:use-module (guix gexp) #:use-module (guix store) #:export (%test-cgit)) (define %make-git-repository ;; Create Git repository in /srv/git/test. #~(begin (mkdir-p "/srv/git/test") (system* (string-append #$git "/bin/git") "-C" "/srv/git/test" "init"= ))) (define %cgit-configuration-nginx (list (nginx-server-configuration (root cgit) (locations (list (nginx-location-configuration (uri "@cgit") (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.= cgi;" "fastcgi_param PATH_INFO $uri;" "fastcgi_param QUERY_STRING $args;" "fastcgi_param HTTP_HOST $server_name;" "fastcgi_pass 127.0.0.1:9000;"))))) (try-files (list "$uri" "@cgit")) (http-port 19418) (https-port #f) (ssl-certificate #f) (ssl-certificate-key #f)))) (define %cgit-os ;; Operating system under test. (let ((base-os (simple-operating-system (dhcp-client-service) (service nginx-service-type) (service fcgiwrap-service-type) (service cgit-service-type (cgit-configuration (nginx %cgit-configuration-nginx))) (simple-service 'make-git-repository activation-service-type %make-git-repository)))) (operating-system (inherit base-os) (packages (cons* git (operating-system-packages base-os)))))) (define* (run-cgit-test #:optional (http-port 19418)) "Run tests in %CGIT-OS, which has nginx running and listening on HTTP-PORT." (define os (marionette-operating-system %cgit-os #:imported-modules '((gnu services herd) (guix combinators)))) (define vm (virtual-machine (operating-system os) (port-forwardings `((8080 . ,http-port))))) (define test (with-imported-modules '((gnu build marionette)) #~(begin (use-modules (srfi srfi-11) (srfi srfi-64) (gnu build marionette) (web uri) (web client) (web response)) (define marionette (make-marionette (list #$vm))) (mkdir #$output) (chdir #$output) (test-begin "cgit") ;; Wait for nginx to be up and running. (test-eq "service running" 'running! (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'nginx) 'running!) marionette)) ;; Wait for fcgiwrap to be up and running. (test-eq "service running" 'running! (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'fcgiwrap) 'running!) marionette)) ;; Make sure the PID file is created. (test-assert "PID file" (marionette-eval '(file-exists? "/var/run/nginx/pid") marionette)) ;; Make sure the configuration file is created. (test-assert "Configuration file" (marionette-eval '(file-exists? "/etc/cgitrc") marionette)) ;; Make sure Git test repository is created. (test-assert "Git test repository" (marionette-eval '(file-exists? "/srv/git/test/.git") marionette)) ;; Retrieve the index.html file we put in /srv. (test-equal "http-get" '(200) (let-values (((response text) (http-get "http://localhost:8080" #:decode-body? #t))) ;; TODO Leave only response-code. (pk 'response (list (response-code response) text)))) (test-end) (exit (=3D (test-runner-fail-count (test-runner-current)) 0))))) (gexp->derivation "cgit-test" test)) (define %test-cgit (system-test (name "cgit") (description "Connect to a running CGIT server.") (value (run-cgit-test)))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I wish to make a VM with =E2=80=98guix system vm gnu/tests/version-control.= scm=E2=80=99, but it's not working. It also doesn't work for =E2=80=98gnu/tests/web.scm= =E2=80=99 and =E2=80=98gnu/tests/rsync.scm=E2=80=99. But I sure it worked with =E2=80=98= gnu/tests/rsync.scm=E2=80=99. --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix system vm gnu/tests/web.scm Backtrace: 5 (primitive-load "/gnu/store/zh0lb2g15hirq7zw2477w7s5ww7dxkv0-g= uix-0.=E2=80=A6") In guix/ui.scm: 1375:12 4 (run-guix-command _ . _) In ice-9/boot-9.scm: 837:9 3 (catch _ _ # _) 837:9 2 (catch _ _ # =E2=80=A6) In guix/scripts/system.scm: 1034:8 1 (_) 904:28 0 (process-action vm _ ((argument . "gnu/tests/web.scm") (action= . #) =E2=80=A6)) guix/scripts/system.scm:904:28: In procedure process-action: guix/scripts/system.scm:904:28: In procedure struct_vtable: Wrong type argu= ment in position 1 (expecting struct): # --8<---------------cut here---------------end--------------->8--- Then I prepared a VM declaration in system-cgit.scm. It works and I got response 200. So, I have no idea why test fails. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=system-cgit.scm Content-Description: system-cgit.scm ;; This is an operating system configuration template ;; for a "bare bones" setup, with no X11 display server. (use-modules (gnu)) (use-service-modules networking version-control web) (use-package-modules curl version-control) (define %make-git-repository ;; Create Git repository in /srv/git/test. #~(begin (mkdir-p "/srv/git/test") (system* (string-append #$git "/bin/git") "-C" "/srv/git/test" "init"))) (define %cgit-configuration-nginx (list (nginx-server-configuration (root cgit) (locations (list (nginx-location-configuration (uri "@cgit") (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;" "fastcgi_param PATH_INFO $uri;" "fastcgi_param QUERY_STRING $args;" "fastcgi_param HTTP_HOST $server_name;" "fastcgi_pass 127.0.0.1:9000;"))))) (try-files (list "$uri" "@cgit")) (http-port 19418) (https-port #f) (ssl-certificate #f) (ssl-certificate-key #f)))) (operating-system (host-name "komputilo") (timezone "Europe/Moscow") (locale "en_US.utf8") ;; Assuming /dev/sdX is the target hard disk, and "my-root" is ;; the label of the target root file system. (bootloader (grub-configuration (target "/dev/sda") (terminal-outputs '(console)))) (file-systems (cons (file-system (device "my-root") (title 'label) (mount-point "/") (type "ext4")) %base-file-systems)) ;; This is where user accounts are specified. The "root" ;; account is implicit, and is initially created with the ;; empty password. (users (cons (user-account (name "alice") (comment "Bob's sister") (group "users") ;; Adding the account to the "wheel" group ;; makes it a sudoer. Adding it to "audio" ;; and "video" allows the user to play sound ;; and access the webcam. (supplementary-groups '("wheel" "audio" "video")) (home-directory "/home/alice")) %base-user-accounts)) (packages (cons* git curl %base-packages)) ;; Add services to the baseline: a DHCP client and ;; an SSH server. (services (cons* (dhcp-client-service) (service nginx-service-type) (service fcgiwrap-service-type) (service cgit-service-type (cgit-configuration (nginx %cgit-configuration-nginx))) (simple-service 'make-git-repository activation-service-type %make-git-repository) %base-services))) --=-=-= Content-Type: text/plain Thanks for review! --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 01 17:55:33 2017 Received: (at 28283) by debbugs.gnu.org; 1 Oct 2017 21:55:34 +0000 Received: from localhost ([127.0.0.1]:43173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dymCv-0007sR-HA for submit@debbugs.gnu.org; Sun, 01 Oct 2017 17:55:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dymCu-0007sE-4n for 28283@debbugs.gnu.org; Sun, 01 Oct 2017 17:55:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dymCn-0007pC-Ae for 28283@debbugs.gnu.org; Sun, 01 Oct 2017 17:55:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dymCn-0007o9-2u; Sun, 01 Oct 2017 17:55:21 -0400 Received: from [2a01:e0a:1d:7270:6a6c:dc17:fc02:cfda] (port=32886 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dymCl-00029p-So; Sun, 01 Oct 2017 17:55:20 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> <87d16mv0o3.fsf@gnu.org> <87efr19fms.fsf@gmail.com> <87ingasvfx.fsf@gnu.org> <87h8vuehv6.fsf@gmail.com> <87d16ibeif.fsf@gnu.org> <874lrlr46b.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 =?utf-8?Q?Vend=C3=A9miaire?= an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 01 Oct 2017 23:55:16 +0200 In-Reply-To: <874lrlr46b.fsf@gmail.com> (Oleg Pykhalov's message of "Fri, 29 Sep 2017 17:05:16 +0300") Message-ID: <871smmr0sb.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28283 Cc: 28283@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Oleg, Oleg Pykhalov skribis: > =E2=80=98try-files=E2=80=99 are in =E2=80=98= =E2=80=99 in origin/master now, > https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D4d14808af4c01b4fb= 0a4564584aa68f0e53c4ef4 Awesome. >> Please add a sentence above or below the example like =E2=80=9CThis exam= ple >> shows =E2=80=A6=E2=80=9D. > > Sorry, I don't understand what do you mean. There is a sentence above > example that answers a question =E2=80=9CWhat does example do?=E2=80=9D a= nd I guess > =E2=80=9CWhat does example show?=E2=80=9D. Oops you=E2=80=99re right, sorry for overlooking this. > From 64b328c90fbaedca4b081fb33af6e3dbae27eeb6 Mon Sep 17 00:00:00 2001 > From: Oleg Pykhalov > Date: Thu, 28 Sep 2017 20:02:35 +0300 > Subject: [PATCH] gnu: services: version-control: Add cgit. > > * gnu/services/version-control.scm > (, ): New record types. > (cgit-configuration-robots-string, cgit-activation, > cgit-configuration-nginx-config): New procedures. > (%cgit-configuration-nginx, cgit-service-type): New variables. > * doc/guix.texi (Version Control): Document the cgit service. [...] > +(define-gexp-compiler (cgit-configuration-file-compiler > + (file ) system target) > + (match file > + (($ css logo > + robots virtual-root repository-directo= ry) > + (text-file > + "cgitrc" > + (string-concatenate > + (filter-map > + (match-lambda > + ((key . #f) #f) > + ((key . value) (string-append key "=3D" value "\n"))) > + `(("css" . ,css) > + ("logo" . ,logo) > + ("robots" . ,(cgit-configuration-robots-string robots)) > + ("virtual-root" . ,virtual-root) > + ("repository-directory" . ,repository-directory)))))))) I changed this part like this so that things work as expected if we pass items that live in the store (along with other changes): --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/doc/guix.texi b/doc/guix.texi index 4bdbe4b70..d5abf900a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17000,8 +17000,10 @@ Extra options will be passed to @code{git daemon},= please run @end table @end deftp =20 -@subsubheading Cgit service +@subsubheading Cgit Service =20 +@cindex Cgit service +@cindex Git, web interface @uref{https://git.zx2c4.com/cgit/, Cgit} is a web frontend for Git repositories written in C. =20 diff --git a/gnu/services/version-control.scm b/gnu/services/version-contro= l.scm index 50b09c0ce..208351447 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2016 ng0 ;;; Copyright =C2=A9 2016 Sou Bunnbu +;;; Copyright =C2=A9 2017 Oleg Pykhalov ;;; ;;; This file is part of GNU Guix. ;;; @@ -189,18 +190,23 @@ access to exported repositories under @file{/srv/git}= ." (match file (($ css logo robots virtual-root repository-directory) - (text-file - "cgitrc" - (string-concatenate - (filter-map - (match-lambda - ((key . #f) #f) - ((key . value) (string-append key "=3D" value "\n"))) - `(("css" . ,css) - ("logo" . ,logo) - ("robots" . ,(cgit-configuration-robots-string robots)) - ("virtual-root" . ,virtual-root) - ("repository-directory" . ,repository-directory)))))))) + (apply text-file* "cgitrc" + (letrec-syntax ((option (syntax-rules () + ((_ key value) + (if value + `(,key "=3D" ,value) + '())))) + (key/value (syntax-rules () + ((_ (key value) rest ...) + (append (option key value) + (key/value rest ...))) + ((_) + '())))) + (key/value ("css" css) + ("logo" logo) + ("robots" (cgit-configuration-robots-string robot= s)) + ("virtual-root" virtual-root) + ("repository-directory" repository-directory)))))= )) =20 (define %cgit-configuration-nginx (list --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I looked at the test failures, and I wonder if everything=E2=80=99s working= as intended. What I did for debugging was: --8<---------------cut here---------------start------------->8--- $ guix gc -R /gnu/store/i71plcn5y8b29nc59s5d7m2cx810ki6n-cgit-test.drv |gr= ep run-vm /gnu/store/v9s4ai0dvgvmga6lyj4z2733lavr3acl-run-vm.sh-builder /gnu/store/6a2l7mcshdzc38zj8nkinjlzqmgjnx3b-run-vm.sh.drv $ guix build /gnu/store/6a2l7mcshdzc38zj8nkinjlzqmgjnx3b-run-vm.sh.drv /gnu/store/igjg0i4d3sj77jpgppn09r66jql6nliw-run-vm.sh $ /gnu/store/igjg0i4d3sj77jpgppn09r66jql6nliw-run-vm.sh -serial stdio =E2=80=A6 --8<---------------cut here---------------end--------------->8--- Then I experimented with w3m inside the VM. Apparently some URLs are being rewritten, with /cgit.cgi/cgit.cgi/cgit.cgi/=E2=80=A6 and so on, which looks weird. Could you investigate more in a VM (you can simply use =E2=80=98guix system= vm=E2=80=99 with a config similar to that of the test) to see what=E2=80=99s going on? Looks like we=E2=80=99re almost there, but I=E2=80=99d feel more confident = if we could get a test running. :-) Thank you! Ludo=E2=80=99. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 03 02:22:32 2017 Received: (at 28283) by debbugs.gnu.org; 3 Oct 2017 06:22:32 +0000 Received: from localhost ([127.0.0.1]:44985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzGb9-0003oa-V2 for submit@debbugs.gnu.org; Tue, 03 Oct 2017 02:22:32 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:52253) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzGb8-0003oL-Aa for 28283@debbugs.gnu.org; Tue, 03 Oct 2017 02:22:31 -0400 Received: by mail-lf0-f48.google.com with SMTP id b127so8439296lfe.9 for <28283@debbugs.gnu.org>; Mon, 02 Oct 2017 23:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=VheSrUsEgd409QCuIRK4lf9adzk/cK83PBE2EJqfYuQ=; b=EWcmeThN3cQKjATVouENEY7Z5B4i6IWgp7BPHXscX/pqx23UQnL3BbJOgchFPJDO1G hUMdTHyUgijzlhHsbjk6CePnxY3bue9+l6io8VrYvX5NaUUiBdie1/oFwh6y8j/k/ANj gYXG2VIc+3nH2cXpQ32dUQXPtyLABu7v7GfBwhK78MKzY0GCs2rOB74Awg/kwqcIX0AI EbO90MZcyhEzC5A/T0boTlyvuOke/cbmhYj+NwHBo029rXAAepVsTDXMq+4SGE8xgZjN g//xr5VTAUk1RsrKY3QyQTYI2WROG1v8MQNncy2t0YHPY+16PxChvKoVQ28AMXEGmLYK bfng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=VheSrUsEgd409QCuIRK4lf9adzk/cK83PBE2EJqfYuQ=; b=AfS4ThsQeWDxCCZDuxf7vJK5sigRqdRvuKhnlEIneH+sohfZCMuLF3IOGhmKI1YLTk hTa6fDaR31BKCwLV07d4svUMSqlNTgp5uCv8P1+UybTd/gxqUmJY8sfiNiLeKOLLEDTt qIlY4pt3kE+xcCftBdjX2PdcJpTtBfT2T+KV9JiI17A3uz0V8sCBPYaijT5zLZklCAq5 8zz+XJx5WvLazY9/gGHKv0CZBQNhpBv5pTftHhMG5joWPhn4QTejj1qxGCDH5BabH/qV szeyQtGqYECDZ2n45eqCKXo0edQeZaDnnVhRgVxJ3eWRR6IBDEy1P7xSOlHyexowJvbG oygg== X-Gm-Message-State: AMCzsaV3VrjkL5NBFRJ9Ja3t3a2ahKMQn1Bhq/4bhhSWW8tv+9DUn047 /EGXFt8Pp1NM20FIEdLCXm711g== X-Google-Smtp-Source: AOwi7QARwrkVNJ4kEPWpjEgZ7HmZoqll+Hj5pD5rAceqLorariknXPT6kihDuKx07LEMxWE0xpHdmA== X-Received: by 10.25.67.75 with SMTP id m11mr4634575lfj.69.1507011743930; Mon, 02 Oct 2017 23:22:23 -0700 (PDT) Received: from magnolia ([178.71.70.176]) by smtp.gmail.com with ESMTPSA id k37sm106285lfi.27.2017.10.02.23.22.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Oct 2017 23:22:22 -0700 (PDT) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> <87d16mv0o3.fsf@gnu.org> <87efr19fms.fsf@gmail.com> <87ingasvfx.fsf@gnu.org> <87h8vuehv6.fsf@gmail.com> <87d16ibeif.fsf@gnu.org> <874lrlr46b.fsf@gmail.com> <871smmr0sb.fsf@gnu.org> Date: Tue, 03 Oct 2017 09:22:08 +0300 In-Reply-To: <871smmr0sb.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 01 Oct 2017 23:55:16 +0200") Message-ID: <87wp4cbvjj.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28283 Cc: 28283@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Ludovic, ludo@gnu.org (Ludovic Court=C3=A8s) writes: [...] > I changed this part like this so that things work as expected if we pass > items that live in the store (along with other changes): [...] Thanks. But we need to add newline character. Otherwise cgitrc config will be in one line. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm index 208351447..8666648c0 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -194,7 +194,7 @@ access to exported repositories under @file{/srv/git}." (letrec-syntax ((option (syntax-rules () ((_ key value) (if value - `(,key "=" ,value) + `(,key "=" ,value "\n") '())))) (key/value (syntax-rules () ((_ (key value) rest ...) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > $ guix gc -R /gnu/store/i71plcn5y8b29nc59s5d7m2cx810ki6n-cgit-test.drv |= grep run-vm > /gnu/store/v9s4ai0dvgvmga6lyj4z2733lavr3acl-run-vm.sh-builder > /gnu/store/6a2l7mcshdzc38zj8nkinjlzqmgjnx3b-run-vm.sh.drv > $ guix build /gnu/store/6a2l7mcshdzc38zj8nkinjlzqmgjnx3b-run-vm.sh.drv > /gnu/store/igjg0i4d3sj77jpgppn09r66jql6nliw-run-vm.sh > $ /gnu/store/igjg0i4d3sj77jpgppn09r66jql6nliw-run-vm.sh -serial stdio Awesome, this is what I'm searching for. > Then I experimented with w3m inside the VM. > > Apparently some URLs are being rewritten, with > /cgit.cgi/cgit.cgi/cgit.cgi/=E2=80=A6 and so on, which looks weird. > > Could you investigate more in a VM (you can simply use =E2=80=98guix syst= em vm=E2=80=99 > with a config similar to that of the test) to see what=E2=80=99s going on? > Looks like we=E2=80=99re almost there, but I=E2=80=99d feel more confiden= t if we could > get a test running. :-) I think this was because of one line cgitrc config. I have some issues with testing in VM again. $ /gnu/store/igjg0i4d3sj77jpgppn09r66jql6nliw-run-vm.sh -net user,hostfwd= =3Dtcp::10080-:19418 -serial stdio will freeze most of time without `sudo'. If I use `sudo' then I could open site in Icecat, but after several seconds only =E2=80=9CThe connection= was reset=E2=80=9D. $ curl http://localhost:10080 curl: (52) Empty reply from server Also `marionette' service is too much respawning and then dies according to `herd status' --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 03 02:31:35 2017 Received: (at 28283) by debbugs.gnu.org; 3 Oct 2017 06:31:35 +0000 Received: from localhost ([127.0.0.1]:44993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzGju-00045E-TQ for submit@debbugs.gnu.org; Tue, 03 Oct 2017 02:31:35 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:43788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzGjt-00044z-6c for 28283@debbugs.gnu.org; Tue, 03 Oct 2017 02:31:33 -0400 Received: by mail-lf0-f48.google.com with SMTP id o125so3869101lfe.0 for <28283@debbugs.gnu.org>; Mon, 02 Oct 2017 23:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=SaBBsPJLmIzVIC9jFBwZvwJpxtVBrj9ja8Z6IC60wTw=; b=JvUl66RAqL8RZPMnRaruU4l0ITClS/KOqummm0OdQWQtNI3ETCblczJlEH9R94oynK WgiFMTwosVxpMO1EWd4jwgcNQhQ2Qp4A7I+mxQHQ5kFasYcOaejLK/n5dHa6IWbFVbsp ztHctpjQf7QR06fcPGsAjNr2j8TTMn7bmX9zDl9hpiSe8lOWL7fhBD+NBqxBudnU0F7Z UnTtv2ZBWQfcZKDW+S52pumDjT+jCiNxcwwYGfQ3n8JirRTzxFrDEvWeORi2Z/ZeXtJ2 tV/DSX3ov9G2Aj7qEeluaNiBFPdol9r7cWR8joXaWkxO67NhxMevsEJtm8qNhGlWyuAs sKgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=SaBBsPJLmIzVIC9jFBwZvwJpxtVBrj9ja8Z6IC60wTw=; b=Q5sm3FNnBEFMn94x/FzYn/FQC7oqRUMHpFrm9u8rGTGH8Wdl9r7lO3iMB/r0QYsVvK IfZ6os8oL6OCAAAI01/JU8HgFMkWsl3It5Zw4HGV8ujagjhhHs92Ik30gcrHFGcwKGMq HYjVya7fqdIFOXE8iZ/qoukpI8lbT/4LK86ZPonVtTDew9eFouChRohAG0bCD1REnY/j l/w1LEBeeZazDerDb7LSvnEPyeuTO6bIxEyWCQVC52jhTJXilOdzXhObVpO49pvZYrGw hXbG1troDpOV2iYcAKZtKw2Wzx10NotgxIdMpDY7jyGWdFqihDe+0Go30GYjpt1dbUWj X+RA== X-Gm-Message-State: AHPjjUgiA4dlINjoQ9I6BZf5kb4BuzjLpyipwzlB0btYOrp7e8W7mwuM qISfWv2YLYbucDfKJj0qh2dGVQ== X-Google-Smtp-Source: AOwi7QAc/31DQxZ4lFAdujd29wXulqKFHWYMMTsv5XdN3gW8Gtk2QKaEfdwwXXPmXP6USwILxmN2Dg== X-Received: by 10.46.64.4 with SMTP id n4mr8777353lja.33.1507012287022; Mon, 02 Oct 2017 23:31:27 -0700 (PDT) Received: from magnolia ([178.71.70.176]) by smtp.gmail.com with ESMTPSA id d24sm1497619lfc.85.2017.10.02.23.31.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Oct 2017 23:31:26 -0700 (PDT) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> <87d16mv0o3.fsf@gnu.org> <87efr19fms.fsf@gmail.com> <87ingasvfx.fsf@gnu.org> <87h8vuehv6.fsf@gmail.com> <87d16ibeif.fsf@gnu.org> <874lrlr46b.fsf@gmail.com> <871smmr0sb.fsf@gnu.org> <87wp4cbvjj.fsf@gmail.com> Date: Tue, 03 Oct 2017 09:31:25 +0300 In-Reply-To: <87wp4cbvjj.fsf@gmail.com> (Oleg Pykhalov's message of "Tue, 03 Oct 2017 09:22:08 +0300") Message-ID: <87tvzgbv42.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28283 Cc: 28283@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Oleg Pykhalov writes: [...] > $ /gnu/store/igjg0i4d3sj77jpgppn09r66jql6nliw-run-vm.sh -net user,hostfwd= =3Dtcp::10080-:19418 -serial stdio > > will freeze most of time without `sudo'. If I use `sudo' then I could > open site in Icecat, but after several seconds only =E2=80=9CThe connecti= on was > reset=E2=80=9D. Ah, I forgot about that VM build from test already has one `=E2=80=A6-net user,hostfwd=3Dtcp::8080-:19418=E2=80=A6'. This is probably why I have this issue. [...] From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 03 03:30:29 2017 Received: (at 28283) by debbugs.gnu.org; 3 Oct 2017 07:30:29 +0000 Received: from localhost ([127.0.0.1]:45035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzHer-0005jZ-3q for submit@debbugs.gnu.org; Tue, 03 Oct 2017 03:30:28 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:50927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzHen-0005jG-0B for 28283@debbugs.gnu.org; Tue, 03 Oct 2017 03:30:23 -0400 Received: by mail-lf0-f49.google.com with SMTP id a132so481796lfa.7 for <28283@debbugs.gnu.org>; Tue, 03 Oct 2017 00:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-disposition :content-transfer-encoding; bh=cCQ7P/sgP89Ov3siEFsUllsevUpLOFJBUxYEmTCWV8k=; b=bv5JI8g2yshPLjiM/GPLdEcnt8uTXsvsq7OVjG2Xcxl8AmucDIXeNZoZkk5bb+rm/x druDmlsIvLy2TYYL9zbpAkLKJZpPpDjW/gvVdq+RSJec1coW0tZEW6ElVp7zvGmiJ5VA mF2Ew0Ji0B07P8NgDJoWxxfdaEh6fI2AzDLheDAmBaHxKXROBfgBJaPvasNX1oYu48Ui B+ELFEaE3rHWgVyZk7HAzFvyPMuaCaR2BNzXcyNMwjV5+Z0Y9xdPRvGk9hVdSBJVC5g5 lArJjyrF1QanIX6VLZjdZE7U6txeUPiEOeotONmTkuUU67ggh8lJyyCnq6B0vR6BO6YG G1aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-disposition :content-transfer-encoding; bh=cCQ7P/sgP89Ov3siEFsUllsevUpLOFJBUxYEmTCWV8k=; b=AH7IaViui5IALfXvgso6RNtLb5S1aQpcOlfX/6hxCvzgi2M6m6NjLXvsNYQ5gw8mG3 rgwiDVcoPYy5sNMDbZ2gGc8rMfg8ae5H0eCfkJbxAuh4Tljm/rSxv5Np5EQt1Qz4cayI cthIxjulowQ88LGyMo0RY2HjKOE/cE/LVI3ngsu1RIHCGuubh55ZHOQiIjpTOuX+Olzw 2xThhjogidC2iBjd3uc8a44ix7xh4cI7Ix6VybcpNiYWCBbyO3NGBWWrAiqpt0MeknBF IrXwQP4hNjdaPfynieM4lnszEYB2FetBpOI2LihqwSrJMqtEFQuYUEnHX3LhTjcHMU1z DpOQ== X-Gm-Message-State: AMCzsaWlr7t6BDm0ozRl0J4MTXznxLWafUQ3pBh3ShJB6BjfWLA12hPF HK9bNip/CxO8ro45RJH32QzoNA== X-Google-Smtp-Source: AOwi7QDq9zFWLLb3T0e8GQCwPluiTmOuNUOMZTExF8Td/p213oes+SSO6WyB7AZI68xLtN4y9VYD5Q== X-Received: by 10.25.147.11 with SMTP id v11mr2543949lfd.32.1507015814855; Tue, 03 Oct 2017 00:30:14 -0700 (PDT) Received: from magnolia ([178.71.70.176]) by smtp.gmail.com with ESMTPSA id r2sm2766012lja.32.2017.10.03.00.30.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2017 00:30:13 -0700 (PDT) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> <87d16mv0o3.fsf@gnu.org> <87efr19fms.fsf@gmail.com> <87ingasvfx.fsf@gnu.org> <87h8vuehv6.fsf@gmail.com> <87d16ibeif.fsf@gnu.org> <874lrlr46b.fsf@gmail.com> <871smmr0sb.fsf@gnu.org> <87wp4cbvjj.fsf@gmail.com> <87tvzgbv42.fsf@gmail.com> Date: Tue, 03 Oct 2017 10:30:12 +0300 In-Reply-To: <87tvzgbv42.fsf@gmail.com> (Oleg Pykhalov's message of "Tue, 03 Oct 2017 09:31:25 +0300") Message-ID: <87r2ukbse3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-services-version-control-Add-cgit.patch Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28283 Cc: 28283@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) >From b1d8c4be457c86d79b4131090997e63664496ba3 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Thu, 28 Sep 2017 20:02:35 +0300 Subject: [PATCH] gnu: services: version-control: Add cgit. * gnu/services/version-control.scm (, ): New record types. (cgit-configuration-robots-string, cgit-activation, cgit-configuration-nginx-config): New procedures. (%cgit-configuration-nginx, cgit-service-type): New variables. * doc/guix.texi (Version Control): Document the cgit service. --- doc/guix.texi | 65 ++++++++++++++++ gnu/local.mk | 1 + gnu/services/version-control.scm | 119 ++++++++++++++++++++++++++++- gnu/tests/version-control.scm | 161 +++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 345 insertions(+), 1 deletion(-) create mode 100644 gnu/tests/version-control.scm diff --git a/doc/guix.texi b/doc/guix.texi index c57c0bab6..f99257947 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17000,6 +17000,71 @@ Extra options will be passed to @code{git daemon},= please run @end table @end deftp =20 +@subsubheading Cgit Service + +@cindex Cgit service +@cindex Git, web interface +@uref{https://git.zx2c4.com/cgit/, Cgit} is a web frontend for Git +repositories written in C. + +The following example will configure the service with default values. +By default, Cgit can be accessed on port 80 (@code{http://localhost:80}). + +@example +(service nginx-service-type) +(service fcgiwrap-service-type) +(service cgit-service-type) +@end example + +@deftp {Data Type} cgit-configuration +Data type representing the configuration of Cgit. +This type has the following parameters: + +@table @asis +@item @code{config-file} (default: @code{(cgit-configuration-file)}) +The configuration file to use for Cgit. This can be set to a +@dfn{cgit-configuration-file} record value, or any gexp +(@pxref{G-Expressions}). + +For example, to instead use a local file, the @code{local-file} function +can be used: + +@example +(service cgit-service-type + (cgit-configuration + (config-file (local-file "./my-cgitrc.conf")))) +@end example + +@item @code{package} (default: @code{cgit}) +The Cgit package to use. + +@end table +@end deftp + +@deftp {Data Type} cgit-configuration-file +Data type representing the configuration options for Cgit. +This type has the following parameters: + +@table @asis +@item @code{css} (default: @code{"/share/cgit/cgit.css"}) +URL which specifies the css document to include in all Cgit pages. + +@item @code{logo} (default: @code{"/share/cgit/cgit.png"}) +URL which specifies the source of an image which will be used as a logo +on all Cgit pages. + +@item @code{virtual-root} (default: @code{"/"}) +URL which, if specified, will be used as root for all Cgit links. + +@item @code{repository-directory} (default: @code{"/srv/git"}) +Name of the directory to scan for repositories. + +@item @code{robots} (default: @code{(list "noindex" "nofollow")}) +Text used as content for the ``robots'' meta-tag. + +@end table +@end deftp + @node Setuid Programs @subsection Setuid Programs =20 diff --git a/gnu/local.mk b/gnu/local.mk index edd6d8237..0ac1a7e6f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -501,6 +501,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/tests/networking.scm \ %D%/tests/rsync.scm \ %D%/tests/ssh.scm \ + %D%/packages/version-control.scm \ %D%/tests/virtualization.scm \ %D%/tests/web.scm =20 diff --git a/gnu/services/version-control.scm b/gnu/services/version-contro= l.scm index 107bc8e77..e39f4411f 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2016 ng0 ;;; Copyright =C2=A9 2016 Sou Bunnbu +;;; Copyright =C2=A9 2017 Oleg Pykhalov ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,18 +22,40 @@ #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services shepherd) + #:use-module (gnu services web) #:use-module (gnu system shadow) #:use-module (gnu packages version-control) #:use-module (gnu packages admin) #:use-module (guix records) #:use-module (guix gexp) + #:use-module (guix store) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 match) #:export (git-daemon-service git-daemon-service-type git-daemon-configuration - git-daemon-configuration?)) + git-daemon-configuration? + + + cgit-configuration-file + cgit-configuration-file? + cgit-configuration-file-css + cgit-configuration-file-logo + cgit-configuration-file-robots + cgit-configuration-file-virtual-root + cgit-configuration-file-repository-directory + + + cgit-configuration + cgit-configuration? + cgit-configuration-config-file + cgit-configuration-package + + %cgit-configuration-nginx + cgit-configuration-nginx-config + + cgit-service-type)) =20 ;;; Commentary: ;;; @@ -139,3 +162,97 @@ The optional @var{config} argument should be a @code{} object, by default it allows read-only access to exported repositories under @file{/srv/git}." (service git-daemon-service-type config)) + + +;;; +;;; Cgit +;;; + +(define-record-type* + cgit-configuration-file + make-cgit-configuration-file + cgit-configuration-file? + (css cgit-configuration-file-css ; str= ing + (default "/share/cgit/cgit.css")) + (logo cgit-configuration-file-logo ; str= ing + (default "/share/cgit/cgit.png")) + (robots cgit-configuration-file-robots ; list + (default '("noindex" "nofollow"))) + (virtual-root cgit-configuration-file-virtual-root ; str= ing + (default "/")) + (repository-directory cgit-configuration-file-repository-directory ; str= ing + (default "/srv/git"))) + +(define (cgit-configuration-robots-string robots) + (string-join robots ", ")) + +(define-gexp-compiler (cgit-configuration-file-compiler + (file ) system target) + (match file + (($ css logo + robots virtual-root repository-directory) + (apply text-file* "cgitrc" + (letrec-syntax ((option (syntax-rules () + ((_ key value) + (if value + `(,key "=3D" ,value "\n") + '())))) + (key/value (syntax-rules () + ((_ (key value) rest ...) + (append (option key value) + (key/value rest ...))) + ((_) + '())))) + (key/value ("css" css) + ("logo" logo) + ("robots" (cgit-configuration-robots-string robot= s)) + ("virtual-root" virtual-root) + ("scan-path" repository-directory))))))) + +(define %cgit-configuration-nginx + (list + (nginx-server-configuration + (root cgit) + (locations + (list + (nginx-location-configuration + (uri "@cgit") + (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit= .cgi;" + "fastcgi_param PATH_INFO $uri;" + "fastcgi_param QUERY_STRING $args;" + "fastcgi_param HTTP_HOST $server_name;" + "fastcgi_pass 127.0.0.1:9000;"))))) + (try-files (list "$uri" "@cgit")) + (https-port #f) + (ssl-certificate #f) + (ssl-certificate-key #f)))) + +(define-record-type* + cgit-configuration make-cgit-configuration + cgit-configuration? + (config-file cgit-configuration-config-file + (default (cgit-configuration-file))) + (package cgit-configuration-package + (default cgit)) + (nginx cgit-configuration-nginx + (default %cgit-configuration-nginx))) + +(define (cgit-activation config) + ;; Cgit compiled with default configuration path + #~(begin + (use-modules (guix build utils)) + (mkdir-p "/var/cache/cgit") + (copy-file #$(cgit-configuration-config-file config) "/etc/cgitrc"))) + +(define (cgit-configuration-nginx-config config) + (cgit-configuration-nginx config)) + +(define cgit-service-type + (service-type + (name 'cgit) + (extensions + (list (service-extension activation-service-type + cgit-activation) + (service-extension nginx-service-type + cgit-configuration-nginx-config))) + (default-value (cgit-configuration)))) diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm new file mode 100644 index 000000000..11adb37f0 --- /dev/null +++ b/gnu/tests/version-control.scm @@ -0,0 +1,161 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2017 Oleg Pykhalov +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu tests version-control) + #:use-module (gnu tests) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system shadow) + #:use-module (gnu system vm) + #:use-module (gnu services) + #:use-module (gnu services version-control) + #:use-module (gnu services web) + #:use-module (gnu services networking) + #:use-module (gnu packages version-control) + #:use-module (guix gexp) + #:use-module (guix store) + #:export (%test-cgit)) + +(define %make-git-repository + ;; Create Git repository in /srv/git/test. + #~(begin + (mkdir-p "/srv/git/test") + (system* (string-append #$git "/bin/git") "-C" "/srv/git/test" "init= "))) + +(define %cgit-configuration-nginx + (list + (nginx-server-configuration + (root cgit) + (locations + (list + (nginx-location-configuration + (uri "@cgit") + (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit= .cgi;" + "fastcgi_param PATH_INFO $uri;" + "fastcgi_param QUERY_STRING $args;" + "fastcgi_param HTTP_HOST $server_name;" + "fastcgi_pass 127.0.0.1:9000;"))))) + (try-files (list "$uri" "@cgit")) + (http-port 19418) + (https-port #f) + (ssl-certificate #f) + (ssl-certificate-key #f)))) + +(define %cgit-os + ;; Operating system under test. + (let ((base-os + (simple-operating-system + (dhcp-client-service) + (service nginx-service-type) + (service fcgiwrap-service-type) + (service cgit-service-type + (cgit-configuration + (nginx %cgit-configuration-nginx))) + (simple-service 'make-git-repository activation-service-type + %make-git-repository)))) + (operating-system + (inherit base-os) + (packages (cons* git + (operating-system-packages base-os)))))) + +(define* (run-cgit-test #:optional (http-port 19418)) + "Run tests in %CGIT-OS, which has nginx running and listening on +HTTP-PORT." + (define os + (marionette-operating-system + %cgit-os + #:imported-modules '((gnu services herd) + (guix combinators)))) + + (define vm + (virtual-machine + (operating-system os) + (port-forwardings `((8080 . ,http-port))))) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (srfi srfi-11) (srfi srfi-64) + (gnu build marionette) + (web uri) + (web client) + (web response)) + + (define marionette + (make-marionette (list #$vm))) + + (mkdir #$output) + (chdir #$output) + + (test-begin "cgit") + + ;; Wait for nginx to be up and running. + (test-eq "service running" + 'running! + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'nginx) + 'running!) + marionette)) + + ;; Wait for fcgiwrap to be up and running. + (test-eq "service running" + 'running! + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'fcgiwrap) + 'running!) + marionette)) + + ;; Make sure the PID file is created. + (test-assert "PID file" + (marionette-eval + '(file-exists? "/var/run/nginx/pid") + marionette)) + + ;; Make sure the configuration file is created. + (test-assert "Configuration file" + (marionette-eval + '(file-exists? "/etc/cgitrc") + marionette)) + + ;; Make sure Git test repository is created. + (test-assert "Git test repository" + (marionette-eval + '(file-exists? "/srv/git/test/.git") + marionette)) + + ;; Retrieve the index.html file we put in /srv. + (test-equal "http-get" + 200 + (let-values (((response text) + (http-get "http://localhost:8080"))) + (response-code response))) + + (test-end) + (exit (=3D (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "cgit-test" test)) + +(define %test-cgit + (system-test + (name "cgit") + (description "Connect to a running CGIT server.") + (value (run-cgit-test)))) --=20 2.14.2 From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 03 03:36:51 2017 Received: (at 28283) by debbugs.gnu.org; 3 Oct 2017 07:36:52 +0000 Received: from localhost ([127.0.0.1]:45044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzHl2-0005uB-EB for submit@debbugs.gnu.org; Tue, 03 Oct 2017 03:36:51 -0400 Received: from mail-lf0-f53.google.com ([209.85.215.53]:45789) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzHkx-0005tp-1X for 28283@debbugs.gnu.org; Tue, 03 Oct 2017 03:36:46 -0400 Received: by mail-lf0-f53.google.com with SMTP id d17so8637581lfe.2 for <28283@debbugs.gnu.org>; Tue, 03 Oct 2017 00:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-disposition :content-transfer-encoding; bh=Y4jRotUK4UmF0FEkM1c64bP+4QDGGg7SEEcZ0YAzpGQ=; b=cjwC0MD7nXRrLarEX2Br/Z6L1iR1U9rvKXef+XuY2SnnLOr1VxXfahzMW7IgHEEMV/ c0h7JIgyoXdOrB3hZMDL8Lq69IYdhrhER+SYW0ji7LCrqPrbZzeUxc22LFB3W7MBkodo 5N6vV4joJAgcXytGJBMAZVTV3s/PXD4Oq05l9bhx92zDfB4PIYFa2XY0yULlH0BG9v82 EIUEBMR0siHLZGVEDVqFQjQFuNzvNkkkd30nI+Bn8snlub+dpXIe36em+IgarsQJTRIb IMpquA+opvhYJz3PZmDMDCaVSardBSLK+TjN9c0iDe87zhd2WKgIYXsUYCCryoUiuXbP KEQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-disposition :content-transfer-encoding; bh=Y4jRotUK4UmF0FEkM1c64bP+4QDGGg7SEEcZ0YAzpGQ=; b=RCZA7ba0zeC52P+2Lo7RKc0nCTJFiOMjHKwiQQ3NEU1yhQw+Mjv/Ez/pGZ7DJ3D1Xq mEiCMztNudCec7SNSeHOHISiaDUqMkWkEoioJFVZunvcccuXhkxoi9hMTi/7acEL8TYJ z9uzirEBwXeR/6pIyEn7KXfivXjrtkbe997/WG8RafgSOMLIXYzYwoAhOZfXSPmUVgn5 7lZwII/UoSdlSStbtt/gm6LRfBJLRIdwCq8jABwN8WJ3kyXtNa+5KZ1Y2INzHSrznF5L +8P4YiO13DV7KFzQBJpCl4LH4IpgCgDsSdvk9xaQHSqOZTi5xPpIJJt5AdpEdpSBezL8 T7AA== X-Gm-Message-State: AMCzsaW8wxtaMd/dkDdShh53Y9NT1jFCDZLNHiTOJhtfvpDFg76hvHWm P/s9XK7vKcGcL/YTUHPJgGGdUw== X-Google-Smtp-Source: AOwi7QAEahFWcInvMFJvMM0tBFvslQOnu5vz58L6FW2/1T5LXUjLaPUXyHQ7Nson/a+QTimuH/Ycrw== X-Received: by 10.25.29.213 with SMTP id d204mr4233405lfd.47.1507016196891; Tue, 03 Oct 2017 00:36:36 -0700 (PDT) Received: from magnolia ([178.71.70.176]) by smtp.gmail.com with ESMTPSA id w65sm2768166lje.17.2017.10.03.00.36.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2017 00:36:36 -0700 (PDT) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> <87d16mv0o3.fsf@gnu.org> <87efr19fms.fsf@gmail.com> <87ingasvfx.fsf@gnu.org> <87h8vuehv6.fsf@gmail.com> <87d16ibeif.fsf@gnu.org> <874lrlr46b.fsf@gmail.com> <871smmr0sb.fsf@gnu.org> <87wp4cbvjj.fsf@gmail.com> <87tvzgbv42.fsf@gmail.com> <87r2ukbse3.fsf@gmail.com> Date: Tue, 03 Oct 2017 10:36:35 +0300 In-Reply-To: <87r2ukbse3.fsf@gmail.com> (Oleg Pykhalov's message of "Tue, 03 Oct 2017 10:30:12 +0300") Message-ID: <87mv58bs3g.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-services-version-control-Add-cgit.patch Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28283 Cc: 28283@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) >From 984b619620046015113cc4876569f5c87dd37c79 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Thu, 28 Sep 2017 20:02:35 +0300 Subject: [PATCH] gnu: services: version-control: Add cgit. * gnu/services/version-control.scm (, ): New record types. (cgit-configuration-robots-string, cgit-activation, cgit-configuration-nginx-config): New procedures. (%cgit-configuration-nginx, cgit-service-type): New variables. * doc/guix.texi (Version Control): Document the cgit service. --- doc/guix.texi | 65 ++++++++++++++++ gnu/local.mk | 1 + gnu/services/version-control.scm | 119 ++++++++++++++++++++++++++++- gnu/tests/version-control.scm | 161 +++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 345 insertions(+), 1 deletion(-) create mode 100644 gnu/tests/version-control.scm diff --git a/doc/guix.texi b/doc/guix.texi index c57c0bab6..f99257947 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17000,6 +17000,71 @@ Extra options will be passed to @code{git daemon},= please run @end table @end deftp =20 +@subsubheading Cgit Service + +@cindex Cgit service +@cindex Git, web interface +@uref{https://git.zx2c4.com/cgit/, Cgit} is a web frontend for Git +repositories written in C. + +The following example will configure the service with default values. +By default, Cgit can be accessed on port 80 (@code{http://localhost:80}). + +@example +(service nginx-service-type) +(service fcgiwrap-service-type) +(service cgit-service-type) +@end example + +@deftp {Data Type} cgit-configuration +Data type representing the configuration of Cgit. +This type has the following parameters: + +@table @asis +@item @code{config-file} (default: @code{(cgit-configuration-file)}) +The configuration file to use for Cgit. This can be set to a +@dfn{cgit-configuration-file} record value, or any gexp +(@pxref{G-Expressions}). + +For example, to instead use a local file, the @code{local-file} function +can be used: + +@example +(service cgit-service-type + (cgit-configuration + (config-file (local-file "./my-cgitrc.conf")))) +@end example + +@item @code{package} (default: @code{cgit}) +The Cgit package to use. + +@end table +@end deftp + +@deftp {Data Type} cgit-configuration-file +Data type representing the configuration options for Cgit. +This type has the following parameters: + +@table @asis +@item @code{css} (default: @code{"/share/cgit/cgit.css"}) +URL which specifies the css document to include in all Cgit pages. + +@item @code{logo} (default: @code{"/share/cgit/cgit.png"}) +URL which specifies the source of an image which will be used as a logo +on all Cgit pages. + +@item @code{virtual-root} (default: @code{"/"}) +URL which, if specified, will be used as root for all Cgit links. + +@item @code{repository-directory} (default: @code{"/srv/git"}) +Name of the directory to scan for repositories. + +@item @code{robots} (default: @code{(list "noindex" "nofollow")}) +Text used as content for the ``robots'' meta-tag. + +@end table +@end deftp + @node Setuid Programs @subsection Setuid Programs =20 diff --git a/gnu/local.mk b/gnu/local.mk index edd6d8237..cceada5ae 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -501,6 +501,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/tests/networking.scm \ %D%/tests/rsync.scm \ %D%/tests/ssh.scm \ + %D%/tests/version-control.scm \ %D%/tests/virtualization.scm \ %D%/tests/web.scm =20 diff --git a/gnu/services/version-control.scm b/gnu/services/version-contro= l.scm index 107bc8e77..e39f4411f 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2016 ng0 ;;; Copyright =C2=A9 2016 Sou Bunnbu +;;; Copyright =C2=A9 2017 Oleg Pykhalov ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,18 +22,40 @@ #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services shepherd) + #:use-module (gnu services web) #:use-module (gnu system shadow) #:use-module (gnu packages version-control) #:use-module (gnu packages admin) #:use-module (guix records) #:use-module (guix gexp) + #:use-module (guix store) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 match) #:export (git-daemon-service git-daemon-service-type git-daemon-configuration - git-daemon-configuration?)) + git-daemon-configuration? + + + cgit-configuration-file + cgit-configuration-file? + cgit-configuration-file-css + cgit-configuration-file-logo + cgit-configuration-file-robots + cgit-configuration-file-virtual-root + cgit-configuration-file-repository-directory + + + cgit-configuration + cgit-configuration? + cgit-configuration-config-file + cgit-configuration-package + + %cgit-configuration-nginx + cgit-configuration-nginx-config + + cgit-service-type)) =20 ;;; Commentary: ;;; @@ -139,3 +162,97 @@ The optional @var{config} argument should be a @code{} object, by default it allows read-only access to exported repositories under @file{/srv/git}." (service git-daemon-service-type config)) + + +;;; +;;; Cgit +;;; + +(define-record-type* + cgit-configuration-file + make-cgit-configuration-file + cgit-configuration-file? + (css cgit-configuration-file-css ; str= ing + (default "/share/cgit/cgit.css")) + (logo cgit-configuration-file-logo ; str= ing + (default "/share/cgit/cgit.png")) + (robots cgit-configuration-file-robots ; list + (default '("noindex" "nofollow"))) + (virtual-root cgit-configuration-file-virtual-root ; str= ing + (default "/")) + (repository-directory cgit-configuration-file-repository-directory ; str= ing + (default "/srv/git"))) + +(define (cgit-configuration-robots-string robots) + (string-join robots ", ")) + +(define-gexp-compiler (cgit-configuration-file-compiler + (file ) system target) + (match file + (($ css logo + robots virtual-root repository-directory) + (apply text-file* "cgitrc" + (letrec-syntax ((option (syntax-rules () + ((_ key value) + (if value + `(,key "=3D" ,value "\n") + '())))) + (key/value (syntax-rules () + ((_ (key value) rest ...) + (append (option key value) + (key/value rest ...))) + ((_) + '())))) + (key/value ("css" css) + ("logo" logo) + ("robots" (cgit-configuration-robots-string robot= s)) + ("virtual-root" virtual-root) + ("scan-path" repository-directory))))))) + +(define %cgit-configuration-nginx + (list + (nginx-server-configuration + (root cgit) + (locations + (list + (nginx-location-configuration + (uri "@cgit") + (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit= .cgi;" + "fastcgi_param PATH_INFO $uri;" + "fastcgi_param QUERY_STRING $args;" + "fastcgi_param HTTP_HOST $server_name;" + "fastcgi_pass 127.0.0.1:9000;"))))) + (try-files (list "$uri" "@cgit")) + (https-port #f) + (ssl-certificate #f) + (ssl-certificate-key #f)))) + +(define-record-type* + cgit-configuration make-cgit-configuration + cgit-configuration? + (config-file cgit-configuration-config-file + (default (cgit-configuration-file))) + (package cgit-configuration-package + (default cgit)) + (nginx cgit-configuration-nginx + (default %cgit-configuration-nginx))) + +(define (cgit-activation config) + ;; Cgit compiled with default configuration path + #~(begin + (use-modules (guix build utils)) + (mkdir-p "/var/cache/cgit") + (copy-file #$(cgit-configuration-config-file config) "/etc/cgitrc"))) + +(define (cgit-configuration-nginx-config config) + (cgit-configuration-nginx config)) + +(define cgit-service-type + (service-type + (name 'cgit) + (extensions + (list (service-extension activation-service-type + cgit-activation) + (service-extension nginx-service-type + cgit-configuration-nginx-config))) + (default-value (cgit-configuration)))) diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm new file mode 100644 index 000000000..11adb37f0 --- /dev/null +++ b/gnu/tests/version-control.scm @@ -0,0 +1,161 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2017 Oleg Pykhalov +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu tests version-control) + #:use-module (gnu tests) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system shadow) + #:use-module (gnu system vm) + #:use-module (gnu services) + #:use-module (gnu services version-control) + #:use-module (gnu services web) + #:use-module (gnu services networking) + #:use-module (gnu packages version-control) + #:use-module (guix gexp) + #:use-module (guix store) + #:export (%test-cgit)) + +(define %make-git-repository + ;; Create Git repository in /srv/git/test. + #~(begin + (mkdir-p "/srv/git/test") + (system* (string-append #$git "/bin/git") "-C" "/srv/git/test" "init= "))) + +(define %cgit-configuration-nginx + (list + (nginx-server-configuration + (root cgit) + (locations + (list + (nginx-location-configuration + (uri "@cgit") + (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit= .cgi;" + "fastcgi_param PATH_INFO $uri;" + "fastcgi_param QUERY_STRING $args;" + "fastcgi_param HTTP_HOST $server_name;" + "fastcgi_pass 127.0.0.1:9000;"))))) + (try-files (list "$uri" "@cgit")) + (http-port 19418) + (https-port #f) + (ssl-certificate #f) + (ssl-certificate-key #f)))) + +(define %cgit-os + ;; Operating system under test. + (let ((base-os + (simple-operating-system + (dhcp-client-service) + (service nginx-service-type) + (service fcgiwrap-service-type) + (service cgit-service-type + (cgit-configuration + (nginx %cgit-configuration-nginx))) + (simple-service 'make-git-repository activation-service-type + %make-git-repository)))) + (operating-system + (inherit base-os) + (packages (cons* git + (operating-system-packages base-os)))))) + +(define* (run-cgit-test #:optional (http-port 19418)) + "Run tests in %CGIT-OS, which has nginx running and listening on +HTTP-PORT." + (define os + (marionette-operating-system + %cgit-os + #:imported-modules '((gnu services herd) + (guix combinators)))) + + (define vm + (virtual-machine + (operating-system os) + (port-forwardings `((8080 . ,http-port))))) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (srfi srfi-11) (srfi srfi-64) + (gnu build marionette) + (web uri) + (web client) + (web response)) + + (define marionette + (make-marionette (list #$vm))) + + (mkdir #$output) + (chdir #$output) + + (test-begin "cgit") + + ;; Wait for nginx to be up and running. + (test-eq "service running" + 'running! + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'nginx) + 'running!) + marionette)) + + ;; Wait for fcgiwrap to be up and running. + (test-eq "service running" + 'running! + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'fcgiwrap) + 'running!) + marionette)) + + ;; Make sure the PID file is created. + (test-assert "PID file" + (marionette-eval + '(file-exists? "/var/run/nginx/pid") + marionette)) + + ;; Make sure the configuration file is created. + (test-assert "Configuration file" + (marionette-eval + '(file-exists? "/etc/cgitrc") + marionette)) + + ;; Make sure Git test repository is created. + (test-assert "Git test repository" + (marionette-eval + '(file-exists? "/srv/git/test/.git") + marionette)) + + ;; Retrieve the index.html file we put in /srv. + (test-equal "http-get" + 200 + (let-values (((response text) + (http-get "http://localhost:8080"))) + (response-code response))) + + (test-end) + (exit (=3D (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "cgit-test" test)) + +(define %test-cgit + (system-test + (name "cgit") + (description "Connect to a running CGIT server.") + (value (run-cgit-test)))) --=20 2.14.2 From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 03 09:07:57 2017 Received: (at 28283-done) by debbugs.gnu.org; 3 Oct 2017 13:07:57 +0000 Received: from localhost ([127.0.0.1]:45408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzMvV-0000aB-Gi for submit@debbugs.gnu.org; Tue, 03 Oct 2017 09:07:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzMvR-0000Zq-RE for 28283-done@debbugs.gnu.org; Tue, 03 Oct 2017 09:07:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzMvG-0003Fa-V5 for 28283-done@debbugs.gnu.org; Tue, 03 Oct 2017 09:07:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzMvG-0003FU-R5; Tue, 03 Oct 2017 09:07:42 -0400 Received: from [193.50.110.164] (port=37352 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dzMvG-000698-97; Tue, 03 Oct 2017 09:07:42 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Oleg Pykhalov Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit. References: <87h8wq2hxw.fsf@gmail.com> <87a82i2hur.fsf@gmail.com> <873787rh4a.fsf@gnu.org> <87d16mv0o3.fsf@gnu.org> <87efr19fms.fsf@gmail.com> <87ingasvfx.fsf@gnu.org> <87h8vuehv6.fsf@gmail.com> <87d16ibeif.fsf@gnu.org> <874lrlr46b.fsf@gmail.com> <871smmr0sb.fsf@gnu.org> <87wp4cbvjj.fsf@gmail.com> <87tvzgbv42.fsf@gmail.com> <87r2ukbse3.fsf@gmail.com> <87mv58bs3g.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 12 =?utf-8?Q?Vend=C3=A9miaire?= an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 03 Oct 2017 15:07:40 +0200 In-Reply-To: <87mv58bs3g.fsf@gmail.com> (Oleg Pykhalov's message of "Tue, 03 Oct 2017 10:36:35 +0300") Message-ID: <87fub08jmr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28283-done Cc: 28283-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Oleg Pykhalov skribis: > From 984b619620046015113cc4876569f5c87dd37c79 Mon Sep 17 00:00:00 2001 > From: Oleg Pykhalov > Date: Thu, 28 Sep 2017 20:02:35 +0300 > Subject: [PATCH] gnu: services: version-control: Add cgit. > > * gnu/services/version-control.scm > (, ): New record types. > (cgit-configuration-robots-string, cgit-activation, > cgit-configuration-nginx-config): New procedures. > (%cgit-configuration-nginx, cgit-service-type): New variables. > * doc/guix.texi (Version Control): Document the cgit service. > --- > doc/guix.texi | 65 ++++++++++++++++ > gnu/local.mk | 1 + > gnu/services/version-control.scm | 119 ++++++++++++++++++++++++++++- > gnu/tests/version-control.scm | 161 +++++++++++++++++++++++++++++++++= ++++++ > 4 files changed, 345 insertions(+), 1 deletion(-) > create mode 100644 gnu/tests/version-control.scm Awesome! I took the liberty to add more URL tests: --8<---------------cut here---------------start------------->8--- ;; Make sure we can access pages that correspond to our repositor= y. (letrec-syntax ((test-url (syntax-rules () ((_ path code) (test-equal (string-append "GET " path) code (let-values (((response body) (http-get (string-append "http://localhost:= 8080" path)))) (response-code response)))) ((_ path) (test-url path 200))))) (test-url "/") (test-url "/test") (test-url "/test/log") (test-url "/test/tree") (test-url "/test/does-not-exist" 404) (test-url "/does-not-exist" 404)) --8<---------------cut here---------------end--------------->8--- Will push in a minute. Thank you! Ludo=E2=80=99. From unknown Tue Aug 19 02:51:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 01 Nov 2017 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator