From unknown Fri Aug 15 20:27:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#49886] [PATCH] Add gitile and gitile service Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 05 Aug 2021 01:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49886 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49886@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16281283482415 (code B ref -1); Thu, 05 Aug 2021 01:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Aug 2021 01:52:28 +0000 Received: from localhost ([127.0.0.1]:45473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBSYX-0000cl-6Z for submit@debbugs.gnu.org; Wed, 04 Aug 2021 21:52:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:41130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBSYV-0000ce-Dr for submit@debbugs.gnu.org; Wed, 04 Aug 2021 21:52:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBSYV-0006RT-4C for guix-patches@gnu.org; Wed, 04 Aug 2021 21:52:19 -0400 Received: from lepiller.eu ([89.234.186.109]:52256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBSYS-0002FV-03 for guix-patches@gnu.org; Wed, 04 Aug 2021 21:52:18 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 7482929c for ; Thu, 5 Aug 2021 01:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:mime-version:content-type; s=dkim; bh=Yju Tq5ZyPt+NohoX3d8r701EJONu08/17PgD669YJbs=; b=Qm1Mx3dKnJicpWeIQUe bdTRO4leXv7VmJxjTuSMVm55+RzfAW7yed/H367bSJHZefC/wf6E3purWt8zqbFB FfwXC2+Op/ql+m6Uh4+xHR8VFuL1QtdUJEJk5gs0kAlp9LU75VvxAk+7Yy3eUr/y JG/1hTHWv6C6+wJBs1SNBblrAGNL0vr1W7qWR1xX2cdUw3DxZ5Z06CZBxYgoR+Rc BOrCpDX4kdWEQA818TkD83btoPIzf70QUF1FJ4P1TjfjA6UU+V8hnQjlHwFKUFpj 2gzoBGiRfvVaIzdMfXtIrOcDfFHeGF2GyMRujWsRPVUuonjmGs9DOZOt799H+Dh5 NvQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 0c4fef2b (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Thu, 5 Aug 2021 01:52:10 +0000 (UTC) Date: Thu, 5 Aug 2021 03:51:59 +0200 From: Julien Lepiller Message-ID: <20210805035159.3959e01e@tachikoma.lepiller.eu> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/9V5R=VpoWcy+VCTvn/d+M75" Received-SPF: pass client-ip=89.234.186.109; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_OTHER_BAD_TLD=1.997, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.4 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi guix! Attached is a small patch series that adds gitile and the associated service type. Gitile is a small git forge project I have, and some of you expressed their interest, so here it is :) From 38773e575b313caedfc788d4e28fd219265b4254 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 5 Aug 2021 02:57:32 +0200 Subject: [PATCH 1/2] gnu: Add gitile. Content analysis details: (2.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: myweb.site (site)] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.51.188.17 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 1.7 URIBL_BLACK Contains an URL listed in the URIBL blacklist [URIs: lepiller.eu] 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: 3.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi guix! Attached is a small patch series that adds gitile and the associated service type. Gitile is a small git forge project I have, and some of you expressed their interest, so here it is :) From 38773e575b313caedfc788d4e28fd219265b4254 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 5 Aug 2021 02:57:32 +0200 Subject: [PATCH 1/2] gnu: Add gitile. Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.7 URIBL_BLACK Contains an URL listed in the URIBL blacklist [URIs: lepiller.eu] 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --MP_/9V5R=VpoWcy+VCTvn/d+M75 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi guix! Attached is a small patch series that adds gitile and the associated service type. Gitile is a small git forge project I have, and some of you expressed their interest, so here it is :) --MP_/9V5R=VpoWcy+VCTvn/d+M75 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-Add-gitile.patch =46rom 38773e575b313caedfc788d4e28fd219265b4254 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 5 Aug 2021 02:57:32 +0200 Subject: [PATCH 1/2] gnu: Add gitile. * gnu/packages/version-control.scm (gitile): New variable. --- gnu/packages/version-control.scm | 109 +++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-contro= l.scm index ac61b97f59..29dc86be8c 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -39,6 +39,7 @@ ;;; Copyright =C2=A9 2021 LibreMiami ;;; Copyright =C2=A9 2021 Xinglu Chen ;;; Copyright =C2=A9 2021 Fran=C3=A7ois J. +;;; Copyright =C2=A9 2021 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -93,6 +94,7 @@ #:use-module (gnu packages golang) #:use-module (gnu packages groff) #:use-module (gnu packages guile) + #:use-module (gnu packages guile-xyz) #:use-module (gnu packages image) #:use-module (gnu packages linux) #:use-module (gnu packages mail) @@ -114,6 +116,7 @@ #:use-module (gnu packages readline) #:use-module (gnu packages rsync) #:use-module (gnu packages sqlite) + #:use-module (gnu packages texinfo) #:use-module (gnu packages admin) #:use-module (gnu packages xml) #:use-module (gnu packages emacs) @@ -1517,6 +1520,112 @@ also walk each side of a merge and test those chang= es individually.") control to Git repositories.") (license license:gpl2))) =20 +;; gitile requires a more recent version than the latest release. +(define guile-syntax-highlight-for-gitile + (let ((commit "51727cbb7fc05ef743aab2d7b16314ea1ed790e4") + (revision "0")) + (package + (inherit guile-syntax-highlight) + (version (git-version "0.1" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.dthompson.us/guile-syntax-highlig= ht.git") + (commit commit))) + (file-name (git-file-name "guile-syntax-highlight" version= )) + (sha256 + (base32 + "1cvacy4y5qxajygb1qg8hvhjdf2xnnwnm5j918cabsi8wfwchig7"))= )) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("texinfo" ,texinfo) + ,@(package-native-inputs guile-syntax-highlight)))))) + +(define-public gitile + (package + (name "gitile") + (version "0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.lepiller.eu/git/gitile") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1ciwvqlc0nnzcxx3wjdsrm8i1h9965clv56nzcw7yyhml8ds42dk")))) + (build-system gnu-build-system) + (arguments + `(#:modules ((guix build utils) + (guix build gnu-build-system) + (ice-9 rdelim) + (ice-9 popen)) + #:make-flags (list "GUILE_AUTO_COMPILE=3D0") + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-assets + (lambda* (#:key outputs #:allow-other-keys) + (let ((assets (string-append (assoc-ref outputs "out") + "/share/gitile/assets"))) + (mkdir-p assets) + (copy-recursively "assets" assets)))) + (add-after 'install 'install-bin + (lambda* (#:key outputs #:allow-other-keys) + (install-file "scripts/gitile" + (string-append (assoc-ref outputs "out") + "/bin")))) + (add-after 'install-bin 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Wrap the 'cuirass' command to refer to the right modules. + (let* ((out (assoc-ref outputs "out")) + (commonmark (assoc-ref inputs "guile-commonmark")) + (git (assoc-ref inputs "guile-git")) + (bytes (assoc-ref inputs "guile-bytestructures")) + (fibers (assoc-ref inputs "guile-fibers")) + (gcrypt (assoc-ref inputs "guile-gcrypt")) + (syntax-highlight (assoc-ref inputs "guile-syntax-high= light")) + (deps (list out commonmark git bytes fibers gcrypt + syntax-highlight)) + (guile (assoc-ref %build-inputs "guile")) + (effective (read-line + (open-pipe* OPEN_READ + (string-append guile "/bin/gui= le") + "-c" "(display (effective-vers= ion))"))) + (mods (string-drop-right ;drop trailing colon + (string-join deps + (string-append "/share/guile/sit= e/" + effective ":") + 'suffix) + 1)) + (objs (string-drop-right + (string-join deps + (string-append "/lib/guile/" eff= ective + "/site-ccache:") + 'suffix) + 1))) + (wrap-program (string-append out "/bin/gitile") + `("GUILE_LOAD_PATH" ":" prefix (,mods)) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs))))))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("guile" ,guile-3.0) + ("pkg-config" ,pkg-config))) + (inputs + `(("guile" ,guile-3.0) + ("guile-commonmark" ,guile-commonmark) + ("guile-fibers" ,guile-fibers) + ("guile-gcrypt" ,guile-gcrypt) + ("guile-git" ,guile-git) + ("guile-syntax-highlight" ,guile-syntax-highlight) + ("gnutls" ,gnutls))) + (home-page "https://git.lepiller.eu/gitile") + (synopsis "Simple git forge written in Guile") + (description "Gitile is a git forge written in Guile that lets you +visualize your public Git repositories on a web interface.") + (license license:agpl3+))) + (define-public pre-commit (package (name "pre-commit") --=20 2.32.0 --MP_/9V5R=VpoWcy+VCTvn/d+M75 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0002-gnu-version-control-Add-gitile-service.patch =46rom 3cd7ef0ae922d77ff5d29c831dbdf8d350210fb7 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 5 Aug 2021 03:46:40 +0200 Subject: [PATCH 2/2] gnu: version-control: Add gitile service. * gnu/services/version-control.scm (gitile-service-type): New variable. * doc/guix.texi (Version Control Services): Document it. --- doc/guix.texi | 79 ++++++++++++++++++++ gnu/services/version-control.scm | 124 ++++++++++++++++++++++++++++++- 2 files changed, 202 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index a826171f34..e5e989c223 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -31440,6 +31440,85 @@ This setting controls the commands and features to= enable within Gitolite. @end deftp =20 =20 +@subsubheading Gitile Service + +@cindex Gitile service +@cindex Git, forge +@uref{https://git.lepiller.eu/gitile, Gitile} is a Git forge for viewing +public git repository contents from a web browser. + +Gitile works best in collaboration with Gitolite, and will serve the public +repositories from Gitolite by default. + +The following example will configure Gitile to serve repositories from a +custom location, with some default messages for the home page and the +footers. + +@lisp +(service gitile-service-type + (gitile-configuration + (repositories "/srv/git") + (base-git-url "https://myweb.site/git") + (index-title "My git repositories") + (intro '((p "This is all my public work!"))) + (footer '((p "This is the end"))) + (nginx-server-block + (nginx-server-configuration + (ssl-certificate + "/etc/letsencrypt/live/myweb.site/fullchain.pem") + (ssl-certificate-key + "/etc/letsencrypt/live/myweb.site/privkey.pem") + (listen '("443 ssl http2" "[::]:443 ssl http2")) + (locations + (list + (git-http-nginx-location-configuration + (git-http-configuration + (uri-path "/git/") + (git-root "/var/lib/gitolite/repositories"))))))))) +@end lisp + +@deftp {Data Type} gitile-configuration +Data type representing the configuration for @code{gitile-service-type}. + +@table @asis +@item @code{package} (default: @var{gitile}) +Gitile package to use. + +@item @code{host} (default: @code{"localhost"}) +The host on which gitile is listening. + +@item @code{port} (default: @code{8080}) +The port on which gitile is listening. + +@item @code{database} (default: @code{"/var/lib/gitile/gitile-db.sql"}) +The location of the database. + +@item @code{repositories} (default: @code{"/var/lib/gitolite/repositories"= }) +The location of the repositories. Note that only public repositories will +be shown by Gitile. To make a repository public, add an empty +@file{git-daemon-export-ok} file at the root of that repository. + +@item @code{base-git-url} +The base git url that will be used to show clone commands. + +@item @code{index-title} (default: @code{"Index"}) +The page title for the index page that lists all the available repositorie= s. + +@item @code{intro} (default: @code{'()}) +The intro content, as a list of sxml expressions. This is shown above the= list +of repositories, on the index page. + +@item @code{footer} (default: @code{'()}) +The footer content, as a list of sxml expressions. This is shown on every +page served by Gitile. + +@item @code{nginx-server-block} +An nginx server block that will be extended and used as a reverse proxy by +Gitile to serve its pages, and as a normal web server to serve its assets. +@end table +@end deftp + + @node Game Services @subsection Game Services =20 diff --git a/gnu/services/version-control.scm b/gnu/services/version-contro= l.scm index 8cb5633165..f28206b239 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -4,6 +4,7 @@ ;;; Copyright =C2=A9 2017 Oleg Pykhalov ;;; Copyright =C2=A9 2017 Cl=C3=A9ment Lassieur ;;; Copyright =C2=A9 2018 Christopher Baines +;;; Copyright =C2=A9 2021 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -58,7 +59,22 @@ gitolite-rc-file-roles gitolite-rc-file-enable =20 - gitolite-service-type)) + gitolite-service-type + + + gitile-configuration + gitile-configuration-package + gitile-configuration-host + gitile-configuration-port + gitile-configuration-database + gitile-configuration-repositories + gitile-configuration-git-base-url + gitile-configuration-index-title + gitile-configuration-intro + gitile-configuration-footer + gitile-configuration-nginx-server-block + + gitile-service-type)) =20 ;;; Commentary: ;;; @@ -380,3 +396,109 @@ access to exported repositories under @file{/srv/git}= ." By default, the @code{git} user is used, but this is configurable. Additionally, Gitolite can integrate with with tools like gitweb or cgit to provide a web interface to view selected repositories."))) + +;;; +;;; Gitile +;;; + +(define-record-type* + gitile-configuration make-gitile-configuration gitile-configuration? + (package gitile-configuration-package + (default gitile)) + (host gitile-configuration-host + (default "localhost")) + (port gitile-configuration-port + (default 8080)) + (database gitile-configuration-database + (default "/var/lib/gitile/gitile-db.sql")) + (repositories gitile-configuration-repositories + (default "/var/lib/gitolite/repositories")) + (base-git-url gitile-configuration-base-git-url) + (index-title gitile-configuration-index-title + (default "Index")) + (intro gitile-configuration-intro + (default '())) + (footer gitile-configuration-footer + (default '())) + (nginx-server-block nginx-configuration-nginx-server-block)) + +(define (gitile-config-file host port database repositories base-git-url + index-title intro footer) + (define build + #~(write `(config + (port #$port) + (host #$host) + (database #$database) + (repositories #$repositories) + (base-git-url #$base-git-url) + (index-title #$index-title) + (intro #$intro) + (footer #$footer)) + (open-output-file #$output))) + + (computed-file "gitile.conf" build)) + +(define gitile-nginx-server-block + (match-lambda + (($ package host port database repositories + base-git-url index-title intro footer nginx-server-block) + (list (nginx-server-configuration + (inherit nginx-server-block) + (locations + (append + (list + (nginx-location-configuration + (uri "/") + (body + (list + #~(string-append "proxy_pass http://" #$ho= st + ":" (number->string #$por= t) + "/;"))))) + (map + (lambda (loc) + (nginx-location-configuration + (uri loc) + (body + (list + #~(string-append "root " package "/share/gitile= /assets;"))))) + '("/css" "/js" "/images")) + (nginx-server-configuration-locations nginx-server-block)= ))))))) + +(define gitile-shepherd-service + (match-lambda + (($ package host port database repositories + base-git-url index-title intro footer nginx-server-block) + (list (shepherd-service + (provision '(gitile)) + (requirement '(loopback)) + (documentation "gitile") + (start (let ((gitile (file-append package "/bin/gitile"))) + #~(make-forkexec-constructor + `(,#$gitile "-c" #$(gitile-config-file + host port database + repositories + base-git-url index-title + intro footer)) + #:user "gitile" + #:group "git"))) + (stop #~(make-kill-destructor))))))) + +(define %gitile-accounts + (list (user-account + (name "gitile") + (group "git") + (system? #t) + (comment "Gitile user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define gitile-service-type + (service-type + (name 'gitile) + (extensions + (list (service-extension account-service-type + (const %gitile-accounts)) + (service-extension shepherd-root-service-type + gitile-shepherd-service) + (service-extension nginx-service-type + gitile-nginx-server-block))))) --=20 2.32.0 --MP_/9V5R=VpoWcy+VCTvn/d+M75-- From unknown Fri Aug 15 20:27:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#49886] [PATCH] Add gitile and gitile service Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 05 Aug 2021 14:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49886 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller , 49886@debbugs.gnu.org Received: via spool by 49886-submit@debbugs.gnu.org id=B49886.162817553331936 (code B ref 49886); Thu, 05 Aug 2021 14:59:02 +0000 Received: (at 49886) by debbugs.gnu.org; 5 Aug 2021 14:58:53 +0000 Received: from localhost ([127.0.0.1]:48046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBeph-0008J2-8N for submit@debbugs.gnu.org; Thu, 05 Aug 2021 10:58:53 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:43426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBepf-0008It-PW for 49886@debbugs.gnu.org; Thu, 05 Aug 2021 10:58:52 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by michel.telenet-ops.be with bizsmtp id dqyp2500Z0mfAB406qyqQL; Thu, 05 Aug 2021 16:58:50 +0200 Message-ID: From: Maxime Devos Date: Thu, 05 Aug 2021 16:58:45 +0200 In-Reply-To: <20210805035159.3959e01e@tachikoma.lepiller.eu> References: <20210805035159.3959e01e@tachikoma.lepiller.eu> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-6MNqw88GhgnQ+x4vBpPx" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1628175530; bh=/Kbog9BqGD3u9yi7KNSUmj+dI1AD1cD329ZYrUfR0pE=; h=Subject:From:To:Date:In-Reply-To:References; b=ux15Oe9Tj63PYqTM3+ONaK376WSpSJybS7w0ojIa+56C8USIhcvClFwdCSBnx2VqN tjAmCYk1KNj8sMMTshppwMKkrGyfbncn2VL0eRxWBQ89JUEeVEsp7sBhT9E2YGlIvI 8iprCjhEO7Tp0HJrIY9fXi15FO9VMtS/KkhTNGN57aGIQdg6cKqiJBGWGNzUFoZeJk pUAUe5GmQUKAdy3W2oeoPus960WD/e9bjLPR9Se5Daz5wGIF54gRwQ8ksg7MAy1wPn fI8bhdtV4I+eBSnI+TYLQgV7eFzofpz3TD24KRMaCHwLTyVq0HCmYsgh4Lk3YL7wOX h3JJ7OpHbulUQ== X-Spam-Score: -0.7 (/) 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.7 (-) --=-6MNqw88GhgnQ+x4vBpPx Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Julien Lepiller schreef op do 05-08-2021 om 03:51 [+0200]: > + (add-after 'install-bin 'wrap-program > + (lambda* (#:key inputs outputs #:allow-other-keys) > + ;; Wrap the 'cuirass' command to refer to the right modules= . 'gitile' isn't "cuirass". > + (let* ((out (assoc-ref outputs "out")) > + (commonmark (assoc-ref inputs "guile-commonmark")) > + (git (assoc-ref inputs "guile-git")) > + (bytes (assoc-ref inputs "guile-bytestructures")) > + (fibers (assoc-ref inputs "guile-fibers")) > + (gcrypt (assoc-ref inputs "guile-gcrypt")) > + (syntax-highlight (assoc-ref inputs "guile-syntax-hi= ghlight")) > + (deps (list out commonmark git bytes fibers gcrypt > + syntax-highlight)) > + (guile (assoc-ref %build-inputs "guile")) I wold use 'inputs' instead of '%build-inputs' here. Greetings, Maxime. --=-6MNqw88GhgnQ+x4vBpPx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYQv8pRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kCFAPwOVVkguOlHZ2g3xlfP3KcEdChI meaDye4S0xG2vnlMJQEAqPcafweVmkpSjsBkRkWC8IiEFFvcdxLd0OrJYOqtIQ8= =nML3 -----END PGP SIGNATURE----- --=-6MNqw88GhgnQ+x4vBpPx-- From unknown Fri Aug 15 20:27:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#49886] [PATCH] Add gitile and gitile service Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Aug 2021 10:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49886 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller Cc: 49886@debbugs.gnu.org Received: via spool by 49886-submit@debbugs.gnu.org id=B49886.1628591906649 (code B ref 49886); Tue, 10 Aug 2021 10:39:02 +0000 Received: (at 49886) by debbugs.gnu.org; 10 Aug 2021 10:38:26 +0000 Received: from localhost ([127.0.0.1]:58500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDP9O-0000AP-DC for submit@debbugs.gnu.org; Tue, 10 Aug 2021 06:38:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDP9K-0000A8-LL for 49886@debbugs.gnu.org; Tue, 10 Aug 2021 06:38:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44762) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDP9E-0003X6-73; Tue, 10 Aug 2021 06:38:16 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=45050 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDP9D-0007Mb-U3; Tue, 10 Aug 2021 06:38:16 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210805035159.3959e01e@tachikoma.lepiller.eu> Date: Tue, 10 Aug 2021 12:38:13 +0200 In-Reply-To: <20210805035159.3959e01e@tachikoma.lepiller.eu> (Julien Lepiller's message of "Thu, 5 Aug 2021 03:51:59 +0200") Message-ID: <87lf59shyi.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.3 (/) 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.3 (-) Hello! Julien Lepiller skribis: > Attached is a small patch series that adds gitile and the associated > service type. Gitile is a small git forge project I have, and some of > you expressed their interest, so here it is :) Woohoo, nice! To complement Maxime=E2=80=99s comments: > From 38773e575b313caedfc788d4e28fd219265b4254 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Thu, 5 Aug 2021 02:57:32 +0200 > Subject: [PATCH 1/2] gnu: Add gitile. > > * gnu/packages/version-control.scm (gitile): New variable. [...] > + (synopsis "Simple git forge written in Guile") > + (description "Gitile is a git forge written in Guile that lets you s/git/Git/ > From 3cd7ef0ae922d77ff5d29c831dbdf8d350210fb7 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Thu, 5 Aug 2021 03:46:40 +0200 > Subject: [PATCH 2/2] gnu: version-control: Add gitile service. > > * gnu/services/version-control.scm (gitile-service-type): New variable. > * doc/guix.texi (Version Control Services): Document it. [...] > +@subsubheading Gitile Service > + > +@cindex Gitile service > +@cindex Git, forge > +@uref{https://git.lepiller.eu/gitile, Gitile} is a Git forge for viewing > +public git repository contents from a web browser. s/git/Git/ > +Gitile works best in collaboration with Gitolite, and will serve the pub= lic > +repositories from Gitolite by default. > + > +The following example will configure Gitile to serve repositories from a > +custom location, with some default messages for the home page and the > +footers. > + > +@lisp > +(service gitile-service-type > + (gitile-configuration > + (repositories "/srv/git") > + (base-git-url "https://myweb.site/git") > + (index-title "My git repositories") > + (intro '((p "This is all my public work!"))) > + (footer '((p "This is the end"))) > + (nginx-server-block > + (nginx-server-configuration > + (ssl-certificate > + "/etc/letsencrypt/live/myweb.site/fullchain.pem") > + (ssl-certificate-key > + "/etc/letsencrypt/live/myweb.site/privkey.pem") > + (listen '("443 ssl http2" "[::]:443 ssl http2")) > + (locations > + (list > + (git-http-nginx-location-configuration > + (git-http-configuration > + (uri-path "/git/") > + (git-root "/var/lib/gitolite/repositories")))))))= )) > +@end lisp Could you write a couple of lines about the nginx server block? It=E2=80= =99s quite intimidating and it=E2=80=99s not introduced in the paragraph above. [...] > + No need to export the record type descriptor. > + (start (let ((gitile (file-append package "/bin/gitile"))) > + #~(make-forkexec-constructor > + `(,#$gitile "-c" #$(gitile-config-file > + host port database > + repositories > + base-git-url index-ti= tle > + intro footer)) As a followup it=E2=80=99d be interesting to see if it can run in =E2=80=98make-forkexec-constructor/container=E2=80=99. > +(define gitile-service-type > + (service-type > + (name 'gitile) > + (extensions > + (list (service-extension account-service-type > + (const %gitile-accounts)) > + (service-extension shepherd-root-service-type > + gitile-shepherd-service) > + (service-extension nginx-service-type > + gitile-nginx-server-block))))) Please add a =E2=80=98description=E2=80=99 field. Would be great if you could add a system test too. Otherwise LGTM, it=E2=80=99s exciting to get more Guilish tooling! :-) Ludo=E2=80=99. From unknown Fri Aug 15 20:27:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#49886] [PATCH v2] Add gitile and gitile service Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 25 Aug 2021 21:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49886 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 49886@debbugs.gnu.org Received: via spool by 49886-submit@debbugs.gnu.org id=B49886.16299271206468 (code B ref 49886); Wed, 25 Aug 2021 21:32:02 +0000 Received: (at 49886) by debbugs.gnu.org; 25 Aug 2021 21:32:00 +0000 Received: from localhost ([127.0.0.1]:47970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJ0Ux-0001g7-Pq for submit@debbugs.gnu.org; Wed, 25 Aug 2021 17:32:00 -0400 Received: from lepiller.eu ([89.234.186.109]:56088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJ0Ur-0001fs-BE for 49886@debbugs.gnu.org; Wed, 25 Aug 2021 17:31:50 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 1d9e604a; Wed, 25 Aug 2021 21:31:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type; s=dkim; bh=VZ1SZtfQB8OyvngUB02GnmkPeixH2R5GVc3usO pWTdE=; b=fJoQhPoR8Sv28XUGH0cMskW8U0pZ7ifYq5/8FQuj3CuHI5fFcSghv6 OC9uBbR5BSAwg2BJpmxwUcgtd6fg0LSQsG8D8l8iw63fLYjFlB2vVCHyg6Lt6FRi SoSrFSuZeRlIMccIRwAWw3s58y9cNjdiHga5cb1bismDVN+/eCCTIx33GVnvmWea mg7oSgm0VPLCktID3lPvYKZ47OUc34pyu8OoBgF4P2MqPtoZjP6yMnjlts48NMrC bQBnS54JfjGSyDphoJXO3bkv7MSbf+4FHSABPFua5GIk6wP1h0uHXKEONoG+6YWI 2G2Q4rtxIb5g+1eNsvocKJ+xgAUXJiRQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 18c5a835 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Wed, 25 Aug 2021 21:31:42 +0000 (UTC) Date: Wed, 25 Aug 2021 23:31:36 +0200 From: Julien Lepiller Message-ID: <20210825233136.450d778b@tachikoma.lepiller.eu> In-Reply-To: <87lf59shyi.fsf@gnu.org> References: <20210805035159.3959e01e@tachikoma.lepiller.eu> <87lf59shyi.fsf@gnu.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/WGaDyAVP._GKgThuzA.bXh4" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Thanks for the feedback! attached is a v2 of the series. I added a small change to gitolite that allows changing UNSAFE_PATT (a regex that matches configuration values that contain unsafe characters). I wanted to link to it a [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: myweb.site (site)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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 (+) --MP_/WGaDyAVP._GKgThuzA.bXh4 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks for the feedback! attached is a v2 of the series. I added a small change to gitolite that allows changing UNSAFE_PATT (a regex that matches configuration values that contain unsafe characters). I wanted to link to it and to the nginx configuration sections in the manual, but I don't know how to create that link? I see the @subsubheading NGINX for instance, but I can't @ref{NGINX}. I had to update gitile for the tests to pass and had a few false starts, but now the tests pass and gitile is working even better than before :) --MP_/WGaDyAVP._GKgThuzA.bXh4 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-Add-gitile.patch =46rom d43a77241defdea7848ab4596b427c33675f050e Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 5 Aug 2021 02:57:32 +0200 Subject: [PATCH 1/3] gnu: Add gitile. * gnu/packages/version-control.scm (gitile): New variable. --- gnu/packages/version-control.scm | 109 +++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-contro= l.scm index ac61b97f59..c378ff5bca 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -39,6 +39,7 @@ ;;; Copyright =C2=A9 2021 LibreMiami ;;; Copyright =C2=A9 2021 Xinglu Chen ;;; Copyright =C2=A9 2021 Fran=C3=A7ois J. +;;; Copyright =C2=A9 2021 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -93,6 +94,7 @@ #:use-module (gnu packages golang) #:use-module (gnu packages groff) #:use-module (gnu packages guile) + #:use-module (gnu packages guile-xyz) #:use-module (gnu packages image) #:use-module (gnu packages linux) #:use-module (gnu packages mail) @@ -114,6 +116,7 @@ #:use-module (gnu packages readline) #:use-module (gnu packages rsync) #:use-module (gnu packages sqlite) + #:use-module (gnu packages texinfo) #:use-module (gnu packages admin) #:use-module (gnu packages xml) #:use-module (gnu packages emacs) @@ -1517,6 +1520,112 @@ also walk each side of a merge and test those chang= es individually.") control to Git repositories.") (license license:gpl2))) =20 +;; gitile requires a more recent version than the latest release. +(define guile-syntax-highlight-for-gitile + (let ((commit "897fa5156ff41588e0d281eb00e4e94de63ccd8a") + (revision "0")) + (package + (inherit guile-syntax-highlight) + (version (git-version "0.1" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.dthompson.us/guile-syntax-highlig= ht.git") + (commit commit))) + (file-name (git-file-name "guile-syntax-highlight" version= )) + (sha256 + (base32 + "18zlg4mkgd3swgv2ggfz91ivnnzc0zhvc9ybgrxg1y762va9hyvj"))= )) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("texinfo" ,texinfo) + ,@(package-native-inputs guile-syntax-highlight)))))) + +(define-public gitile + (package + (name "gitile") + (version "0.1.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.lepiller.eu/git/gitile") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1fnmgrrsdc24mvicj2gkv3vasag7h5x27xc12w55i0id9vw7k9sw")))) + (build-system gnu-build-system) + (arguments + `(#:modules ((guix build utils) + (guix build gnu-build-system) + (ice-9 rdelim) + (ice-9 popen)) + #:make-flags (list "GUILE_AUTO_COMPILE=3D0") + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-assets + (lambda* (#:key outputs #:allow-other-keys) + (let ((assets (string-append (assoc-ref outputs "out") + "/share/gitile/assets"))) + (mkdir-p assets) + (copy-recursively "assets" assets)))) + (add-after 'install 'install-bin + (lambda* (#:key outputs #:allow-other-keys) + (install-file "scripts/gitile" + (string-append (assoc-ref outputs "out") + "/bin")))) + (add-after 'install-bin 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Wrap the 'cuirass' command to refer to the right modules. + (let* ((out (assoc-ref outputs "out")) + (commonmark (assoc-ref inputs "guile-commonmark")) + (git (assoc-ref inputs "guile-git")) + (bytes (assoc-ref inputs "guile-bytestructures")) + (fibers (assoc-ref inputs "guile-fibers")) + (gcrypt (assoc-ref inputs "guile-gcrypt")) + (syntax-highlight (assoc-ref inputs "guile-syntax-high= light")) + (deps (list out commonmark git bytes fibers gcrypt + syntax-highlight)) + (guile (assoc-ref inputs "guile")) + (effective (read-line + (open-pipe* OPEN_READ + (string-append guile "/bin/gui= le") + "-c" "(display (effective-vers= ion))"))) + (mods (string-drop-right ;drop trailing colon + (string-join deps + (string-append "/share/guile/sit= e/" + effective ":") + 'suffix) + 1)) + (objs (string-drop-right + (string-join deps + (string-append "/lib/guile/" eff= ective + "/site-ccache:") + 'suffix) + 1))) + (wrap-program (string-append out "/bin/gitile") + `("GUILE_LOAD_PATH" ":" prefix (,mods)) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs))))))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("guile" ,guile-3.0) + ("pkg-config" ,pkg-config))) + (inputs + `(("guile" ,guile-3.0) + ("guile-commonmark" ,guile-commonmark) + ("guile-fibers" ,guile-fibers) + ("guile-gcrypt" ,guile-gcrypt) + ("guile-git" ,guile-git) + ("guile-syntax-highlight" ,guile-syntax-highlight-for-gitile) + ("gnutls" ,gnutls))) + (home-page "https://git.lepiller.eu/gitile") + (synopsis "Simple Git forge written in Guile") + (description "Gitile is a Git forge written in Guile that lets you +visualize your public Git repositories on a web interface.") + (license license:agpl3+))) + (define-public pre-commit (package (name "pre-commit") --=20 2.32.0 --MP_/WGaDyAVP._GKgThuzA.bXh4 Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-gnu-gitolite-Add-unsafe-patt-configuration-option.patch >From 2652e5515c84505c63072309f3b3e7837649cdb9 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Wed, 25 Aug 2021 03:00:44 +0200 Subject: [PATCH 2/3] gnu: gitolite: Add unsafe-patt configuration option. * gnu/services/version-control.scm (gitolite-rc-file): Add unsafe-patt field. (gitolite-rc-file-compiler): Write it. * doc/guix.texi (Version Control Services): Document it. --- doc/guix.texi | 9 +++++++++ gnu/services/version-control.scm | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index a826171f34..29a2fffdfd 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -31426,6 +31426,15 @@ A value like @code{#o0027} will give read access to the group used by Gitolite (by default: @code{git}). This is necessary when using Gitolite with software like cgit or gitweb. +@item @code{unsafe-patt} (default: @code{#f}) +An optional pattern for catching unsafe configurations in the configuration +file. See +@uref{https://gitolite.com/gitolite/git-config.html#compensating-for-unsafe_patt, +Gitolite's documentation} for more information. + +When the value is not @code{#f}, it should be a string containing a Perl +regular expression, such as @samp{"[`~#\$\&()|;<>]"}. + @item @code{git-config-keys} (default: @code{""}) Gitolite allows you to set git config values using the @samp{config} keyword. This setting allows control over the config keys to accept. diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm index 8cb5633165..d0ac2e4a18 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -54,6 +54,7 @@ gitolite-rc-file gitolite-rc-file-umask + gitolite-rc-file-unsafe-patt gitolite-rc-file-git-config-keys gitolite-rc-file-roles gitolite-rc-file-enable @@ -226,6 +227,8 @@ access to exported repositories under @file{/srv/git}." gitolite-rc-file? (umask gitolite-rc-file-umask (default #o0077)) + (unsafe-patt gitolite-rc-file-unsafe-patt + (default #f)) (git-config-keys gitolite-rc-file-git-config-keys (default "")) (roles gitolite-rc-file-roles @@ -245,7 +248,7 @@ access to exported repositories under @file{/srv/git}." (define-gexp-compiler (gitolite-rc-file-compiler (file ) system target) (match file - (($ umask git-config-keys roles enable) + (($ umask unsafe-patt git-config-keys roles enable) (apply text-file* "gitolite.rc" `("%RC = (\n" " UMASK => " ,(format #f "~4,'0o" umask) ",\n" @@ -264,6 +267,9 @@ access to exported repositories under @file{/srv/git}." " ],\n" ");\n" "\n" + ,(if unsafe-patt + (string-append "$UNSAFE_PATT = qr(" unsafe-patt ");") + "") "1;\n"))))) (define-record-type* -- 2.32.0 --MP_/WGaDyAVP._GKgThuzA.bXh4 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0003-gnu-version-control-Add-gitile-service.patch =46rom a80c856fce646eee7257239e4c05e67ac292b5fc Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 5 Aug 2021 03:46:40 +0200 Subject: [PATCH 3/3] gnu: version-control: Add gitile service. * gnu/services/version-control.scm (gitile-service-type): New variable. * doc/guix.texi (Version Control Services): Document it. * gnu/tests/version-control.scm (%test-gitile): New variable. --- doc/guix.texi | 128 ++++++++++++++++++++++++++++ gnu/services/version-control.scm | 128 +++++++++++++++++++++++++++- gnu/tests/version-control.scm | 138 ++++++++++++++++++++++++++++++- 3 files changed, 391 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 29a2fffdfd..94d9301238 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -31449,6 +31449,134 @@ This setting controls the commands and features t= o enable within Gitolite. @end deftp =20 =20 +@subsubheading Gitile Service + +@cindex Gitile service +@cindex Git, forge +@uref{https://git.lepiller.eu/gitile, Gitile} is a Git forge for viewing +public git repository contents from a web browser. + +Gitile works best in collaboration with Gitolite, and will serve the public +repositories from Gitolite by default. The service should listen only on +a local port, and a webserver should be configured to serve static resourc= es. +The gitile service provides an easy way to extend the Nginx service. + +The following example will configure Gitile to serve repositories from a +custom location, with some default messages for the home page and the +footers. + +@lisp +(service gitile-service-type + (gitile-configuration + (repositories "/srv/git") + (base-git-url "https://myweb.site/git") + (index-title "My git repositories") + (intro '((p "This is all my public work!"))) + (footer '((p "This is the end"))) + (nginx-server-block + (nginx-server-configuration + (ssl-certificate + "/etc/letsencrypt/live/myweb.site/fullchain.pem") + (ssl-certificate-key + "/etc/letsencrypt/live/myweb.site/privkey.pem") + (listen '("443 ssl http2" "[::]:443 ssl http2")) + (locations + (list + ;; Allow for https anonymous fetch on /git/ urls. + (git-http-nginx-location-configuration + (git-http-configuration + (uri-path "/git/") + (git-root "/var/lib/gitolite/repositories"))))))))) +@end lisp + +In addition to the configuration record, you should configure your git +repositories to contain some optional information. First, your public +repositories need to contain the @file{.git-daemon-export-ok} magic file +that allows Git to export the repository. Gitile uses the presence of this +file to detect public repositories it should make accessible. To do so wi= th +Gitolite for instance, modify your @file{conf/gitolite.conf} to include +this in the repositories you want to make public: + +@example +repo foo + R =3D daemon +@end example + +In addition, Gitile can read the repository configuration to display more +infomation on the repository. Gitile uses the gitweb namespace for its +configuration. As an example, you can use the following in your +@file{conf/gitolite.conf}: + +@example +repo foo + R =3D daemon + desc =3D A long description, optionally with HTML, shown on the= index page + config gitweb.name =3D The Foo Project + config gitweb.synopsis =3D A short description, shown on the main page= of the project +@end example + +Do not forget to commit and push these changes once you are satisfied. You +may need to change your gitolite configuration to allow the previous +configuration options to be set. One way to do that is to add the +following service definition: + +@lisp +(service gitolite-service-type + (gitolite-configuration + (admin-pubkey (local-file "key.pub")) + (rc-file + (gitolite-rc-file + (umask #o0027) + (git-config-keys ".*") + (unsafe-patt "^$"))))) +@end lisp + +@deftp {Data Type} gitile-configuration +Data type representing the configuration for @code{gitile-service-type}. + +@table @asis +@item @code{package} (default: @var{gitile}) +Gitile package to use. + +@item @code{host} (default: @code{"localhost"}) +The host on which gitile is listening. + +@item @code{port} (default: @code{8080}) +The port on which gitile is listening. + +@item @code{database} (default: @code{"/var/lib/gitile/gitile-db.sql"}) +The location of the database. + +@item @code{repositories} (default: @code{"/var/lib/gitolite/repositories"= }) +The location of the repositories. Note that only public repositories will +be shown by Gitile. To make a repository public, add an empty +@file{git-daemon-export-ok} file at the root of that repository. + +@item @code{base-git-url} +The base git url that will be used to show clone commands. + +@item @code{index-title} (default: @code{"Index"}) +The page title for the index page that lists all the available repositorie= s. + +@item @code{intro} (default: @code{'()}) +The intro content, as a list of sxml expressions. This is shown above the= list +of repositories, on the index page. + +@item @code{footer} (default: @code{'()}) +The footer content, as a list of sxml expressions. This is shown on every +page served by Gitile. + +@item @code{nginx-server-block} +An nginx server block that will be extended and used as a reverse proxy by +Gitile to serve its pages, and as a normal web server to serve its assets. + +You can use this block to add more custom URLs to your domain, such as a +@code{/git/} URL for anonymous clones, or serving any other files you would +like to serve. +@end table +@end deftp + + @node Game Services @subsection Game Services =20 diff --git a/gnu/services/version-control.scm b/gnu/services/version-contro= l.scm index d0ac2e4a18..4cb648eb3e 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -4,6 +4,7 @@ ;;; Copyright =C2=A9 2017 Oleg Pykhalov ;;; Copyright =C2=A9 2017 Cl=C3=A9ment Lassieur ;;; Copyright =C2=A9 2018 Christopher Baines +;;; Copyright =C2=A9 2021 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -59,7 +60,21 @@ gitolite-rc-file-roles gitolite-rc-file-enable =20 - gitolite-service-type)) + gitolite-service-type + + gitile-configuration + gitile-configuration-package + gitile-configuration-host + gitile-configuration-port + gitile-configuration-database + gitile-configuration-repositories + gitile-configuration-git-base-url + gitile-configuration-index-title + gitile-configuration-intro + gitile-configuration-footer + gitile-configuration-nginx + + gitile-service-type)) =20 ;;; Commentary: ;;; @@ -386,3 +401,114 @@ access to exported repositories under @file{/srv/git}= ." By default, the @code{git} user is used, but this is configurable. Additionally, Gitolite can integrate with with tools like gitweb or cgit to provide a web interface to view selected repositories."))) + +;;; +;;; Gitile +;;; + +(define-record-type* + gitile-configuration make-gitile-configuration gitile-configuration? + (package gitile-configuration-package + (default gitile)) + (host gitile-configuration-host + (default "127.0.0.1")) + (port gitile-configuration-port + (default 8080)) + (database gitile-configuration-database + (default "/var/lib/gitile/gitile-db.sql")) + (repositories gitile-configuration-repositories + (default "/var/lib/gitolite/repositories")) + (base-git-url gitile-configuration-base-git-url) + (index-title gitile-configuration-index-title + (default "Index")) + (intro gitile-configuration-intro + (default '())) + (footer gitile-configuration-footer + (default '())) + (nginx gitile-configuration-nginx)) + +(define (gitile-config-file host port database repositories base-git-url + index-title intro footer) + (define build + #~(write `(config + (port #$port) + (host #$host) + (database #$database) + (repositories #$repositories) + (base-git-url #$base-git-url) + (index-title #$index-title) + (intro #$intro) + (footer #$footer)) + (open-output-file #$output))) + + (computed-file "gitile.conf" build)) + +(define gitile-nginx-server-block + (match-lambda + (($ package host port database repositories + base-git-url index-title intro footer nginx) + (list (nginx-server-configuration + (inherit nginx) + (locations + (append + (list + (nginx-location-configuration + (uri "/") + (body + (list + #~(string-append "proxy_pass http://" #$ho= st + ":" (number->string #$por= t) + "/;"))))) + (map + (lambda (loc) + (nginx-location-configuration + (uri loc) + (body + (list + #~(string-append "root " #$package "/share/giti= le/assets;"))))) + '("/css" "/js" "/images")) + (nginx-server-configuration-locations nginx)))))))) + +(define gitile-shepherd-service + (match-lambda + (($ package host port database repositories + base-git-url index-title intro footer nginx) + (list (shepherd-service + (provision '(gitile)) + (requirement '(loopback)) + (documentation "gitile") + (start (let ((gitile (file-append package "/bin/gitile"))) + #~(make-forkexec-constructor + `(,#$gitile "-c" #$(gitile-config-file + host port database + repositories + base-git-url index-title + intro footer)) + #:user "gitile" + #:group "git"))) + (stop #~(make-kill-destructor))))))) + +(define %gitile-accounts + (list (user-group + (name "git") + (system? #t)) + (user-account + (name "gitile") + (group "git") + (system? #t) + (comment "Gitile user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define gitile-service-type + (service-type + (name 'gitile) + (description "Run Gitile, a small Git forge. Expose public repositori= es +on the web.") + (extensions + (list (service-extension account-service-type + (const %gitile-accounts)) + (service-extension shepherd-root-service-type + gitile-shepherd-service) + (service-extension nginx-service-type + gitile-nginx-server-block))))) diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm index d3cf19c913..a7cde1f163 100644 --- a/gnu/tests/version-control.scm +++ b/gnu/tests/version-control.scm @@ -38,7 +38,8 @@ #:use-module (guix modules) #:export (%test-cgit %test-git-http - %test-gitolite)) + %test-gitolite + %test-gitile)) =20 (define README-contents "Hello! This is what goes inside the 'README' file.") @@ -63,7 +64,10 @@ (invoke git "commit" "-m" "That's a commit.")) =20 (mkdir-p "/srv/git") - (rename-file "/tmp/test-repo/.git" "/srv/git/test"))))) + (rename-file "/tmp/test-repo/.git" "/srv/git/test") + (with-output-to-file "/srv/git/test/git-daemon-export-ok" + (lambda _ + (display ""))))))) =20 (define %test-repository-service ;; Service that creates /srv/git/test. @@ -416,3 +420,133 @@ HTTP-PORT." (name "gitolite") (description "Clone the Gitolite admin repository.") (value (run-gitolite-test)))) + +;;; +;;; Gitile. +;;; + +(define %gitile-configuration-nginx + (nginx-server-configuration + (root "/does/not/exists") + (try-files (list "$uri" "=3D404")) + (listen '("19418")) + (ssl-certificate #f) + (ssl-certificate-key #f))) + +(define %gitile-os + ;; Operating system under test. + (simple-operating-system + (service dhcp-client-service-type) + (simple-service 'srv-git activation-service-type + #~(mkdir-p "/srv/git")) + (service gitile-service-type + (gitile-configuration + (base-git-url "http://localhost") + (repositories "/srv/git") + (nginx %gitile-configuration-nginx))) + %test-repository-service)) + +(define* (run-gitile-test #:optional (http-port 19418)) + "Run tests in %GITOLITE-OS, which has nginx running and listening on +HTTP-PORT." + (define os + (marionette-operating-system + %gitile-os + #:imported-modules '((gnu services herd) + (guix combinators)))) + + (define vm + (virtual-machine + (operating-system os) + (port-forwardings `((8081 . ,http-port))))) + + (define test + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules (srfi srfi-11) (srfi srfi-64) + (gnu build marionette) + (web uri) + (web client) + (web response)) + + (define marionette + (make-marionette (list #$vm))) + + (mkdir #$output) + (chdir #$output) + + (test-begin "gitile") + + ;; XXX: Shepherd reads the config file *before* binding its cont= rol + ;; socket, so /var/run/shepherd/socket might not exist yet when = the + ;; 'marionette' service is started. + (test-assert "shepherd socket ready" + (marionette-eval + `(begin + (use-modules (gnu services herd)) + (let loop ((i 10)) + (cond ((file-exists? (%shepherd-socket-file)) + #t) + ((> i 0) + (sleep 1) + (loop (- i 1))) + (else + 'failure)))) + marionette)) + + ;; Wait for nginx to be up and running. + (test-assert "nginx running" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'nginx)) + marionette)) + + ;; Make sure the PID file is created. + (test-assert "PID file" + (marionette-eval + '(file-exists? "/var/run/nginx/pid") + marionette)) + + ;; Make sure Git test repository is created. + (test-assert "Git test repository" + (marionette-eval + '(file-exists? "/srv/git/test") + marionette)) + + (sleep 2) + + ;; Make sure we can access pages that correspond to our reposito= ry. + (letrec-syntax ((test-url + (syntax-rules () + ((_ path code) + (test-equal (string-append "GET " path) + code + (let-values (((response body) + (http-get (string-append + "http://localhost= :8081" + path)))) + (response-code response)))) + ((_ path) + (test-url path 200))))) + (test-url "/") + (test-url "/css/gitile.css") + (test-url "/test") + (test-url "/test/commits") + (test-url "/test/tree" 404) + (test-url "/test/tree/-") + (test-url "/test/tree/-/README") + (test-url "/test/does-not-exist" 404) + (test-url "/test/tree/-/does-not-exist" 404) + (test-url "/does-not-exist" 404)) + + (test-end) + (exit (=3D (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "gitile-test" test)) + +(define %test-gitile + (system-test + (name "gitile") + (description "Connect to a running Gitile server.") + (value (run-gitile-test)))) --=20 2.32.0 --MP_/WGaDyAVP._GKgThuzA.bXh4-- From unknown Fri Aug 15 20:27:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#49886] [PATCH v2] Add gitile and gitile service Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Aug 2021 12:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49886 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller Cc: 49886@debbugs.gnu.org Received: via spool by 49886-submit@debbugs.gnu.org id=B49886.163032780510157 (code B ref 49886); Mon, 30 Aug 2021 12:51:01 +0000 Received: (at 49886) by debbugs.gnu.org; 30 Aug 2021 12:50:05 +0000 Received: from localhost ([127.0.0.1]:58418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKgjl-0002dl-Hp for submit@debbugs.gnu.org; Mon, 30 Aug 2021 08:50:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKgjk-0002ck-Ew for 49886@debbugs.gnu.org; Mon, 30 Aug 2021 08:50:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44644) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKgje-0006xL-EY; Mon, 30 Aug 2021 08:49:58 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=45100 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKgje-0008SM-5W; Mon, 30 Aug 2021 08:49:58 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210805035159.3959e01e@tachikoma.lepiller.eu> <87lf59shyi.fsf@gnu.org> <20210825233136.450d778b@tachikoma.lepiller.eu> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 Fructidor an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 30 Aug 2021 14:49:56 +0200 In-Reply-To: <20210825233136.450d778b@tachikoma.lepiller.eu> (Julien Lepiller's message of "Wed, 25 Aug 2021 23:31:36 +0200") Message-ID: <87tuj7ayh7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) 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: -3.3 (---) Hi Julien! Julien Lepiller skribis: > attached is a v2 of the series. I added a small change to gitolite that > allows changing UNSAFE_PATT (a regex that matches configuration values > that contain unsafe characters). I wanted to link to it and to the > nginx configuration sections in the manual, but I don't know how to > create that link? I see the @subsubheading NGINX for instance, but I > can't @ref{NGINX}. Right, you cannot cross-reference a heading; you=E2=80=99d need either a no= de or an anchor so you can cross-reference it. > I had to update gitile for the tests to pass and had a few false > starts, but now the tests pass and gitile is working even better than > before :) Yay! :-) > From d43a77241defdea7848ab4596b427c33675f050e Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Thu, 5 Aug 2021 02:57:32 +0200 > Subject: [PATCH 1/3] gnu: Add gitile. > > * gnu/packages/version-control.scm (gitile): New variable. LGTM! > From 2652e5515c84505c63072309f3b3e7837649cdb9 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Wed, 25 Aug 2021 03:00:44 +0200 > Subject: [PATCH 2/3] gnu: gitolite: Add unsafe-patt configuration option. > > * gnu/services/version-control.scm (gitolite-rc-file): Add unsafe-patt > field. > (gitolite-rc-file-compiler): Write it. > * doc/guix.texi (Version Control Services): Document it. [...] > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -31426,6 +31426,15 @@ A value like @code{#o0027} will give read access= to the group used by Gitolite > (by default: @code{git}). This is necessary when using Gitolite with so= ftware > like cgit or gitweb. >=20=20 > +@item @code{unsafe-patt} (default: @code{#f}) I=E2=80=99d call this field =E2=80=98unsafe-pattern=E2=80=99 for clarity. > +An optional pattern for catching unsafe configurations in the configurat= ion s/pattern/Perl regular expression/ ? > +file. See > +@uref{https://gitolite.com/gitolite/git-config.html#compensating-for-uns= afe_patt, > +Gitolite's documentation} for more information. > + > +When the value is not @code{#f}, it should be a string containing a Perl > +regular expression, such as @samp{"[`~#\$\&()|;<>]"}. =E2=80=9Csuch as @samp{=E2=80=A6}, which catches XYZ.=E2=80=9D OK with changes along these lines! > From a80c856fce646eee7257239e4c05e67ac292b5fc Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Thu, 5 Aug 2021 03:46:40 +0200 > Subject: [PATCH 3/3] gnu: version-control: Add gitile service. > > * gnu/services/version-control.scm (gitile-service-type): New variable. > * doc/guix.texi (Version Control Services): Document it. > * gnu/tests/version-control.scm (%test-gitile): New variable. LGTM, thank you! Ludo=E2=80=99. From unknown Fri Aug 15 20:27:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#49886] [PATCH v2] Add gitile and gitile service Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Aug 2021 16:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49886 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller , Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 49886@debbugs.gnu.org Received: via spool by 49886-submit@debbugs.gnu.org id=B49886.16303424698822 (code B ref 49886); Mon, 30 Aug 2021 16:55:01 +0000 Received: (at 49886) by debbugs.gnu.org; 30 Aug 2021 16:54:29 +0000 Received: from localhost ([127.0.0.1]:60119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKkYG-0002ID-Qa for submit@debbugs.gnu.org; Mon, 30 Aug 2021 12:54:28 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:59458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKkYE-0002Hv-WA for 49886@debbugs.gnu.org; Mon, 30 Aug 2021 12:54:28 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id nsuR250010mfAB401suRxn; Mon, 30 Aug 2021 18:54:25 +0200 Message-ID: <7f8054226ce4857aa98c847fb1f14c7ea4d8805d.camel@telenet.be> From: Maxime Devos Date: Mon, 30 Aug 2021 18:54:24 +0200 In-Reply-To: <20210825233136.450d778b@tachikoma.lepiller.eu> References: <20210805035159.3959e01e@tachikoma.lepiller.eu> <87lf59shyi.fsf@gnu.org> <20210825233136.450d778b@tachikoma.lepiller.eu> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-tAAiO75arpY5t7wak1lL" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1630342465; bh=OdOpM4FISI/xD7W+nLqeaMxy3SiiO8AUlnvr0JM65Ug=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Lem3UVU4KUS2JtvleOnfk92Iczv71AHfocMYqFk+TOxYriknEZ6h0lB+jv4WzDCuH x6xDZWoKpHQMG8hug5jz6cEfNH7VD9WfEnJkSr/GUoKECgI12DgTS0fvnPoVc84yCG gPdTNNUOO6ojHGC/N7+pEl8S/xnR50BBFKZy3lyzlWEsGv2vsQQ9QVFfClCSblw0mg hAiYA4qtXvnhEYw1lhLJua1f3mXpYpF+0xXi86hmh8OQcm0QIu7Il8vLPMe5GOnplv vSeHuMq86UfLMV07mSM/UC89ElPc/hscWDhSCCfMBRp179aM9ZLhjxU/8nkxjnChAa dYwws+SmrhK0w== X-Spam-Score: -0.7 (/) 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.7 (-) --=-tAAiO75arpY5t7wak1lL Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Julien Lepiller schreef op wo 25-08-2021 om 23:31 [+0200]: > + (add-after 'install-bin 'wrap-program > + (lambda* (#:key inputs outputs #:allow-other-keys) > + ;; Wrap the 'cuirass' command to refer to the right modules= . I think you meant 'gitile' here. > + (let* ((out (assoc-ref outputs "out")) > + (commonmark (assoc-ref inputs "guile-commonmark")) > + (git (assoc-ref inputs "guile-git")) > + (bytes (assoc-ref inputs "guile-bytestructures")) > + (fibers (assoc-ref inputs "guile-fibers")) > + (gcrypt (assoc-ref inputs "guile-gcrypt")) > + (syntax-highlight (assoc-ref inputs "guile-syntax-hi= ghlight")) > + (deps (list out commonmark git bytes fibers gcrypt > + syntax-highlight)) > + (guile (assoc-ref inputs "guile")) > + (effective (read-line > + (open-pipe* OPEN_READ > + (string-append guile "/bin/g= uile") > + "-c" "(display (effective-ve= rsion))"))) You can use "target-guile-effective-version" from (guix build guile-build-s= ystem) here. Greetings, Maxime. --=-tAAiO75arpY5t7wak1lL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYS0NQBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jIIAQDPsIGMbETFeclYTCsbrMiZBkjb I8zcMHmKZK4WRT/oLAD/UNJX4bHH9LP7V6TQVZEmkt57G0oMseNox4hCTAUsFw8= =wiVW -----END PGP SIGNATURE----- --=-tAAiO75arpY5t7wak1lL-- From unknown Fri Aug 15 20:27:05 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Julien Lepiller Subject: bug#49886: closed (Re: bug#49886: [PATCH v2] Add gitile and gitile service) Message-ID: References: <20210903000454.421d34ff@tachikoma.lepiller.eu> <20210805035159.3959e01e@tachikoma.lepiller.eu> X-Gnu-PR-Message: they-closed 49886 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 49886@debbugs.gnu.org Date: Thu, 02 Sep 2021 22:06:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1630620362-27452-1" This is a multi-part message in MIME format... ------------=_1630620362-27452-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #49886: [PATCH] Add gitile and gitile service which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 49886@debbugs.gnu.org. --=20 49886: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D49886 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1630620362-27452-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 49886-done) by debbugs.gnu.org; 2 Sep 2021 22:05:16 +0000 Received: from localhost ([127.0.0.1]:42257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLupg-00077p-Bq for submit@debbugs.gnu.org; Thu, 02 Sep 2021 18:05:16 -0400 Received: from lepiller.eu ([89.234.186.109]:56958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLupe-00077h-Bd for 49886-done@debbugs.gnu.org; Thu, 02 Sep 2021 18:05:15 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id e5292df2; Thu, 2 Sep 2021 22:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=SCRdqYu/X+Jl KwPLq1M2s6KsWP3afb1Fv8d1g4YI73I=; b=KGAVimttYX1wKyagYOXSJWcgrwcA 4wAYpi4x9HYCEdhTmgfbjCPgtVZWQjuikb4PymlRpR/FasWyHXmaFgUFVx+T9amD 7hFqzm3XqwsFaWffNUIlAeKLVssT9CNcZVTV51ufnKjIPvTa0vhKchtidUhsClTE sjcDRDr1vwI0DSRTrA0eP1Hb+yQMRbkyQWZwBeYcbESy/ldhZH9ugA+DPUEgZjv1 8145jC80P3T+Lz2HmzvirjJS7+bLSC3YLqh53ttjfPHZGXP2A+r6ssy8rpyq7bXi abReM+pnGnx7tfgXTlNLt59rHpPvJ81D5dK/fArYCGdlNgBwdbk+AWSbXQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 7435aa46 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 2 Sep 2021 22:05:10 +0000 (UTC) Date: Fri, 3 Sep 2021 00:04:54 +0200 From: Julien Lepiller To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Subject: Re: bug#49886: [PATCH v2] Add gitile and gitile service Message-ID: <20210903000454.421d34ff@tachikoma.lepiller.eu> In-Reply-To: <87tuj7ayh7.fsf@gnu.org> References: <20210805035159.3959e01e@tachikoma.lepiller.eu> <87lf59shyi.fsf@gnu.org> <20210825233136.450d778b@tachikoma.lepiller.eu> <87tuj7ayh7.fsf@gnu.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49886-done Cc: 49886-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Pushed, thanks! ------------=_1630620362-27452-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 5 Aug 2021 01:52:28 +0000 Received: from localhost ([127.0.0.1]:45473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBSYX-0000cl-6Z for submit@debbugs.gnu.org; Wed, 04 Aug 2021 21:52:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:41130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBSYV-0000ce-Dr for submit@debbugs.gnu.org; Wed, 04 Aug 2021 21:52:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBSYV-0006RT-4C for guix-patches@gnu.org; Wed, 04 Aug 2021 21:52:19 -0400 Received: from lepiller.eu ([89.234.186.109]:52256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBSYS-0002FV-03 for guix-patches@gnu.org; Wed, 04 Aug 2021 21:52:18 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 7482929c for ; Thu, 5 Aug 2021 01:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:mime-version:content-type; s=dkim; bh=Yju Tq5ZyPt+NohoX3d8r701EJONu08/17PgD669YJbs=; b=Qm1Mx3dKnJicpWeIQUe bdTRO4leXv7VmJxjTuSMVm55+RzfAW7yed/H367bSJHZefC/wf6E3purWt8zqbFB FfwXC2+Op/ql+m6Uh4+xHR8VFuL1QtdUJEJk5gs0kAlp9LU75VvxAk+7Yy3eUr/y JG/1hTHWv6C6+wJBs1SNBblrAGNL0vr1W7qWR1xX2cdUw3DxZ5Z06CZBxYgoR+Rc BOrCpDX4kdWEQA818TkD83btoPIzf70QUF1FJ4P1TjfjA6UU+V8hnQjlHwFKUFpj 2gzoBGiRfvVaIzdMfXtIrOcDfFHeGF2GyMRujWsRPVUuonjmGs9DOZOt799H+Dh5 NvQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 0c4fef2b (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Thu, 5 Aug 2021 01:52:10 +0000 (UTC) Date: Thu, 5 Aug 2021 03:51:59 +0200 From: Julien Lepiller To: guix-patches@gnu.org Subject: [PATCH] Add gitile and gitile service Message-ID: <20210805035159.3959e01e@tachikoma.lepiller.eu> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/9V5R=VpoWcy+VCTvn/d+M75" Received-SPF: pass client-ip=89.234.186.109; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_OTHER_BAD_TLD=1.997, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.4 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi guix! Attached is a small patch series that adds gitile and the associated service type. Gitile is a small git forge project I have, and some of you expressed their interest, so here it is :) From 38773e575b313caedfc788d4e28fd219265b4254 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 5 Aug 2021 02:57:32 +0200 Subject: [PATCH 1/2] gnu: Add gitile. Content analysis details: (2.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: myweb.site (site)] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.51.188.17 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 1.7 URIBL_BLACK Contains an URL listed in the URIBL blacklist [URIs: lepiller.eu] X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 3.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi guix! Attached is a small patch series that adds gitile and the associated service type. Gitile is a small git forge project I have, and some of you expressed their interest, so here it is :) From 38773e575b313caedfc788d4e28fd219265b4254 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 5 Aug 2021 02:57:32 +0200 Subject: [PATCH 1/2] gnu: Add gitile. Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.7 URIBL_BLACK Contains an URL listed in the URIBL blacklist [URIs: lepiller.eu] 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --MP_/9V5R=VpoWcy+VCTvn/d+M75 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi guix! Attached is a small patch series that adds gitile and the associated service type. Gitile is a small git forge project I have, and some of you expressed their interest, so here it is :) --MP_/9V5R=VpoWcy+VCTvn/d+M75 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-Add-gitile.patch =46rom 38773e575b313caedfc788d4e28fd219265b4254 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 5 Aug 2021 02:57:32 +0200 Subject: [PATCH 1/2] gnu: Add gitile. * gnu/packages/version-control.scm (gitile): New variable. --- gnu/packages/version-control.scm | 109 +++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-contro= l.scm index ac61b97f59..29dc86be8c 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -39,6 +39,7 @@ ;;; Copyright =C2=A9 2021 LibreMiami ;;; Copyright =C2=A9 2021 Xinglu Chen ;;; Copyright =C2=A9 2021 Fran=C3=A7ois J. +;;; Copyright =C2=A9 2021 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -93,6 +94,7 @@ #:use-module (gnu packages golang) #:use-module (gnu packages groff) #:use-module (gnu packages guile) + #:use-module (gnu packages guile-xyz) #:use-module (gnu packages image) #:use-module (gnu packages linux) #:use-module (gnu packages mail) @@ -114,6 +116,7 @@ #:use-module (gnu packages readline) #:use-module (gnu packages rsync) #:use-module (gnu packages sqlite) + #:use-module (gnu packages texinfo) #:use-module (gnu packages admin) #:use-module (gnu packages xml) #:use-module (gnu packages emacs) @@ -1517,6 +1520,112 @@ also walk each side of a merge and test those chang= es individually.") control to Git repositories.") (license license:gpl2))) =20 +;; gitile requires a more recent version than the latest release. +(define guile-syntax-highlight-for-gitile + (let ((commit "51727cbb7fc05ef743aab2d7b16314ea1ed790e4") + (revision "0")) + (package + (inherit guile-syntax-highlight) + (version (git-version "0.1" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.dthompson.us/guile-syntax-highlig= ht.git") + (commit commit))) + (file-name (git-file-name "guile-syntax-highlight" version= )) + (sha256 + (base32 + "1cvacy4y5qxajygb1qg8hvhjdf2xnnwnm5j918cabsi8wfwchig7"))= )) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("texinfo" ,texinfo) + ,@(package-native-inputs guile-syntax-highlight)))))) + +(define-public gitile + (package + (name "gitile") + (version "0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.lepiller.eu/git/gitile") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1ciwvqlc0nnzcxx3wjdsrm8i1h9965clv56nzcw7yyhml8ds42dk")))) + (build-system gnu-build-system) + (arguments + `(#:modules ((guix build utils) + (guix build gnu-build-system) + (ice-9 rdelim) + (ice-9 popen)) + #:make-flags (list "GUILE_AUTO_COMPILE=3D0") + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-assets + (lambda* (#:key outputs #:allow-other-keys) + (let ((assets (string-append (assoc-ref outputs "out") + "/share/gitile/assets"))) + (mkdir-p assets) + (copy-recursively "assets" assets)))) + (add-after 'install 'install-bin + (lambda* (#:key outputs #:allow-other-keys) + (install-file "scripts/gitile" + (string-append (assoc-ref outputs "out") + "/bin")))) + (add-after 'install-bin 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Wrap the 'cuirass' command to refer to the right modules. + (let* ((out (assoc-ref outputs "out")) + (commonmark (assoc-ref inputs "guile-commonmark")) + (git (assoc-ref inputs "guile-git")) + (bytes (assoc-ref inputs "guile-bytestructures")) + (fibers (assoc-ref inputs "guile-fibers")) + (gcrypt (assoc-ref inputs "guile-gcrypt")) + (syntax-highlight (assoc-ref inputs "guile-syntax-high= light")) + (deps (list out commonmark git bytes fibers gcrypt + syntax-highlight)) + (guile (assoc-ref %build-inputs "guile")) + (effective (read-line + (open-pipe* OPEN_READ + (string-append guile "/bin/gui= le") + "-c" "(display (effective-vers= ion))"))) + (mods (string-drop-right ;drop trailing colon + (string-join deps + (string-append "/share/guile/sit= e/" + effective ":") + 'suffix) + 1)) + (objs (string-drop-right + (string-join deps + (string-append "/lib/guile/" eff= ective + "/site-ccache:") + 'suffix) + 1))) + (wrap-program (string-append out "/bin/gitile") + `("GUILE_LOAD_PATH" ":" prefix (,mods)) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs))))))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("guile" ,guile-3.0) + ("pkg-config" ,pkg-config))) + (inputs + `(("guile" ,guile-3.0) + ("guile-commonmark" ,guile-commonmark) + ("guile-fibers" ,guile-fibers) + ("guile-gcrypt" ,guile-gcrypt) + ("guile-git" ,guile-git) + ("guile-syntax-highlight" ,guile-syntax-highlight) + ("gnutls" ,gnutls))) + (home-page "https://git.lepiller.eu/gitile") + (synopsis "Simple git forge written in Guile") + (description "Gitile is a git forge written in Guile that lets you +visualize your public Git repositories on a web interface.") + (license license:agpl3+))) + (define-public pre-commit (package (name "pre-commit") --=20 2.32.0 --MP_/9V5R=VpoWcy+VCTvn/d+M75 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0002-gnu-version-control-Add-gitile-service.patch =46rom 3cd7ef0ae922d77ff5d29c831dbdf8d350210fb7 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 5 Aug 2021 03:46:40 +0200 Subject: [PATCH 2/2] gnu: version-control: Add gitile service. * gnu/services/version-control.scm (gitile-service-type): New variable. * doc/guix.texi (Version Control Services): Document it. --- doc/guix.texi | 79 ++++++++++++++++++++ gnu/services/version-control.scm | 124 ++++++++++++++++++++++++++++++- 2 files changed, 202 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index a826171f34..e5e989c223 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -31440,6 +31440,85 @@ This setting controls the commands and features to= enable within Gitolite. @end deftp =20 =20 +@subsubheading Gitile Service + +@cindex Gitile service +@cindex Git, forge +@uref{https://git.lepiller.eu/gitile, Gitile} is a Git forge for viewing +public git repository contents from a web browser. + +Gitile works best in collaboration with Gitolite, and will serve the public +repositories from Gitolite by default. + +The following example will configure Gitile to serve repositories from a +custom location, with some default messages for the home page and the +footers. + +@lisp +(service gitile-service-type + (gitile-configuration + (repositories "/srv/git") + (base-git-url "https://myweb.site/git") + (index-title "My git repositories") + (intro '((p "This is all my public work!"))) + (footer '((p "This is the end"))) + (nginx-server-block + (nginx-server-configuration + (ssl-certificate + "/etc/letsencrypt/live/myweb.site/fullchain.pem") + (ssl-certificate-key + "/etc/letsencrypt/live/myweb.site/privkey.pem") + (listen '("443 ssl http2" "[::]:443 ssl http2")) + (locations + (list + (git-http-nginx-location-configuration + (git-http-configuration + (uri-path "/git/") + (git-root "/var/lib/gitolite/repositories"))))))))) +@end lisp + +@deftp {Data Type} gitile-configuration +Data type representing the configuration for @code{gitile-service-type}. + +@table @asis +@item @code{package} (default: @var{gitile}) +Gitile package to use. + +@item @code{host} (default: @code{"localhost"}) +The host on which gitile is listening. + +@item @code{port} (default: @code{8080}) +The port on which gitile is listening. + +@item @code{database} (default: @code{"/var/lib/gitile/gitile-db.sql"}) +The location of the database. + +@item @code{repositories} (default: @code{"/var/lib/gitolite/repositories"= }) +The location of the repositories. Note that only public repositories will +be shown by Gitile. To make a repository public, add an empty +@file{git-daemon-export-ok} file at the root of that repository. + +@item @code{base-git-url} +The base git url that will be used to show clone commands. + +@item @code{index-title} (default: @code{"Index"}) +The page title for the index page that lists all the available repositorie= s. + +@item @code{intro} (default: @code{'()}) +The intro content, as a list of sxml expressions. This is shown above the= list +of repositories, on the index page. + +@item @code{footer} (default: @code{'()}) +The footer content, as a list of sxml expressions. This is shown on every +page served by Gitile. + +@item @code{nginx-server-block} +An nginx server block that will be extended and used as a reverse proxy by +Gitile to serve its pages, and as a normal web server to serve its assets. +@end table +@end deftp + + @node Game Services @subsection Game Services =20 diff --git a/gnu/services/version-control.scm b/gnu/services/version-contro= l.scm index 8cb5633165..f28206b239 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -4,6 +4,7 @@ ;;; Copyright =C2=A9 2017 Oleg Pykhalov ;;; Copyright =C2=A9 2017 Cl=C3=A9ment Lassieur ;;; Copyright =C2=A9 2018 Christopher Baines +;;; Copyright =C2=A9 2021 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -58,7 +59,22 @@ gitolite-rc-file-roles gitolite-rc-file-enable =20 - gitolite-service-type)) + gitolite-service-type + + + gitile-configuration + gitile-configuration-package + gitile-configuration-host + gitile-configuration-port + gitile-configuration-database + gitile-configuration-repositories + gitile-configuration-git-base-url + gitile-configuration-index-title + gitile-configuration-intro + gitile-configuration-footer + gitile-configuration-nginx-server-block + + gitile-service-type)) =20 ;;; Commentary: ;;; @@ -380,3 +396,109 @@ access to exported repositories under @file{/srv/git}= ." By default, the @code{git} user is used, but this is configurable. Additionally, Gitolite can integrate with with tools like gitweb or cgit to provide a web interface to view selected repositories."))) + +;;; +;;; Gitile +;;; + +(define-record-type* + gitile-configuration make-gitile-configuration gitile-configuration? + (package gitile-configuration-package + (default gitile)) + (host gitile-configuration-host + (default "localhost")) + (port gitile-configuration-port + (default 8080)) + (database gitile-configuration-database + (default "/var/lib/gitile/gitile-db.sql")) + (repositories gitile-configuration-repositories + (default "/var/lib/gitolite/repositories")) + (base-git-url gitile-configuration-base-git-url) + (index-title gitile-configuration-index-title + (default "Index")) + (intro gitile-configuration-intro + (default '())) + (footer gitile-configuration-footer + (default '())) + (nginx-server-block nginx-configuration-nginx-server-block)) + +(define (gitile-config-file host port database repositories base-git-url + index-title intro footer) + (define build + #~(write `(config + (port #$port) + (host #$host) + (database #$database) + (repositories #$repositories) + (base-git-url #$base-git-url) + (index-title #$index-title) + (intro #$intro) + (footer #$footer)) + (open-output-file #$output))) + + (computed-file "gitile.conf" build)) + +(define gitile-nginx-server-block + (match-lambda + (($ package host port database repositories + base-git-url index-title intro footer nginx-server-block) + (list (nginx-server-configuration + (inherit nginx-server-block) + (locations + (append + (list + (nginx-location-configuration + (uri "/") + (body + (list + #~(string-append "proxy_pass http://" #$ho= st + ":" (number->string #$por= t) + "/;"))))) + (map + (lambda (loc) + (nginx-location-configuration + (uri loc) + (body + (list + #~(string-append "root " package "/share/gitile= /assets;"))))) + '("/css" "/js" "/images")) + (nginx-server-configuration-locations nginx-server-block)= ))))))) + +(define gitile-shepherd-service + (match-lambda + (($ package host port database repositories + base-git-url index-title intro footer nginx-server-block) + (list (shepherd-service + (provision '(gitile)) + (requirement '(loopback)) + (documentation "gitile") + (start (let ((gitile (file-append package "/bin/gitile"))) + #~(make-forkexec-constructor + `(,#$gitile "-c" #$(gitile-config-file + host port database + repositories + base-git-url index-title + intro footer)) + #:user "gitile" + #:group "git"))) + (stop #~(make-kill-destructor))))))) + +(define %gitile-accounts + (list (user-account + (name "gitile") + (group "git") + (system? #t) + (comment "Gitile user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define gitile-service-type + (service-type + (name 'gitile) + (extensions + (list (service-extension account-service-type + (const %gitile-accounts)) + (service-extension shepherd-root-service-type + gitile-shepherd-service) + (service-extension nginx-service-type + gitile-nginx-server-block))))) --=20 2.32.0 --MP_/9V5R=VpoWcy+VCTvn/d+M75-- ------------=_1630620362-27452-1--