GNU bug report logs - #49886
[PATCH] Add gitile and gitile service

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Thu, 5 Aug 2021 01:53:02 UTC

Severity: normal

Tags: patch

Done: Julien Lepiller <julien <at> lepiller.eu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49886 in the body.
You can then email your comments to 49886 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#49886; Package guix-patches. (Thu, 05 Aug 2021 01:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julien Lepiller <julien <at> lepiller.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 05 Aug 2021 01:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: guix-patches <at> gnu.org
Subject: [PATCH] Add gitile and gitile service
Date: Thu, 5 Aug 2021 03:51:59 +0200
[Message part 1 (text/plain, 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 :)
[0001-gnu-Add-gitile.patch (text/x-patch, attachment)]
[0002-gnu-version-control-Add-gitile-service.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#49886; Package guix-patches. (Thu, 05 Aug 2021 14:59:02 GMT) Full text and rfc822 format available.

Message #8 received at 49886 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Julien Lepiller <julien <at> lepiller.eu>, 49886 <at> debbugs.gnu.org
Subject: Re: [bug#49886] [PATCH] Add gitile and gitile service
Date: Thu, 05 Aug 2021 16:58:45 +0200
[Message part 1 (text/plain, inline)]
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-highlight"))
> +                    (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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#49886; Package guix-patches. (Tue, 10 Aug 2021 10:39:02 GMT) Full text and rfc822 format available.

Message #11 received at 49886 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 49886 <at> debbugs.gnu.org
Subject: Re: bug#49886: [PATCH] Add gitile and gitile service
Date: Tue, 10 Aug 2021 12:38:13 +0200
Hello!

Julien Lepiller <julien <at> lepiller.eu> 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’s comments:

> From 38773e575b313caedfc788d4e28fd219265b4254 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien <at> lepiller.eu>
> 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 <julien <at> lepiller.eu>
> 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 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

Could you write a couple of lines about the nginx server block?  It’s
quite intimidating and it’s not introduced in the paragraph above.


[...]

> +            <gitile-configuration>

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-title
> +                                                   intro footer))

As a followup it’d be interesting to see if it can run in
‘make-forkexec-constructor/container’.

> +(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 ‘description’ field.

Would be great if you could add a system test too.

Otherwise LGTM, it’s exciting to get more Guilish tooling!  :-)

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#49886; Package guix-patches. (Wed, 25 Aug 2021 21:32:02 GMT) Full text and rfc822 format available.

Message #14 received at 49886 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 49886 <at> debbugs.gnu.org
Subject: Re: bug#49886: [PATCH v2] Add gitile and gitile service
Date: Wed, 25 Aug 2021 23:31:36 +0200
[Message part 1 (text/plain, 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 :)
[0001-gnu-Add-gitile.patch (text/x-patch, attachment)]
[0002-gnu-gitolite-Add-unsafe-patt-configuration-option.patch (text/x-patch, attachment)]
[0003-gnu-version-control-Add-gitile-service.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#49886; Package guix-patches. (Mon, 30 Aug 2021 12:51:01 GMT) Full text and rfc822 format available.

Message #17 received at 49886 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 49886 <at> debbugs.gnu.org
Subject: Re: bug#49886: [PATCH v2] Add gitile and gitile service
Date: Mon, 30 Aug 2021 14:49:56 +0200
Hi Julien!

Julien Lepiller <julien <at> lepiller.eu> 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’d need either a node 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 <julien <at> lepiller.eu>
> 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 <julien <at> lepiller.eu>
> 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 software
>  like cgit or gitweb.
>  
> +@item @code{unsafe-patt} (default: @code{#f})

I’d call this field ‘unsafe-pattern’ for clarity.

> +An optional pattern for catching unsafe configurations in the configuration

s/pattern/Perl regular expression/ ?

> +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{"[`~#\$\&()|;<>]"}.

“such as @samp{…}, which catches XYZ.”

OK with changes along these lines!

> From a80c856fce646eee7257239e4c05e67ac292b5fc Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien <at> lepiller.eu>
> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#49886; Package guix-patches. (Mon, 30 Aug 2021 16:55:01 GMT) Full text and rfc822 format available.

Message #20 received at 49886 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Julien Lepiller <julien <at> lepiller.eu>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 49886 <at> debbugs.gnu.org
Subject: Re: [bug#49886] [PATCH v2] Add gitile and gitile service
Date: Mon, 30 Aug 2021 18:54:24 +0200
[Message part 1 (text/plain, inline)]
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-highlight"))
> +                    (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/guile")
> +                                            "-c" "(display (effective-version))")))

You can use "target-guile-effective-version" from (guix build guile-build-system)
here.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Reply sent to Julien Lepiller <julien <at> lepiller.eu>:
You have taken responsibility. (Thu, 02 Sep 2021 22:06:02 GMT) Full text and rfc822 format available.

Notification sent to Julien Lepiller <julien <at> lepiller.eu>:
bug acknowledged by developer. (Thu, 02 Sep 2021 22:06:02 GMT) Full text and rfc822 format available.

Message #25 received at 49886-done <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 49886-done <at> debbugs.gnu.org
Subject: Re: bug#49886: [PATCH v2] Add gitile and gitile service
Date: Fri, 3 Sep 2021 00:04:54 +0200
Pushed, thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Oct 2021 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 208 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.