40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
-
+
-
+
-
+
|
<h4>UNIX</h4>
1. Find your CGI scripts directory (if applicable). This is commonly something like <base>/cgi-bin/, but does not have to be.
2. Inside that directory build a script file which looks like this:<br><code><pre> #! /usr/bin/env fossil<br> repository: /full/path/to/repository/file.fsl</pre></code>
3. Ensure that the script file so generated is set executable for the CGI user account.
4. Ensure that every directory in the path leading to the repository is browseable (chmod +x) to the CGI user account.
5. Ensure that the repository file is readable <em>and</em> writable to the CGI user account.
The following <cite>bash</cite> script can be run from within the directory containing the <cite>Fossil</cite> repositories to be shared (and, of course, altered for your setup) to set some of the constraints above up automatically:
The following shell script can be run from within the directory containing the <cite>Fossil</cite> repositories to be shared (and, of course, altered for your setup) to set some of the constraints above up automatically:
<nowiki><font face="monospace">
<font color="#a52a2a"> 1 </font><font color="#0000ff">#! /usr/bin/env bash</font><br>
<font color="#a52a2a"> 1 </font><font color="#0000ff">#! /bin/sh</font><br>
<font color="#a52a2a"> 2 </font><font color="#008b8b">CGI_ROOT</font>=/usr/lib/fossil<br>
<font color="#a52a2a"> 3 </font><font color="#008b8b">REPOSITORY_OWNER</font>=michael<br>
<font color="#a52a2a"> 4 </font><font color="#008b8b">CGI_GROUP</font>=www-data<br>
<font color="#a52a2a"> 5 </font><font color="#a52a2a"><b>if</b></font> <font color="#a52a2a"><b>[</b></font> <font color="#6a5acd">`whoami`</font> <font color="#a52a2a"><b>=</b></font> <font color="#ff00ff">'root'</font> <font color="#a52a2a"><b>]</b></font><br>
<font color="#a52a2a"> 5 </font><font color="#a52a2a"><b>if</b></font> <font color="#a52a2a"><b>[</b></font> <font color="#6a5acd">"`id -un`"</font> <font color="#a52a2a"><b>=</b></font> <font color="#ff00ff">'root'</font> <font color="#a52a2a"><b>]</b></font><br>
<font color="#a52a2a"> 6 </font><font color="#a52a2a"><b>then</b></font><br>
<font color="#a52a2a"> 7 </font> <font color="#a52a2a"><b>for</b></font> repository <font color="#a52a2a"><b>in</b></font> *.fsl<br>
<font color="#a52a2a"> 8 </font> <font color="#a52a2a"><b>do</b></font><br>
<font color="#a52a2a"> 9 </font> <font color="#008b8b">SOURCE</font>=<font color="#6a5acd">`</font><font color="#a52a2a"><b>pwd</b></font><font color="#6a5acd">`</font>/<font color="#a020f0">$repository</font><br>
<font color="#a52a2a">10 </font> <font color="#008b8b">DESTINATION</font>=<font color="#a020f0">$CGI_ROOT</font>/<font color="#a020f0">${</font><font color="#a020f0">repository</font><font color="#a52a2a"><b>%</b></font>.fsl<font color="#a020f0">}</font><br>
<font color="#a52a2a">11 </font> <font color="#a52a2a"><b>echo</b></font><font color="#ff00ff"> </font><font color="#a52a2a"><b>"</b></font><font color="#ff00ff">#! /usr/bin/env fossil</font><font color="#a52a2a"><b>"</b></font><font color="#ff00ff"> </font><font color="#a52a2a"><b>></b></font> <font color="#a020f0">$DESTINATION</font><br>
<font color="#a52a2a">12 </font> <font color="#a52a2a"><b>echo</b></font><font color="#ff00ff"> </font><font color="#a52a2a"><b>"</b></font><font color="#ff00ff">repository: </font><font color="#a020f0">$SOURCE</font><font color="#a52a2a"><b>"</b></font><font color="#ff00ff"> </font><font color="#a52a2a"><b>>></b></font> <font color="#a020f0">$DESTINATION</font><br>
|