1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
+
-
-
+
+
+
+
+
+
+
+
|
<h1>Fossil Cookbook</h1>
The <cite>Fossil</cite> Cookbook is a collection of task-oriented instructions for intermediate users who wish to do more than basic operations with their <cite>Fossil</cite> repositories. The [Tutorial|tutorial] is a more suitable place for newcomers trying to learn the basic concepts to go first before tackling these recipes.
<h2>Index</h2>
<ul>
Server recipes:
* <a href="#CGI">Using <cite>Fossil</cite>'s Built-In CGI</a>
<li> Server recipes:
<ul>
<li> <a href="#CGI">Using <cite>Fossil</cite>'s Built-In CGI</a>
</ul>
<li> <a href="#env">Using Environment variables</a>
<li> <a href="#css">Example CSS</a>
<li> <a href="#source-hilight">Source highlighting</a>
</ul>
<h2><a name="CGI">Using <cite>Fossil</cite>'s Built-In CGI</a></h2>
<h3>Motivation</h3>
* You want to share a repository through your existing web infrastructure.
* You want to share more than one repository at the same time.
<h3>Problem</h3>
|
64
65
66
67
68
69
70
|
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
<li>As with most Windows based web instructions, permission are not as important, however at the least, you need to make sure that your repository is not flagged read-only, as you will encounter database errors if it is.</li>
</ul>
<h3>Discussion</h3>
Using the CGI server is the best solution combining an existing web infrastructure and the sharing of many <cite>Fossil</cite> repositories. Unlike the ad-hoc solution which requires, in effect, a separate port for each simultaneously-shared repository, and which requires several instances of fossil running -- one for each shared repository -- the CGI approach uses URLs to distinguish between repositories and only (briefly) runs a copy of fossil when the repository is actually accessed.
Sharing repositories with CGI is really only worth the effort if more than one repository is being shared, however. With only one being shared, <code>fossil server</code> is likely more than adequate or the use of (x)inetd may be indicated. If, however, there is already an existing web infrastructure in place, CGI still may be preferred if only for consistency and maintainability of the system as a whole.
<h2><a name="env">Using Environment variables</a></h2>
<h3>Motivation</h3>
* Want to use a different editor for checkins (Unix/Windows)
* Use a proxy if you are behind a firewall
<h3>Solution</h3>
Environment variables are used to customize some programme behaviour. On Linux/Unix they can be set in you ~/.bashrc or even on command line. On Windows they can be set in the system settings.
<cite>Fossil</cite> checks the following environment variables:
* VISUAL/EDITOR
* http_proxy
* TMP_DIR
* GATEWAY_INTERFACE
* SQLITE_FORCE_PROXY_LOCKING
* USER
* USERNAME
<b>VISUAL/EDITOR</b> contain the editor of your choice that is used to write the commit file.
<b>TMP_DIR</b> specifies the directory for temporary files.
<b>GATEWAY_INTERFACE</b> ???
<b>SQLITE_FORCE_PROXY_LOCKING</b> ???
<b>USER</b>
<b>USERNAME</b>
<h2><a name="css"></a>Example CSS</h2>
<h3>Motivation</h3>
The default UI may not be stylish in everyones eyes.
It is up to you to change it. See the CSS code below from this site [http://fossil.wanderinghorse.net/index.cgi/index|Wandering Horse]
<nowiki>
<pre>
/* General settings for the entire page */
body {
margin: 0ex 1ex;
padding: 0px;
background-color: white;
font-family: "sans serif";
}
/* Make the links in the footer less ugly... */
a { color: #000f6a; }
a:link { color: #000f6a; }
a:visited { color: #000f6a; }
a:hover { background-color: #e3e3e3; }
hr {
height: 3px;
border-top: none; /*1px dashed #005;*/
border-bottom: 1px dashed #005;
border-left: none;
border-right: none;
}
/* The project logo in the upper left-hand corner of each page */
div.logo {
display: table-cell;
text-align: center;
vertical-align: bottom;
color: #000f6a;
}
/* The page title centered at the top of each page */
div.title {
display: table-cell;
font-size: 2em;
font-weight: bold;
text-align: center;
color: #000f6a;
vertical-align: bottom;
width: 100%;
}
/* The login status message in the top right-hand corner */
div.status {
display: table-cell;
text-align: right;
vertical-align: bottom;
color: #000f6a;
font-size: 0.8em;
}
/* The header across the top of the page */
div.header {
display: table;
width: 100%;
text-align: center;
}
/* The main menu bar that appears at the top of the page beneath
** the header */
div.mainmenu {
padding: 2px 5px 2px 5px;
font-size: 0.9em;
text-align: center;
letter-spacing: 1px;
background-color: #e3e3e3;
color: #000f6a;
border: 1px inset black;
}
/* The submenu bar that *sometimes* appears below the main menu */
div.submenu {
padding: 2px 5px 2px 5px;
font-size: 0.9em;
text-align: center;
background-color: #e3e3e3;
color: #000f6a;
}
div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited {
padding: 2px 10px 2px 10px;
color: #000f6a;
background-color: #e3e3e3;
text-decoration: none;
}
div.mainmenu a:hover, div.submenu a:hover {
color: #e3e3e3;
background-color: #000f6a;
}
/* All page content from the bottom of the menu or submenu down to
** the footer */
div.content {
padding: 0ex 1ex 0ex 2ex;
}
/* Some pages have section dividers */
div.section {
margin-bottom: 0px;
margin-top: 1em;
padding: 1px 1px 1px 1px;
font-size: 1.2em;
font-weight: bold;
background-color: #e3e3e3;
color: #000f6a;
}
/* The "Date" that occurs on the left hand side of timelines */
div.divider {
background-color: #e3e3e3;
color: #000f6a;
border: 1px #bbbbff solid;
font-size: 1em; font-weight: normal;
padding: .25em;
margin: .2em 0 .2em 0;
float: left;
clear: left;
}
/* The footer at the very bottom of the page */
div.footer {
font-size: 0.8em;
padding: 2px 5px 2px 5px;
text-align: center;
letter-spacing: 1px;
background-color: #e3e3e3;
color: #000f6a;
border: 1px inset black;
}
/* Make the links in the footer less ugly... */
div.footer a { color: #000f6a; }
div.footer a:link { color: #000f6a; }
div.footer a:visited { color: #000f6a; }
div.footer a:hover { background-color: #000f6a; color: #e3e3e3; }
/* verbatim blocks */
pre.verbatim {
background-color: #f5f5f5;
padding: 0.5em;
}
/* The label/value pairs on (for example) the vinfo page */
table.label-value th {
vertical-align: top;
text-align: right;
padding: 0.2ex 2ex;
}
/* For marking important UI elements which shouldn't be
lightly dismissed. I mainly use it to mark "not yet
implemented" parts of a page. Whether or not to have
a 'border' attribute set is arguable. */
.achtung {
color: #ff0000;
background: #ffff00;
border: 1px solid #ff0000;
}
table.fossil_db_generic_query_view {
border-spacing: 0px;
border: 1px solid black;
}
table.fossil_db_generic_query_view td {
padding: 2px 1em 2px 1em;
}
table.fossil_db_generic_query_view tr {
}
table.fossil_db_generic_query_view tr.even {
background: #ffffff;
}
table.fossil_db_generic_query_view tr.odd {
background: #e5e5e5;
}
table.fossil_db_generic_query_view tr.header {
background: #558195;
font-size: 1.5em;
color: #ffffff;
}
</pre>
</nowiki>
<h2><a name="source-hilight">Source highlighting</a></h2>
Found this link in the mailing list:
[http://ilia.org.il/fossil/source_highlight.html|Source highlighting]
|