help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Set up cgit with git-http-backend properly


From: Simon Streit
Subject: Set up cgit with git-http-backend properly
Date: Thu, 30 Jun 2022 12:40:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]