greenhouse

greenhouse

minimal software forge

git clone git@git.lostduk.com:greenhouse.git

greenhouse / petal / petal.1136 lines · 2654B · raw

1.TH PETAL 1 petal
2.SH NAME
3petal \- git web interface
4.SH SYNOPSIS
5.B petal
6.SH DESCRIPTION
7.B petal
8is a CGI program that shows the bare git repositories in
9.IR root .
10A directory
11.IR root / name .git
12is a repository named
13.IR name ;
14names may be nested, such as
15.BR group/repo ,
16up to
17.B maxdepth
18levels.
19Only repositories containing
20.B git-daemon-export-ok
21are shown.
22.P
23Pages are selected by
24.BR PATH_INFO .
25The longest prefix that names a repository is the repository, the rest
26is the page.
27A
28.I ref
29is a branch, a tag or a commit id of 4 to 40 hex digits; the longest
30prefix of the rest that resolves to one is taken.
31Without a
32.IR ref ,
33.B HEAD
34is used.
35.TP
36.B /
37Index of all repositories with description, owner and age of the last
38commit.
39.TP
40.IR /repo ", " /repo /log[/ ref ]
41Log,
42.B loglimit
43commits per page; older pages are reached with
44.BI ?ofs= n .
45.TP
46.IR /repo /tree[/ ref [/ path ]]
47Directory listing or file view with line anchors.
48Files larger than
49.B maxblob
50bytes are not shown.
51.TP
52.IR /repo /raw/ ref / path
53The file as is, served as
54.B text/plain
55or, if binary,
56.BR application/octet-stream .
57.TP
58.IR /repo /commit/ id
59Commit metadata, diffstat and diff, cut after
60.B maxdiff
61lines.
62.I id
63must be a commit id of 4 to 40 hex digits.
64.TP
65.IR /repo /refs
66Branches and tags.
67.P
68Every response carries a Content-Security-Policy that allows only the
69stylesheet and icon from the same origin.
70.SH ENVIRONMENT
71.TP
72.B PATH_INFO
73The page.
74.TP
75.B SCRIPT_NAME
76URL prefix for links.
77.TP
78.B QUERY_STRING
79.BI ofs= n
80for the log.
81.TP
82.B HOME
83libgit2 refuses repositories owned by another user unless they are
84listed as
85.B safe.directory
86in
87.IR $HOME /.gitconfig.
88.SH FILES
89.TP
90.IR root / repo .git/description
91One line describing the repository.
92.TP
93.IR root / repo .git/owner
94One line naming the owner.
95.TP
96.IR root / repo .git/git-daemon-export-ok
97Present if the repository is public.
98.TP
99.IR PREFIX /share/petal/style.css ", " icon.svg
100Stylesheet and icon, to be served at
101.B css
102and
103.BR icon .
104.SH EXAMPLES
105.B petal
106sets no resource limits itself.
107Run it through a wrapper:
108.P
109.nf
110#!/bin/sh
111ulimit -t 10
112exec /usr/local/bin/petal
113.fi
114.P
115.BR nginx :
116.P
117.nf
118location = /style.css { alias /usr/local/share/petal/style.css; }
119location = /icon.svg { alias /usr/local/share/petal/icon.svg; }
120location / {
121	include fastcgi_params;
122	fastcgi_param SCRIPT_FILENAME /usr/local/bin/petal-cgi;
123	fastcgi_param SCRIPT_NAME "";
124	fastcgi_param PATH_INFO $uri;
125	fastcgi_pass unix:/run/fcgiwrap.sock;
126}
127.fi
128.SH CUSTOMIZATION
129.B petal
130is configured by editing
131.I config.h
132and recompiling.
133.SH SEE ALSO
134.BR herbarium (1),
135.BR hedge (1),
136.BR git-http-backend (1)