/usr/share/doc/monotone/html/Netsync-Transport-Hooks.html is in monotone-doc 1.1-9.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>monotone documentation: Netsync Transport Hooks</title>
<meta name="description" content="monotone documentation: Netsync Transport Hooks">
<meta name="keywords" content="monotone documentation: Netsync Transport Hooks">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="General-Index.html#General-Index" rel="index" title="General Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Hooks.html#Hooks" rel="up" title="Hooks">
<link href="Trust-Evaluation-Hooks.html#Trust-Evaluation-Hooks" rel="next" title="Trust Evaluation Hooks">
<link href="Netsync-Permission-Hooks.html#Netsync-Permission-Hooks" rel="prev" title="Netsync Permission Hooks">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="texinfo.css">
</head>
<body lang="en">
<a name="Netsync-Transport-Hooks"></a>
<div class="header">
<p>
Next: <a href="Trust-Evaluation-Hooks.html#Trust-Evaluation-Hooks" accesskey="n" rel="next">Trust Evaluation Hooks</a>, Previous: <a href="Netsync-Permission-Hooks.html#Netsync-Permission-Hooks" accesskey="p" rel="prev">Netsync Permission Hooks</a>, Up: <a href="Hooks.html#Hooks" accesskey="u" rel="up">Hooks</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Netsync-Transport-Hooks-1"></a>
<h4 class="subsection">6.1.5 Netsync Transport Hooks</h4>
<p>When a monotone client initiates a netsync connection, these hooks are
called to attempt to parse the host argument provided on the command
line. If the hooks fail or return nil, monotone will interpret the
host argument as a network name (possibly with a port number) and open
a TCP socket.
</p>
<dl compact="compact">
<dd><a name="get_005fnetsync_005fconnect_005fcommand"></a></dd>
<dt><code>get_netsync_connect_command (<var>uri</var>, <var>args</var>)</code>
<a name="index-get_005fnetsync_005fconnect_005fcommand-_0028uri_002c-args_0029"></a>
</dt>
<dd>
<p>Returns a table describing a command to run to connect to the
specified host. The <var>uri</var> argument is a table containing
between 0 and 7 components:
</p>
<ul>
<li> <code>uri["scheme"]</code>, such as <code>"ssh"</code> or <code>"file"</code>
</li><li> <code>uri["user"]</code>, the name of a remote user
</li><li> <code>uri["host"]</code>, the name or address of a remote host
</li><li> <code>uri["port"]</code>, a network port number
</li><li> <code>uri["path"]</code>, a filesystem path
</li><li> <code>uri["query"]</code>, for additional parameters
</li><li> <code>uri["fragment"]</code>, to describe a sub-location within the remote resource
</li></ul>
<p>The <var>args</var> argument is a table containing between 0 and 3
components:
</p>
<ul>
<li> <code>args["include"]</code>, the branch pattern to include
</li><li> <code>args["exclude"]</code>, the branch pattern to exclude
</li><li> <code>args["debug"]</code>, whether to run the connection in debug mode
</li></ul>
<p>The default definition of this hook follows:
</p>
<div class="smallexample">
<pre class="smallexample">function get_netsync_connect_command(uri, args)
local argv = nil
if uri["scheme"] == "ssh"
and uri["host"]
and uri["path"] then
argv = { "ssh" }
if uri["user"] then
table.insert(argv, "-l")
table.insert(argv, uri["user"])
end
if uri["port"] then
table.insert(argv, "-p")
table.insert(argv, uri["port"])
end
table.insert(argv, uri["host"])
end
if uri["scheme"] == "file" and uri["path"] then
argv = { }
end
if argv then
table.insert(argv, get_mtn_command(uri["host"]))
if args["debug"] then
table.insert(argv, "--debug")
else
table.insert(argv, "--quiet")
end
table.insert(argv, "--db")
table.insert(argv, uri["path"])
table.insert(argv, "serve")
table.insert(argv, "--stdio")
table.insert(argv, "--no-transport-auth")
if args["include"] then
table.insert(argv, args["include"])
end
if args["exclude"] then
table.insert(argv, "--exclude")
table.insert(argv, args["exclude"])
end
end
return argv
end
</pre></div>
</dd>
<dt><code>use_transport_auth (<var>uri</var>)</code>
<a name="index-use_005ftransport_005fauth-_0028uri_0029"></a>
</dt>
<dd>
<p>Returns a boolean indicating whether monotone should use transport
authentication mechanisms when communicating with <var>uri</var>. If this
hook fails, the return value is assumed to be <code>true</code>. The form of
the <var>uri</var> argument is a table, identical to the table provided as
an argument to <code>get_netsync_connect_command</code>.
</p>
<p>Note that the return value of this hook must "match" the semantics of
the command returned by <code>get_netsync_connect_command</code>. In
particular, if this hook returns <code>false</code>, the <code>serve</code>
command line arguments passed to the remote end of the connection
should include the <samp>--no-transport-auth</samp> option. A mismatch
between this hook’s return value and the command line returned by
<code>get_netsync_connect_command</code> will cause a communication failure,
as the local and remote monotone processes will have mismatched
authentication assumptions.
</p>
<div class="smallexample">
<pre class="smallexample">function use_transport_auth(uri)
if uri["scheme"] == "ssh"
or uri["scheme"] == "file" then
return false
else
return true
end
end
</pre></div>
</dd>
<dt><code>get_mtn_command(<var>host</var>)</code>
<a name="index-get_005fmtn_005fcommand_0028host_0029"></a>
</dt>
<dd>
<p>Returns a string containing the monotone command to be executed on
<var>host</var> when communicating over <code>ssh</code>. The <var>host</var>
argument is a string containing the name of the host to which
<code>ssh</code> is connecting, from the server URI. This is useful when
there are multiple monotone binaries on the remote host, or the
monotone binary is not in the default path.
</p>
<div class="smallexample">
<pre class="smallexample">function get_mtn_command(host)
return "mtn"
end
</pre></div>
</dd>
</dl>
<hr>
<div class="header">
<p>
Next: <a href="Trust-Evaluation-Hooks.html#Trust-Evaluation-Hooks" accesskey="n" rel="next">Trust Evaluation Hooks</a>, Previous: <a href="Netsync-Permission-Hooks.html#Netsync-Permission-Hooks" accesskey="p" rel="prev">Netsync Permission Hooks</a>, Up: <a href="Hooks.html#Hooks" accesskey="u" rel="up">Hooks</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|