From unknown Fri Aug 15 02:04:53 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#29820 <29820@debbugs.gnu.org> To: bug#29820 <29820@debbugs.gnu.org> Subject: Status: [PATCH] services: cgit: Add more configuration fields. Reply-To: bug#29820 <29820@debbugs.gnu.org> Date: Fri, 15 Aug 2025 09:04:53 +0000 retitle 29820 [PATCH] services: cgit: Add more configuration fields. reassign 29820 guix-patches submitter 29820 Oleg Pykhalov severity 29820 normal tag 29820 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 22 17:34:17 2017 Received: (at submit) by debbugs.gnu.org; 22 Dec 2017 22:34:17 +0000 Received: from localhost ([127.0.0.1]:48425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSVtL-0002Bl-I1 for submit@debbugs.gnu.org; Fri, 22 Dec 2017 17:34:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSVtH-0002BW-KN for submit@debbugs.gnu.org; Fri, 22 Dec 2017 17:34:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSVt7-0003sE-IY for submit@debbugs.gnu.org; Fri, 22 Dec 2017 17:34:02 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_50,FORM_FRAUD, FREEMAIL_FROM,T_DKIM_INVALID,T_FILL_THIS_FORM_SHORT autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36729) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eSVt7-0003s2-6Q for submit@debbugs.gnu.org; Fri, 22 Dec 2017 17:33:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSVt1-0004Lg-EV for guix-patches@gnu.org; Fri, 22 Dec 2017 17:33:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSVsw-0003hz-EP for guix-patches@gnu.org; Fri, 22 Dec 2017 17:33:51 -0500 Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:33666) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eSVsv-0003gp-Iw for guix-patches@gnu.org; Fri, 22 Dec 2017 17:33:46 -0500 Received: by mail-lf0-x233.google.com with SMTP id g80so28494561lfg.0 for ; Fri, 22 Dec 2017 14:33:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version; bh=Qch9ST/8k+1fUFdIEz+pwZZesNp24dRKirwHi1eC5fY=; b=hzecZtnNlG0irsJx6hm3dmciWNwbvTZHFnSYvtGaT0tNZPpRIpyG2HWV3i2+3E1fyF 9f1htRPNKZhen03Pc1sUjYsDZYBBs5tNz0po2CMo5KzWOWUABeTSTvzdk2pFcW9McfeY s+Z07KvOLsL677h0cXYKqHPYFdhiZme6yJS+YSH7ZyqjS2bA7Uvw7FedmRDZ8VK7eAvl vhMqHOeoxo5WhdhqcQBFPKya26X9paXW04nb1ZTI+eV44gTGJt4v8Im6xA8L/GPprTbx JZeTLiqLzEs6gFm4syBaQm60+IXQSDDfZtlZ56Z4idVr58UFwPxPI8ywMzMLEsBQoIAQ IISA== 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:date:message-id:mime-version; bh=Qch9ST/8k+1fUFdIEz+pwZZesNp24dRKirwHi1eC5fY=; b=SYqrKTaweExjodKUiL2ssTmz5PrZaCoaIz8BUPQKovEEkzQ4dRRjBd9h6P0DoBnO/W zTj642K3Tu4Wdp+FfSlGf/IBRAFyVFmuybIguEc1w9qRE47USJSw4cBKlqKfVjLqUpU5 Va0r+X//c0rFxj03T5AuLQiXzg5W3fkfg/8CvHQMcPGW8uv9WhcuL9vN+uXt8+21ToHI HlwpDCWjd5c1MPr2ntA0qU9ODRnSxXeLUDexS4XQ5k5NJvRQgcMeBoqeiGANZX0VJKZK aRZxIh2Cl0GjIXU5/eACLZoaE8N0JuceraWkD/FZE8jbH4RXRLsDEk63k9WCLYkLHy7P K2Og== X-Gm-Message-State: AKGB3mKTonmBaRQQXlnxtYWIGMZ5xJYW2ol5c/TSw+cyFommy+7QjdCg jEJllIe1yJhZNqAbcjKCuiQ= X-Google-Smtp-Source: ACJfBotqMXoCKOVYg6itt0y8iKlM2+KT2GWG5lG7ikjbaFiHTavUoy4W5ZAeV5pp5O8sAchVdihr+g== X-Received: by 10.46.85.18 with SMTP id j18mr9498031ljb.109.1513982023923; Fri, 22 Dec 2017 14:33:43 -0800 (PST) Received: from magnolia (pppoe.178-66-223-169.dynamic.avangarddsl.ru. [178.66.223.169]) by smtp.gmail.com with ESMTPSA id c23sm2648828lfg.13.2017.12.22.14.33.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Dec 2017 14:33:43 -0800 (PST) From: Oleg Pykhalov To: guix-patches@gnu.org Subject: [PATCH] services: cgit: Add more configuration fields. Date: Sat, 23 Dec 2017 01:33:33 +0300 Message-ID: <87incy9yv6.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: -3.0 (---) X-Debbugs-Envelope-To: submit Cc: Oleg Pykhalov 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: 1.0 (+) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-services-cgit-Add-more-configuration-fields.patch Content-Transfer-Encoding: quoted-printable Content-Description: [PATCH] services: cgit: Add more configuration fields. From=2026b620e568dd5ad6d2429138e3d34533cb764036 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Tue, 12 Dec 2017 02:13:55 +0300 Subject: [PATCH] services: cgit: Add more configuration fields. * gnu/services/version-control.scm (cgit-service-type): Move to separate fi= le. * gnu/services/cgit.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add this. * gnu/tests/version-control.scm (gnu): Add this. * doc/guix.texi (Cgit Service): Document this. =2D-- doc/guix.texi | 925 +++++++++++++++++++++++++++++++++++= ++-- gnu/local.mk | 1 + gnu/services/cgit.scm | 642 +++++++++++++++++++++++++++ gnu/services/version-control.scm | 118 ----- gnu/tests/version-control.scm | 1 + 5 files changed, 1535 insertions(+), 152 deletions(-) create mode 100644 gnu/services/cgit.scm diff --git a/doc/guix.texi b/doc/guix.texi index 94d4d8f92..21119fb4e 100644 =2D-- a/doc/guix.texi +++ b/doc/guix.texi @@ -17897,57 +17897,914 @@ By default, Cgit can be accessed on port 80 (@co= de{http://localhost:80}). @example (service nginx-service-type) (service fcgiwrap-service-type) =2D(service cgit-service-type) +(service cgit-service-type + (cgit-configuration + (branch-sort "age") + (enable-commit-graph? #t) + (enable-follow-links? #t) + (enable-index-links? #t) + (enable-log-filecount? #t) + (enable-log-linecount? #t) + (enable-remote-branches? #t) + (enable-subject-links? #t) + (remove-suffix? #t) + (enable-index-owner? #f) + (snapshots (list "tar.gz")))) @end example =20 =2D@deftp {Data Type} cgit-configuration =2DData type representing the configuration of Cgit. =2DThis type has the following parameters: +@c %start of fragment =20 =2D@table @asis =2D@item @code{config-file} (default: @code{(cgit-configuration-file)}) =2DThe configuration file to use for Cgit. This can be set to a =2D@dfn{cgit-configuration-file} record value, or any gexp =2D(@pxref{G-Expressions}). +Available @code{cgit-configuration} fields are: =20 =2DFor example, to instead use a local file, the @code{local-file} function =2Dcan be used: +@deftypevr {@code{cgit-configuration} parameter} package package +The CGIT package. =20 =2D@example =2D(service cgit-service-type =2D (cgit-configuration =2D (config-file (local-file "./my-cgitrc.conf")))) =2D@end example +@end deftypevr =20 =2D@item @code{package} (default: @code{cgit}) =2DThe Cgit package to use. +@deftypevr {@code{cgit-configuration} parameter} nginx-server-configuratio= n-list nginx +NGINX configuration. =20 =2D@end table =2D@end deftp +@end deftypevr =20 =2D@deftp {Data Type} cgit-configuration-file =2DData type representing the configuration options for Cgit. =2DThis type has the following parameters: +@deftypevr {@code{cgit-configuration} parameter} string about-filter +Specifies a command which will be invoked to format the content of about +pages (both top-level and for each repository). =20 =2D@table @asis =2D@item @code{css} (default: @code{"/share/cgit/cgit.css"}) +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string agefile +Specifies a path, relative to each repository path, which can be used to +specify the date and time of the youngest commit in the repository. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string auth-filter +Specifies a command that will be invoked for authenticating repository +access. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string branch-sort +Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set @samp{name} enables ordering by branch name. + +Defaults to @samp{"name"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string cache-root +Path used to store the Cgit cache entries. + +Defaults to @samp{"/var/cache/cgit"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-static-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed with a fixed SHA1. + +Defaults to @samp{-1}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-dynamic-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed without a fixed SHA1. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-repo-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of the repository summary page. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-root-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of the repository index page. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-scanrc-ttl +Number which specifies the time-to-live, in minutes, for the result of +scanning a path for Git repositories. + +Defaults to @samp{15}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-about-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of the repository about page. + +Defaults to @samp{15}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-snapshot-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of snapshots. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-size +The maximum number of entries in the cgit cache. When set to @samp{0}, +caching is disabled. + +Defaults to @samp{0}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean case-sensitive-so= rt? +Sort items in the repo list case sensitively. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list clone-prefix +List of common prefixes which, when combined with a repository URL, +generates valid clone URLs for the repository. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list clone-url +List of @code{clone-url} templates. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string commit-filter +Command which will be invoked to format commit messages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string commit-sort +Flag which, when set to @samp{date}, enables strict date ordering in the +commit log, and when set to @samp{topo} enables strict topological +ordering. + +Defaults to @samp{"git log"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string css URL which specifies the css document to include in all Cgit pages. =20 =2D@item @code{logo} (default: @code{"/share/cgit/cgit.png"}) +Defaults to @samp{"/share/cgit/cgit.css"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string email-filter +Specifies a command which will be invoked to format names and email +address of committers, authors, and taggers, as represented in various +places throughout the Cgit interface. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean embedded? +Flag which, when set to @samp{#t}, will make Cgit generate a HTML +fragment suitable for embedding in other HTML pages. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-commit-gra= ph? +Flag which, when set to @samp{#t}, will make Cgit print an ASCII-art +commit history graph to the left of the commit messages in the +repository log page. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-filter-ove= rrides? +Flag which, when set to @samp{#t}, allows all filter settings to be +overridden in repository-specific cgitrc files. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-follow-lin= ks? +Flag which, when set to @samp{#t}, allows users to follow a file in the +log view. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-http-clone? +If set to @samp{#t}, Cgit will act as an dumb HTTP endpoint for Git +clones. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-index-link= s? +Flag which, when set to @samp{#t}, will make Cgit generate extra links +"summary", "commit", "tree" for each repo in the repository index. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-index-owne= r? +Flag which, when set to @samp{#t}, will make Cgit display the owner of +each repo in the repository index. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-log-fileco= unt? +Flag which, when set to @samp{#t}, will make Cgit print the number of +modified files for each commit on the repository log page. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-log-lineco= unt? +Flag which, when set to @samp{#t}, will make Cgit print the number of +added and removed lines for each commit on the repository log page. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-remote-bra= nches? +Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-subject-li= nks? +Flag which, when set to @code{1}, will make Cgit use the subject of the +parent commit as link text when generating links to parent commits in +commit view. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-html-servi= ng? +Flag which, when set to @samp{#t}, will make Cgit use the subject of the +parent commit as link text when generating links to parent commits in +commit view. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-tree-linen= umbers? +Flag which, when set to @samp{#t}, will make Cgit generate linenumber +links for plaintext blobs printed in the tree view. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-git-config? +Flag which, when set to @samp{#f}, will allow Cgit to use Git config to +set any repo specific settings. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string favicon +URL used as link to a shortcut icon for Cgit. + +Defaults to @samp{"/favicon.ico"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string footer +The content of the file specified with this option will be included +verbatim at the bottom of all pages (i.e. it replaces the standard +"generated by..." message. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string head-include +The content of the file specified with this option will be included +verbatim in the HTML HEAD section on all pages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string header +The content of the file specified with this option will be included +verbatim at the top of all pages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string include +Name of a configfile to include before the rest of the current config- +file is parsed. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string index-header +The content of the file specified with this option will be included +verbatim above the repository index. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string index-info +The content of the file specified with this option will be included +verbatim below the heading on the repository index page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean local-time? +Flag which, if set to @samp{#t}, makes Cgit print commit and tag times +in the servers timezone. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string logo URL which specifies the source of an image which will be used as a logo on all Cgit pages. =20 =2D@item @code{virtual-root} (default: @code{"/"}) =2DURL which, if specified, will be used as root for all Cgit links. +Defaults to @samp{"/share/cgit/cgit.png"}. =20 =2D@item @code{repository-directory} (default: @code{"/srv/git"}) =2DName of the directory to scan for repositories. +@end deftypevr =20 =2D@item @code{robots} (default: @code{(list "noindex" "nofollow")}) =2DText used as content for the ``robots'' meta-tag. +@deftypevr {@code{cgit-configuration} parameter} string logo-link +URL loaded when clicking on the Cgit logo image. =20 =2D@end table =2D@end deftp +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string owner-filter +Command which will be invoked to format the Owner column of the main +page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-atom-items +Number of items to display in atom feeds view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-commit-count +Number of entries to list per page in "log" view. + +Defaults to @samp{50}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-message-length +Number of commit message characters to display in "log" view. + +Defaults to @samp{80}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-repo-count +Specifies the number of entries to list per page on the repository index +page. + +Defaults to @samp{50}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-repodesc-leng= th +Specifies the maximum number of repo description characters to display +on the repository index page. + +Defaults to @samp{80}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-blob-size +Specifies the maximum size of a blob to display HTML for in KBytes. + +Defaults to @samp{0}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string max-stats +Maximum statistics period. Valid values are @samp{week},@samp{month}, +@samp{quarter} and @samp{year.} + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} mimetype-alist mimetype +Mimetype for the specified filename extension. + +Defaults to @samp{((gif "image/gif") (html "text/html") (jpg +"image/jpeg") (jpeg "image/jpeg") (pdf "application/pdf") (png +"image/png") (svg "image/svg+xml"))}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string mimetype-file +Specifies the file to use for automatic mimetype lookup. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string module-link +Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean nocache? +If set to the value @samp{#t} caching will be disabled. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean noplainemail? +If set to @samp{#t} showing full author email addresses will be +disabled. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean noheader? +Flag which, when set to @samp{#t}, will make Cgit omit the standard +header on all pages. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list project-list +A list of subdirectories inside of @code{repository-directory}, relative +to it, that should loaded as Git repositories. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string readme +Text which will be used as default value for @code{cgit-repo-readme}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean remove-suffix? +If set to @code{#t} and @code{repository-directory} is enabled, if any +repositories are found with a suffix of @code{.git}, this suffix will be +removed for the URL and name. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer renamelimit +Maximum number of files to consider when detecting renames. + +Defaults to @samp{-1}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string repository-sort +The way in which repositories in each section are sorted. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} robots-list robots +Text used as content for the @code{robots} meta-tag. + +Defaults to @samp{("noindex" "nofollow")}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string root-desc +Text printed below the heading on the repository index page. + +Defaults to @samp{"a fast webinterface for the git dscm"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string root-readme +The content of the file specified with this option will be included +verbatim below thef "about" link on the repository index page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string root-title +Text printed as heading on the repository index page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean scan-hidden-path +If set to @samp{#t} and repository-directory is enabled, +repository-directory will recurse into directories whose name starts +with a period. Otherwise, repository-directory will stay away from such +directories, considered as "hidden". Note that this does not apply to +the ".git" directory in non-bare repos. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list snapshots +Text which specifies the default set of snapshot formats that cgit +generates links for. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} repository-directory repo= sitory-directory +Name of the directory to scan for repositories. + +Defaults to @samp{"/srv/git"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string section +The name of the current repository section - all repositories defined +after this option will inherit the current section name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string section-sort +Flag which, when set to @samp{1}, will sort the sections on the +repository listing by name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer section-from-path +A number which, if defined prior to repository-directory, specifies how +many path elements from each repo path to use as a default section name. + +Defaults to @samp{0}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean side-by-side-diff= s? +If set to @samp{#t} shows side-by-side diffs instead of unidiffs per +default. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string source-filter +Specifies a command which will be invoked to format plaintext blobs in +the tree view. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer summary-branches +Specifies the number of branches to display in the repository "summary" +view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer summary-log +Specifies the number of log entries to display in the repository +"summary" view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer summary-tags +Specifies the number of tags to display in the repository "summary" +view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string strict-export +Filename which, if specified, needs to be present within the repository +for Cgit to allow access to that repository. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string virtual-root +URL which, if specified, will be used as root for all Cgit links. + +Defaults to @samp{"/"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} repository-cgit-configura= tion-list repositories +A list of @dfn{cgit-repo} records to use with config. + +Defaults to @samp{()}. + +Available @code{repository-cgit-configuration} fields are: + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ab= out-filter +Override the default @code{about-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string br= anch-sort +Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set to @samp{name} enables ordering by branch name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-list clon= e-url +A list of URLs which can be used to clone repo. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string co= mmit-filter +Override the default @code{commit-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string co= mmit-sort +Flag which, when set to @samp{date}, enables strict date ordering in the +commit log, and when set to @samp{topo} enables strict topological +ordering. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string de= fbranch +The name of the default branch for this repository. If no such branch +exists in the repository, the first branch name (when sorted) is used as +default instead. By default branch pointed to by HEAD, or "master" if +there is no suitable HEAD. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string de= sc +The value to show as repository description. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ho= mepage +The value to show as repository homepage. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string em= ail-filter +Override the default @code{email-filter.} + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-commit-graph? +A flag which can be used to disable the global setting +@code{enable-commit-graph?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-log-filecount? +A flag which can be used to disable the global setting +@code{enable-log-filecount?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-log-linecount? +A flag which can be used to disable the global setting +@code{enable-log-linecount?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-remote-branches? +Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-subject-links? +A flag which can be used to override the global setting +@code{enable-subject-links?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-html-serving? +A flag which can be used to override the global setting +@code{enable-html-serving?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean h= ide? +Flag which, when set to @code{#t}, hides the repository from the +repository index. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean i= gnore? +Flag which, when set to @samp{#t}, ignores the repository. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string lo= go +URL which specifies the source of an image which will be used as a logo +on this repo=E2=80=99s pages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string lo= go-link +URL loaded when clicking on the Cgit logo image. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ow= ner-filter +Override the default @code{owner-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string mo= dule-link +Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing. The arguments for the +formatstring are the path and SHA1 of the submodule commit. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} module-link-pa= th module-link-path +Text which will be used as the formatstring for a hyperlink when a +submodule with the specified subdirectory path is printed in a directory +listing. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ma= x-stats +Override the default maximum statistics period. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string na= me +The value to show as repository name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ow= ner +A value used to identify the owner of the repository. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string pa= th +An absolute path to the repository directory. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string re= adme +A path (relative to repo) which specifies a file to include verbatim as +the "About" page for this repo. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-list snap= shots +A mask of snapshot formats for this repo that cgit generates links for, +restricted by the global @code{snapshots} setting. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string se= ction +The name of the current repository section - all repositories defined +after this option will inherit the current section name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string so= urce-filter +Override the default @code{source-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string url +The relative URL used to access the repository. + +Defaults to @samp{""}. + +@end deftypevr + +@end deftypevr + + +@c %end of fragment =20 @node Setuid Programs @subsection Setuid Programs diff --git a/gnu/local.mk b/gnu/local.mk index b1cf3c3de..9c2f91b91 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -445,6 +445,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/services/avahi.scm \ %D%/services/base.scm \ %D%/services/certbot.scm \ + %D%/services/cgit.scm \ %D%/services/configuration.scm \ %D%/services/cuirass.scm \ %D%/services/cups.scm \ diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm new file mode 100644 index 000000000..a8f22eb0a =2D-- /dev/null +++ b/gnu/services/cgit.scm @@ -0,0 +1,642 @@ +;;; 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 services cgit) + #:use-module (gnu packages admin) + #:use-module (gnu packages version-control) + #:use-module (gnu services base) + #:use-module (gnu services configuration) + #:use-module (gnu services shepherd) + #:use-module (gnu services web) + #:use-module (gnu services) + #:use-module (gnu system shadow) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix records) + #:use-module (guix store) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:export (repository-cgit-configuration + cgit-configuration + %cgit-configuration-nginx + cgit-configuration-nginx-config + cgit-service-type)) + +(define %cgit-configuration-nginx + (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")) + (listen '("80")) + (ssl-certificate #f) + (ssl-certificate-key #f))) + + +;;; +;;; Serialize +;;; + +(define (uglify-field-name field-name) + (let ((str (symbol->string field-name))) + (string-join (string-split (string-delete #\? str) #\-) "-"))) + +(define (serialize-field field-name val) + (format #t "~a=3D~a\n" (uglify-field-name field-name) val)) + +(define (serialize-string field-name val) + (if (string=3D? val "") "" (serialize-field field-name val))) + +(define (serialize-boolean field-name val) + (serialize-field field-name (if val 1 0))) + +(define (serialize-list field-name val) + (if (null? val) "" (serialize-field field-name (string-join val)))) + +(define robots-list? list?) + +(define (serialize-robots-list field-name val) + (if (null? val) "" (serialize-field field-name (string-join val ", ")))) + +(define (integer? val) + (exact-integer? val)) + +(define (serialize-integer field-name val) + (serialize-field field-name val)) + +(define (serialize-repository-cgit-configuration x) + (serialize-configuration x repository-cgit-configuration-fields)) + +(define (repository-cgit-configuration-list? val) + (list? val)) + +(define (serialize-repository-cgit-configuration-list field-name val) + (for-each serialize-repository-cgit-configuration val)) + +(define (nginx-server-configuration-list? val) + (and (list? val) (and-map nginx-server-configuration? val))) + +(define (serialize-nginx-server-configuration-list field-name val) + #f) + + +;;; +;;; Serialize +;;; + +(define (serialize-repo-field field-name val) + (format #t "repo.~a=3D~a\n" (uglify-field-name field-name) val)) + +(define (serialize-repo-list field-name val) + (if (null? val) "" (serialize-repo-field field-name (string-join val)))) + +(define repo-boolean? boolean?) + +(define (serialize-repo-boolean field-name val) + (serialize-repo-field field-name (if val 1 0))) + +(define (serialize-repo-integer field-name val) + (serialize-repo-field field-name val)) + +(define repo-list? list?) + +(define repo-string? string?) + +(define (serialize-repo-string field-name val) + (if (string=3D? val "") "" (serialize-repo-field field-name val))) + +(define module-link-path? list?) + +(define (serialize-module-link-path field-name val) + (if (null? val) + "" + (format #t "repo.~a.~a=3D~a\n" + (uglify-field-name field-name) + (car val) (cadr val)))) + +(define repository-directory? string?) + +(define (serialize-repository-directory _ val) + (if (string=3D? val "") "" (format #t "scan-path=3D~a\n" val))) + +(define mimetype-alist? list?) + +(define (serialize-mimetype-alist field-name val) + (format #t "# Mimetypes\n~a" + (apply string-append + (fold (lambda (x xs) + (cons* (symbol->string (car x)) "=3D" (cadr x) "\= n" xs)) + '() val)))) + +(define-configuration repository-cgit-configuration + (about-filter + (repo-string "") + "Override the default @code{about-filter}.") + (branch-sort + (repo-string "") + "Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set to @samp{name} enables ordering by branch name.") + (clone-url + (repo-list '()) + "A list of URLs which can be used to clone repo.") + (commit-filter + (repo-string "") + "Override the default @code{commit-filter}.") + (commit-sort + (repo-string "") + "Flag which, when set to @samp{date}, enables strict date ordering in t= he +commit log, and when set to @samp{topo} enables strict topological orderin= g.") + (defbranch + (repo-string "") + "The name of the default branch for this repository. If no such branch +exists in the repository, the first branch name (when sorted) is used as +default instead. By default branch pointed to by HEAD, or \"master\" if t= here +is no suitable HEAD.") + (desc + (repo-string "") + "The value to show as repository description.") + (homepage + (repo-string "") + "The value to show as repository homepage.") + (email-filter + (repo-string "") + "Override the default @code{email-filter.}") + (enable-commit-graph? + (repo-boolean #f) + "A flag which can be used to disable the global setting +@code{enable-commit-graph?}.") + (enable-log-filecount? + (repo-boolean #f) + "A flag which can be used to disable the global setting +@code{enable-log-filecount?}.") + (enable-log-linecount? + (repo-boolean #f) + "A flag which can be used to disable the global setting +@code{enable-log-linecount?}.") + (enable-remote-branches? + (repo-boolean #f) + "Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views.") + (enable-subject-links? + (repo-boolean #f) + "A flag which can be used to override the global setting +@code{enable-subject-links?}.") + (enable-html-serving? + (repo-boolean #f) + "A flag which can be used to override the global setting +@code{enable-html-serving?}.") + (hide? + (repo-boolean #f) + "Flag which, when set to @code{#t}, hides the repository from the +repository index.") + (ignore? + (repo-boolean #f) + "Flag which, when set to @samp{#t}, ignores the repository.") + (logo + (repo-string "") + "URL which specifies the source of an image which will be used as a +logo on this repo=E2=80=99s pages.") + (logo-link + (repo-string "") + "URL loaded when clicking on the Cgit logo image.") + (owner-filter + (repo-string "") + "Override the default @code{owner-filter}.") + (module-link + (repo-string "") + "Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing. The arguments for the +formatstring are the path and SHA1 of the submodule commit.") + (module-link-path + (module-link-path '()) + "Text which will be used as the formatstring for a hyperlink when a +submodule with the specified subdirectory path is printed in a directory +listing.") + (max-stats + (repo-string "") + "Override the default maximum statistics period.") + (name + (repo-string "") + "The value to show as repository name.") + (owner + (repo-string "") + "A value used to identify the owner of the repository.") + (path + (repo-string "") + "An absolute path to the repository directory.") + (readme + (repo-string "") + "A path (relative to repo) which specifies a file to include verbatim +as the \"About\" page for this repo.") + (snapshots + (repo-list '()) + "A mask of snapshot formats for this repo that cgit generates links for, +restricted by the global @code{snapshots} setting.") + (section + (repo-string "") + "The name of the current repository section - all repositories defined +after this option will inherit the current section name.") + (source-filter + (repo-string "") + "Override the default @code{source-filter}.") + (url + (repo-string "") + "The relative URL used to access the repository.")) + +;; Generate a record, which may include a list of +;; , , . +(define-configuration cgit-configuration + (package + (package cgit) + "The CGIT package.") + (nginx + (nginx-server-configuration-list (list %cgit-configuration-nginx)) + "NGINX configuration.") + (about-filter + (string "") + "Specifies a command which will be invoked to format the content of abo= ut +pages (both top-level and for each repository).") + (agefile + (string "") + "Specifies a path, relative to each repository path, which can be used = to +specify the date and time of the youngest commit in the repository.") + (auth-filter + (string "") + "Specifies a command that will be invoked for authenticating repository +access.") + (branch-sort + (string "name") + "Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set @samp{name} enables ordering by branch name.") + (cache-root + (string "/var/cache/cgit") + "Path used to store the Cgit cache entries.") + (cache-static-ttl + (integer -1) + "Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed with a fixed SHA1.") + (cache-dynamic-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed without a fixed SHA1.") + (cache-repo-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of the repository summary page.") + (cache-root-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of the repository index page.") + (cache-scanrc-ttl + (integer 15) + "Number which specifies the time-to-live, in minutes, for the result of +scanning a path for Git repositories.") + (cache-about-ttl + (integer 15) + "Number which specifies the time-to-live, in minutes, for the cached +version of the repository about page.") + (cache-snapshot-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of snapshots.") + (cache-size + (integer 0) + "The maximum number of entries in the cgit cache. When set to +@samp{0}, caching is disabled.") + (case-sensitive-sort? + (boolean #t) + "Sort items in the repo list case sensitively.") + (clone-prefix + (list '()) + "List of common prefixes which, when combined with a repository URL, +generates valid clone URLs for the repository.") + (clone-url + (list '()) + "List of @code{clone-url} templates.") + (commit-filter + (string "") + "Command which will be invoked to format commit messages.") + (commit-sort + (string "git log") + "Flag which, when set to @samp{date}, enables strict date ordering in t= he +commit log, and when set to @samp{topo} enables strict topological +ordering.") + (css + (string "/share/cgit/cgit.css") + "URL which specifies the css document to include in all Cgit pages.") + (email-filter + (string "") + "Specifies a command which will be invoked to format names and email +address of committers, authors, and taggers, as represented in various +places throughout the Cgit interface.") + (embedded? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit generate a HTML +fragment suitable for embedding in other HTML pages.") + (enable-commit-graph? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit print an ASCII-art +commit history graph to the left of the commit messages in the +repository log page.") + (enable-filter-overrides? + (boolean #f) + "Flag which, when set to @samp{#t}, allows all filter settings to be +overridden in repository-specific cgitrc files.") + (enable-follow-links? + (boolean #f) + "Flag which, when set to @samp{#t}, allows users to follow a file in the +log view.") + (enable-http-clone? + (boolean #t) + "If set to @samp{#t}, Cgit will act as an dumb HTTP endpoint for Git +clones.") + (enable-index-links? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit generate extra links +\"summary\", \"commit\", \"tree\" for each repo in the repository index.") + (enable-index-owner? + (boolean #t) + "Flag which, when set to @samp{#t}, will make Cgit display the owner of +each repo in the repository index.") + (enable-log-filecount? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit print the number of +modified files for each commit on the repository log page.") + (enable-log-linecount? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit print the number of +added and removed lines for each commit on the repository log page.") + (enable-remote-branches? + (boolean #f) + "Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views.") + (enable-subject-links? + (boolean #f) + "Flag which, when set to @code{1}, will make Cgit use the subject of +the parent commit as link text when generating links to parent commits +in commit view.") + (enable-html-serving? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit use the subject of t= he +parent commit as link text when generating links to parent commits in +commit view.") + (enable-tree-linenumbers? + (boolean #t) + "Flag which, when set to @samp{#t}, will make Cgit generate linenumber +links for plaintext blobs printed in the tree view.") + (enable-git-config? + (boolean #f) + "Flag which, when set to @samp{#f}, will allow Cgit to use Git config to +set any repo specific settings.") + (favicon + (string "/favicon.ico") + "URL used as link to a shortcut icon for Cgit.") + (footer + (string "") + "The content of the file specified with this option will be included +verbatim at the bottom of all pages (i.e. it replaces the standard +\"generated by...\" message.") + (head-include + (string "") + "The content of the file specified with this option will be included +verbatim in the HTML HEAD section on all pages.") + (header + (string "") + "The content of the file specified with this option will be included +verbatim at the top of all pages.") + (include + (string "") + "Name of a configfile to include before the rest of the current config- +file is parsed.") + (index-header + (string "") + "The content of the file specified with this option will be included +verbatim above the repository index.") + (index-info + (string "") + "The content of the file specified with this option will be included +verbatim below the heading on the repository index page.") + (local-time? + (boolean #f) + "Flag which, if set to @samp{#t}, makes Cgit print commit and tag times +in the servers timezone.") + (logo + (string "/share/cgit/cgit.png") + "URL which specifies the source of an image which will be used as a logo +on all Cgit pages.") + (logo-link + (string "") + "URL loaded when clicking on the Cgit logo image.") + (owner-filter + (string "") + "Command which will be invoked to format the Owner column of the main +page.") + (max-atom-items + (integer 10) + "Number of items to display in atom feeds view.") + (max-commit-count + (integer 50) + "Number of entries to list per page in \"log\" view.") + (max-message-length + (integer 80) + "Number of commit message characters to display in \"log\" view.") + (max-repo-count + (integer 50) + "Specifies the number of entries to list per page on the repository ind= ex +page.") + (max-repodesc-length + (integer 80) + "Specifies the maximum number of repo description characters to display +on the repository index page.") + (max-blob-size + (integer 0) + "Specifies the maximum size of a blob to display HTML for in KBytes.") + (max-stats + (string "") + "Maximum statistics period. Valid values are @samp{week},@samp{month}, +@samp{quarter} and @samp{year.}") + (mimetype + (mimetype-alist '((gif "image/gif") + (html "text/html") + (jpg "image/jpeg") + (jpeg "image/jpeg") + (pdf "application/pdf") + (png "image/png") + (svg "image/svg+xml"))) + "Mimetype for the specified filename extension.") + (mimetype-file + (string "") + "Specifies the file to use for automatic mimetype lookup.") + (module-link + (string "") + "Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing.") + (nocache? + (boolean #f) + "If set to the value @samp{#t} caching will be disabled.") + (noplainemail? + (boolean #f) + "If set to @samp{#t} showing full author email addresses will be +disabled.") + (noheader? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit omit the standard +header on all pages.") + (project-list + (list '()) + "A list of subdirectories inside of @code{repository-directory}, relati= ve +to it, that should loaded as Git repositories.") + (readme + (string "") + "Text which will be used as default value for @code{cgit-repo-readme}.") + (remove-suffix? + (boolean #f) + "If set to @code{#t} and @code{repository-directory} is enabled, if any +repositories are found with a suffix of @code{.git}, this suffix will be +removed for the URL and name.") + (renamelimit + (integer -1) + "Maximum number of files to consider when detecting renames.") + (repository-sort + (string "") + "The way in which repositories in each section are sorted.") + (robots + (robots-list (list "noindex" "nofollow")) + "Text used as content for the @code{robots} meta-tag.") + (root-desc + (string "a fast webinterface for the git dscm") + "Text printed below the heading on the repository index page.") + (root-readme + (string "") + "The content of the file specified with this option will be included +verbatim below thef \"about\" link on the repository index page.") + (root-title + (string "") + "Text printed as heading on the repository index page.") + (scan-hidden-path + (boolean #f) + "If set to @samp{#t} and repository-directory is enabled, +repository-directory will recurse into directories whose name starts with a +period. Otherwise, repository-directory will stay away from such director= ies, +considered as \"hidden\". Note that this does not apply to the \".git\" +directory in non-bare repos.") + (snapshots + ;; Should be specified before repository-directory, + ;; see . + (list '()) + "Text which specifies the default set of snapshot formats that cgit +generates links for.") + (repository-directory + (repository-directory "/srv/git") + "Name of the directory to scan for repositories.") + (section + (string "") + "The name of the current repository section - all repositories defined +after this option will inherit the current section name.") + (section-sort + (string "") + "Flag which, when set to @samp{1}, will sort the sections on the reposi= tory +listing by name.") + (section-from-path + (integer 0) + "A number which, if defined prior to repository-directory, specifies how +many path elements from each repo path to use as a default section name.") + (side-by-side-diffs? + (boolean #f) + "If set to @samp{#t} shows side-by-side diffs instead of unidiffs per +default.") + (source-filter + (string "") + "Specifies a command which will be invoked to format plaintext blobs in= the +tree view.") + (summary-branches + (integer 10) + "Specifies the number of branches to display in the repository \"summar= y\" +view.") + (summary-log + (integer 10) + "Specifies the number of log entries to display in the repository +\"summary\" view.") + (summary-tags + (integer 10) + "Specifies the number of tags to display in the repository \"summary\" +view.") + (strict-export + (string "") + "Filename which, if specified, needs to be present within the repository +for Cgit to allow access to that repository.") + (virtual-root + (string "/") + "URL which, if specified, will be used as root for all Cgit links.") + (repositories + (repository-cgit-configuration-list '()) + "A list of @dfn{cgit-repo} records to use with config.")) + +(define (configuration->text config) + (with-output-to-string + (lambda _ + (serialize-configuration config cgit-configuration-fields)))) + +(define (cgit-configuration-file config) + "Return the Cgit configuration file corresponding to CONFIG." + (plain-file "cgitrc" config)) + +(define (cgit-configuration-file-text config) + (cgit-configuration-file (configuration->text config))) + +(define (cgit-activation config) + (match config + (($ cache-root) + #~(begin + (use-modules (guix build utils)) + (mkdir-p #$cache-root) + ;; Cgit compiled with default configuration path. + (copy-file #$(cgit-configuration-file-text 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)) + (description + "Run the Cgit web interface, which allows users to browse Git +repositories."))) + +(define (generate-cgit-documentation) + (generate-documentation + `((cgit-configuration + ,cgit-configuration-fields + (repositories repository-cgit-configuration)) + (repository-cgit-configuration + ,repository-cgit-configuration-fields)) + 'cgit-configuration)) diff --git a/gnu/services/version-control.scm b/gnu/services/version-contro= l.scm index 6bf656949..dc3bd056c 100644 =2D-- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -1,7 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2016 ng0 ;;; Copyright =C2=A9 2016 Sou Bunnbu =2D;;; Copyright =C2=A9 2017 Oleg Pykhalov ;;; Copyright =C2=A9 2017 Cl=C3=A9ment Lassieur ;;; ;;; This file is part of GNU Guix. @@ -38,26 +37,6 @@ git-daemon-configuration git-daemon-configuration? =20 =2D =2D cgit-configuration-file =2D cgit-configuration-file? =2D cgit-configuration-file-css =2D cgit-configuration-file-logo =2D cgit-configuration-file-robots =2D cgit-configuration-file-virtual-root =2D cgit-configuration-file-repository-directory =2D =2D =2D cgit-configuration =2D cgit-configuration? =2D cgit-configuration-config-file =2D cgit-configuration-package =2D =2D %cgit-configuration-nginx =2D cgit-configuration-nginx-config =2D =2D cgit-service-type =2D git-http-configuration git-http-configuration? git-http-nginx-location-configuration)) @@ -173,103 +152,6 @@ access to exported repositories under @file{/srv/git}= ." (service git-daemon-service-type config)) =20 =2D;;; =2D;;; Cgit =2D;;; =2D =2D(define-record-type* =2D cgit-configuration-file =2D make-cgit-configuration-file =2D cgit-configuration-file? =2D (css cgit-configuration-file-css ; s= tring =2D (default "/share/cgit/cgit.css")) =2D (logo cgit-configuration-file-logo ; s= tring =2D (default "/share/cgit/cgit.png")) =2D (robots cgit-configuration-file-robots ; l= ist =2D (default '("noindex" "nofollow"))) =2D (virtual-root cgit-configuration-file-virtual-root ; s= tring =2D (default "/")) =2D (repository-directory cgit-configuration-file-repository-directory ; s= tring =2D (default "/srv/git"))) =2D =2D(define (cgit-configuration-robots-string robots) =2D (string-join robots ", ")) =2D =2D(define-gexp-compiler (cgit-configuration-file-compiler =2D (file ) system target) =2D (match file =2D (($ css logo =2D robots virtual-root repository-directo= ry) =2D (apply text-file* "cgitrc" =2D (letrec-syntax ((option (syntax-rules () =2D ((_ key value) =2D (if value =2D `(,key "=3D" ,value "\n") =2D '())))) =2D (key/value (syntax-rules () =2D ((_ (key value) rest ...) =2D (append (option key value) =2D (key/value rest ...))) =2D ((_) =2D '())))) =2D (key/value ("css" css) =2D ("logo" logo) =2D ("robots" (cgit-configuration-robots-string rob= ots)) =2D ("virtual-root" virtual-root) =2D ("scan-path" repository-directory))))))) =2D =2D(define %cgit-configuration-nginx =2D (list =2D (nginx-server-configuration =2D (root cgit) =2D (locations =2D (list =2D (nginx-location-configuration =2D (uri "@cgit") =2D (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cg= it.cgi;" =2D "fastcgi_param PATH_INFO $uri;" =2D "fastcgi_param QUERY_STRING $args;" =2D "fastcgi_param HTTP_HOST $server_name;" =2D "fastcgi_pass 127.0.0.1:9000;"))))) =2D (try-files (list "$uri" "@cgit")) =2D (listen '("80")) =2D (ssl-certificate #f) =2D (ssl-certificate-key #f)))) =2D =2D(define-record-type* =2D cgit-configuration make-cgit-configuration =2D cgit-configuration? =2D (config-file cgit-configuration-config-file =2D (default (cgit-configuration-file))) =2D (package cgit-configuration-package =2D (default cgit)) =2D (nginx cgit-configuration-nginx =2D (default %cgit-configuration-nginx))) =2D =2D(define (cgit-activation config) =2D ;; Cgit compiled with default configuration path =2D #~(begin =2D (use-modules (guix build utils)) =2D (mkdir-p "/var/cache/cgit") =2D (copy-file #$(cgit-configuration-config-file config) "/etc/cgitrc"= ))) =2D =2D(define (cgit-configuration-nginx-config config) =2D (cgit-configuration-nginx config)) =2D =2D(define cgit-service-type =2D (service-type =2D (name 'cgit) =2D (extensions =2D (list (service-extension activation-service-type =2D cgit-activation) =2D (service-extension nginx-service-type =2D cgit-configuration-nginx-config))) =2D (default-value (cgit-configuration)) =2D (description =2D "Run the Cgit web interface, which allows users to browse Git =2Drepositories."))) =2D =2D ;;; ;;; HTTP access. Add the result of calling ;;; git-http-nginx-location-configuration to an nginx-server-configuration= 's diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm index 7367861b0..53e247a05 100644 =2D-- a/gnu/tests/version-control.scm +++ b/gnu/tests/version-control.scm @@ -26,6 +26,7 @@ #:use-module (gnu system vm) #:use-module (gnu services) #:use-module (gnu services version-control) + #:use-module (gnu services cgit) #:use-module (gnu services web) #:use-module (gnu services networking) #:use-module (gnu packages version-control) =2D-=20 2.15.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEc+OyAXw1EaDPCmAPckbhHGm3lWkFAlo9iD0ACgkQckbhHGm3 lWlksQ/+MtNX6mgmL53hk02b/qjUomoMx1uo0FpbUfcDfKxA2INShv/peqv0IwKh RdcS/6sxmafp5DYzo3C7bAco9+k53TI5paJoU3tPF5n+cGQshqViS6NljEGUoowN oimgBezkOvyzBy29Eh616LfNIt/bjpEhzQktMxy7tVKp4eO6Gs9V/HRALYrJMF3Z 4/eIa+m4qjbUnFe0y6y90quh4oNvyBvPUZm4PRV65yJjnMcqDmV7s0NaWHR9D+J9 IIzftZN823Aiui6sN8GR86mHrO05+tu+b998JTaQP7ELZdcnUoVrVSp9r+VAQ/4e 6k3LUndg3DPGwTZ2Hln55aNTeav33wJbu0NRXiFi2MJEhQOCsj2ymaCIAnDatPKN MAMsK4jx2vFRHSfkaGhlgqOHYL/WG2wRIHlrlZMyyCEthC/VUH/91eVZQNSLmyPs lIAhHpveljocU2L1S5PyKEUON7Y1CFflxgIKKm/RKg2LlOBHwdefi1S2iUQNmCo0 QFIUlnM4Ih7w5pOruNxABHvhAKNEaB6AST+/v7GFN4pTqF+UoOD9njQ334Qkq53R t/S7bp0nwD5ch10w4+zQqwpselJnBRyzZFrfqT+Hr4HnXsSVXbWBFbtOZ7wp7s20 F2gNSc4Ae3MJGeg8BHYyVaGif5xsSj/4sscz3hFdbaJNaMgd2KE= =woow -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 25 12:00:40 2017 Received: (at 29820) by debbugs.gnu.org; 25 Dec 2017 17:00:40 +0000 Received: from localhost ([127.0.0.1]:52011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTW7E-0006lE-9F for submit@debbugs.gnu.org; Mon, 25 Dec 2017 12:00:40 -0500 Received: from mail.lassieur.org ([83.152.10.219]:33752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTW79-0006l2-8v for 29820@debbugs.gnu.org; Mon, 25 Dec 2017 12:00:38 -0500 Received: from rodion (192.168.0.254 [192.168.0.254]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id b607dd20 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Mon, 25 Dec 2017 17:00:32 +0000 (UTC) References: <87incy9yv6.fsf@gmail.com> User-agent: mu4e 0.9.18; emacs 25.3.1 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur To: Oleg Pykhalov Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. In-reply-to: <87incy9yv6.fsf@gmail.com> Date: Mon, 25 Dec 2017 18:00:32 +0100 Message-ID: <87lghqbv4f.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29820 Cc: 29820@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 (/) Oleg Pykhalov writes: > From 26b620e568dd5ad6d2429138e3d34533cb764036 Mon Sep 17 00:00:00 2001 > From: Oleg Pykhalov > Date: Tue, 12 Dec 2017 02:13:55 +0300 > Subject: [PATCH] services: cgit: Add more configuration fields. > > * gnu/services/version-control.scm (cgit-service-type): Move to separate file. > * gnu/services/cgit.scm: New file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Add this. > * gnu/tests/version-control.scm (gnu): Add this. > * doc/guix.texi (Cgit Service): Document this. > --- > doc/guix.texi | 925 +++++++++++++++++++++++++++++++++++++-- > gnu/local.mk | 1 + > gnu/services/cgit.scm | 642 +++++++++++++++++++++++++++ > gnu/services/version-control.scm | 118 ----- > gnu/tests/version-control.scm | 1 + > 5 files changed, 1535 insertions(+), 152 deletions(-) > create mode 100644 gnu/services/cgit.scm Hi Oleg, thank you very much for this work! > +(define (serialize-repository-cgit-configuration x) > + (serialize-configuration x repository-cgit-configuration-fields)) 'url' needs to be the first setting specified for each repo. I think you could use something like this to make sure it is: (define (serialize-repository-cgit-configuration x) (define (rest? field) (not (eq? (configuration-field-name field) 'url))) (let ((url (repository-cgit-configuration-url x)) (rest (filter rest? repository-cgit-configuration-fields))) (serialize-repo-string 'url url) (serialize-configuration x rest))) The same mechanism could be used for 'snapshots' and 'source-filter', according to the Archlinux link you provided. > +(define (serialize-module-link-path field-name val) > + (if (null? val) > + "" > + (format #t "repo.~a.~a=~a\n" > + (uglify-field-name field-name) > + (car val) (cadr val)))) I think 'match' is better than 'car' and 'cadr' because it names things. > +(define (serialize-mimetype-alist field-name val) > + (format #t "# Mimetypes\n~a" > + (apply string-append > + (fold (lambda (x xs) > + (cons* (symbol->string (car x)) "=" (cadr x) "\n" xs)) > + '() val)))) Maybe you could use 'match' instead of 'car' and 'cadr'? And I think 'x' and 'xs' are not very clear. Also, isn't 'map' more natural than 'fold'? I'd use something like this: (define (serialize-mimetype-alist-clem field-name val) (format #t "# Mimetypes\n~a" (string-join (map (match-lambda ((extension mimetype) (format #f "~a=~a" (symbol->string extension) mimetype))) val) "\n"))) Another advantage is that the order won't be inverted. > + (defbranch > + (repo-string "") ^--- Extra space here (because of 'def' being interpreted by your text editor I reckon). > + "The name of the default branch for this repository. If no such branch Two spaces here :-) --------^ > + (email-filter > + (repo-string "") > + "Override the default @code{email-filter.}") }. ---^ > + (enable-remote-branches? > + (repo-boolean #f) > + "Flag which, when set to @code{#t}, will make Cgit display remote > +branches in the summary and refs views.") I think the official project uses 'cgit' instead of 'Cgit' (there are other occurrences where you use 'Cgit'). > +(define-configuration cgit-configuration > + (package > + (package cgit) ^--- There is one extra space here (because package is interpreted by your text editor I reckon). > + (footer > + (string "") > + "The content of the file specified with this option will be included > +verbatim at the bottom of all pages (i.e. it replaces the standard > +\"generated by...\" message.") I think you forgot the closing parenthesis inside the comment. > + (max-stats > + (string "") > + "Maximum statistics period. Valid values are @samp{week},@samp{month}, Space here :-) ---^ > +@samp{quarter} and @samp{year.}") }. ----^ > + (scan-hidden-path > + (boolean #f) > + "If set to @samp{#t} and repository-directory is enabled, > +repository-directory will recurse into directories whose name starts with a > +period. Otherwise, repository-directory will stay away from such directories, > +considered as \"hidden\". Note that this does not apply to the \".git\" Space here -----^ > + (repository-directory > + (repository-directory "/srv/git") > + "Name of the directory to scan for repositories.") I believe it would be clearer if it was named the same way cgit names it: scan-path. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 26 08:54:29 2017 Received: (at 29820) by debbugs.gnu.org; 26 Dec 2017 13:54:29 +0000 Received: from localhost ([127.0.0.1]:52457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTpga-0005n5-S3 for submit@debbugs.gnu.org; Tue, 26 Dec 2017 08:54:28 -0500 Received: from mail.lassieur.org ([83.152.10.219]:33756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTpgY-0005mw-OU for 29820@debbugs.gnu.org; Tue, 26 Dec 2017 08:54:27 -0500 Received: from rodion (192.168.0.254 [192.168.0.254]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id 49af5f15 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Tue, 26 Dec 2017 13:54:22 +0000 (UTC) References: <87incy9yv6.fsf@gmail.com> User-agent: mu4e 0.9.18; emacs 25.3.1 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur To: Oleg Pykhalov Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. In-reply-to: <87incy9yv6.fsf@gmail.com> Date: Tue, 26 Dec 2017 14:54:21 +0100 Message-ID: <87k1x9bnn6.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29820 Cc: 29820@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 (/) Oleg Pykhalov writes: > + (project-list > + (list '()) > + "A list of subdirectories inside of @code{repository-directory}, relative > +to it, that should loaded as Git repositories.") I forgot one thing: 'project-list' is a file, not a list of strings. I agree it's weird that cgit's documentation doesn't say it's a file. I see two solutions: 1. Change the type to 'string', so that people can set a file name. 2. Use a list type that would transparently transform its values into a file in the store, with the generated cgitrc file pointing to it. The second solution is better because the user won't need to create the file. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 26 14:59:52 2017 Received: (at 29820) by debbugs.gnu.org; 26 Dec 2017 19:59:52 +0000 Received: from localhost ([127.0.0.1]:52915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTvOB-0005yQ-QP for submit@debbugs.gnu.org; Tue, 26 Dec 2017 14:59:51 -0500 Received: from mail.lassieur.org ([83.152.10.219]:33764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTvO5-0005yA-S0 for 29820@debbugs.gnu.org; Tue, 26 Dec 2017 14:59:50 -0500 Received: from rodion (192.168.0.254 [192.168.0.254]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id dac99072 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Tue, 26 Dec 2017 19:59:41 +0000 (UTC) References: <87incy9yv6.fsf@gmail.com> User-agent: mu4e 0.9.18; emacs 25.3.1 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur To: Oleg Pykhalov Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. In-reply-to: <87incy9yv6.fsf@gmail.com> Date: Tue, 26 Dec 2017 20:59:41 +0100 Message-ID: <87h8sdb6qa.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29820 Cc: 29820@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 (/) Oleg Pykhalov writes: > From 26b620e568dd5ad6d2429138e3d34533cb764036 Mon Sep 17 00:00:00 2001 > From: Oleg Pykhalov > Date: Tue, 12 Dec 2017 02:13:55 +0300 > Subject: [PATCH] services: cgit: Add more configuration fields. > > * gnu/services/version-control.scm (cgit-service-type): Move to separate file. > * gnu/services/cgit.scm: New file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Add this. > * gnu/tests/version-control.scm (gnu): Add this. > * doc/guix.texi (Cgit Service): Document this. > --- Also, could you add a way to use an opaque configuration file? It would be helpful for users who don't have time to update their configuration, or in case there are new cgit configurations that are not yet implemented by the Scheme service. Thank you :-) From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 28 11:45:48 2017 Received: (at 29820) by debbugs.gnu.org; 28 Dec 2017 16:45:48 +0000 Received: from localhost ([127.0.0.1]:55376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eUbJP-0002Xs-Df for submit@debbugs.gnu.org; Thu, 28 Dec 2017 11:45:48 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:43985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eUbJJ-0002Xc-Oa for 29820@debbugs.gnu.org; Thu, 28 Dec 2017 11:45:41 -0500 Received: by mail-lf0-f53.google.com with SMTP id o26so31584856lfc.10 for <29820@debbugs.gnu.org>; Thu, 28 Dec 2017 08:45:37 -0800 (PST) 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=cjdTArtv+n2bhIQ1O4V+Hk6bYJhurHZ3/IJzdxtLtzI=; b=HWyWbg4N8QiFjR+eRtx7Q3/FNw5UOx9AZ/RAfOZqsHnMTOFxR83+oF5tY/BinMEBo1 boUYadjCEBkuGs7xZlpfVSdEXLZ8K2hPY+2FFu6r1hTxc19/4TwnDqwGvcGpIATsb7Am JS+FJrdcmv8w1iFIJx6a4paPQ8d51LCnojWxLMsjUcgX+FMqYYbGry+Kjxk28gpUAyFD nafR223PGCuj5oBOZ9aiPu4U130S+jvPrWnxyG11nqcWyECJCWx105XUc2yOy7xhqiHQ YpY8uFK7+k5qwvvuqOKEBIVOlkuuA1CIM3fv6CBN+gU4M2DuauwHwMNrqNt9eZB34/we HPLQ== 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=cjdTArtv+n2bhIQ1O4V+Hk6bYJhurHZ3/IJzdxtLtzI=; b=nFhrAxZv0bX47EoyovRF+oVJBGYvhebq8pH66489fSVgXj0xUkHEuDQJrGsCSl7j3U gjKFCTnEQxf80EsCFoXDA70yIL2aclPL4AsXS+2HYu9KeiDkFRPpfcq5PMVqTvcH6rP3 LNkIGvg1xR8nX1BTGWkU1HO8mxqcj0pGbLRj/3csUF0I5CTRGilBo5qH79OsS4XgQbdO BZBvnmqfmPn6YyzgAoyfkSuApwqlq3FRqmBMw60l2/yGy5EN1kb5Ja8ajkU7zmOFou8G f6GQM1mSavAz+6Aeh3Fg18jJOrCR22G3OPJAV1yfCOKUxMGKuRbTiFTxiIkohMNSsZlf yTog== X-Gm-Message-State: AKGB3mILzJEimb7IjQLYzxK1dRq62IKfj2d9CwFJP3hJ+vMq/lOaFltX k05xDvPHV3YnJ+u6cSiEdmQ4T/o0 X-Google-Smtp-Source: ACJfBotLy4tciGJn5SAn+NVAtTHVbrxzoRL/oJDk17zf9DM+Xa3WnLGSBw3yrzg8gYpRuXANwV4ryw== X-Received: by 10.46.21.87 with SMTP id 23mr18496121ljv.107.1514479530842; Thu, 28 Dec 2017 08:45:30 -0800 (PST) Received: from magnolia (ppp78-37-129-160.pppoe.avangarddsl.ru. [78.37.129.160]) by smtp.gmail.com with ESMTPSA id e23sm4061300lfi.92.2017.12.28.08.45.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Dec 2017 08:45:29 -0800 (PST) From: Oleg Pykhalov To: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. References: <87incy9yv6.fsf@gmail.com> <87h8sdb6qa.fsf@lassieur.org> Date: Thu, 28 Dec 2017 19:45:22 +0300 In-Reply-To: <87h8sdb6qa.fsf@lassieur.org> (=?utf-8?Q?=22Cl=C3=A9ment?= Lassieur"'s message of "Tue, 26 Dec 2017 20:59:41 +0100") Message-ID: <87po6yu7h9.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.0 (/) X-Debbugs-Envelope-To: 29820 Cc: 29820@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 Hello Cl=C3=A9ment, Thank you for review! Cl=C3=A9ment Lassieur writes: [...] >> +(define (serialize-repository-cgit-configuration x) >> + (serialize-configuration x repository-cgit-configuration-fields)) > > 'url' needs to be the first setting specified for each repo. I think > you could use something like this to make sure it is: > > (define (serialize-repository-cgit-configuration x) > (define (rest? field) > (not (eq? (configuration-field-name field) 'url))) > (let ((url (repository-cgit-configuration-url x)) > (rest (filter rest? repository-cgit-configuration-fields))) > (serialize-repo-string 'url url) > (serialize-configuration x rest))) Output doesn't change. --8<---------------cut here---------------start------------->8--- scheme@(gnu services cgit)> (serialize-configuration (repository-cgit-configuration (url "http://cgit.magnolia.local") (source-filter "la")) repository-cgit-configuration-fields) repo.enable-commit-graph=3D0 repo.enable-log-filecount=3D0 repo.enable-log-linecount=3D0 repo.enable-remote-branches=3D0 repo.enable-subject-links=3D0 repo.enable-html-serving=3D0 repo.hide=3D0 repo.ignore=3D0 repo.source-filter=3Dla repo.url=3Dhttp://cgit.magnolia.local scheme@(gnu services cgit)>=20 It's been nice interacting with you! Press C-c C-z to bring me back. GNU Guile 2.2.2 Copyright (C) 1995-2017 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> ,m (gnu services cgit) ;;; note: source file /home/natsu/src/guix-wip-cgit/gnu/services/cgit.scm ;;; newer than compiled /home/natsu/src/guix-wip-cgit/gnu/services/cg= it.go ;;; note: source file /home/natsu/src/guix-wip-cgit/gnu/services/cgit.scm ;;; newer than compiled /home/natsu/.cache/guile/ccache/2.2-LE-8-3.A/= home/natsu/src/guix-wip-cgit/gnu/services/cgit.scm.go scheme@(gnu services cgit)> (serialize-configuration (repository-cgit-configuration (url "http://cgit.magnolia.local") (source-filter "la")) repository-cgit-configuration-fields) repo.enable-commit-graph=3D0 repo.enable-log-filecount=3D0 repo.enable-log-linecount=3D0 repo.enable-remote-branches=3D0 repo.enable-subject-links=3D0 repo.enable-html-serving=3D0 repo.hide=3D0 repo.ignore=3D0 repo.source-filter=3Dla repo.url=3Dhttp://cgit.magnolia.local --8<---------------cut here---------------end--------------->8--- > The same mechanism could be used for 'snapshots' and 'source-filter', > according to the Archlinux link you provided. However, simple reordering fields in (define-configuration =E2=80=A6) works. I reordered in attached patch. Is it good enough? --8<---------------cut here---------------start------------->8--- scheme@(gnu services cgit)> (serialize-configuration (repository-cgit-configuration (url "http://cgit.magnolia.local") (source-filter "la")) repository-cgit-configuration-fields) repo.url=3Dhttp://cgit.magnolia.local repo.enable-commit-graph=3D0 repo.enable-log-filecount=3D0 repo.enable-log-linecount=3D0 repo.enable-remote-branches=3D0 repo.enable-subject-links=3D0 repo.enable-html-serving=3D0 repo.hide=3D0 repo.ignore=3D0 repo.source-filter=3Dla --8<---------------cut here---------------end--------------->8--- >> +(define (serialize-module-link-path field-name val) >> + (if (null? val) >> + "" >> + (format #t "repo.~a.~a=3D~a\n" >> + (uglify-field-name field-name) >> + (car val) (cadr val)))) > > I think 'match' is better than 'car' and 'cadr' because it names things. Applied. >> +(define (serialize-mimetype-alist field-name val) >> + (format #t "# Mimetypes\n~a" >> + (apply string-append >> + (fold (lambda (x xs) >> + (cons* (symbol->string (car x)) "=3D" (cadr x)= "\n" xs)) >> + '() val)))) > > > Maybe you could use 'match' instead of 'car' and 'cadr'? And I think > 'x' and 'xs' are not very clear. Also, isn't 'map' more natural than > 'fold'? I'd use something like this: > > (define (serialize-mimetype-alist-clem field-name val) > (format #t "# Mimetypes\n~a" > (string-join > (map (match-lambda > ((extension mimetype) > (format #f "~a=3D~a" (symbol->string extension) mimety= pe))) > val) "\n"))) > > Another advantage is that the order won't be inverted. Applied. Also I added forgoten "mimetype.". >> + (defbranch >> + (repo-string "") > ^--- Extra space here (because of 'def' being interpreted by your > text editor I reckon). Applied. >> + "The name of the default branch for this repository. If no such bra= nch > Two spaces here :-) --------^ Applied. >> + (email-filter >> + (repo-string "") >> + "Override the default @code{email-filter.}") > }. ---^ Applied. >> + (enable-remote-branches? >> + (repo-boolean #f) >> + "Flag which, when set to @code{#t}, will make Cgit display remote >> +branches in the summary and refs views.") > > I think the official project uses 'cgit' instead of 'Cgit' (there are > other occurrences where you use 'Cgit'). Ludovic asked to capitalize cgit in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28283#14 >> +(define-configuration cgit-configuration >> + (package >> + (package cgit) > ^--- There is one extra space here (because package is interpreted > by your text editor I reckon). Applied. >> + (footer >> + (string "") >> + "The content of the file specified with this option will be included >> +verbatim at the bottom of all pages (i.e. it replaces the standard >> +\"generated by...\" message.") > > I think you forgot the closing parenthesis inside the comment. Applied. >> + (max-stats >> + (string "") >> + "Maximum statistics period. Valid values are @samp{week},@samp{mont= h}, > Space here :-) ---^ >> +@samp{quarter} and @samp{year.}") > }. ----^ Done >> + (scan-hidden-path >> + (boolean #f) >> + "If set to @samp{#t} and repository-directory is enabled, >> +repository-directory will recurse into directories whose name starts wi= th a >> +period. Otherwise, repository-directory will stay away from such direc= tories, >> +considered as \"hidden\". Note that this does not apply to the \".git\" > Space here -----^ Applied. >> + (repository-directory >> + (repository-directory "/srv/git") >> + "Name of the directory to scan for repositories.") > > I believe it would be clearer if it was named the same way cgit names > it: scan-path. Ludovic asked to rename it in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28283#14 I don't know should we stay close to cgit naming conventions or not. Thoughts? >> + (project-list >> + (list '()) >> + "A list of subdirectories inside of @code{repository-directory}, rel= ative >> +to it, that should loaded as Git repositories.") > > I forgot one thing: 'project-list' is a file, not a list of strings. I > agree it's weird that cgit's documentation doesn't say it's a file. I > see two solutions: Sorry, it's not clear for me. As I understand from CGITRC(5) it's a list like: project-list=3D/share/cgit/cgit.png /share/cgit/cgit.jpg relative to /srv/git (in our case). > 1. Change the type to 'string', so that people can set a file name. > > 2. Use a list type that would transparently transform its values into a > file in the store, with the generated cgitrc file pointing to it. > > The second solution is better because the user won't need to create the > file. I choose 1st for now, because 2nd I don't understand what need to be produced at the end. Could you give me an example? > Also, could you add a way to use an opaque configuration file? It would > be helpful for users who don't have time to update their configuration, > or in case there are new cgit configurations that are not yet > implemented by the Scheme service. Sure. Is the following order is OK? (serialize-configuration (cgit-configuration (extra-options (list "soo=3Ddo")) (repositories (list (repository-cgit-configuration (module-link-path '("/super/cow" "moo")) (extra-options (list "goo=3Dfoo")))))) cgit-configuration-fields) =E2=80=A6 repo.extra-options=3Dgoo=3Dfoo extra-options=3Dsoo=3Ddo # END OF FILE Also I need to mention that this patch probably will broke system reconfigure and require update /etc/config.scm. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-services-cgit-Add-more-configuration-fields.patch Content-Transfer-Encoding: quoted-printable >From d48b3bf9915e4d161eec98a3d52df8644a0b2bfa Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Tue, 12 Dec 2017 02:13:55 +0300 Subject: [PATCH] services: cgit: Add more configuration fields. * gnu/services/version-control.scm (cgit-service-type): Move to separate fi= le. * gnu/services/cgit.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add this. * gnu/tests/version-control.scm (gnu): Add this. * doc/guix.texi (Cgit Service): Document this. --- doc/guix.texi | 942 +++++++++++++++++++++++++++++++++++= ++-- gnu/local.mk | 1 + gnu/services/cgit.scm | 658 +++++++++++++++++++++++++++ gnu/services/version-control.scm | 118 ----- gnu/tests/version-control.scm | 1 + 5 files changed, 1568 insertions(+), 152 deletions(-) create mode 100644 gnu/services/cgit.scm diff --git a/doc/guix.texi b/doc/guix.texi index 94d4d8f92..19ba6b5a6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17897,57 +17897,931 @@ By default, Cgit can be accessed on port 80 (@co= de{http://localhost:80}). @example (service nginx-service-type) (service fcgiwrap-service-type) -(service cgit-service-type) +(service cgit-service-type + (cgit-configuration + (branch-sort "age") + (enable-commit-graph? #t) + (enable-follow-links? #t) + (enable-index-links? #t) + (enable-log-filecount? #t) + (enable-log-linecount? #t) + (enable-remote-branches? #t) + (enable-subject-links? #t) + (remove-suffix? #t) + (enable-index-owner? #f) + (snapshots (list "tar.gz")))) @end example =20 -@deftp {Data Type} cgit-configuration -Data type representing the configuration of Cgit. -This type has the following parameters: +@c The following documentation was initially generated by +@c (generate-cgit-documentation) in (gnu services cgit). Manually +@c maintained documentation is better, so we shouldn't hesitate to edit +@c below as needed. However if the change you want to make to this +@c documentation can be done in an automated way, it's probably easier +@c to change (generate-documentation) than to make it below and have to +@c deal with the churn as Cgit updates. =20 -@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}). +Available @code{cgit-configuration} fields are: =20 -For example, to instead use a local file, the @code{local-file} function -can be used: +@deftypevr {@code{cgit-configuration} parameter} package package +The CGIT package. =20 -@example -(service cgit-service-type - (cgit-configuration - (config-file (local-file "./my-cgitrc.conf")))) -@end example +@end deftypevr =20 -@item @code{package} (default: @code{cgit}) -The Cgit package to use. +@deftypevr {@code{cgit-configuration} parameter} nginx-server-configuratio= n-list nginx +NGINX configuration. =20 -@end table -@end deftp +@end deftypevr =20 -@deftp {Data Type} cgit-configuration-file -Data type representing the configuration options for Cgit. -This type has the following parameters: +@deftypevr {@code{cgit-configuration} parameter} string about-filter +Specifies a command which will be invoked to format the content of about +pages (both top-level and for each repository). =20 -@table @asis -@item @code{css} (default: @code{"/share/cgit/cgit.css"}) +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string agefile +Specifies a path, relative to each repository path, which can be used to +specify the date and time of the youngest commit in the repository. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string auth-filter +Specifies a command that will be invoked for authenticating repository +access. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string branch-sort +Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set @samp{name} enables ordering by branch name. + +Defaults to @samp{"name"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string cache-root +Path used to store the Cgit cache entries. + +Defaults to @samp{"/var/cache/cgit"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-static-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed with a fixed SHA1. + +Defaults to @samp{-1}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-dynamic-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed without a fixed SHA1. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-repo-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of the repository summary page. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-root-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of the repository index page. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-scanrc-ttl +Number which specifies the time-to-live, in minutes, for the result of +scanning a path for Git repositories. + +Defaults to @samp{15}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-about-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of the repository about page. + +Defaults to @samp{15}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-snapshot-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of snapshots. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-size +The maximum number of entries in the cgit cache. When set to @samp{0}, +caching is disabled. + +Defaults to @samp{0}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean case-sensitive-so= rt? +Sort items in the repo list case sensitively. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list clone-prefix +List of common prefixes which, when combined with a repository URL, +generates valid clone URLs for the repository. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list clone-url +List of @code{clone-url} templates. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string commit-filter +Command which will be invoked to format commit messages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string commit-sort +Flag which, when set to @samp{date}, enables strict date ordering in the +commit log, and when set to @samp{topo} enables strict topological +ordering. + +Defaults to @samp{"git log"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string css URL which specifies the css document to include in all Cgit pages. =20 -@item @code{logo} (default: @code{"/share/cgit/cgit.png"}) +Defaults to @samp{"/share/cgit/cgit.css"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string email-filter +Specifies a command which will be invoked to format names and email +address of committers, authors, and taggers, as represented in various +places throughout the Cgit interface. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean embedded? +Flag which, when set to @samp{#t}, will make Cgit generate a HTML +fragment suitable for embedding in other HTML pages. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-commit-gra= ph? +Flag which, when set to @samp{#t}, will make Cgit print an ASCII-art +commit history graph to the left of the commit messages in the +repository log page. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-filter-ove= rrides? +Flag which, when set to @samp{#t}, allows all filter settings to be +overridden in repository-specific cgitrc files. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-follow-lin= ks? +Flag which, when set to @samp{#t}, allows users to follow a file in the +log view. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-http-clone? +If set to @samp{#t}, Cgit will act as an dumb HTTP endpoint for Git +clones. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-index-link= s? +Flag which, when set to @samp{#t}, will make Cgit generate extra links +"summary", "commit", "tree" for each repo in the repository index. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-index-owne= r? +Flag which, when set to @samp{#t}, will make Cgit display the owner of +each repo in the repository index. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-log-fileco= unt? +Flag which, when set to @samp{#t}, will make Cgit print the number of +modified files for each commit on the repository log page. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-log-lineco= unt? +Flag which, when set to @samp{#t}, will make Cgit print the number of +added and removed lines for each commit on the repository log page. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-remote-bra= nches? +Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-subject-li= nks? +Flag which, when set to @code{1}, will make Cgit use the subject of the +parent commit as link text when generating links to parent commits in +commit view. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-html-servi= ng? +Flag which, when set to @samp{#t}, will make Cgit use the subject of the +parent commit as link text when generating links to parent commits in +commit view. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-tree-linen= umbers? +Flag which, when set to @samp{#t}, will make Cgit generate linenumber +links for plaintext blobs printed in the tree view. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-git-config? +Flag which, when set to @samp{#f}, will allow Cgit to use Git config to +set any repo specific settings. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string favicon +URL used as link to a shortcut icon for Cgit. + +Defaults to @samp{"/favicon.ico"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string footer +The content of the file specified with this option will be included +verbatim at the bottom of all pages (i.e. it replaces the standard +"generated by..." message). + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string head-include +The content of the file specified with this option will be included +verbatim in the HTML HEAD section on all pages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string header +The content of the file specified with this option will be included +verbatim at the top of all pages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string include +Name of a configfile to include before the rest of the current config- +file is parsed. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string index-header +The content of the file specified with this option will be included +verbatim above the repository index. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string index-info +The content of the file specified with this option will be included +verbatim below the heading on the repository index page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean local-time? +Flag which, if set to @samp{#t}, makes Cgit print commit and tag times +in the servers timezone. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string logo URL which specifies the source of an image which will be used as a logo on all Cgit pages. =20 -@item @code{virtual-root} (default: @code{"/"}) -URL which, if specified, will be used as root for all Cgit links. +Defaults to @samp{"/share/cgit/cgit.png"}. =20 -@item @code{repository-directory} (default: @code{"/srv/git"}) -Name of the directory to scan for repositories. +@end deftypevr =20 -@item @code{robots} (default: @code{(list "noindex" "nofollow")}) -Text used as content for the ``robots'' meta-tag. +@deftypevr {@code{cgit-configuration} parameter} string logo-link +URL loaded when clicking on the Cgit logo image. =20 -@end table -@end deftp +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string owner-filter +Command which will be invoked to format the Owner column of the main +page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-atom-items +Number of items to display in atom feeds view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-commit-count +Number of entries to list per page in "log" view. + +Defaults to @samp{50}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-message-length +Number of commit message characters to display in "log" view. + +Defaults to @samp{80}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-repo-count +Specifies the number of entries to list per page on the repository index +page. + +Defaults to @samp{50}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-repodesc-leng= th +Specifies the maximum number of repo description characters to display +on the repository index page. + +Defaults to @samp{80}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-blob-size +Specifies the maximum size of a blob to display HTML for in KBytes. + +Defaults to @samp{0}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string max-stats +Maximum statistics period. Valid values are @samp{week},@samp{month}, +@samp{quarter} and @samp{year}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} mimetype-alist mimetype +Mimetype for the specified filename extension. + +Defaults to @samp{((gif "image/gif") (html "text/html") (jpg +"image/jpeg") (jpeg "image/jpeg") (pdf "application/pdf") (png +"image/png") (svg "image/svg+xml"))}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string mimetype-file +Specifies the file to use for automatic mimetype lookup. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string module-link +Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean nocache? +If set to the value @samp{#t} caching will be disabled. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean noplainemail? +If set to @samp{#t} showing full author email addresses will be +disabled. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean noheader? +Flag which, when set to @samp{#t}, will make Cgit omit the standard +header on all pages. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string project-list +A list of subdirectories inside of @code{repository-directory}, relative +to it, that should loaded as Git repositories. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string readme +Text which will be used as default value for @code{cgit-repo-readme}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean remove-suffix? +If set to @code{#t} and @code{repository-directory} is enabled, if any +repositories are found with a suffix of @code{.git}, this suffix will be +removed for the URL and name. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer renamelimit +Maximum number of files to consider when detecting renames. + +Defaults to @samp{-1}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string repository-sort +The way in which repositories in each section are sorted. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} robots-list robots +Text used as content for the @code{robots} meta-tag. + +Defaults to @samp{("noindex" "nofollow")}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string root-desc +Text printed below the heading on the repository index page. + +Defaults to @samp{"a fast webinterface for the git dscm"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string root-readme +The content of the file specified with this option will be included +verbatim below thef "about" link on the repository index page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string root-title +Text printed as heading on the repository index page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean scan-hidden-path +If set to @samp{#t} and repository-directory is enabled, +repository-directory will recurse into directories whose name starts +with a period. Otherwise, repository-directory will stay away from such +directories, considered as "hidden". Note that this does not apply to +the ".git" directory in non-bare repos. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list snapshots +Text which specifies the default set of snapshot formats that cgit +generates links for. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} repository-directory repo= sitory-directory +Name of the directory to scan for repositories. + +Defaults to @samp{"/srv/git"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string section +The name of the current repository section - all repositories defined +after this option will inherit the current section name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string section-sort +Flag which, when set to @samp{1}, will sort the sections on the +repository listing by name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer section-from-path +A number which, if defined prior to repository-directory, specifies how +many path elements from each repo path to use as a default section name. + +Defaults to @samp{0}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean side-by-side-diff= s? +If set to @samp{#t} shows side-by-side diffs instead of unidiffs per +default. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string source-filter +Specifies a command which will be invoked to format plaintext blobs in +the tree view. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer summary-branches +Specifies the number of branches to display in the repository "summary" +view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer summary-log +Specifies the number of log entries to display in the repository +"summary" view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer summary-tags +Specifies the number of tags to display in the repository "summary" +view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string strict-export +Filename which, if specified, needs to be present within the repository +for Cgit to allow access to that repository. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string virtual-root +URL which, if specified, will be used as root for all Cgit links. + +Defaults to @samp{"/"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} repository-cgit-configura= tion-list repositories +A list of @dfn{cgit-repo} records to use with config. + +Defaults to @samp{()}. + +Available @code{repository-cgit-configuration} fields are: + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-list snap= shots +A mask of snapshot formats for this repo that cgit generates links for, +restricted by the global @code{snapshots} setting. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string so= urce-filter +Override the default @code{source-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string url +The relative URL used to access the repository. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ab= out-filter +Override the default @code{about-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string br= anch-sort +Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set to @samp{name} enables ordering by branch name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-list clon= e-url +A list of URLs which can be used to clone repo. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string co= mmit-filter +Override the default @code{commit-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string co= mmit-sort +Flag which, when set to @samp{date}, enables strict date ordering in the +commit log, and when set to @samp{topo} enables strict topological +ordering. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string de= fbranch +The name of the default branch for this repository. If no such branch +exists in the repository, the first branch name (when sorted) is used as +default instead. By default branch pointed to by HEAD, or "master" if +there is no suitable HEAD. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string de= sc +The value to show as repository description. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ho= mepage +The value to show as repository homepage. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string em= ail-filter +Override the default @code{email-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-commit-graph? +A flag which can be used to disable the global setting +@code{enable-commit-graph?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-log-filecount? +A flag which can be used to disable the global setting +@code{enable-log-filecount?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-log-linecount? +A flag which can be used to disable the global setting +@code{enable-log-linecount?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-remote-branches? +Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-subject-links? +A flag which can be used to override the global setting +@code{enable-subject-links?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-html-serving? +A flag which can be used to override the global setting +@code{enable-html-serving?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean h= ide? +Flag which, when set to @code{#t}, hides the repository from the +repository index. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean i= gnore? +Flag which, when set to @samp{#t}, ignores the repository. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string lo= go +URL which specifies the source of an image which will be used as a logo +on this repo=E2=80=99s pages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string lo= go-link +URL loaded when clicking on the Cgit logo image. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ow= ner-filter +Override the default @code{owner-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string mo= dule-link +Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing. The arguments for the +formatstring are the path and SHA1 of the submodule commit. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} module-link-pa= th module-link-path +Text which will be used as the formatstring for a hyperlink when a +submodule with the specified subdirectory path is printed in a directory +listing. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ma= x-stats +Override the default maximum statistics period. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string na= me +The value to show as repository name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ow= ner +A value used to identify the owner of the repository. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string pa= th +An absolute path to the repository directory. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string re= adme +A path (relative to repo) which specifies a file to include verbatim as +the "About" page for this repo. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string se= ction +The name of the current repository section - all repositories defined +after this option will inherit the current section name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-list extr= a-options +Extra options will be appended to cgitrc file. + +Defaults to @samp{()}. + +@end deftypevr + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list extra-options +Extra options will be appended to cgitrc file. + +Defaults to @samp{()}. + +@end deftypevr =20 @node Setuid Programs @subsection Setuid Programs diff --git a/gnu/local.mk b/gnu/local.mk index b1cf3c3de..9c2f91b91 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -445,6 +445,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/services/avahi.scm \ %D%/services/base.scm \ %D%/services/certbot.scm \ + %D%/services/cgit.scm \ %D%/services/configuration.scm \ %D%/services/cuirass.scm \ %D%/services/cups.scm \ diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm new file mode 100644 index 000000000..c45124b7a --- /dev/null +++ b/gnu/services/cgit.scm @@ -0,0 +1,658 @@ +;;; 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 services cgit) + #:use-module (gnu packages admin) + #:use-module (gnu packages version-control) + #:use-module (gnu services base) + #:use-module (gnu services configuration) + #:use-module (gnu services shepherd) + #:use-module (gnu services web) + #:use-module (gnu services) + #:use-module (gnu system shadow) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix records) + #:use-module (guix store) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:export (repository-cgit-configuration + cgit-configuration + %cgit-configuration-nginx + cgit-configuration-nginx-config + cgit-service-type)) + +(define %cgit-configuration-nginx + (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")) + (listen '("80")) + (ssl-certificate #f) + (ssl-certificate-key #f))) + + +;;; +;;; Serialize +;;; + +(define (uglify-field-name field-name) + (let ((str (symbol->string field-name))) + (string-join (string-split (string-delete #\? str) #\-) "-"))) + +(define (serialize-field field-name val) + (format #t "~a=3D~a\n" (uglify-field-name field-name) val)) + +(define (serialize-string field-name val) + (if (string=3D? val "") "" (serialize-field field-name val))) + +(define (serialize-boolean field-name val) + (serialize-field field-name (if val 1 0))) + +(define (serialize-list field-name val) + (if (null? val) "" (serialize-field field-name (string-join val)))) + +(define robots-list? list?) + +(define (serialize-robots-list field-name val) + (if (null? val) "" (serialize-field field-name (string-join val ", ")))) + +(define (integer? val) + (exact-integer? val)) + +(define (serialize-integer field-name val) + (serialize-field field-name val)) + +(define (serialize-repository-cgit-configuration x) + (serialize-configuration x repository-cgit-configuration-fields)) + +(define (repository-cgit-configuration-list? val) + (list? val)) + +(define (serialize-repository-cgit-configuration-list field-name val) + (for-each serialize-repository-cgit-configuration val)) + +(define (nginx-server-configuration-list? val) + (and (list? val) (and-map nginx-server-configuration? val))) + +(define (serialize-nginx-server-configuration-list field-name val) + #f) + + +;;; +;;; Serialize +;;; + +(define (serialize-repo-field field-name val) + (format #t "repo.~a=3D~a\n" (uglify-field-name field-name) val)) + +(define (serialize-repo-list field-name val) + (if (null? val) "" (serialize-repo-field field-name (string-join val)))) + +(define repo-boolean? boolean?) + +(define (serialize-repo-boolean field-name val) + (serialize-repo-field field-name (if val 1 0))) + +(define (serialize-repo-integer field-name val) + (serialize-repo-field field-name val)) + +(define repo-list? list?) + +(define repo-string? string?) + +(define (serialize-repo-string field-name val) + (if (string=3D? val "") "" (serialize-repo-field field-name val))) + +(define module-link-path? list?) + +(define (serialize-module-link-path field-name val) + (if (null? val) "" + (match val + ((path text) + (format #t "repo.~a.~a=3D~a\n" + (string-drop-right (uglify-field-name 'module-link-path) + (string-length "-path")) + path text))))) + +(define repository-directory? string?) + +(define (serialize-repository-directory _ val) + (if (string=3D? val "") "" (format #t "scan-path=3D~a\n" val))) + +(define mimetype-alist? list?) + +(define (serialize-mimetype-alist field-name val) + (format #t "# Mimetypes\n~a" + (string-join + (map (match-lambda + ((extension mimetype) + (format #f "mimetype.~a=3D~a" + (symbol->string extension) mimetype))) + val) "\n"))) + +(define-configuration repository-cgit-configuration + (snapshots ; =C2=B9 + (repo-list '()) + "A mask of snapshot formats for this repo that cgit generates links for, +restricted by the global @code{snapshots} setting.") + (source-filter; =C2=B9 + (repo-string "") + "Override the default @code{source-filter}.") + (url ; =C2=B9 + (repo-string "") + "The relative URL used to access the repository.") + (about-filter + (repo-string "") + "Override the default @code{about-filter}.") + (branch-sort + (repo-string "") + "Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set to @samp{name} enables ordering by branch name.") + (clone-url + (repo-list '()) + "A list of URLs which can be used to clone repo.") + (commit-filter + (repo-string "") + "Override the default @code{commit-filter}.") + (commit-sort + (repo-string "") + "Flag which, when set to @samp{date}, enables strict date ordering in t= he +commit log, and when set to @samp{topo} enables strict topological orderin= g.") + (defbranch + (repo-string "") + "The name of the default branch for this repository. If no such branch +exists in the repository, the first branch name (when sorted) is used as +default instead. By default branch pointed to by HEAD, or \"master\" if t= here +is no suitable HEAD.") + (desc + (repo-string "") + "The value to show as repository description.") + (homepage + (repo-string "") + "The value to show as repository homepage.") + (email-filter + (repo-string "") + "Override the default @code{email-filter}.") + (enable-commit-graph? + (repo-boolean #f) + "A flag which can be used to disable the global setting +@code{enable-commit-graph?}.") + (enable-log-filecount? + (repo-boolean #f) + "A flag which can be used to disable the global setting +@code{enable-log-filecount?}.") + (enable-log-linecount? + (repo-boolean #f) + "A flag which can be used to disable the global setting +@code{enable-log-linecount?}.") + (enable-remote-branches? + (repo-boolean #f) + "Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views.") + (enable-subject-links? + (repo-boolean #f) + "A flag which can be used to override the global setting +@code{enable-subject-links?}.") + (enable-html-serving? + (repo-boolean #f) + "A flag which can be used to override the global setting +@code{enable-html-serving?}.") + (hide? + (repo-boolean #f) + "Flag which, when set to @code{#t}, hides the repository from the +repository index.") + (ignore? + (repo-boolean #f) + "Flag which, when set to @samp{#t}, ignores the repository.") + (logo + (repo-string "") + "URL which specifies the source of an image which will be used as a +logo on this repo=E2=80=99s pages.") + (logo-link + (repo-string "") + "URL loaded when clicking on the Cgit logo image.") + (owner-filter + (repo-string "") + "Override the default @code{owner-filter}.") + (module-link + (repo-string "") + "Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing. The arguments for the +formatstring are the path and SHA1 of the submodule commit.") + (module-link-path + (module-link-path '()) + "Text which will be used as the formatstring for a hyperlink when a +submodule with the specified subdirectory path is printed in a directory +listing.") + (max-stats + (repo-string "") + "Override the default maximum statistics period.") + (name + (repo-string "") + "The value to show as repository name.") + (owner + (repo-string "") + "A value used to identify the owner of the repository.") + (path + (repo-string "") + "An absolute path to the repository directory.") + (readme + (repo-string "") + "A path (relative to repo) which specifies a file to include verbatim +as the \"About\" page for this repo.") + (section + (repo-string "") + "The name of the current repository section - all repositories defined +after this option will inherit the current section name.") + (extra-options + (repo-list '()) + "Extra options will be appended to cgitrc file.")) + +;; Generate a record, which may include a list of +;; , , . +(define-configuration cgit-configuration + (package + (package cgit) + "The CGIT package.") + (nginx + (nginx-server-configuration-list (list %cgit-configuration-nginx)) + "NGINX configuration.") + (about-filter + (string "") + "Specifies a command which will be invoked to format the content of abo= ut +pages (both top-level and for each repository).") + (agefile + (string "") + "Specifies a path, relative to each repository path, which can be used = to +specify the date and time of the youngest commit in the repository.") + (auth-filter + (string "") + "Specifies a command that will be invoked for authenticating repository +access.") + (branch-sort + (string "name") + "Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set @samp{name} enables ordering by branch name.") + (cache-root + (string "/var/cache/cgit") + "Path used to store the Cgit cache entries.") + (cache-static-ttl + (integer -1) + "Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed with a fixed SHA1.") + (cache-dynamic-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed without a fixed SHA1.") + (cache-repo-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of the repository summary page.") + (cache-root-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of the repository index page.") + (cache-scanrc-ttl + (integer 15) + "Number which specifies the time-to-live, in minutes, for the result of +scanning a path for Git repositories.") + (cache-about-ttl + (integer 15) + "Number which specifies the time-to-live, in minutes, for the cached +version of the repository about page.") + (cache-snapshot-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of snapshots.") + (cache-size + (integer 0) + "The maximum number of entries in the cgit cache. When set to +@samp{0}, caching is disabled.") + (case-sensitive-sort? + (boolean #t) + "Sort items in the repo list case sensitively.") + (clone-prefix + (list '()) + "List of common prefixes which, when combined with a repository URL, +generates valid clone URLs for the repository.") + (clone-url + (list '()) + "List of @code{clone-url} templates.") + (commit-filter + (string "") + "Command which will be invoked to format commit messages.") + (commit-sort + (string "git log") + "Flag which, when set to @samp{date}, enables strict date ordering in t= he +commit log, and when set to @samp{topo} enables strict topological +ordering.") + (css + (string "/share/cgit/cgit.css") + "URL which specifies the css document to include in all Cgit pages.") + (email-filter + (string "") + "Specifies a command which will be invoked to format names and email +address of committers, authors, and taggers, as represented in various +places throughout the Cgit interface.") + (embedded? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit generate a HTML +fragment suitable for embedding in other HTML pages.") + (enable-commit-graph? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit print an ASCII-art +commit history graph to the left of the commit messages in the +repository log page.") + (enable-filter-overrides? + (boolean #f) + "Flag which, when set to @samp{#t}, allows all filter settings to be +overridden in repository-specific cgitrc files.") + (enable-follow-links? + (boolean #f) + "Flag which, when set to @samp{#t}, allows users to follow a file in the +log view.") + (enable-http-clone? + (boolean #t) + "If set to @samp{#t}, Cgit will act as an dumb HTTP endpoint for Git +clones.") + (enable-index-links? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit generate extra links +\"summary\", \"commit\", \"tree\" for each repo in the repository index.") + (enable-index-owner? + (boolean #t) + "Flag which, when set to @samp{#t}, will make Cgit display the owner of +each repo in the repository index.") + (enable-log-filecount? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit print the number of +modified files for each commit on the repository log page.") + (enable-log-linecount? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit print the number of +added and removed lines for each commit on the repository log page.") + (enable-remote-branches? + (boolean #f) + "Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views.") + (enable-subject-links? + (boolean #f) + "Flag which, when set to @code{1}, will make Cgit use the subject of +the parent commit as link text when generating links to parent commits +in commit view.") + (enable-html-serving? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit use the subject of t= he +parent commit as link text when generating links to parent commits in +commit view.") + (enable-tree-linenumbers? + (boolean #t) + "Flag which, when set to @samp{#t}, will make Cgit generate linenumber +links for plaintext blobs printed in the tree view.") + (enable-git-config? + (boolean #f) + "Flag which, when set to @samp{#f}, will allow Cgit to use Git config to +set any repo specific settings.") + (favicon + (string "/favicon.ico") + "URL used as link to a shortcut icon for Cgit.") + (footer + (string "") + "The content of the file specified with this option will be included +verbatim at the bottom of all pages (i.e. it replaces the standard +\"generated by...\" message).") + (head-include + (string "") + "The content of the file specified with this option will be included +verbatim in the HTML HEAD section on all pages.") + (header + (string "") + "The content of the file specified with this option will be included +verbatim at the top of all pages.") + (include + (string "") + "Name of a configfile to include before the rest of the current config- +file is parsed.") + (index-header + (string "") + "The content of the file specified with this option will be included +verbatim above the repository index.") + (index-info + (string "") + "The content of the file specified with this option will be included +verbatim below the heading on the repository index page.") + (local-time? + (boolean #f) + "Flag which, if set to @samp{#t}, makes Cgit print commit and tag times +in the servers timezone.") + (logo + (string "/share/cgit/cgit.png") + "URL which specifies the source of an image which will be used as a logo +on all Cgit pages.") + (logo-link + (string "") + "URL loaded when clicking on the Cgit logo image.") + (owner-filter + (string "") + "Command which will be invoked to format the Owner column of the main +page.") + (max-atom-items + (integer 10) + "Number of items to display in atom feeds view.") + (max-commit-count + (integer 50) + "Number of entries to list per page in \"log\" view.") + (max-message-length + (integer 80) + "Number of commit message characters to display in \"log\" view.") + (max-repo-count + (integer 50) + "Specifies the number of entries to list per page on the repository ind= ex +page.") + (max-repodesc-length + (integer 80) + "Specifies the maximum number of repo description characters to display +on the repository index page.") + (max-blob-size + (integer 0) + "Specifies the maximum size of a blob to display HTML for in KBytes.") + (max-stats + (string "") + "Maximum statistics period. Valid values are @samp{week},@samp{month}, +@samp{quarter} and @samp{year}.") + (mimetype + (mimetype-alist '((gif "image/gif") + (html "text/html") + (jpg "image/jpeg") + (jpeg "image/jpeg") + (pdf "application/pdf") + (png "image/png") + (svg "image/svg+xml"))) + "Mimetype for the specified filename extension.") + (mimetype-file + (string "") + "Specifies the file to use for automatic mimetype lookup.") + (module-link + (string "") + "Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing.") + (nocache? + (boolean #f) + "If set to the value @samp{#t} caching will be disabled.") + (noplainemail? + (boolean #f) + "If set to @samp{#t} showing full author email addresses will be +disabled.") + (noheader? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit omit the standard +header on all pages.") + (project-list + (string "") + "A list of subdirectories inside of @code{repository-directory}, relati= ve +to it, that should loaded as Git repositories.") + (readme + (string "") + "Text which will be used as default value for @code{cgit-repo-readme}.") + (remove-suffix? + (boolean #f) + "If set to @code{#t} and @code{repository-directory} is enabled, if any +repositories are found with a suffix of @code{.git}, this suffix will be +removed for the URL and name.") + (renamelimit + (integer -1) + "Maximum number of files to consider when detecting renames.") + (repository-sort + (string "") + "The way in which repositories in each section are sorted.") + (robots + (robots-list (list "noindex" "nofollow")) + "Text used as content for the @code{robots} meta-tag.") + (root-desc + (string "a fast webinterface for the git dscm") + "Text printed below the heading on the repository index page.") + (root-readme + (string "") + "The content of the file specified with this option will be included +verbatim below thef \"about\" link on the repository index page.") + (root-title + (string "") + "Text printed as heading on the repository index page.") + (scan-hidden-path + (boolean #f) + "If set to @samp{#t} and repository-directory is enabled, +repository-directory will recurse into directories whose name starts with a +period. Otherwise, repository-directory will stay away from such director= ies, +considered as \"hidden\". Note that this does not apply to the \".git\" +directory in non-bare repos.") + (snapshots ; =C2=B9 + (list '()) + "Text which specifies the default set of snapshot formats that cgit +generates links for.") + (repository-directory + (repository-directory "/srv/git") + "Name of the directory to scan for repositories.") + (section + (string "") + "The name of the current repository section - all repositories defined +after this option will inherit the current section name.") + (section-sort + (string "") + "Flag which, when set to @samp{1}, will sort the sections on the reposi= tory +listing by name.") + (section-from-path + (integer 0) + "A number which, if defined prior to repository-directory, specifies how +many path elements from each repo path to use as a default section name.") + (side-by-side-diffs? + (boolean #f) + "If set to @samp{#t} shows side-by-side diffs instead of unidiffs per +default.") + (source-filter + (string "") + "Specifies a command which will be invoked to format plaintext blobs in= the +tree view.") + (summary-branches + (integer 10) + "Specifies the number of branches to display in the repository \"summar= y\" +view.") + (summary-log + (integer 10) + "Specifies the number of log entries to display in the repository +\"summary\" view.") + (summary-tags + (integer 10) + "Specifies the number of tags to display in the repository \"summary\" +view.") + (strict-export + (string "") + "Filename which, if specified, needs to be present within the repository +for Cgit to allow access to that repository.") + (virtual-root + (string "/") + "URL which, if specified, will be used as root for all Cgit links.") + (repositories + (repository-cgit-configuration-list '()) + "A list of @dfn{cgit-repo} records to use with config.") + (extra-options + (list '()) + "Extra options will be appended to cgitrc file.")) + +(define (configuration->text config) + (with-output-to-string + (lambda _ + (serialize-configuration config cgit-configuration-fields)))) + +(define (cgit-configuration-file config) + "Return the Cgit configuration file corresponding to CONFIG." + (plain-file "cgitrc" config)) + +(define (cgit-configuration-file-text config) + (cgit-configuration-file (configuration->text config))) + +(define (cgit-activation config) + (match config + (($ cache-root) + #~(begin + (use-modules (guix build utils)) + (mkdir-p #$cache-root) + ;; Cgit compiled with default configuration path. + (copy-file #$(cgit-configuration-file-text 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)) + (description + "Run the Cgit web interface, which allows users to browse Git +repositories."))) + +(define (generate-cgit-documentation) + (generate-documentation + `((cgit-configuration + ,cgit-configuration-fields + (repositories repository-cgit-configuration)) + (repository-cgit-configuration + ,repository-cgit-configuration-fields)) + 'cgit-configuration)) + + +;;; +;;; Footnotes +;;; + +;; =C2=B9 Should be specified before in specific order, +;; see . diff --git a/gnu/services/version-control.scm b/gnu/services/version-contro= l.scm index 6bf656949..dc3bd056c 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -1,7 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2016 ng0 ;;; Copyright =C2=A9 2016 Sou Bunnbu -;;; Copyright =C2=A9 2017 Oleg Pykhalov ;;; Copyright =C2=A9 2017 Cl=C3=A9ment Lassieur ;;; ;;; This file is part of GNU Guix. @@ -38,26 +37,6 @@ git-daemon-configuration git-daemon-configuration? =20 - - 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 - git-http-configuration git-http-configuration? git-http-nginx-location-configuration)) @@ -173,103 +152,6 @@ access to exported repositories under @file{/srv/git}= ." (service git-daemon-service-type config)) =20 -;;; -;;; 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")) - (listen '("80")) - (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)) - (description - "Run the Cgit web interface, which allows users to browse Git -repositories."))) - - ;;; ;;; HTTP access. Add the result of calling ;;; git-http-nginx-location-configuration to an nginx-server-configuration= 's diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm index 7367861b0..53e247a05 100644 --- a/gnu/tests/version-control.scm +++ b/gnu/tests/version-control.scm @@ -26,6 +26,7 @@ #:use-module (gnu system vm) #:use-module (gnu services) #:use-module (gnu services version-control) + #:use-module (gnu services cgit) #:use-module (gnu services web) #:use-module (gnu services networking) #:use-module (gnu packages version-control) --=20 2.15.1 --=-=-= Content-Type: text/plain Succeeded make check-system TESTS="cgit" Thanks, Oleg. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 29 13:40:14 2017 Received: (at 29820) by debbugs.gnu.org; 29 Dec 2017 18:40:14 +0000 Received: from localhost ([127.0.0.1]:56911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eUzZm-0004sC-5j for submit@debbugs.gnu.org; Fri, 29 Dec 2017 13:40:14 -0500 Received: from mail.lassieur.org ([83.152.10.219]:34010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eUzZk-0004s3-7i for 29820@debbugs.gnu.org; Fri, 29 Dec 2017 13:40:12 -0500 Received: from rodion (192.168.0.254 [192.168.0.254]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id d43d4504 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Fri, 29 Dec 2017 18:40:06 +0000 (UTC) References: <87incy9yv6.fsf@gmail.com> <87h8sdb6qa.fsf@lassieur.org> <87po6yu7h9.fsf@gmail.com> User-agent: mu4e 0.9.18; emacs 25.3.1 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur To: Oleg Pykhalov Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. In-reply-to: <87po6yu7h9.fsf@gmail.com> Date: Fri, 29 Dec 2017 19:40:05 +0100 Message-ID: <871sjdz8ca.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29820 Cc: 29820@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 (/) Oleg Pykhalov writes: >> 'url' needs to be the first setting specified for each repo. I think >> you could use something like this to make sure it is: >> >> (define (serialize-repository-cgit-configuration x) >> (define (rest? field) >> (not (eq? (configuration-field-name field) 'url))) >> (let ((url (repository-cgit-configuration-url x)) >> (rest (filter rest? repository-cgit-configuration-fields))) >> (serialize-repo-string 'url url) >> (serialize-configuration x rest))) > > Output doesn't change. [...] > However, simple reordering fields in (define-configuration …) works. > I reordered in attached patch. Is it good enough? It didn't work because you didn't call the 'serialize-repository-cgit-configuration' function. With this snippet, it will be called: --8<---------------cut here---------------start------------->8--- (serialize-configuration (cgit-configuration (repositories (list (repository-cgit-configuration (url "http://cgit.magnolia.local") (source-filter "la"))))) cgit-configuration-fields) --8<---------------cut here---------------end--------------->8--- I'm not sure which way is the best. I tend to prefer a hard coded logic because it will prevent bugs if later people forget about the order and add fields at the wrong place. If you stick with depending on the fields order, then could you add very clear comments so that people don't add fields at the wrong place? WDYT? >> I think the official project uses 'cgit' instead of 'Cgit' (there are >> other occurrences where you use 'Cgit'). > > Ludovic asked to capitalize cgit in > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28283#14 But he was only talking about titles wasn't he? >>> + (repository-directory >>> + (repository-directory "/srv/git") >>> + "Name of the directory to scan for repositories.") >> >> I believe it would be clearer if it was named the same way cgit names >> it: scan-path. > > Ludovic asked to rename it in > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28283#14 > > I don't know should we stay close to cgit naming conventions or not. > Thoughts? At least it should be possible to grep 'scan_path' in the documentation, so that users can easily find what to use instead of 'scan-path'. Could you say 'scan_path' is the original name in the docstring? >>> + (project-list >>> + (list '()) >>> + "A list of subdirectories inside of @code{repository-directory}, relative >>> +to it, that should loaded as Git repositories.") >> >> I forgot one thing: 'project-list' is a file, not a list of strings. I >> agree it's weird that cgit's documentation doesn't say it's a file. I >> see two solutions: > > Sorry, it's not clear for me. As I understand from CGITRC(5) it's a > list like: > > project-list=/share/cgit/cgit.png /share/cgit/cgit.jpg > > relative to /srv/git (in our case). CGITRC isn't clear. It's really a file containing the list of git directories. For example: /etc/cgit/project-list: --8<---------------cut here---------------start------------->8--- a/b/foo.git c/bar.git baz.git --8<---------------cut here---------------end--------------->8--- And project-list=/etc/cgit/project-list >> 1. Change the type to 'string', so that people can set a file name. >> >> 2. Use a list type that would transparently transform its values into a >> file in the store, with the generated cgitrc file pointing to it. >> >> The second solution is better because the user won't need to create the >> file. > > I choose 1st for now, because 2nd I don't understand what need to be > produced at the end. Could you give me an example? With 2nd, users would write a configuration like (project-list '("a/b/foo.git" "c/bar.git" "baz.git")) And 'guix system reconfigure' would create the file /gnu/store/xxxxxxx-project-list containing those three lines. The generated cgitrc file would contain: project-list=/gnu/store/xxxxxxx-project-list You could use a type whose serializer would call the 'plain-file' procedure. >> Also, could you add a way to use an opaque configuration file? It would >> be helpful for users who don't have time to update their configuration, >> or in case there are new cgit configurations that are not yet >> implemented by the Scheme service. > > Sure. > > Is the following order is OK? > > (serialize-configuration > (cgit-configuration > (extra-options (list "soo=do")) > (repositories (list > (repository-cgit-configuration > (module-link-path '("/super/cow" "moo")) > (extra-options (list "goo=foo")))))) > cgit-configuration-fields) > > … > repo.extra-options=goo=foo > extra-options=soo=do > # END OF FILE I was more thinking about something like in the Dovecot service where you can pass the whole file as a string. > Also I need to mention that this patch probably will broke system > reconfigure and require update /etc/config.scm. Yes, of course :-) From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 30 22:26:30 2018 Received: (at 29820) by debbugs.gnu.org; 31 Jan 2018 03:26:30 +0000 Received: from localhost ([127.0.0.1]:50076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egj2Z-0003Kg-TN for submit@debbugs.gnu.org; Tue, 30 Jan 2018 22:26:30 -0500 Received: from mail-lf0-f43.google.com ([209.85.215.43]:40300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egj2U-0003KP-CX for 29820@debbugs.gnu.org; Tue, 30 Jan 2018 22:26:26 -0500 Received: by mail-lf0-f43.google.com with SMTP id h92so18507395lfi.7 for <29820@debbugs.gnu.org>; Tue, 30 Jan 2018 19:26:22 -0800 (PST) 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=zavt1IgLY1ppG3TZfwpzSStT3pl4ed0VewbQjSTtM1c=; b=U1QM07zQ11oO2y+OYdgSX2Zc4gkI1+eVQ6KxBRks85taepsucx7QMs1ydjfLqmAIAm W7LwGTSzblHOxTGdcT0ulrPgkSa98VobDQNObbrFzz+degpbl7rHOn75SJsfBbw46N9Y TXF7fWYie4tCMliPi8AD4FeppjJpJe657KkttWLMTw7Oxme9/nAGPZ9S/sHVC9SIgyAw mKlOF+mUqrpINFdgBV3NYDNS58qHR8pGraKjwBevalp5v3VI3IerTOUx4Mmd+NkeLIIN YzXdt3fHdBNtmhZmEcropZTyzu9pirmczMlhdg2tL4kpIY1wKlBcun7C4LHELOr0WhUA tNjQ== 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=zavt1IgLY1ppG3TZfwpzSStT3pl4ed0VewbQjSTtM1c=; b=Buk93q2ytevZ6O08fJI9gc3xdoYtNWi5lXlg86umwVJirRQrmvZWvyHxbSfprk+rmi cJOS1gaQdcPaGHKjYeGKQ9MndbAVJzVx4J/+3gFGb4sgIrJtyI9x5zCdd4eiK2skwInQ 1kVYW3NaUphSyVqAIzFR541qW/lMwuxapQnAW8NLMQ7SW9Dy7d2cQR0pCqORxO4CVPDN JgbOMrsw/hKfsgLB7pQ/foYJV7zPbrqpGeys89X5q+e7eP5aq5ChIRmchZroh8FAQfBL I9Dw3jAqP0AhzFqAVQQhqJLgJKxl1RpsOGl/yR2QKfMVOS1d13sFl5aM1nflkBqGy6Q7 6fLg== X-Gm-Message-State: AKwxytfxBi0GGckGZBBm0Vjz/yrzGwetJS6AYDadpTPq4uYIECOLGfNh xTaU+oV8fvDVQepK+EyrZdq23w== X-Google-Smtp-Source: AH8x2259ufSfWTE76nerD75KhVGP0h1qaSYVulziUNoaVjla8h7udDhLfBTFcYk1K3+GicS/k1fhzg== X-Received: by 10.46.93.156 with SMTP id v28mr7482991lje.5.1517369175893; Tue, 30 Jan 2018 19:26:15 -0800 (PST) Received: from magnolia (ppp91-122-178-74.pppoe.avangarddsl.ru. [91.122.178.74]) by smtp.gmail.com with ESMTPSA id h22sm3693979lfl.12.2018.01.30.19.26.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2018 19:26:14 -0800 (PST) From: Oleg Pykhalov To: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. References: <87incy9yv6.fsf@gmail.com> <87h8sdb6qa.fsf@lassieur.org> <87po6yu7h9.fsf@gmail.com> <871sjdz8ca.fsf@lassieur.org> Date: Wed, 31 Jan 2018 06:26:10 +0300 Message-ID: <87r2q6zp2l.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29820 Cc: 29820@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: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Cl=C3=A9ment, apologies for such a long pause. I tried to implement all we talked about, but I kinda stuck. What do you think about merging and not hold it more for a small issue with project-list? The patch is attached. The test suite succeeds: =2D-8<---------------cut here---------------start------------->8--- ./pre-inst-env env GUIX_PACKAGE_PATH=3D make check-system TESTS=3Dcgit =2D-8<---------------cut here---------------end--------------->8--- Cl=C3=A9ment Lassieur writes: [...] > If you stick with depending on the fields order, then could you add > very clear comments so that people don't add fields at the wrong > place? WDYT? I think we could stick with ordering fields and comments. I'll add a note commentary about order at the head of the file. >>> I think the official project uses 'cgit' instead of 'Cgit' (there are >>> other occurrences where you use 'Cgit'). >> >> Ludovic asked to capitalize cgit in >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28283#14 > > But he was only talking about titles wasn't he? I think not only, because we have Cgit everywhere in the current documentation. >>>> + (repository-directory >>>> + (repository-directory "/srv/git") >>>> + "Name of the directory to scan for repositories.") >>> >>> I believe it would be clearer if it was named the same way cgit names >>> it: scan-path. >> >> Ludovic asked to rename it in >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28283#14 >> >> I don't know should we stay close to cgit naming conventions or not. >> Thoughts? > > At least it should be possible to grep 'scan_path' in the documentation, > so that users can easily find what to use instead of 'scan-path'. Could > you say 'scan_path' is the original name in the docstring? Good idea, thank you! I'll add a '(represents @code{scan-path})' to the description of the 'repository-directory' field. >>>> + (project-list >>>> + (list '()) >>>> + "A list of subdirectories inside of @code{repository-directory}, r= elative >>>> +to it, that should loaded as Git repositories.") >>> >>> I forgot one thing: 'project-list' is a file, not a list of strings. I >>> agree it's weird that cgit's documentation doesn't say it's a file. I >>> see two solutions: >> >> Sorry, it's not clear for me. As I understand from CGITRC(5) it's a >> list like: >> >> project-list=3D/share/cgit/cgit.png /share/cgit/cgit.jpg >> >> relative to /srv/git (in our case). > > CGITRC isn't clear. It's really a file containing the list of git > directories. For example: > > /etc/cgit/project-list: > > a/b/foo.git > c/bar.git > baz.git > > And > > project-list=3D/etc/cgit/project-list > >>> 1. Change the type to 'string', so that people can set a file name. >>> >>> 2. Use a list type that would transparently transform its values into a >>> file in the store, with the generated cgitrc file pointing to it. >>> >>> The second solution is better because the user won't need to create the >>> file. >> >> I choose 1st for now, because 2nd I don't understand what need to be >> produced at the end. Could you give me an example? > > With 2nd, users would write a configuration like > > (project-list '("a/b/foo.git" > "c/bar.git" > "baz.git")) > > And 'guix system reconfigure' would create the file > /gnu/store/xxxxxxx-project-list containing those three lines. The > generated cgitrc file would contain: > > project-list=3D/gnu/store/xxxxxxx-project-list > > You could use a type whose serializer would call the 'plain-file' > procedure. Will be in a TODO list until I get more familiar with Guix or somebody else add this. >>> Also, could you add a way to use an opaque configuration file? It would >>> be helpful for users who don't have time to update their configuration, >>> or in case there are new cgit configurations that are not yet >>> implemented by the Scheme service. >> >> Sure. >> >> Is the following order is OK? >> >> (serialize-configuration >> (cgit-configuration >> (extra-options (list "soo=3Ddo")) >> (repositories (list >> (repository-cgit-configuration >> (module-link-path '("/super/cow" "moo")) >> (extra-options (list "goo=3Dfoo")))))) >> cgit-configuration-fields) >> >> =E2=80=A6 >> repo.extra-options=3Dgoo=3Dfoo >> extra-options=3Dsoo=3Ddo >> # END OF FILE > > I was more thinking about something like in the Dovecot service where > you can pass the whole file as a string. OK, thank you for a reference to Dovecot example. I'll add this. >> Also I need to mention that this patch probably will broke system >> reconfigure and require update /etc/config.scm. > > Yes, of course :-) OK. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-services-cgit-Add-more-configuration-fields.patch Content-Transfer-Encoding: quoted-printable Content-Description: [PATCH] services: cgit: Add more configuration fields. From=20c20ee2cd72343732904f89eb6d46ca6ce7eacb27 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Tue, 12 Dec 2017 02:13:55 +0300 Subject: [PATCH] services: cgit: Add more configuration fields. * gnu/services/version-control.scm (cgit-service-type): Move to separate fi= le. * gnu/services/cgit.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add this. * gnu/tests/version-control.scm: Add this. * doc/guix.texi (Cgit Service): Document this. =2D-- doc/guix.texi | 953 +++++++++++++++++++++++++++++++++++= ++-- gnu/local.mk | 1 + gnu/services/cgit.scm | 683 ++++++++++++++++++++++++++++ gnu/services/version-control.scm | 121 ----- gnu/tests/version-control.scm | 3 +- 5 files changed, 1605 insertions(+), 156 deletions(-) create mode 100644 gnu/services/cgit.scm diff --git a/doc/guix.texi b/doc/guix.texi index 2b27a675c..9ac967093 100644 =2D-- a/doc/guix.texi +++ b/doc/guix.texi @@ -45,7 +45,8 @@ Copyright @copyright{} 2017 George Clemmer@* Copyright @copyright{} 2017 Andy Wingo@* Copyright @copyright{} 2017 Arun Isaac@* Copyright @copyright{} 2017 nee@* =2DCopyright @copyright{} 2018 Rutger Helling +Copyright @copyright{} 2018 Rutger Helling@* +Copyright @copyright{} 2018 Oleg Pykhalov =20 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -18276,54 +18277,938 @@ By default, Cgit can be accessed on port 80 (@co= de{http://localhost:80}). (service cgit-service-type) @end example =20 =2D@deftp {Data Type} cgit-configuration =2DData type representing the configuration of Cgit. =2DThis type has the following parameters: +@c %start of fragment =20 =2D@table @asis =2D@item @code{config-file} (default: @code{(cgit-configuration-file)}) =2DThe configuration file to use for Cgit. This can be set to a =2D@dfn{cgit-configuration-file} record value, or any gexp =2D(@pxref{G-Expressions}). +Available @code{cgit-configuration} fields are: =20 =2DFor example, to instead use a local file, the @code{local-file} function =2Dcan be used: +@deftypevr {@code{cgit-configuration} parameter} package package +The CGIT package. =20 =2D@example =2D(service cgit-service-type =2D (cgit-configuration =2D (config-file (local-file "./my-cgitrc.conf")))) =2D@end example +@end deftypevr =20 =2D@item @code{package} (default: @code{cgit}) =2DThe Cgit package to use. +@deftypevr {@code{cgit-configuration} parameter} nginx-server-configuratio= n-list nginx +NGINX configuration. =20 =2D@end table =2D@end deftp +@end deftypevr =20 =2D@deftp {Data Type} cgit-configuration-file =2DData type representing the configuration options for Cgit. =2DThis type has the following parameters: +@deftypevr {@code{cgit-configuration} parameter} string about-filter +Specifies a command which will be invoked to format the content of about +pages (both top-level and for each repository). =20 =2D@table @asis =2D@item @code{css} (default: @code{"/share/cgit/cgit.css"}) +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string agefile +Specifies a path, relative to each repository path, which can be used to +specify the date and time of the youngest commit in the repository. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string auth-filter +Specifies a command that will be invoked for authenticating repository +access. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string branch-sort +Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set @samp{name} enables ordering by branch name. + +Defaults to @samp{"name"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string cache-root +Path used to store the Cgit cache entries. + +Defaults to @samp{"/var/cache/cgit"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-static-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed with a fixed SHA1. + +Defaults to @samp{-1}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-dynamic-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed without a fixed SHA1. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-repo-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of the repository summary page. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-root-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of the repository index page. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-scanrc-ttl +Number which specifies the time-to-live, in minutes, for the result of +scanning a path for Git repositories. + +Defaults to @samp{15}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-about-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of the repository about page. + +Defaults to @samp{15}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-snapshot-ttl +Number which specifies the time-to-live, in minutes, for the cached +version of snapshots. + +Defaults to @samp{5}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer cache-size +The maximum number of entries in the cgit cache. When set to @samp{0}, +caching is disabled. + +Defaults to @samp{0}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean case-sensitive-so= rt? +Sort items in the repo list case sensitively. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list clone-prefix +List of common prefixes which, when combined with a repository URL, +generates valid clone URLs for the repository. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list clone-url +List of @code{clone-url} templates. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string commit-filter +Command which will be invoked to format commit messages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string commit-sort +Flag which, when set to @samp{date}, enables strict date ordering in the +commit log, and when set to @samp{topo} enables strict topological +ordering. + +Defaults to @samp{"git log"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string css URL which specifies the css document to include in all Cgit pages. =20 =2D@item @code{logo} (default: @code{"/share/cgit/cgit.png"}) +Defaults to @samp{"/share/cgit/cgit.css"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string email-filter +Specifies a command which will be invoked to format names and email +address of committers, authors, and taggers, as represented in various +places throughout the Cgit interface. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean embedded? +Flag which, when set to @samp{#t}, will make Cgit generate a HTML +fragment suitable for embedding in other HTML pages. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-commit-gra= ph? +Flag which, when set to @samp{#t}, will make Cgit print an ASCII-art +commit history graph to the left of the commit messages in the +repository log page. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-filter-ove= rrides? +Flag which, when set to @samp{#t}, allows all filter settings to be +overridden in repository-specific cgitrc files. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-follow-lin= ks? +Flag which, when set to @samp{#t}, allows users to follow a file in the +log view. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-http-clone? +If set to @samp{#t}, Cgit will act as an dumb HTTP endpoint for Git +clones. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-index-link= s? +Flag which, when set to @samp{#t}, will make Cgit generate extra links +"summary", "commit", "tree" for each repo in the repository index. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-index-owne= r? +Flag which, when set to @samp{#t}, will make Cgit display the owner of +each repo in the repository index. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-log-fileco= unt? +Flag which, when set to @samp{#t}, will make Cgit print the number of +modified files for each commit on the repository log page. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-log-lineco= unt? +Flag which, when set to @samp{#t}, will make Cgit print the number of +added and removed lines for each commit on the repository log page. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-remote-bra= nches? +Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-subject-li= nks? +Flag which, when set to @code{1}, will make Cgit use the subject of the +parent commit as link text when generating links to parent commits in +commit view. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-html-servi= ng? +Flag which, when set to @samp{#t}, will make Cgit use the subject of the +parent commit as link text when generating links to parent commits in +commit view. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-tree-linen= umbers? +Flag which, when set to @samp{#t}, will make Cgit generate linenumber +links for plaintext blobs printed in the tree view. + +Defaults to @samp{#t}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean enable-git-config? +Flag which, when set to @samp{#f}, will allow Cgit to use Git config to +set any repo specific settings. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string favicon +URL used as link to a shortcut icon for Cgit. + +Defaults to @samp{"/favicon.ico"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string footer +The content of the file specified with this option will be included +verbatim at the bottom of all pages (i.e. it replaces the standard +"generated by..." message). + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string head-include +The content of the file specified with this option will be included +verbatim in the HTML HEAD section on all pages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string header +The content of the file specified with this option will be included +verbatim at the top of all pages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string include +Name of a configfile to include before the rest of the current config- +file is parsed. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string index-header +The content of the file specified with this option will be included +verbatim above the repository index. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string index-info +The content of the file specified with this option will be included +verbatim below the heading on the repository index page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean local-time? +Flag which, if set to @samp{#t}, makes Cgit print commit and tag times +in the servers timezone. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string logo URL which specifies the source of an image which will be used as a logo on all Cgit pages. =20 =2D@item @code{virtual-root} (default: @code{"/"}) =2DURL which, if specified, will be used as root for all Cgit links. +Defaults to @samp{"/share/cgit/cgit.png"}. =20 =2D@item @code{repository-directory} (default: @code{"/srv/git"}) =2DName of the directory to scan for repositories. +@end deftypevr =20 =2D@item @code{robots} (default: @code{(list "noindex" "nofollow")}) =2DText used as content for the ``robots'' meta-tag. +@deftypevr {@code{cgit-configuration} parameter} string logo-link +URL loaded when clicking on the Cgit logo image. =20 =2D@end table =2D@end deftp +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string owner-filter +Command which will be invoked to format the Owner column of the main +page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-atom-items +Number of items to display in atom feeds view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-commit-count +Number of entries to list per page in "log" view. + +Defaults to @samp{50}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-message-length +Number of commit message characters to display in "log" view. + +Defaults to @samp{80}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-repo-count +Specifies the number of entries to list per page on the repository index +page. + +Defaults to @samp{50}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-repodesc-leng= th +Specifies the maximum number of repo description characters to display +on the repository index page. + +Defaults to @samp{80}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer max-blob-size +Specifies the maximum size of a blob to display HTML for in KBytes. + +Defaults to @samp{0}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string max-stats +Maximum statistics period. Valid values are @samp{week},@samp{month}, +@samp{quarter} and @samp{year}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} mimetype-alist mimetype +Mimetype for the specified filename extension. + +Defaults to @samp{((gif "image/gif") (html "text/html") (jpg +"image/jpeg") (jpeg "image/jpeg") (pdf "application/pdf") (png +"image/png") (svg "image/svg+xml"))}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string mimetype-file +Specifies the file to use for automatic mimetype lookup. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string module-link +Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean nocache? +If set to the value @samp{#t} caching will be disabled. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean noplainemail? +If set to @samp{#t} showing full author email addresses will be +disabled. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean noheader? +Flag which, when set to @samp{#t}, will make Cgit omit the standard +header on all pages. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string project-list +A list of subdirectories inside of @code{repository-directory}, relative +to it, that should loaded as Git repositories. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string readme +Text which will be used as default value for @code{cgit-repo-readme}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean remove-suffix? +If set to @code{#t} and @code{repository-directory} is enabled, if any +repositories are found with a suffix of @code{.git}, this suffix will be +removed for the URL and name. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer renamelimit +Maximum number of files to consider when detecting renames. + +Defaults to @samp{-1}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string repository-sort +The way in which repositories in each section are sorted. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} robots-list robots +Text used as content for the @code{robots} meta-tag. + +Defaults to @samp{("noindex" "nofollow")}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string root-desc +Text printed below the heading on the repository index page. + +Defaults to @samp{"a fast webinterface for the git dscm"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string root-readme +The content of the file specified with this option will be included +verbatim below thef "about" link on the repository index page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string root-title +Text printed as heading on the repository index page. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean scan-hidden-path +If set to @samp{#t} and repository-directory is enabled, +repository-directory will recurse into directories whose name starts +with a period. Otherwise, repository-directory will stay away from such +directories, considered as "hidden". Note that this does not apply to +the ".git" directory in non-bare repos. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list snapshots +Text which specifies the default set of snapshot formats that cgit +generates links for. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} repository-directory repo= sitory-directory +Name of the directory to scan for repositories (represents +@code{scan-path}). + +Defaults to @samp{"/srv/git"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string section +The name of the current repository section - all repositories defined +after this option will inherit the current section name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string section-sort +Flag which, when set to @samp{1}, will sort the sections on the +repository listing by name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer section-from-path +A number which, if defined prior to repository-directory, specifies how +many path elements from each repo path to use as a default section name. + +Defaults to @samp{0}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} boolean side-by-side-diff= s? +If set to @samp{#t} shows side-by-side diffs instead of unidiffs per +default. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string source-filter +Specifies a command which will be invoked to format plaintext blobs in +the tree view. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer summary-branches +Specifies the number of branches to display in the repository "summary" +view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer summary-log +Specifies the number of log entries to display in the repository +"summary" view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} integer summary-tags +Specifies the number of tags to display in the repository "summary" +view. + +Defaults to @samp{10}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string strict-export +Filename which, if specified, needs to be present within the repository +for Cgit to allow access to that repository. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} string virtual-root +URL which, if specified, will be used as root for all Cgit links. + +Defaults to @samp{"/"}. + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} repository-cgit-configura= tion-list repositories +A list of @dfn{cgit-repo} records to use with config. + +Defaults to @samp{()}. + +Available @code{repository-cgit-configuration} fields are: + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-list snap= shots +A mask of snapshot formats for this repo that cgit generates links for, +restricted by the global @code{snapshots} setting. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string so= urce-filter +Override the default @code{source-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string url +The relative URL used to access the repository. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ab= out-filter +Override the default @code{about-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string br= anch-sort +Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set to @samp{name} enables ordering by branch name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-list clon= e-url +A list of URLs which can be used to clone repo. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string co= mmit-filter +Override the default @code{commit-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string co= mmit-sort +Flag which, when set to @samp{date}, enables strict date ordering in the +commit log, and when set to @samp{topo} enables strict topological +ordering. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string de= fbranch +The name of the default branch for this repository. If no such branch +exists in the repository, the first branch name (when sorted) is used as +default instead. By default branch pointed to by HEAD, or "master" if +there is no suitable HEAD. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string de= sc +The value to show as repository description. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ho= mepage +The value to show as repository homepage. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string em= ail-filter +Override the default @code{email-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-commit-graph? +A flag which can be used to disable the global setting +@code{enable-commit-graph?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-log-filecount? +A flag which can be used to disable the global setting +@code{enable-log-filecount?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-log-linecount? +A flag which can be used to disable the global setting +@code{enable-log-linecount?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-remote-branches? +Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-subject-links? +A flag which can be used to override the global setting +@code{enable-subject-links?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean e= nable-html-serving? +A flag which can be used to override the global setting +@code{enable-html-serving?}. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean h= ide? +Flag which, when set to @code{#t}, hides the repository from the +repository index. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-boolean i= gnore? +Flag which, when set to @samp{#t}, ignores the repository. + +Defaults to @samp{#f}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string lo= go +URL which specifies the source of an image which will be used as a logo +on this repo=E2=80=99s pages. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string lo= go-link +URL loaded when clicking on the Cgit logo image. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ow= ner-filter +Override the default @code{owner-filter}. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string mo= dule-link +Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing. The arguments for the +formatstring are the path and SHA1 of the submodule commit. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} module-link-pa= th module-link-path +Text which will be used as the formatstring for a hyperlink when a +submodule with the specified subdirectory path is printed in a directory +listing. + +Defaults to @samp{()}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ma= x-stats +Override the default maximum statistics period. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string na= me +The value to show as repository name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string ow= ner +A value used to identify the owner of the repository. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string pa= th +An absolute path to the repository directory. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string re= adme +A path (relative to repo) which specifies a file to include verbatim as +the "About" page for this repo. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-string se= ction +The name of the current repository section - all repositories defined +after this option will inherit the current section name. + +Defaults to @samp{""}. + +@end deftypevr + +@deftypevr {@code{repository-cgit-configuration} parameter} repo-list extr= a-options +Extra options will be appended to cgitrc file. + +Defaults to @samp{()}. + +@end deftypevr + +@end deftypevr + +@deftypevr {@code{cgit-configuration} parameter} list extra-options +Extra options will be appended to cgitrc file. + +Defaults to @samp{()}. + +@end deftypevr + + +@c %end of fragment + +However, it could be that you just want to get a @code{cgitrc} up and +running. In that case, you can pass an @code{opaque-cgit-configuration} +as a record to @code{cgit-service-type}. As its name indicates, an +opaque configuration does not have easy reflective capabilities. + +Available @code{opaque-cgit-configuration} fields are: + +@deftypevr {@code{opaque-cgit-configuration} parameter} package cgit +The cgit package. +@end deftypevr + +@deftypevr {@code{opaque-cgit-configuration} parameter} string string +The contents of the @code{cgitrc}, as a string. +@end deftypevr + +For example, if your @code{cgitrc} is just the empty string, you +could instantiate a cgit service like this: + +@example +(service cgit-service-type + (opaque-cgit-configuration + (cgitrc ""))) +@end example =20 @node Setuid Programs @subsection Setuid Programs diff --git a/gnu/local.mk b/gnu/local.mk index 6c46c4e5d..00fd94937 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -450,6 +450,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/services/avahi.scm \ %D%/services/base.scm \ %D%/services/certbot.scm \ + %D%/services/cgit.scm \ %D%/services/configuration.scm \ %D%/services/cuirass.scm \ %D%/services/cups.scm \ diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm new file mode 100644 index 000000000..e5bf481ef =2D-- /dev/null +++ b/gnu/services/cgit.scm @@ -0,0 +1,683 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2018 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 services cgit) + #:use-module (gnu packages admin) + #:use-module (gnu packages version-control) + #:use-module (gnu services base) + #:use-module (gnu services configuration) + #:use-module (gnu services shepherd) + #:use-module (gnu services web) + #:use-module (gnu services) + #:use-module (gnu system shadow) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix records) + #:use-module (guix store) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:export (repository-cgit-configuration + cgit-configuration + %cgit-configuration-nginx + cgit-configuration-nginx-config + opaque-cgit-configuration + cgit-service-type)) + +;;; Commentary: +;;; +;;; This module provides a service definition for the Cgit a web frontend = for +;;; Git repositories written in C. +;;; +;;; Note: fields of and +;;; should be specified in the specific order. +;;; +;;; Code: + +(define %cgit-configuration-nginx + (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")) + (listen '("80")) + (ssl-certificate #f) + (ssl-certificate-key #f))) + + +;;; +;;; Serialize +;;; + +(define (uglify-field-name field-name) + (let ((str (symbol->string field-name))) + (string-join (string-split (string-delete #\? str) #\-) "-"))) + +(define (serialize-field field-name val) + (format #t "~a=3D~a\n" (uglify-field-name field-name) val)) + +(define (serialize-string field-name val) + (if (string=3D? val "") "" (serialize-field field-name val))) + +(define (serialize-boolean field-name val) + (serialize-field field-name (if val 1 0))) + +(define (serialize-list field-name val) + (if (null? val) "" (serialize-field field-name (string-join val)))) + +(define robots-list? list?) + +(define (serialize-robots-list field-name val) + (if (null? val) "" (serialize-field field-name (string-join val ", ")))) + +(define (integer? val) + (exact-integer? val)) + +(define (serialize-integer field-name val) + (serialize-field field-name val)) + +(define (serialize-repository-cgit-configuration x) + (serialize-configuration x repository-cgit-configuration-fields)) + +(define (repository-cgit-configuration-list? val) + (list? val)) + +(define (serialize-repository-cgit-configuration-list field-name val) + (for-each serialize-repository-cgit-configuration val)) + + +;;; +;;; Serialize +;;; + +(define (nginx-server-configuration-list? val) + (and (list? val) (and-map nginx-server-configuration? val))) + +(define (serialize-nginx-server-configuration-list field-name val) + #f) + + +;;; +;;; Serialize +;;; + +(define (serialize-repo-field field-name val) + (format #t "repo.~a=3D~a\n" (uglify-field-name field-name) val)) + +(define (serialize-repo-list field-name val) + (if (null? val) "" (serialize-repo-field field-name (string-join val)))) + +(define repo-boolean? boolean?) + +(define (serialize-repo-boolean field-name val) + (serialize-repo-field field-name (if val 1 0))) + +(define (serialize-repo-integer field-name val) + (serialize-repo-field field-name val)) + +(define repo-list? list?) + +(define repo-string? string?) + +(define (serialize-repo-string field-name val) + (if (string=3D? val "") "" (serialize-repo-field field-name val))) + +(define module-link-path? list?) + +(define (serialize-module-link-path field-name val) + (if (null? val) "" + (match val + ((path text) + (format #t "repo.~a.~a=3D~a\n" + (string-drop-right (uglify-field-name 'module-link-path) + (string-length "-path")) + path text))))) + +(define repository-directory? string?) + +(define (serialize-repository-directory _ val) + (if (string=3D? val "") "" (format #t "scan-path=3D~a\n" val))) + +(define mimetype-alist? list?) + +(define (serialize-mimetype-alist field-name val) + (format #t "# Mimetypes\n~a" + (string-join + (map (match-lambda + ((extension mimetype) + (format #f "mimetype.~a=3D~a" + (symbol->string extension) mimetype))) + val) "\n"))) + +(define-configuration repository-cgit-configuration + (snapshots + (repo-list '()) + "A mask of snapshot formats for this repo that cgit generates links for, +restricted by the global @code{snapshots} setting.") + (source-filter + (repo-string "") + "Override the default @code{source-filter}.") + (url + (repo-string "") + "The relative URL used to access the repository.") + (about-filter + (repo-string "") + "Override the default @code{about-filter}.") + (branch-sort + (repo-string "") + "Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set to @samp{name} enables ordering by branch name.") + (clone-url + (repo-list '()) + "A list of URLs which can be used to clone repo.") + (commit-filter + (repo-string "") + "Override the default @code{commit-filter}.") + (commit-sort + (repo-string "") + "Flag which, when set to @samp{date}, enables strict date ordering in t= he +commit log, and when set to @samp{topo} enables strict topological orderin= g.") + (defbranch + (repo-string "") + "The name of the default branch for this repository. If no such branch +exists in the repository, the first branch name (when sorted) is used as +default instead. By default branch pointed to by HEAD, or \"master\" if t= here +is no suitable HEAD.") + (desc + (repo-string "") + "The value to show as repository description.") + (homepage + (repo-string "") + "The value to show as repository homepage.") + (email-filter + (repo-string "") + "Override the default @code{email-filter}.") + (enable-commit-graph? + (repo-boolean #f) + "A flag which can be used to disable the global setting +@code{enable-commit-graph?}.") + (enable-log-filecount? + (repo-boolean #f) + "A flag which can be used to disable the global setting +@code{enable-log-filecount?}.") + (enable-log-linecount? + (repo-boolean #f) + "A flag which can be used to disable the global setting +@code{enable-log-linecount?}.") + (enable-remote-branches? + (repo-boolean #f) + "Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views.") + (enable-subject-links? + (repo-boolean #f) + "A flag which can be used to override the global setting +@code{enable-subject-links?}.") + (enable-html-serving? + (repo-boolean #f) + "A flag which can be used to override the global setting +@code{enable-html-serving?}.") + (hide? + (repo-boolean #f) + "Flag which, when set to @code{#t}, hides the repository from the +repository index.") + (ignore? + (repo-boolean #f) + "Flag which, when set to @samp{#t}, ignores the repository.") + (logo + (repo-string "") + "URL which specifies the source of an image which will be used as a +logo on this repo=E2=80=99s pages.") + (logo-link + (repo-string "") + "URL loaded when clicking on the Cgit logo image.") + (owner-filter + (repo-string "") + "Override the default @code{owner-filter}.") + (module-link + (repo-string "") + "Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing. The arguments for the +formatstring are the path and SHA1 of the submodule commit.") + (module-link-path + (module-link-path '()) + "Text which will be used as the formatstring for a hyperlink when a +submodule with the specified subdirectory path is printed in a directory +listing.") + (max-stats + (repo-string "") + "Override the default maximum statistics period.") + (name + (repo-string "") + "The value to show as repository name.") + (owner + (repo-string "") + "A value used to identify the owner of the repository.") + (path + (repo-string "") + "An absolute path to the repository directory.") + (readme + (repo-string "") + "A path (relative to repo) which specifies a file to include verbatim +as the \"About\" page for this repo.") + (section + (repo-string "") + "The name of the current repository section - all repositories defined +after this option will inherit the current section name.") + (extra-options + (repo-list '()) + "Extra options will be appended to cgitrc file.")) + +;; Generate a record, which may include a list of +;; , , . +(define-configuration cgit-configuration + (package + (package cgit) + "The CGIT package.") + (nginx + (nginx-server-configuration-list (list %cgit-configuration-nginx)) + "NGINX configuration.") + (about-filter + (string "") + "Specifies a command which will be invoked to format the content of abo= ut +pages (both top-level and for each repository).") + (agefile + (string "") + "Specifies a path, relative to each repository path, which can be used = to +specify the date and time of the youngest commit in the repository.") + (auth-filter + (string "") + "Specifies a command that will be invoked for authenticating repository +access.") + (branch-sort + (string "name") + "Flag which, when set to @samp{age}, enables date ordering in the branch +ref list, and when set @samp{name} enables ordering by branch name.") + (cache-root + (string "/var/cache/cgit") + "Path used to store the Cgit cache entries.") + (cache-static-ttl + (integer -1) + "Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed with a fixed SHA1.") + (cache-dynamic-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of repository pages accessed without a fixed SHA1.") + (cache-repo-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of the repository summary page.") + (cache-root-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of the repository index page.") + (cache-scanrc-ttl + (integer 15) + "Number which specifies the time-to-live, in minutes, for the result of +scanning a path for Git repositories.") + (cache-about-ttl + (integer 15) + "Number which specifies the time-to-live, in minutes, for the cached +version of the repository about page.") + (cache-snapshot-ttl + (integer 5) + "Number which specifies the time-to-live, in minutes, for the cached +version of snapshots.") + (cache-size + (integer 0) + "The maximum number of entries in the cgit cache. When set to +@samp{0}, caching is disabled.") + (case-sensitive-sort? + (boolean #t) + "Sort items in the repo list case sensitively.") + (clone-prefix + (list '()) + "List of common prefixes which, when combined with a repository URL, +generates valid clone URLs for the repository.") + (clone-url + (list '()) + "List of @code{clone-url} templates.") + (commit-filter + (string "") + "Command which will be invoked to format commit messages.") + (commit-sort + (string "git log") + "Flag which, when set to @samp{date}, enables strict date ordering in t= he +commit log, and when set to @samp{topo} enables strict topological +ordering.") + (css + (string "/share/cgit/cgit.css") + "URL which specifies the css document to include in all Cgit pages.") + (email-filter + (string "") + "Specifies a command which will be invoked to format names and email +address of committers, authors, and taggers, as represented in various +places throughout the Cgit interface.") + (embedded? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit generate a HTML +fragment suitable for embedding in other HTML pages.") + (enable-commit-graph? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit print an ASCII-art +commit history graph to the left of the commit messages in the +repository log page.") + (enable-filter-overrides? + (boolean #f) + "Flag which, when set to @samp{#t}, allows all filter settings to be +overridden in repository-specific cgitrc files.") + (enable-follow-links? + (boolean #f) + "Flag which, when set to @samp{#t}, allows users to follow a file in the +log view.") + (enable-http-clone? + (boolean #t) + "If set to @samp{#t}, Cgit will act as an dumb HTTP endpoint for Git +clones.") + (enable-index-links? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit generate extra links +\"summary\", \"commit\", \"tree\" for each repo in the repository index.") + (enable-index-owner? + (boolean #t) + "Flag which, when set to @samp{#t}, will make Cgit display the owner of +each repo in the repository index.") + (enable-log-filecount? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit print the number of +modified files for each commit on the repository log page.") + (enable-log-linecount? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit print the number of +added and removed lines for each commit on the repository log page.") + (enable-remote-branches? + (boolean #f) + "Flag which, when set to @code{#t}, will make Cgit display remote +branches in the summary and refs views.") + (enable-subject-links? + (boolean #f) + "Flag which, when set to @code{1}, will make Cgit use the subject of +the parent commit as link text when generating links to parent commits +in commit view.") + (enable-html-serving? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit use the subject of t= he +parent commit as link text when generating links to parent commits in +commit view.") + (enable-tree-linenumbers? + (boolean #t) + "Flag which, when set to @samp{#t}, will make Cgit generate linenumber +links for plaintext blobs printed in the tree view.") + (enable-git-config? + (boolean #f) + "Flag which, when set to @samp{#f}, will allow Cgit to use Git config to +set any repo specific settings.") + (favicon + (string "/favicon.ico") + "URL used as link to a shortcut icon for Cgit.") + (footer + (string "") + "The content of the file specified with this option will be included +verbatim at the bottom of all pages (i.e. it replaces the standard +\"generated by...\" message).") + (head-include + (string "") + "The content of the file specified with this option will be included +verbatim in the HTML HEAD section on all pages.") + (header + (string "") + "The content of the file specified with this option will be included +verbatim at the top of all pages.") + (include + (string "") + "Name of a configfile to include before the rest of the current config- +file is parsed.") + (index-header + (string "") + "The content of the file specified with this option will be included +verbatim above the repository index.") + (index-info + (string "") + "The content of the file specified with this option will be included +verbatim below the heading on the repository index page.") + (local-time? + (boolean #f) + "Flag which, if set to @samp{#t}, makes Cgit print commit and tag times +in the servers timezone.") + (logo + (string "/share/cgit/cgit.png") + "URL which specifies the source of an image which will be used as a logo +on all Cgit pages.") + (logo-link + (string "") + "URL loaded when clicking on the Cgit logo image.") + (owner-filter + (string "") + "Command which will be invoked to format the Owner column of the main +page.") + (max-atom-items + (integer 10) + "Number of items to display in atom feeds view.") + (max-commit-count + (integer 50) + "Number of entries to list per page in \"log\" view.") + (max-message-length + (integer 80) + "Number of commit message characters to display in \"log\" view.") + (max-repo-count + (integer 50) + "Specifies the number of entries to list per page on the repository ind= ex +page.") + (max-repodesc-length + (integer 80) + "Specifies the maximum number of repo description characters to display +on the repository index page.") + (max-blob-size + (integer 0) + "Specifies the maximum size of a blob to display HTML for in KBytes.") + (max-stats + (string "") + "Maximum statistics period. Valid values are @samp{week},@samp{month}, +@samp{quarter} and @samp{year}.") + (mimetype + (mimetype-alist '((gif "image/gif") + (html "text/html") + (jpg "image/jpeg") + (jpeg "image/jpeg") + (pdf "application/pdf") + (png "image/png") + (svg "image/svg+xml"))) + "Mimetype for the specified filename extension.") + (mimetype-file + (string "") + "Specifies the file to use for automatic mimetype lookup.") + (module-link + (string "") + "Text which will be used as the formatstring for a hyperlink when a +submodule is printed in a directory listing.") + (nocache? + (boolean #f) + "If set to the value @samp{#t} caching will be disabled.") + (noplainemail? + (boolean #f) + "If set to @samp{#t} showing full author email addresses will be +disabled.") + (noheader? + (boolean #f) + "Flag which, when set to @samp{#t}, will make Cgit omit the standard +header on all pages.") + (project-list + (string "") + "A list of subdirectories inside of @code{repository-directory}, relati= ve +to it, that should loaded as Git repositories.") + (readme + (string "") + "Text which will be used as default value for @code{cgit-repo-readme}.") + (remove-suffix? + (boolean #f) + "If set to @code{#t} and @code{repository-directory} is enabled, if any +repositories are found with a suffix of @code{.git}, this suffix will be +removed for the URL and name.") + (renamelimit + (integer -1) + "Maximum number of files to consider when detecting renames.") + (repository-sort + (string "") + "The way in which repositories in each section are sorted.") + (robots + (robots-list (list "noindex" "nofollow")) + "Text used as content for the @code{robots} meta-tag.") + (root-desc + (string "a fast webinterface for the git dscm") + "Text printed below the heading on the repository index page.") + (root-readme + (string "") + "The content of the file specified with this option will be included +verbatim below thef \"about\" link on the repository index page.") + (root-title + (string "") + "Text printed as heading on the repository index page.") + (scan-hidden-path + (boolean #f) + "If set to @samp{#t} and repository-directory is enabled, +repository-directory will recurse into directories whose name starts with a +period. Otherwise, repository-directory will stay away from such director= ies, +considered as \"hidden\". Note that this does not apply to the \".git\" +directory in non-bare repos.") + (snapshots + (list '()) + "Text which specifies the default set of snapshot formats that cgit +generates links for.") + (repository-directory + (repository-directory "/srv/git") + "Name of the directory to scan for repositories (represents +@code{scan-path}).") + (section + (string "") + "The name of the current repository section - all repositories defined +after this option will inherit the current section name.") + (section-sort + (string "") + "Flag which, when set to @samp{1}, will sort the sections on the reposi= tory +listing by name.") + (section-from-path + (integer 0) + "A number which, if defined prior to repository-directory, specifies how +many path elements from each repo path to use as a default section name.") + (side-by-side-diffs? + (boolean #f) + "If set to @samp{#t} shows side-by-side diffs instead of unidiffs per +default.") + (source-filter + (string "") + "Specifies a command which will be invoked to format plaintext blobs in= the +tree view.") + (summary-branches + (integer 10) + "Specifies the number of branches to display in the repository \"summar= y\" +view.") + (summary-log + (integer 10) + "Specifies the number of log entries to display in the repository +\"summary\" view.") + (summary-tags + (integer 10) + "Specifies the number of tags to display in the repository \"summary\" +view.") + (strict-export + (string "") + "Filename which, if specified, needs to be present within the repository +for Cgit to allow access to that repository.") + (virtual-root + (string "/") + "URL which, if specified, will be used as root for all Cgit links.") + (repositories + (repository-cgit-configuration-list '()) + "A list of @dfn{cgit-repo} records to use with config.") + (extra-options + (list '()) + "Extra options will be appended to cgitrc file.")) + +(define-configuration opaque-cgit-configuration + (cgit + (package cgit) + "The cgit package.") + (cgitrc + (string (configuration-missing-field 'opaque-cgit-configuration 'cgitrc= )) + "The contents of the @code{cgitrc} to use.") + (cache-root + (string "/var/cache/cgit") + "Path used to store the Cgit cache entries.") + (nginx + (nginx-server-configuration-list (list %cgit-configuration-nginx)) + "NGINX configuration.")) + +(define (cgit-activation config) + "Return the activation gexp for CONFIG." + (let* ((opaque-config? (opaque-cgit-configuration? config)) + (config-str + (if opaque-config? + (opaque-cgit-configuration-cgitrc config) + (with-output-to-string + (lambda () + (serialize-configuration config + cgit-configuration-fields)))))) + #~(begin + (use-modules (guix build utils)) + (mkdir-p #$(if opaque-config? + (opaque-cgit-configuration-cache-root config) + (cgit-configuration-cache-root config))) + (copy-file #$(plain-file "cgitrc" config-str) "/etc/cgitrc")))) + +(define (cgit-configuration-nginx-config config) + (if (opaque-cgit-configuration? config) + (opaque-cgit-configuration-nginx 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) + + ;; Make sure fcgiwrap is instantiated. + (service-extension fcgiwrap-service-type + (const #t)))) + (default-value (cgit-configuration)) + (description + "Run the Cgit web interface, which allows users to browse Git +repositories."))) + +(define (generate-cgit-documentation) + (generate-documentation + `((cgit-configuration + ,cgit-configuration-fields + (repositories repository-cgit-configuration)) + (repository-cgit-configuration + ,repository-cgit-configuration-fields)) + 'cgit-configuration)) diff --git a/gnu/services/version-control.scm b/gnu/services/version-contro= l.scm index 7166ed3d4..afead87ec 100644 =2D-- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -38,26 +38,6 @@ git-daemon-configuration git-daemon-configuration? =20 =2D =2D cgit-configuration-file =2D cgit-configuration-file? =2D cgit-configuration-file-css =2D cgit-configuration-file-logo =2D cgit-configuration-file-robots =2D cgit-configuration-file-virtual-root =2D cgit-configuration-file-repository-directory =2D =2D =2D cgit-configuration =2D cgit-configuration? =2D cgit-configuration-config-file =2D cgit-configuration-package =2D =2D %cgit-configuration-nginx =2D cgit-configuration-nginx-config =2D =2D cgit-service-type =2D git-http-configuration git-http-configuration? git-http-nginx-location-configuration)) @@ -173,107 +153,6 @@ access to exported repositories under @file{/srv/git}= ." (service git-daemon-service-type config)) =20 =2D;;; =2D;;; Cgit =2D;;; =2D =2D(define-record-type* =2D cgit-configuration-file =2D make-cgit-configuration-file =2D cgit-configuration-file? =2D (css cgit-configuration-file-css ; s= tring =2D (default "/share/cgit/cgit.css")) =2D (logo cgit-configuration-file-logo ; s= tring =2D (default "/share/cgit/cgit.png")) =2D (robots cgit-configuration-file-robots ; l= ist =2D (default '("noindex" "nofollow"))) =2D (virtual-root cgit-configuration-file-virtual-root ; s= tring =2D (default "/")) =2D (repository-directory cgit-configuration-file-repository-directory ; s= tring =2D (default "/srv/git"))) =2D =2D(define (cgit-configuration-robots-string robots) =2D (string-join robots ", ")) =2D =2D(define-gexp-compiler (cgit-configuration-file-compiler =2D (file ) system target) =2D (match file =2D (($ css logo =2D robots virtual-root repository-directo= ry) =2D (apply text-file* "cgitrc" =2D (letrec-syntax ((option (syntax-rules () =2D ((_ key value) =2D (if value =2D `(,key "=3D" ,value "\n") =2D '())))) =2D (key/value (syntax-rules () =2D ((_ (key value) rest ...) =2D (append (option key value) =2D (key/value rest ...))) =2D ((_) =2D '())))) =2D (key/value ("css" css) =2D ("logo" logo) =2D ("robots" (cgit-configuration-robots-string rob= ots)) =2D ("virtual-root" virtual-root) =2D ("scan-path" repository-directory))))))) =2D =2D(define %cgit-configuration-nginx =2D (list =2D (nginx-server-configuration =2D (root cgit) =2D (locations =2D (list =2D (nginx-location-configuration =2D (uri "@cgit") =2D (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cg= it.cgi;" =2D "fastcgi_param PATH_INFO $uri;" =2D "fastcgi_param QUERY_STRING $args;" =2D "fastcgi_param HTTP_HOST $server_name;" =2D "fastcgi_pass 127.0.0.1:9000;"))))) =2D (try-files (list "$uri" "@cgit")) =2D (listen '("80")) =2D (ssl-certificate #f) =2D (ssl-certificate-key #f)))) =2D =2D(define-record-type* =2D cgit-configuration make-cgit-configuration =2D cgit-configuration? =2D (config-file cgit-configuration-config-file =2D (default (cgit-configuration-file))) =2D (package cgit-configuration-package =2D (default cgit)) =2D (nginx cgit-configuration-nginx =2D (default %cgit-configuration-nginx))) =2D =2D(define (cgit-activation config) =2D ;; Cgit compiled with default configuration path =2D #~(begin =2D (use-modules (guix build utils)) =2D (mkdir-p "/var/cache/cgit") =2D (copy-file #$(cgit-configuration-config-file config) "/etc/cgitrc"= ))) =2D =2D(define (cgit-configuration-nginx-config config) =2D (cgit-configuration-nginx config)) =2D =2D(define cgit-service-type =2D (service-type =2D (name 'cgit) =2D (extensions =2D (list (service-extension activation-service-type =2D cgit-activation) =2D (service-extension nginx-service-type =2D cgit-configuration-nginx-config) =2D =2D ;; Make sure fcgiwrap is instantiated. =2D (service-extension fcgiwrap-service-type =2D (const #t)))) =2D (default-value (cgit-configuration)) =2D (description =2D "Run the Cgit web interface, which allows users to browse Git =2Drepositories."))) =2D =2D ;;; ;;; HTTP access. Add the result of calling ;;; git-http-nginx-location-configuration to an nginx-server-configuration= 's diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm index 9882cdbe2..802473973 100644 =2D-- a/gnu/tests/version-control.scm +++ b/gnu/tests/version-control.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU =2D;;; Copyright =C2=A9 2017 Oleg Pykhalov +;;; Copyright =C2=A9 2017, 2018 Oleg Pykhalov ;;; Copyright =C2=A9 2017, 2018 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2017 Cl=C3=A9ment Lassieur ;;; @@ -26,6 +26,7 @@ #:use-module (gnu system vm) #:use-module (gnu services) #:use-module (gnu services version-control) + #:use-module (gnu services cgit) #:use-module (gnu services web) #:use-module (gnu services networking) #:use-module (gnu packages version-control) =2D-=20 2.15.1 --=-=-= Content-Type: text/plain Oleg. --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEc+OyAXw1EaDPCmAPckbhHGm3lWkFAlpxN1IACgkQckbhHGm3 lWmgqQ/+PHXS85l/3o5QSHCZRaWewaBpvKH4UT8XNSp8s+j5Jf94NHLM1r8/QbID WgwxfHDkSzNS8CIXAAQwkzMexfTLrKA4h3RpbVKW6F44MvWAvwuj2HLUUQECucSJ cxl6xlJN4G2AbujD/4ek30fp4nswBeKboBzRqjMrbItR2gxXqKes650gPwcuHSq7 woHthMQMdSoLMYuFZEe37mLWRleUgdtbXn560QiOjN+eU3HOFbsp8ux5Dd8HECyL wd1iOQbHIaLfYpdfigZ2yJ4dexu09BSJ2a20nY6Of8Rv0jQJXNW833OQf7jv3ty1 Xoh4gPgxNowDXqe/c/WvJI5hswuI8+JxlUd15SM1LCwgNQKdNe2AxjVKe8keCy4u XRjVK1YiDuUxKLnXHXGYpxwKijUTPzpJVHXgvdd9VRZzWVSwiwYH7SybP2hkd9HE 7dq9EfCfikmaEswo7fqdYGvI287FmfcosZtWat2chGMjFUSpwzc6tafedPAu54+T iPw9Twx8S2PfS7F1iZztf+lHc0D5eYXzv+NJaqoOM9hOcp+DRBBY0ELnxygsECha QFHgfbReBzXHUvviq8NQhbo+oZOEx/lVYRZNtN4upUNjyGkctKsUXANQREg/xzhG yp18XCmr9Ch6J4gRPJ64YEWE5l9j5sGGje1LQrj21K0BIBrPQXk= =4Rno -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 24 18:03:56 2018 Received: (at 29820) by debbugs.gnu.org; 24 Feb 2018 23:03:56 +0000 Received: from localhost ([127.0.0.1]:59168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epirE-0002Xh-9v for submit@debbugs.gnu.org; Sat, 24 Feb 2018 18:03:56 -0500 Received: from mail.lassieur.org ([83.152.10.219]:53902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epirC-0002XY-Ib for 29820@debbugs.gnu.org; Sat, 24 Feb 2018 18:03:55 -0500 Received: from rodion (88.191.118.83 [88.191.118.83]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id cab2ef61 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Sat, 24 Feb 2018 23:03:50 +0000 (UTC) References: <87incy9yv6.fsf@gmail.com> <87h8sdb6qa.fsf@lassieur.org> <87po6yu7h9.fsf@gmail.com> <871sjdz8ca.fsf@lassieur.org> <87r2q6zp2l.fsf@gmail.com> User-agent: mu4e 1.0; emacs 25.3.1 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur To: Oleg Pykhalov Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. In-reply-to: <87r2q6zp2l.fsf@gmail.com> X-TUID: ppstlVwhu5bD Date: Sun, 25 Feb 2018 00:03:49 +0100 Message-ID: <87h8q6at2i.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29820 Cc: 29820@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 (/) Hi Oleg, Now is my turn to be late :-) I'm really sorry. Oleg Pykhalov writes: > Hello Clément, > > apologies for such a long pause. I tried to implement all we talked > about, but I kinda stuck. What do you think about merging and not hold > it more for a small issue with project-list? The patch is attached. Sure, it's very helpful, thank you for this work! > The test suite succeeds: > --8<---------------cut here---------------start------------->8--- > ./pre-inst-env env GUIX_PACKAGE_PATH= make check-system TESTS=cgit > --8<---------------cut here---------------end--------------->8--- > > Clément Lassieur writes: > > [...] > >> If you stick with depending on the fields order, then could you add >> very clear comments so that people don't add fields at the wrong >> place? WDYT? > > I think we could stick with ordering fields and comments. > > I'll add a note commentary about order at the head of the file. Cool thanks! >>>> I think the official project uses 'cgit' instead of 'Cgit' (there are >>>> other occurrences where you use 'Cgit'). >>> >>> Ludovic asked to capitalize cgit in >>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28283#14 >> >> But he was only talking about titles wasn't he? > > I think not only, because we have Cgit everywhere in the current > documentation. Then it should be changed to 'cgit', there is no need to copy documentation mistakes :-). This is an example of commit from Ludovic where he doesn't capitalize 'zlib': https://git.savannah.gnu.org/cgit/guix.git/commit/?id=06e3a5181efa0ea83bb6608d3cbfba5caa56d7e9. >>>>> + (repository-directory >>>>> + (repository-directory "/srv/git") >>>>> + "Name of the directory to scan for repositories.") >>>> >>>> I believe it would be clearer if it was named the same way cgit names >>>> it: scan-path. >>> >>> Ludovic asked to rename it in >>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28283#14 >>> >>> I don't know should we stay close to cgit naming conventions or not. >>> Thoughts? >> >> At least it should be possible to grep 'scan_path' in the documentation, >> so that users can easily find what to use instead of 'scan-path'. Could >> you say 'scan_path' is the original name in the docstring? > > Good idea, thank you! I'll add a '(represents @code{scan-path})' to the > description of the 'repository-directory' field. Ok! >>>>> + (project-list >>>>> + (list '()) >>>>> + "A list of subdirectories inside of @code{repository-directory}, relative >>>>> +to it, that should loaded as Git repositories.") >>>> >>>> I forgot one thing: 'project-list' is a file, not a list of strings. I >>>> agree it's weird that cgit's documentation doesn't say it's a file. I >>>> see two solutions: >>> >>> Sorry, it's not clear for me. As I understand from CGITRC(5) it's a >>> list like: >>> >>> project-list=/share/cgit/cgit.png /share/cgit/cgit.jpg >>> >>> relative to /srv/git (in our case). >> >> CGITRC isn't clear. It's really a file containing the list of git >> directories. For example: >> >> /etc/cgit/project-list: >> >> a/b/foo.git >> c/bar.git >> baz.git >> >> And >> >> project-list=/etc/cgit/project-list >> >>>> 1. Change the type to 'string', so that people can set a file name. >>>> >>>> 2. Use a list type that would transparently transform its values into a >>>> file in the store, with the generated cgitrc file pointing to it. >>>> >>>> The second solution is better because the user won't need to create the >>>> file. >>> >>> I choose 1st for now, because 2nd I don't understand what need to be >>> produced at the end. Could you give me an example? >> >> With 2nd, users would write a configuration like >> >> (project-list '("a/b/foo.git" >> "c/bar.git" >> "baz.git")) >> >> And 'guix system reconfigure' would create the file >> /gnu/store/xxxxxxx-project-list containing those three lines. The >> generated cgitrc file would contain: >> >> project-list=/gnu/store/xxxxxxx-project-list >> >> You could use a type whose serializer would call the 'plain-file' >> procedure. > > Will be in a TODO list until I get more familiar with Guix or somebody > else add this. It's actually more complicated than I thought, because file-like objects can't be serialized as strings. So the serialization mechanism would need to be a bit reworked, so that it uses lists instead of strings, but it could be done later. I guess the most sensible thing to do is to comment the 'project-list' field, with a TODO note, explaining that cgit expects a file name that should be created from a list of strings provided by the user. >>>> Also, could you add a way to use an opaque configuration file? It would >>>> be helpful for users who don't have time to update their configuration, >>>> or in case there are new cgit configurations that are not yet >>>> implemented by the Scheme service. >>> >>> Sure. >>> >>> Is the following order is OK? >>> >>> (serialize-configuration >>> (cgit-configuration >>> (extra-options (list "soo=do")) >>> (repositories (list >>> (repository-cgit-configuration >>> (module-link-path '("/super/cow" "moo")) >>> (extra-options (list "goo=foo")))))) >>> cgit-configuration-fields) >>> >>> … >>> repo.extra-options=goo=foo >>> extra-options=soo=do >>> # END OF FILE >> >> I was more thinking about something like in the Dovecot service where >> you can pass the whole file as a string. > > OK, thank you for a reference to Dovecot example. I'll add this. Great! From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 24 18:09:41 2018 Received: (at 29820) by debbugs.gnu.org; 24 Feb 2018 23:09:41 +0000 Received: from localhost ([127.0.0.1]:59212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epiwn-0002gu-At for submit@debbugs.gnu.org; Sat, 24 Feb 2018 18:09:41 -0500 Received: from mail.lassieur.org ([83.152.10.219]:53906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epiwl-0002gl-Ho for 29820@debbugs.gnu.org; Sat, 24 Feb 2018 18:09:39 -0500 Received: from rodion (88.191.118.83 [88.191.118.83]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id bb9e355f (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Sat, 24 Feb 2018 23:09:35 +0000 (UTC) References: <87incy9yv6.fsf@gmail.com> <87h8sdb6qa.fsf@lassieur.org> <87po6yu7h9.fsf@gmail.com> <871sjdz8ca.fsf@lassieur.org> <87r2q6zp2l.fsf@gmail.com> <87h8q6at2i.fsf@lassieur.org> User-agent: mu4e 1.0; emacs 25.3.1 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur To: Oleg Pykhalov Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. In-reply-to: <87h8q6at2i.fsf@lassieur.org> Date: Sun, 25 Feb 2018 00:09:34 +0100 Message-ID: <87fu5qassx.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29820 Cc: 29820@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 (/) Clément Lassieur writes: >>>>> I think the official project uses 'cgit' instead of 'Cgit' (there are >>>>> other occurrences where you use 'Cgit'). >>>> >>>> Ludovic asked to capitalize cgit in >>>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28283#14 >>> >>> But he was only talking about titles wasn't he? >> >> I think not only, because we have Cgit everywhere in the current >> documentation. > > Then it should be changed to 'cgit', there is no need to copy > documentation mistakes :-). This is an example of commit from Ludovic > where he doesn't capitalize 'zlib': > https://git.savannah.gnu.org/cgit/guix.git/commit/?id=06e3a5181efa0ea83bb6608d3cbfba5caa56d7e9. I forgot to say that apart from this it looks good to me, so I think you can push! From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 25 00:25:46 2018 Received: (at 29820) by debbugs.gnu.org; 25 Feb 2018 05:25:46 +0000 Received: from localhost ([127.0.0.1]:59364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epooj-00030j-Ow for submit@debbugs.gnu.org; Sun, 25 Feb 2018 00:25:45 -0500 Received: from mail-lf0-f42.google.com ([209.85.215.42]:44773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epooh-00030V-Fd for 29820@debbugs.gnu.org; Sun, 25 Feb 2018 00:25:43 -0500 Received: by mail-lf0-f42.google.com with SMTP id v9so17733979lfa.11 for <29820@debbugs.gnu.org>; Sat, 24 Feb 2018 21:25:43 -0800 (PST) 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=FdysK7cc31ZoD7Agb8bnlGPb5rXAYgEm+7AYGrHLfJU=; b=lD8u/dzQ58adDpkmpPWuSFjFAZBhOl7eAxDtnDe1pILYPeJNxNZEyJR/aznct0I2Ld YCZCYL3rNZOae3WXeePQbN+TG5rqPujZlmRwsJp+g3mt4nHndaRd9NBfdz9Peb2G5apf ob1BcyayDFxy+xL+l74nsOee5f58FnEtl4/Z2RGCMnGgOnUENmM80Ccb5o5n+VXg6xRJ zGZzSxDJeq4PxSPYeDoMNk4UO8viyqcF14hCkC2YyLVhtHb7e7lieJnEi9FOgJjPryRF QbUUJeb+cYFbakep0HA0lAaSS3KW9UogzGhldfK8/frcAYFt5e3nw55pJR5wW15hwAW0 lSVA== 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=FdysK7cc31ZoD7Agb8bnlGPb5rXAYgEm+7AYGrHLfJU=; b=nwBreYnqy8YKyOUb/KEkORmp9KtcJhhHb9+oOva5XqTW1Fas7hhrUBBELR0jZBNKzu NNFeP0aG7yDKwBT98YN2YCF+IoaQQMVT6oyRbTgVBsM6OI+cwzFJr1yO9brL8HPH2lO/ LpXUBgEoLyTC5CAA8BWWtEGWMACcnp8QhlzoJ10/iSq2NXv5AwcGPvqOpvZPMNjJ3htg 0UE3f94iOzQ+ZH+jnL4pzOyVieWatYuJs94SN1oDWhPnaOP1Vosne52zYiru7rpDPHO+ nTrMcsB9B06FF0xTDp2v619hHCJr9srEgzDCfwrDJeth858dkSQgUs+4RybwbHcqda/U puNw== X-Gm-Message-State: APf1xPAHWVi2S3dCbk9cdl5pOV9DanygJmt4toCeyFgGjgdRCo3STWHh 8bpSc4EIo3u+AbbCDwqLVg21rw== X-Google-Smtp-Source: AG47ELvnFARJv6xOEe9+JWBQUDtgYUhEBnUabLT1PmxnZsqXuon0sWWH+7i4DPjXrZGvWBJy/WN1/A== X-Received: by 10.46.16.212 with SMTP id 81mr4481382ljq.119.1519536336523; Sat, 24 Feb 2018 21:25:36 -0800 (PST) Received: from magnolia (ppp91-122-179-73.pppoe.avangarddsl.ru. [91.122.179.73]) by smtp.gmail.com with ESMTPSA id r23sm1298942ljr.42.2018.02.24.21.25.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 24 Feb 2018 21:25:35 -0800 (PST) From: Oleg Pykhalov To: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. References: <87incy9yv6.fsf@gmail.com> <87h8sdb6qa.fsf@lassieur.org> <87po6yu7h9.fsf@gmail.com> <871sjdz8ca.fsf@lassieur.org> <87r2q6zp2l.fsf@gmail.com> <87h8q6at2i.fsf@lassieur.org> Date: Sun, 25 Feb 2018 08:25:31 +0300 In-Reply-To: <87h8q6at2i.fsf@lassieur.org> (=?utf-8?Q?=22Cl=C3=A9ment?= Lassieur"'s message of "Sun, 25 Feb 2018 00:03:49 +0100") Message-ID: <87muzxej3o.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29820 Cc: 29820@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 Hello Cl=C3=A9ment, Cl=C3=A9ment Lassieur writes: [...] >>>>> I think the official project uses 'cgit' instead of 'Cgit' (there are >>>>> other occurrences where you use 'Cgit'). >>>> >>>> Ludovic asked to capitalize cgit in >>>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28283#14 >>> >>> But he was only talking about titles wasn't he? >> >> I think not only, because we have Cgit everywhere in the current >> documentation. > > Then it should be changed to 'cgit', there is no need to copy > documentation mistakes :-). This is an example of commit from Ludovic > where he doesn't capitalize 'zlib': > https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D06e3a5181efa0ea83= bb6608d3cbfba5caa56d7e9. OK. Also I see in cgit README [1], they use =E2=80=9Ccgit=E2=80=9D even in= titles. On the other hand it feels wrong to me, because it's a name of the program, like Guile, Guix, Linux or Emacs. It might be better to stick to that convention for readability (e.g. not =E2=80=98cgit=E2=80=99 as a co= mmand or a file name, but as a project name =E2=80=9CCgit=E2=80=9D). And because of w= e rename even configuration options like =E2=80=98scan-path=E2=80=99, it's OK to force the capitalization also. WDYT? [1] https://git.zx2c4.com/cgit/tree/README Thanks, Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEc+OyAXw1EaDPCmAPckbhHGm3lWkFAlqSSMsACgkQckbhHGm3 lWkw/Q/+Lf2kKODfm/PhoGsWvQKRZq3oLGNhr6hEiQHpQOZpacxIHulHm6pY2UOo epUtTCfzEmgD6S5tBlp8M9sGYqlre9uyxbPaiZyMt8FFj+cjnJWhYUjdLl1Lcjkr qnBAtW/YfXuJ++fO5y1uNkUqmkvDYcaWRY0MV+7hRGK+Z0CHDqf4ZLKJ9LUwd721 tUyKH6X96dYTG6EAnEpJqIYCgK03f4+ZHuoxUZghVSw/j2jR7Jz5V/zfrA11pk5s Ip7m202HkYySeyTo0yU43je5w5lMrGhv5QE6NuNaCsXJj67ujkxAI0eUF3fISt/2 LC+ashpqZ/DSdH7pQiA3dcYMo/Hz8hsWoeuS1vCuyhfqK4Lwc6EMRlsxMuKRqnsd +GnArb1iUvxqxfHQpa4xeDfTaLxtyNDFIE/2lQK2r4pIlOcSadSGqUVWXK6rC4pw +3Wtjl6QD94jNRaU1P9aljTEgD24er2piZ7ncaTEKe/THayJ/9Vqa7Pbbri7UFpk jpu7d+9VwS4FXuLxZskQUgjXgp5P0smcaKELqtUXWb09DOoKFGAfnrNw1SqdzkL6 mXE1/YHaC6hnuIaGRmFyw93UWHBiRGs7CUMnJ7IfiPwtWiUwI8obJDuyS0Yfd9Ow EZYRpffRPx7Vribf75jJOHOwE0F1R8tWuDNt/DQsT0m6CKraptA= =w+6S -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 25 04:34:49 2018 Received: (at 29820) by debbugs.gnu.org; 25 Feb 2018 09:34:49 +0000 Received: from localhost ([127.0.0.1]:59397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epshl-0000aD-EB for submit@debbugs.gnu.org; Sun, 25 Feb 2018 04:34:49 -0500 Received: from mail.lassieur.org ([83.152.10.219]:53912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epshi-0000a2-El for 29820@debbugs.gnu.org; Sun, 25 Feb 2018 04:34:47 -0500 Received: from rodion (88.191.118.83 [88.191.118.83]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id c410315e (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Sun, 25 Feb 2018 09:34:44 +0000 (UTC) References: <87incy9yv6.fsf@gmail.com> <87h8sdb6qa.fsf@lassieur.org> <87po6yu7h9.fsf@gmail.com> <871sjdz8ca.fsf@lassieur.org> <87r2q6zp2l.fsf@gmail.com> <87h8q6at2i.fsf@lassieur.org> <87muzxej3o.fsf@gmail.com> User-agent: mu4e 1.0; emacs 25.3.1 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur To: Oleg Pykhalov Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. In-reply-to: <87muzxej3o.fsf@gmail.com> Date: Sun, 25 Feb 2018 10:34:44 +0100 Message-ID: <87efl9beff.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29820 Cc: 29820@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 (/) Oleg Pykhalov writes: > OK. Also I see in cgit README [1], they use “cgit” even in titles. > > On the other hand it feels wrong to me, because it's a name of the > program, like Guile, Guix, Linux or Emacs. It might be better to stick > to that convention for readability (e.g. not ‘cgit’ as a command or a > file name, but as a project name “Cgit”). And because of we rename even > configuration options like ‘scan-path’, it's OK to force the > capitalization also. WDYT? Our convention is to follow upstream convention. Guile, Linux, Emacs are all capitalized upsteam, which is why they are capitalized in Guix documentation. It's up to the upstream project to choose. Plus, cgit seems to pay a lot of attention to it. See, the title is: cgit - CGI for Git And then: Building cgit involves building a proper version of Git. Clearly they acknowledge that Git is capitalized (because upstream decided so), but cgit is not. So I think we should not capitalize it :-) From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 27 12:25:23 2018 Received: (at 29820) by debbugs.gnu.org; 27 Feb 2018 17:25:23 +0000 Received: from localhost ([127.0.0.1]:35879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqj0F-0001oA-0c for submit@debbugs.gnu.org; Tue, 27 Feb 2018 12:25:23 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:53968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqj0D-0001o2-PJ for 29820@debbugs.gnu.org; Tue, 27 Feb 2018 12:25:22 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 5527610695; Tue, 27 Feb 2018 18:25:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fPmV9tXmyMvj; Tue, 27 Feb 2018 18:25:20 +0100 (CET) Received: from ribbon (unknown [193.50.110.216]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 5E3C3613; Tue, 27 Feb 2018 18:25:20 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. References: <87incy9yv6.fsf@gmail.com> <87h8sdb6qa.fsf@lassieur.org> <87po6yu7h9.fsf@gmail.com> <871sjdz8ca.fsf@lassieur.org> <87r2q6zp2l.fsf@gmail.com> <87h8q6at2i.fsf@lassieur.org> <87muzxej3o.fsf@gmail.com> <87efl9beff.fsf@lassieur.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?utf-8?Q?Vent=C3=B4se?= an 226 de la =?utf-8?Q?R?= =?utf-8?Q?=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, 27 Feb 2018 18:25:19 +0100 In-Reply-To: <87efl9beff.fsf@lassieur.org> (=?utf-8?Q?=22Cl=C3=A9ment?= Lassieur"'s message of "Sun, 25 Feb 2018 10:34:44 +0100") Message-ID: <871sh6z6o0.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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29820 Cc: 29820@debbugs.gnu.org, Oleg Pykhalov 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: 1.0 (+) Cl=C3=A9ment Lassieur skribis: > Oleg Pykhalov writes: > >> OK. Also I see in cgit README [1], they use =E2=80=9Ccgit=E2=80=9D even= in titles. >> >> On the other hand it feels wrong to me, because it's a name of the >> program, like Guile, Guix, Linux or Emacs. It might be better to stick >> to that convention for readability (e.g. not =E2=80=98cgit=E2=80=99 as a= command or a >> file name, but as a project name =E2=80=9CCgit=E2=80=9D). And because o= f we rename even >> configuration options like =E2=80=98scan-path=E2=80=99, it's OK to force= the >> capitalization also. WDYT? > > Our convention is to follow upstream convention. Guile, Linux, Emacs > are all capitalized upsteam, which is why they are capitalized in Guix > documentation. It's up to the upstream project to choose. > > Plus, cgit seems to pay a lot of attention to it. See, the title is: > cgit - CGI for Git > And then: > Building cgit involves building a proper version of Git. > > Clearly they acknowledge that Git is capitalized (because upstream > decided so), but cgit is not. > > So I think we should not capitalize it :-) Agreed. (Though again we should not lose our hair over it. :-)) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 27 20:51:10 2018 Received: (at 29820) by debbugs.gnu.org; 28 Feb 2018 01:51:10 +0000 Received: from localhost ([127.0.0.1]:36284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqqti-0004Um-L5 for submit@debbugs.gnu.org; Tue, 27 Feb 2018 20:51:10 -0500 Received: from mail-lf0-f45.google.com ([209.85.215.45]:36212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqqtf-0004US-3p; Tue, 27 Feb 2018 20:51:07 -0500 Received: by mail-lf0-f45.google.com with SMTP id g72so1153849lfg.3; Tue, 27 Feb 2018 17:51:06 -0800 (PST) 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=Qa59fzWRwTekmWaGSgQgvDCy/AsNUH8v51dvEqPUCbo=; b=GiFKnYU0HoGiJeYPbYR3dfcOC2HD9V0QqxXYtpZFLTtMFAJEVM1CPUQDfHNGvlAICS GJS+H9zo/Yz0PsOSVBiUpyJsBwFOW8aTUEsWTKzyl/EkV+pQOpAJ6QtxiXrEF6m+wZvo PXO1xIjZEaNf+X2DYySfofAtL7KiXrVGLxU3smfx0PWtKVoOwD1+CdIOoiaPZiKdZCx/ 7cQekeTImoDzisWOIpg9rShmLYvhmtQ8iixo4iYDwjooXX/1dcur5j4BKqjeTPVg45d+ DLAiGkIRsuwmzvez4aux9W/hUwWGBMG8H5OrJvGDCQGAXQ80nnXBLGFdqomAatw8eapw DbRA== 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=Qa59fzWRwTekmWaGSgQgvDCy/AsNUH8v51dvEqPUCbo=; b=JkQ6Emf6frLoOUsAZCDsBSINiiVRuQooQ+3AI5Qm4bSDN9nVNwlpxHU09blXJo/J3K PCz7u9Irw6jjr4vnIzwfY3ys8QYMNGIsB5tfL8whfVn4NppQ0XwMDjrQ36aUfXg9Lg0W 96hoFrgYZfdcUvWZlw1YqW9YpaWUFIq9HS0T9S/5oSJe1L7DPgt0lTkJXirAFlq6vK96 1/QtEgTBnbsaU+j0k1QgesqDmsbAXVSYFCF/3xU9cT5n9rBAxLg+GLsevkqQhbWkvSp/ XIBhUK8p10RszaDznTlA5GifT/vrcGVAgOdUpmi8MRVYIyksu4OB5cIrN6VZnRTgPVgc NGdA== X-Gm-Message-State: APf1xPCNihaFEzLgwLEsl14lUht1OZMqwHzCtBx0t19fQ3Sjlfm8sr8f osfa4D3jYS8YY4eDoc80It+zLw== X-Google-Smtp-Source: AG47ELtZJjQBFv1D8bxJUQVB87SP3ZGb1Jjw5xEro6zz/lb3NphbBJ66+dlSrgDn3SfFE/TknLNtLg== X-Received: by 10.46.99.130 with SMTP id s2mr11283077lje.17.1519782660818; Tue, 27 Feb 2018 17:51:00 -0800 (PST) Received: from magnolia ([178.71.62.205]) by smtp.gmail.com with ESMTPSA id s82sm113275lja.7.2018.02.27.17.50.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2018 17:50:59 -0800 (PST) From: Oleg Pykhalov To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#29820] [PATCH] services: cgit: Add more configuration fields. References: <87incy9yv6.fsf@gmail.com> <87h8sdb6qa.fsf@lassieur.org> <87po6yu7h9.fsf@gmail.com> <871sjdz8ca.fsf@lassieur.org> <87r2q6zp2l.fsf@gmail.com> <87h8q6at2i.fsf@lassieur.org> <87muzxej3o.fsf@gmail.com> <87efl9beff.fsf@lassieur.org> <871sh6z6o0.fsf@gnu.org> Date: Wed, 28 Feb 2018 04:50:55 +0300 In-Reply-To: <871sh6z6o0.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 27 Feb 2018 18:25:19 +0100") Message-ID: <87bmg9hog0.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29820 Cc: 29820@debbugs.gnu.org, 29820-done@debbugs.gnu.org, =?utf-8?Q?Cl=C3=A9ment?= Lassieur 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 Hello Ludovic, Thank you for a vote in this discussion! ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Cl=C3=A9ment Lassieur skribis: > >> Clearly they acknowledge that Git is capitalized (because upstream >> decided so), but cgit is not. >> >> So I think we should not capitalize it :-) > > Agreed. (Though again we should not lose our hair over it. :-)) OK. Pushed as e1cf4fd2d2fc0aab0f91c8ac961a8134cbefe200 I'll close the bug report. Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEc+OyAXw1EaDPCmAPckbhHGm3lWkFAlqWCv8ACgkQckbhHGm3 lWkH/w/+NodKiuQR5SxRjNTjrkENSE1s4SKsQHXYteqADmQ9rus+N9JxXSOA+LYg li4bk56vRT45KEvWvSzfSkxbVmVCF2yGiqqGRYSxjQm8LzUaeX/gJMqrgbY4vWK/ i78j67ZdCPFhI7pGsJOsI9PyIrvo1IjTghqx/9RifUmiFJ8+1IfJGc/LhW4sA58q GlEAVZj7g6WHA1IGj7GLsn3P9s2fNrTwWbhtwV70qOmJ9eSHXWbhTXw7F9sqBaWX DThN7u2nr0ccx7N3nhfRHm1dxo3xXyvDCSNrRvauBoL5ab29nKmpO1695kch4Oqt uBr3rujjWlA9nfP2aVi/wzmz49Uepae7MaRMmTxzVipeqnp8kbZlRJ4liLwujkIH ta/CkAfZZ886NDrVB0qKS/5B2l+NygZSH1v6PwKUcMYXWb7yhbsCnsvypHhTEdoM oFHQEpet85biuYc1HXShsjQ6DJgwwGLXCXrUCTTXWonxtgSUGzfgUD3dIKFAJZhH I7vAJq0U2nhZdHDt56BUbJ50Xey68dFz2p6N1Djtp6l38W9ftBDk641+NQiLE1nO VxiJ+Jpbuv8f1n6BhuMyiQMDnNHCd/bivFO2ZQX38Wn2joDKmaPd9RwBcV1eF3E0 hXoIaVxQe+0fsicjdK0+YRBOdPZbw3zjs5q1Iaq7e+P155OJbxw= =j42E -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Aug 15 02:04:53 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, 28 Mar 2018 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