New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CGI scripts, specifically cgit #3

Closed
alephnull opened this Issue Mar 27, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@alephnull
Contributor

alephnull commented Mar 27, 2018

I am trying to get cgit to be served by merecat and have come up against this bug. I do not fully understand CGI and PATH_INFO but I did track down an old patch for thttpd which seems relevant. However, I cannot figure out if this patch has been applied as it cannot be applied in its current form.

I'd be happy to provide any other information to help debug this.

@troglobit

This comment has been minimized.

Owner

troglobit commented Mar 28, 2018

Hi! What version of Mercat httpd are you using, a released version or the latest master? I've mostly run GitWeb and fixed some CGI issues surrounding that, see http://git.troglobit.com/

The mail thread you linked to look very interesting, I found the "titan" patches¹ which I'll look into when I find the time. There could definitely be more details to look into. The patch itself is however already applied to Merecat, which leads me back to my first question; what version of Merecat are you using?
__
¹) https://marc.info/?l=thttpd&m=108352795820187&w=2

@alephnull

This comment has been minimized.

Contributor

alephnull commented Mar 30, 2018

What version of Mercat httpd are you using, a released version or the latest master?

Latest master, built into a debian package. Its running on armhf.

@troglobit

This comment has been minimized.

Owner

troglobit commented Mar 30, 2018

OK, thanks! I think I've reproduced your problem now. Set up a cgit instance on my own server http://cgit.troglobit.com/ ... I'll look into the details over the weekend.

@troglobit

This comment has been minimized.

Owner

troglobit commented Mar 30, 2018

With the following in my /etc/cgitrc, a bit of linking+symlinking, and some magic virtual host bind-mounts, I got it working on my Ubuntu server. Note the leading slash in the virtual-root:*

# cgit config

css=/cgit.css
logo=/cgit.png

# Prepend this to all URLs
virtual-root=/cgit.cgi/

# Home of all GIT repos
scan-path=/srv/git/

# if you do not want that webcrawler (like google) index your site
robots=noindex, nofollow

My /usr/share/cgit is bind mounted into /var/www/cgit.troglobit.com and contains the following files (cgit.cgi is linked from ../../lib/cgit/):

root@example:/usr/share/cgit# ll
total 1000
drwxr-xr-x   2 root root   4096 Mar 30 11:16 ./
drwxr-xr-x 140 root root   4096 Mar 30 09:39 ../
-rwxr-xr-x   2 root root 986800 Feb 12  2016 cgit.cgi*
-rw-r--r--   1 root root  13312 Feb 12  2016 cgit.css
-rw-r--r--   1 root root   1278 Feb 12  2016 cgit.png
-rw-r--r--   1 root root   1078 Feb 12  2016 favicon.ico
lrwxrwxrwx   1 root root     22 Mar 30 11:16 filters -> ../../lib/cgit/filters/
lrwxrwxrwx   1 root root      8 Mar 30 10:16 index.cgi -> cgit.cgi*
-rw-r--r--   1 root root     47 Feb 12  2016 robots.txt
@alephnull

This comment has been minimized.

Contributor

alephnull commented Apr 3, 2018

Thanks @troglobit. I tried your config but I could not get it working without vhosts. I cannot setup vhosts at this time but I will sooner or later.

@alephnull alephnull closed this Apr 3, 2018

@troglobit

This comment has been minimized.

Owner

troglobit commented Apr 3, 2018

Aha, well that could be that you need to use /var/www/cgi-bin/ for all such purposes, or an issue with chrooting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment