| ︙ | | | ︙ | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
collection of artifacts. Each artifact is identified by its SHA1 hash
expressed as a 40-character lower-case hexadecimal string.
Synchronization is simply the process of sharing artifacts between
servers so that all servers have copies of all artifacts. Because
artifacts are unordered, the order in which artifacts are received
at a server is inconsequential. It is assumed that the SHA1 hashes
of artifacts are unique - that every artifact has a different SHA1 hash.
To a first approximation, synchronization proceeds by sharing lists
SHA1 hashes of available artifacts, then sharing those artifacts that
are not found on one side or the other of the connection. In practice,
a repository might contain millions of artifacts. The list of
SHA1 hashes for this many artifacts can be large. So optimizations are
employed that usually reduce the number of SHA1 hashes that need to be
shared to a few hundred.</p>
|
|
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
collection of artifacts. Each artifact is identified by its SHA1 hash
expressed as a 40-character lower-case hexadecimal string.
Synchronization is simply the process of sharing artifacts between
servers so that all servers have copies of all artifacts. Because
artifacts are unordered, the order in which artifacts are received
at a server is inconsequential. It is assumed that the SHA1 hashes
of artifacts are unique - that every artifact has a different SHA1 hash.
To a first approximation, synchronization proceeds by sharing lists
SHA1 hashes of available artifacts, then sharing those artifacts that
are not found on one side or the other of the connection. In practice,
a repository might contain millions of artifacts. The list of
SHA1 hashes for this many artifacts can be large. So optimizations are
employed that usually reduce the number of SHA1 hashes that need to be
shared to a few hundred.</p>
|
| ︙ | | | ︙ | |
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
|
from the server. The nonce is the SHA1 hash of the remainder of
the message - all text that follows the newline character that
terminates the login card. The signature is the SHA1 hash of
the concatenation of the nonce and the users password.</p>
<p>For each login card, the server looks up the user and verifies
that the nonce matches the SHA1 hash of the remainder of the
message. It then checks the signature hash to make sure the
signature matches. If everything
checks out, then the client is granted all privileges of the
specified user.</p>
<p>Privileges are cumulative. There can be multiple successful
login cards. The session privileges are the bit-wise OR of the
privileges of each individual login.</p>
<h3>3.3 File and Compressed File Cards</h3>
<p>Artifacts are transferred using either "file" cards, or "cfile" cards.
(The name "file" card comes from the fact that most artifacts correspond to
files, and "cfile" is just a compressed file.)
</p>
<h4>3.3.1 File Cards</h4>
<p>For sync protocols, artifacts are transferred using "file"
cards. File cards come in two different formats depending
|
|
|
|
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
|
from the server. The nonce is the SHA1 hash of the remainder of
the message - all text that follows the newline character that
terminates the login card. The signature is the SHA1 hash of
the concatenation of the nonce and the users password.</p>
<p>For each login card, the server looks up the user and verifies
that the nonce matches the SHA1 hash of the remainder of the
message. It then checks the signature hash to make sure the
signature matches. If everything
checks out, then the client is granted all privileges of the
specified user.</p>
<p>Privileges are cumulative. There can be multiple successful
login cards. The session privileges are the bit-wise OR of the
privileges of each individual login.</p>
<h3>3.3 File and Compressed File Cards</h3>
<p>Artifacts are transferred using either "file" cards, or "cfile" cards.
(The name "file" card comes from the fact that most artifacts correspond to
files, and "cfile" is just a compressed file.)
</p>
<h4>3.3.1 File Cards</h4>
<p>For sync protocols, artifacts are transferred using "file"
cards. File cards come in two different formats depending
|
| ︙ | | | ︙ | |
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
|
that immediately follow the cfile card. If the cfile card has only
three arguments, that means the payload is the complete content of the
artifact. If the cfile card has four arguments, then the payload is a
delta and the second argument is the ID of another artifact that is the
source of the delta and the third argument is the original size of the
delta artifact.</p>
<p>Unlike file cards, cfile cards are only sent in one direction during a
clone from server to client for clone protocol version "3" or greater.</p>
<h3>3.4 Push and Pull Cards</h3>
<p>Among the first cards in a client-to-server message are
the push and pull cards. The push card tells the server that
the client is pushing content. The pull card tells the server
|
|
|
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
|
that immediately follow the cfile card. If the cfile card has only
three arguments, that means the payload is the complete content of the
artifact. If the cfile card has four arguments, then the payload is a
delta and the second argument is the ID of another artifact that is the
source of the delta and the third argument is the original size of the
delta artifact.</p>
<p>Unlike file cards, cfile cards are only sent in one direction during a
clone from server to client for clone protocol version "3" or greater.</p>
<h3>3.4 Push and Pull Cards</h3>
<p>Among the first cards in a client-to-server message are
the push and pull cards. The push card tells the server that
the client is pushing content. The pull card tells the server
|
| ︙ | | | ︙ | |
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
|
<blockquote>
<b>reqconfig</b> <i>configuration-name</i>
</blockquote>
<p>As of [/timeline?r=trunk&c=2015-03-19+03%3A57%3A46&n=20|2015-03-19], the configuration-name must be one of the
following values:
<center><table border=0>
<tr><td valign="top">
<ul>
<li> css
<li> header
<li> footer
<li> logo-mimetype
<li> logo-image
|
|
|
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
|
<blockquote>
<b>reqconfig</b> <i>configuration-name</i>
</blockquote>
<p>As of [/timeline?r=trunk&c=2015-03-19+03%3A57%3A46&n=20|2015-03-19], the configuration-name must be one of the
following values:
<table border=0 align="center">
<tr><td valign="top">
<ul>
<li> css
<li> header
<li> footer
<li> logo-mimetype
<li> logo-image
|
| ︙ | | | ︙ | |
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
|
<li> ticket-title-expr
<li> ticket-closed-expr
<li> @reportfmt
<li> @user
<li> @concealed
<li> @shun
</ul></td></tr>
</table></center>
<p>New configuration-names are likely to be added in future releases of
Fossil. If the server receives a configuration-name that it does not
understand, the entire reqconfig card is silently ignored. The reqconfig
card might also be ignored if the user lacks sufficient privilege to
access the requested information.
<p>The configuration-names that begin with an alphabetic character refer
to values in the "config" table of the server database. For example,
the "logo-image" configuration item refers to the project logo image
that is configured on the Admin page of the [./webui.wiki | web-interface].
The value of the configuration item is returned to the client using a
"config" card.
<p>If the configuration-name begins with "@", that refers to a class of
values instead of a single value. The content of these configuration items
is returned in a "config" card that contains pure SQL text that is
intended to be evaluated by the client.
<p>The @user and @concealed configuration items contain sensitive information
and are ignored for clients without sufficient privilege.
<h3>3.10 Configuration Cards</h3>
|
|
|
|
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
|
<li> ticket-title-expr
<li> ticket-closed-expr
<li> @reportfmt
<li> @user
<li> @concealed
<li> @shun
</ul></td></tr>
</table>
<p>New configuration-names are likely to be added in future releases of
Fossil. If the server receives a configuration-name that it does not
understand, the entire reqconfig card is silently ignored. The reqconfig
card might also be ignored if the user lacks sufficient privilege to
access the requested information.
<p>The configuration-names that begin with an alphabetic character refer
to values in the "config" table of the server database. For example,
the "logo-image" configuration item refers to the project logo image
that is configured on the Admin page of the [./webui.wiki | web-interface].
The value of the configuration item is returned to the client using a
"config" card.
<p>If the configuration-name begins with "@", that refers to a class of
values instead of a single value. The content of these configuration items
is returned in a "config" card that contains pure SQL text that is
intended to be evaluated by the client.
<p>The @user and @concealed configuration items contain sensitive information
and are ignored for clients without sufficient privilege.
<h3>3.10 Configuration Cards</h3>
|
| ︙ | | | ︙ | |
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
|
<blockquote>
<b>error</b> <i>error-message</i>
</blockquote>
<p>The error message is English text that is encoded in order to
be a single token.
A space (ASCII 0x20) is represented as "\s" (ASCII 0x5C, 0x73). A
newline (ASCII 0x0a) is "\n" (ASCII 0x6C, x6E). A backslash
(ASCII 0x5C) is represented as two backslashes "\\". Apart from
space and newline, no other whitespace characters nor any
unprintable characters are allowed in
the error message.</p>
<h3>3.12 Comment Cards</h3>
|
|
|
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
|
<blockquote>
<b>error</b> <i>error-message</i>
</blockquote>
<p>The error message is English text that is encoded in order to
be a single token.
A space (ASCII 0x20) is represented as "\s" (ASCII 0x5C, 0x73). A
newline (ASCII 0x0a) is "\n" (ASCII 0x6C, x6E). A backslash
(ASCII 0x5C) is represented as two backslashes "\\". Apart from
space and newline, no other whitespace characters nor any
unprintable characters are allowed in
the error message.</p>
<h3>3.12 Comment Cards</h3>
|
| ︙ | | | ︙ | |
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
|
<p>Here are the key points of the synchronization protocol:</p>
<ol>
<li>The client sends one or more PUSH HTTP requests to the server.
The request and reply content type is "application/x-fossil".
<li>HTTP request content is compressed using zlib.
<li>The content of request and reply consists of cards with one
card per line.
<li>Card formats are:
<ul>
<li> <b>login</b> <i>userid nonce signature</i>
<li> <b>push</b> <i>servercode projectcode</i>
<li> <b>pull</b> <i>servercode projectcode</i>
<li> <b>clone</b>
<li> <b>file</b> <i>artifact-id size</i> <b>\n</b> <i>content</i>
|
|
|
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
|
<p>Here are the key points of the synchronization protocol:</p>
<ol>
<li>The client sends one or more PUSH HTTP requests to the server.
The request and reply content type is "application/x-fossil".
<li>HTTP request content is compressed using zlib.
<li>The content of request and reply consists of cards with one
card per line.
<li>Card formats are:
<ul>
<li> <b>login</b> <i>userid nonce signature</i>
<li> <b>push</b> <i>servercode projectcode</i>
<li> <b>pull</b> <i>servercode projectcode</i>
<li> <b>clone</b>
<li> <b>file</b> <i>artifact-id size</i> <b>\n</b> <i>content</i>
|
| ︙ | | | ︙ | |