unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Simon Streit <simon@netpanic.org>
To: help-guix@gnu.org
Subject: Set up cgit with git-http-backend properly
Date: Thu, 30 Jun 2022 12:40:28 +0200	[thread overview]
Message-ID: <ygufsjm77tv.fsf@netpanic.org> (raw)

Hello!

Lately I've been running a cgit instance serving a local Guix channel
with my own personal modifications.

Here's my code snippet:
--8<---------------cut here---------------start------------->8---
(service
 cgit-service-type
 (cgit-configuration
  (enable-git-config? #t)
  (remove-suffix? #t)
  (root-title "git.example.com")
  (clone-prefix (list "https://git.example.com"))
  (strict-export "git-daemon-export-ok")
  (nginx
   (list
    (nginx-server-configuration
     (server-name '("git.example.com"))
     (root cgit)
     (locations
      (list
       (git-http-nginx-location-configuration
        (git-http-configuration (uri-path "/")))
       (nginx-location-configuration
	(uri "@cgit")
	(body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;"
	        "fastcgi_param PATH_INFO $uri;"
	        "fastcgi_param QUERY_STRING $args;"
	        "fastcgi_param HTTP_HOST $server_name;"
	        "fastcgi_pass 127.0.0.1:9000;")))))
     (try-files (list "$uri" "@cgit"))
     (ssl-certificate "/etc/letsencrypt/live/example.com/fullchain.pem")
     (ssl-certificate-key "/etc/letsencrypt/live/example.com/privkey.pem"))))))
--8<---------------cut here---------------end--------------->8---

With this setting running guix pull onto a channel will error out:
--8<---------------cut here---------------start------------->8---
guix pull: error: Git error: invalid content-type: 'text/plain; charset=UTF-8'
--8<---------------cut here---------------end--------------->8---

Which appears that my nginx instance or cgit is still serving git
repositories over git's old dumb http protocol instead of providing it
over git-http-backend.  The logs in nginx are suggesting no error
though.

Chances are that I got it wrong from reading the manual.  Has anyone
else set this up yet?  It'd be grand to have this working.


Thanks in advance!
Simon



             reply	other threads:[~2022-06-30 10:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 10:40 Simon Streit [this message]
2022-07-02  9:35 ` Set up cgit with git-http-backend properly pelzflorian (Florian Pelz)
2022-07-04 10:29   ` Simon Streit
2022-07-04 10:38     ` Simon Streit
2022-07-06 16:27     ` pelzflorian (Florian Pelz)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ygufsjm77tv.fsf@netpanic.org \
    --to=simon@netpanic.org \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).