List for cgit developers and users
 help / color / mirror / Atom feed
* setup issue: cgit only shows summary page
@ 2015-01-16 16:30 luky-37
  2015-01-16 17:05 ` john
  0 siblings, 1 reply; 4+ messages in thread
From: luky-37 @ 2015-01-16 16:30 UTC (permalink / raw)


Hey guys,


I've a probably stupid setup issue, I just can't figure it out and need
a fresh set of eyes:
I compiled cgit from source (@d6c405077) and installed it
on a Ubuntu VM together with nginx through fcgiwrapper.

When I open cgit in my browser it recognizes the repositories, etc,
but I only ever see the summary page with the list of repositories.

If I click on one of them ("/cgit/<repo>/" or "/cgit/cgit.cgi/<repo>/")
it does open in the browser but the content is always the summary page of
all repositories, never the actual repository itself.

Repositories are correctly discovered and for example the "idle" column shows
correct values, but I can't seem to open one of those repositories.


I triple checked file permissions, that doesn't appear to be the problem.

I've also attached strace to the fcgiwrapper process monitoring its cgit
children, and I don't see any permission problems.



cgitrc is:
#virtual-root=/cgit/
css=/cgit/cgit.css
logo=/cgit/cgit.png
favicon=/cgit/favicon.ico
remove-suffix=1
scan-path=/srv/git

and the relevant part of the nginx config is:

root /var/www/htdocs;

location /cgit/ {
		try_files $uri @cgitcgi;
}

location @cgitcgi {
		fastcgi_param ? DOCUMENT_ROOT $document_root;
		fastcgi_param ? SCRIPT_NAME /cgit/cgit.cgi;
		fastcgi_param ? QUERY_STRING ? ? ? ? ? ?$query_string;
		fastcgi_param ? REQUEST_METHOD ? ? ? ? ?$request_method;
		fastcgi_param ? CONTENT_TYPE ? ? ? ? ? ?$content_type;
		fastcgi_param ? CONTENT_LENGTH ? ? ? ? ?$content_length;
		fastcgi_param ? REQUEST_URI ? ? ? ? ? ? $request_uri;
		fastcgi_param ? SERVER_PROTOCOL ? ? ? ? $server_protocol;
		fastcgi_param ? GATEWAY_INTERFACE ? ? ? CGI/1.1;
		fastcgi_param ? SERVER_SOFTWARE ? ? ? ? nginx/$nginx_version;
		fastcgi_param ? REMOTE_ADDR ? ? ? ? ? ? $remote_addr;
		fastcgi_param ? REMOTE_PORT ? ? ? ? ? ? $remote_port;
		fastcgi_param ? SERVER_ADDR ? ? ? ? ? ? $server_addr;
		fastcgi_param ? SERVER_PORT ? ? ? ? ? ? $server_port;
		fastcgi_param ? SERVER_NAME ? ? ? ? ? ? $server_name;
		fastcgi_param ? HTTPS ? ? ? ? ? ? ? ? ? $https if_not_empty;
		fastcgi_pass ? ? ? ?unix:/var/run/fcgiwrap.socket;
}




I've played a lot with those fastcgi parameters in nginx, but I can't
seem to figure out a working combination.



Any hints on how to troubleshoot this properly would be greatly appreciated.



Regards,

Lukas

 		 	   		  


^ permalink raw reply	[flat|nested] 4+ messages in thread

* setup issue: cgit only shows summary page
  2015-01-16 16:30 setup issue: cgit only shows summary page luky-37
@ 2015-01-16 17:05 ` john
  2015-01-16 17:48   ` peter
  0 siblings, 1 reply; 4+ messages in thread
From: john @ 2015-01-16 17:05 UTC (permalink / raw)


On Fri, Jan 16, 2015 at 05:30:56PM +0100, Lukas Tribus wrote:
> I've a probably stupid setup issue, I just can't figure it out and need
> a fresh set of eyes:
> I compiled cgit from source (@d6c405077) and installed it
> on a Ubuntu VM together with nginx through fcgiwrapper.
> 
> When I open cgit in my browser it recognizes the repositories, etc,
> but I only ever see the summary page with the list of repositories.
> 
> If I click on one of them ("/cgit/<repo>/" or "/cgit/cgit.cgi/<repo>/")
> it does open in the browser but the content is always the summary page of
> all repositories, never the actual repository itself.
> 
> Repositories are correctly discovered and for example the "idle" column shows
> correct values, but I can't seem to open one of those repositories.
> 
> 
> I triple checked file permissions, that doesn't appear to be the problem.
> 
> I've also attached strace to the fcgiwrapper process monitoring its cgit
> children, and I don't see any permission problems.
> 
> 
> 
> cgitrc is:
> #virtual-root=/cgit/
> css=/cgit/cgit.css
> logo=/cgit/cgit.png
> favicon=/cgit/favicon.ico
> remove-suffix=1
> scan-path=/srv/git
> 
> and the relevant part of the nginx config is:
> 
> root /var/www/htdocs;
> 
> location /cgit/ {
> 		try_files $uri @cgitcgi;
> }
> 
> location @cgitcgi {
> 		fastcgi_param ? DOCUMENT_ROOT $document_root;
> 		fastcgi_param ? SCRIPT_NAME /cgit/cgit.cgi;
> 		fastcgi_param ? QUERY_STRING ? ? ? ? ? ?$query_string;
> 		fastcgi_param ? REQUEST_METHOD ? ? ? ? ?$request_method;
> 		fastcgi_param ? CONTENT_TYPE ? ? ? ? ? ?$content_type;
> 		fastcgi_param ? CONTENT_LENGTH ? ? ? ? ?$content_length;
> 		fastcgi_param ? REQUEST_URI ? ? ? ? ? ? $request_uri;
> 		fastcgi_param ? SERVER_PROTOCOL ? ? ? ? $server_protocol;
> 		fastcgi_param ? GATEWAY_INTERFACE ? ? ? CGI/1.1;
> 		fastcgi_param ? SERVER_SOFTWARE ? ? ? ? nginx/$nginx_version;
> 		fastcgi_param ? REMOTE_ADDR ? ? ? ? ? ? $remote_addr;
> 		fastcgi_param ? REMOTE_PORT ? ? ? ? ? ? $remote_port;
> 		fastcgi_param ? SERVER_ADDR ? ? ? ? ? ? $server_addr;
> 		fastcgi_param ? SERVER_PORT ? ? ? ? ? ? $server_port;
> 		fastcgi_param ? SERVER_NAME ? ? ? ? ? ? $server_name;
> 		fastcgi_param ? HTTPS ? ? ? ? ? ? ? ? ? $https if_not_empty;
> 		fastcgi_pass ? ? ? ?unix:/var/run/fcgiwrap.socket;
> }

I think you either need to set PATH_INFO here *or* to avoid setting
SCRIPT_NAME.  CGit uses SCRIPT_NAME to decide whether to use path URLs
or the "url=" query parameter.  If it's using path URLs then you need to
have PATH_INFO specified as the full path (which must start with
$SCRIPT_NAME).

Note that I've never used fcgiwrapper so I don't know whether it will
set either of those automatically; I'm just going on how CGit behaves.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* setup issue: cgit only shows summary page
  2015-01-16 17:05 ` john
@ 2015-01-16 17:48   ` peter
  2015-01-19 13:22     ` luky-37
  0 siblings, 1 reply; 4+ messages in thread
From: peter @ 2015-01-16 17:48 UTC (permalink / raw)


On Friday 16 January 2015 17:05:45 John Keeping wrote:
> On Fri, Jan 16, 2015 at 05:30:56PM +0100, Lukas Tribus wrote:
> > I've a probably stupid setup issue, I just can't figure it out and need
> > a fresh set of eyes:
> > I compiled cgit from source (@d6c405077) and installed it
> > on a Ubuntu VM together with nginx through fcgiwrapper.
> > 
> > When I open cgit in my browser it recognizes the repositories, etc,
> > but I only ever see the summary page with the list of repositories.
> > 
> > If I click on one of them ("/cgit/<repo>/" or "/cgit/cgit.cgi/<repo>/")
> > it does open in the browser but the content is always the summary page of
> > all repositories, never the actual repository itself.
> > 
> > Repositories are correctly discovered and for example the "idle" column shows
> > correct values, but I can't seem to open one of those repositories.
> > 
> > 
> > I triple checked file permissions, that doesn't appear to be the problem.
> > 
> > I've also attached strace to the fcgiwrapper process monitoring its cgit
> > children, and I don't see any permission problems.
> > 
> > 
> > 
> > cgitrc is:
> > #virtual-root=/cgit/
> > css=/cgit/cgit.css
> > logo=/cgit/cgit.png
> > favicon=/cgit/favicon.ico
> > remove-suffix=1
> > scan-path=/srv/git
> > 
> > and the relevant part of the nginx config is:
> > 
> > root /var/www/htdocs;
> > 
> > location /cgit/ {
> > 		try_files $uri @cgitcgi;
> > }
> > 
> > location @cgitcgi {
> > 		fastcgi_param   DOCUMENT_ROOT $document_root;
> > 		fastcgi_param   SCRIPT_NAME /cgit/cgit.cgi;
> > 		fastcgi_param   QUERY_STRING            $query_string;
> > 		fastcgi_param   REQUEST_METHOD          $request_method;
> > 		fastcgi_param   CONTENT_TYPE            $content_type;
> > 		fastcgi_param   CONTENT_LENGTH          $content_length;
> > 		fastcgi_param   REQUEST_URI             $request_uri;
> > 		fastcgi_param   SERVER_PROTOCOL         $server_protocol;
> > 		fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
> > 		fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;
> > 		fastcgi_param   REMOTE_ADDR             $remote_addr;
> > 		fastcgi_param   REMOTE_PORT             $remote_port;
> > 		fastcgi_param   SERVER_ADDR             $server_addr;
> > 		fastcgi_param   SERVER_PORT             $server_port;
> > 		fastcgi_param   SERVER_NAME             $server_name;
> > 		fastcgi_param   HTTPS                   $https if_not_empty;
> > 		fastcgi_pass        unix:/var/run/fcgiwrap.socket;
> > }
> 
> I think you either need to set PATH_INFO here *or* to avoid setting
> SCRIPT_NAME.  CGit uses SCRIPT_NAME to decide whether to use path URLs
> or the "url=" query parameter.  If it's using path URLs then you need to
> have PATH_INFO specified as the full path (which must start with
> $SCRIPT_NAME).
> 
> Note that I've never used fcgiwrapper so I don't know whether it will
> set either of those automatically; I'm just going on how CGit behaves.

fcgiwrap uses SCRIPT_FILENAME (if set) and the concatenation of
DOCUMENT_ROOT and SCRIPT_NAME otherwise.

Suggestions for the nginx config: generally a default, sane set of
fastcgi parameters is available in the fastcgi_params file which you can
include with "include fastcgi_params;".

For a working fcgiwrap + nginx config, see:
http://lists.zx2c4.com/pipermail/cgit/2013-April/001307.html
-- 
Kind regards,
Peter
https://lekensteyn.nl




^ permalink raw reply	[flat|nested] 4+ messages in thread

* setup issue: cgit only shows summary page
  2015-01-16 17:48   ` peter
@ 2015-01-19 13:22     ` luky-37
  0 siblings, 0 replies; 4+ messages in thread
From: luky-37 @ 2015-01-19 13:22 UTC (permalink / raw)


>> I think you either need to set PATH_INFO here *or* to avoid setting
>> SCRIPT_NAME. CGit uses SCRIPT_NAME to decide whether to use path URLs
>> or the "url=" query parameter. If it's using path URLs then you need to
>> have PATH_INFO specified as the full path (which must start with
>> $SCRIPT_NAME).
>>
>> Note that I've never used fcgiwrapper so I don't know whether it will
>> set either of those automatically; I'm just going on how CGit behaves.
>
> fcgiwrap uses SCRIPT_FILENAME (if set) and the concatenation of
> DOCUMENT_ROOT and SCRIPT_NAME otherwise.
>
> Suggestions for the nginx config: generally a default, sane set of
> fastcgi parameters is available in the fastcgi_params file which you can
> include with "include fastcgi_params;".

Thanks for these hints. In the end, I had to intercept the fcgi requests
to understand whats going on exactly, and I found that nginx' try_files
resets PATH_INFO [1].

Configuring:
?fastcgi_split_path_info ? ? ? ^(/cgit/)(.*)$;
?fastcgi_param PATH_INFO $fastcgi_path_info;


did the trick for me, without removing try_files.


Lukas


[1] http://trac.nginx.org/nginx/ticket/321

 		 	   		  


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-19 13:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-16 16:30 setup issue: cgit only shows summary page luky-37
2015-01-16 17:05 ` john
2015-01-16 17:48   ` peter
2015-01-19 13:22     ` luky-37

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 NNTP newsgroup(s).