unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Simon Streit <simon@netpanic.org>
To: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
Cc: help-guix@gnu.org
Subject: Re: Set up cgit with git-http-backend properly
Date: Mon, 04 Jul 2022 12:29:57 +0200	[thread overview]
Message-ID: <ygu1qv1maqi.fsf@netpanic.org> (raw)
In-Reply-To: <87wncvdfh2.fsf@pelzflorian.de> (pelzflorian@pelzflorian.de's message of "Sat, 02 Jul 2022 11:35:37 +0200")

Hello Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> writes:

> what did you base your setup on?

I've been trying to figure it out from the manual and could have found a
config snippet months ago while setting it up.  It has not worked as
expected since.

> with uri-path "/git".  I think you want "/" though because you have
> its own domain.  Or maybe you want "".

To keep things simple I'm only trying to get it working with
‘git-http-nginx-location-configuration’ now.  So far it appears that it
only works when ‘uri-path’ is anything else than "" or "/".

Looking at the service definition in ‘gnu/services/version-contro.scm’
"" and "/" are the same the output of nginx' config file.  After
modifying

(string-append "~ /" (string-trim-both uri-path #\/) "(/.*)")

to

(string-append "~ " (string-trim-both uri-path #\/) "(/.*)")

serving and cloning from https://git.example.com/repo(.git) works now.
But it doesn't when cgit is enabled and serving repositories in the same
path at the same time.

Good news is that I'm at a step further now and have it working with:

(nginx-server-configuration
 (server-name '("git.example.com"))
 (root cgit)
 (try-files (list "$uri" "@cgit"))
 (locations
  (list
   (nginx-location-configuration
    (uri "@cgit")
    (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;"
	    "fastcgi_param PATH_INFO $uri;"
	    "fastcgi_param QUERY_STRING $args;"
	    "fastcgi_param HTTP_HOST $server_name;"
	    "fastcgi_pass 127.0.0.1:9000;")))
   (git-http-nginx-location-configuration
    (git-http-configuration))
   (nginx-location-configuration (uri "/.well-known")
                                 (body '("root /var/www;")))))
 (ssl-certificate "/etc/letsencrypt/live/example.com/fullchain.pem")
 (ssl-certificate-key "/etc/letsencrypt/live/example.com/privkey.pem"))

Though I still rather not keep the URL at
‘http://git.example.com/git/REPO(.git)’ for cloning.

Is there maybe another way around this?


  reply	other threads:[~2022-07-04 10:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 10:40 Set up cgit with git-http-backend properly Simon Streit
2022-07-02  9:35 ` pelzflorian (Florian Pelz)
2022-07-04 10:29   ` Simon Streit [this message]
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=ygu1qv1maqi.fsf@netpanic.org \
    --to=simon@netpanic.org \
    --cc=help-guix@gnu.org \
    --cc=pelzflorian@pelzflorian.de \
    /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).