Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
Junio C Hamano | 70fafca | 2006-02-06 08:02:01 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 7.0.2" /> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | <style type="text/css"> |
| 8 | /* Debug borders */ |
| 9 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 10 | /* |
| 11 | border: 1px solid red; |
| 12 | */ |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | margin: 1em 5% 1em 5%; |
| 17 | } |
| 18 | |
| 19 | a { color: blue; } |
| 20 | a:visited { color: fuchsia; } |
| 21 | |
| 22 | em { |
| 23 | font-style: italic; |
| 24 | } |
| 25 | |
| 26 | strong { |
| 27 | font-weight: bold; |
| 28 | } |
| 29 | |
| 30 | tt { |
| 31 | color: navy; |
| 32 | } |
| 33 | |
| 34 | h1, h2, h3, h4, h5, h6 { |
| 35 | color: #527bbd; |
| 36 | font-family: sans-serif; |
| 37 | margin-top: 1.2em; |
| 38 | margin-bottom: 0.5em; |
| 39 | line-height: 1.3; |
| 40 | } |
| 41 | |
| 42 | h1 { |
| 43 | border-bottom: 2px solid silver; |
| 44 | } |
| 45 | h2 { |
| 46 | border-bottom: 2px solid silver; |
| 47 | padding-top: 0.5em; |
| 48 | } |
| 49 | |
| 50 | div.sectionbody { |
| 51 | font-family: serif; |
| 52 | margin-left: 0; |
| 53 | } |
| 54 | |
| 55 | hr { |
| 56 | border: 1px solid silver; |
| 57 | } |
| 58 | |
| 59 | p { |
| 60 | margin-top: 0.5em; |
| 61 | margin-bottom: 0.5em; |
| 62 | } |
| 63 | |
| 64 | pre { |
| 65 | padding: 0; |
| 66 | margin: 0; |
| 67 | } |
| 68 | |
| 69 | span#author { |
| 70 | color: #527bbd; |
| 71 | font-family: sans-serif; |
| 72 | font-weight: bold; |
| 73 | font-size: 1.2em; |
| 74 | } |
| 75 | span#email { |
| 76 | } |
| 77 | span#revision { |
| 78 | font-family: sans-serif; |
| 79 | } |
| 80 | |
| 81 | div#footer { |
| 82 | font-family: sans-serif; |
| 83 | font-size: small; |
| 84 | border-top: 2px solid silver; |
| 85 | padding-top: 0.5em; |
| 86 | margin-top: 4.0em; |
| 87 | } |
| 88 | div#footer-text { |
| 89 | float: left; |
| 90 | padding-bottom: 0.5em; |
| 91 | } |
| 92 | div#footer-badges { |
| 93 | float: right; |
| 94 | padding-bottom: 0.5em; |
| 95 | } |
| 96 | |
| 97 | div#preamble, |
| 98 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 99 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 100 | div.admonitionblock { |
| 101 | margin-right: 10%; |
| 102 | margin-top: 1.5em; |
| 103 | margin-bottom: 1.5em; |
| 104 | } |
| 105 | div.admonitionblock { |
| 106 | margin-top: 2.5em; |
| 107 | margin-bottom: 2.5em; |
| 108 | } |
| 109 | |
| 110 | div.content { /* Block element content. */ |
| 111 | padding: 0; |
| 112 | } |
| 113 | |
| 114 | /* Block element titles. */ |
| 115 | div.title, caption.title { |
| 116 | font-family: sans-serif; |
| 117 | font-weight: bold; |
| 118 | text-align: left; |
| 119 | margin-top: 1.0em; |
| 120 | margin-bottom: 0.5em; |
| 121 | } |
| 122 | div.title + * { |
| 123 | margin-top: 0; |
| 124 | } |
| 125 | |
| 126 | td div.title:first-child { |
| 127 | margin-top: 0.0em; |
| 128 | } |
| 129 | div.content div.title:first-child { |
| 130 | margin-top: 0.0em; |
| 131 | } |
| 132 | div.content + div.title { |
| 133 | margin-top: 0.0em; |
| 134 | } |
| 135 | |
| 136 | div.sidebarblock > div.content { |
| 137 | background: #ffffee; |
| 138 | border: 1px solid silver; |
| 139 | padding: 0.5em; |
| 140 | } |
| 141 | |
| 142 | div.listingblock > div.content { |
| 143 | border: 1px solid silver; |
| 144 | background: #f4f4f4; |
| 145 | padding: 0.5em; |
| 146 | } |
| 147 | |
| 148 | div.quoteblock > div.content { |
| 149 | padding-left: 2.0em; |
| 150 | } |
| 151 | div.quoteblock .attribution { |
| 152 | text-align: right; |
| 153 | } |
| 154 | |
| 155 | div.admonitionblock .icon { |
| 156 | vertical-align: top; |
| 157 | font-size: 1.1em; |
| 158 | font-weight: bold; |
| 159 | text-decoration: underline; |
| 160 | color: #527bbd; |
| 161 | padding-right: 0.5em; |
| 162 | } |
| 163 | div.admonitionblock td.content { |
| 164 | padding-left: 0.5em; |
| 165 | border-left: 2px solid silver; |
| 166 | } |
| 167 | |
| 168 | div.exampleblock > div.content { |
| 169 | border-left: 2px solid silver; |
| 170 | padding: 0.5em; |
| 171 | } |
| 172 | |
| 173 | div.verseblock div.content { |
| 174 | white-space: pre; |
| 175 | } |
| 176 | |
| 177 | div.imageblock div.content { padding-left: 0; } |
| 178 | div.imageblock img { border: 1px solid silver; } |
| 179 | span.image img { border-style: none; } |
| 180 | |
| 181 | dl { |
| 182 | margin-top: 0.8em; |
| 183 | margin-bottom: 0.8em; |
| 184 | } |
| 185 | dt { |
| 186 | margin-top: 0.5em; |
| 187 | margin-bottom: 0; |
| 188 | font-style: italic; |
| 189 | } |
| 190 | dd > *:first-child { |
| 191 | margin-top: 0; |
| 192 | } |
| 193 | |
| 194 | ul, ol { |
| 195 | list-style-position: outside; |
| 196 | } |
| 197 | ol.olist2 { |
| 198 | list-style-type: lower-alpha; |
| 199 | } |
| 200 | |
| 201 | div.tableblock > table { |
| 202 | border-color: #527bbd; |
| 203 | border-width: 3px; |
| 204 | } |
| 205 | thead { |
| 206 | font-family: sans-serif; |
| 207 | font-weight: bold; |
| 208 | } |
| 209 | tfoot { |
| 210 | font-weight: bold; |
| 211 | } |
| 212 | |
| 213 | div.hlist { |
| 214 | margin-top: 0.8em; |
| 215 | margin-bottom: 0.8em; |
| 216 | } |
| 217 | td.hlist1 { |
| 218 | vertical-align: top; |
| 219 | font-style: italic; |
| 220 | padding-right: 0.8em; |
| 221 | } |
| 222 | td.hlist2 { |
| 223 | vertical-align: top; |
| 224 | } |
| 225 | |
| 226 | @media print { |
| 227 | div#footer-badges { display: none; } |
| 228 | } |
| 229 | include::./stylesheets/xhtml11-manpage.css[] |
| 230 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 231 | |
| 232 | div.sidebar-content { |
| 233 | background: #ffffee; |
| 234 | border: 1px solid silver; |
| 235 | padding: 0.5em; |
| 236 | } |
| 237 | div.sidebar-title, div.image-title { |
| 238 | font-family: sans-serif; |
| 239 | font-weight: bold; |
| 240 | margin-top: 0.0em; |
| 241 | margin-bottom: 0.5em; |
| 242 | } |
| 243 | |
| 244 | div.listingblock div.content { |
| 245 | border: 1px solid silver; |
| 246 | background: #f4f4f4; |
| 247 | padding: 0.5em; |
| 248 | } |
| 249 | |
| 250 | div.quoteblock-content { |
| 251 | padding-left: 2.0em; |
| 252 | } |
| 253 | |
| 254 | div.exampleblock-content { |
| 255 | border-left: 2px solid silver; |
| 256 | padding-left: 0.5em; |
| 257 | } |
| 258 | </style> |
| 259 | <title>git-daemon(1)</title> |
| 260 | </head> |
| 261 | <body> |
| 262 | <div id="header"> |
| 263 | <h1> |
| 264 | git-daemon(1) Manual Page |
| 265 | </h1> |
| 266 | <h2>NAME</h2> |
| 267 | <div class="sectionbody"> |
| 268 | <p>git-daemon - |
Junio C Hamano | 0107892 | 2006-03-10 00:31:47 | [diff] [blame] | 269 | A really simple server for git repositories |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 270 | </p> |
| 271 | </div> |
| 272 | </div> |
| 273 | <h2>SYNOPSIS</h2> |
| 274 | <div class="sectionbody"> |
Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 275 | <div class="verseblock"> |
Junio C Hamano | 032c631 | 2006-09-28 07:39:18 | [diff] [blame] | 276 | <div class="content"><em>git-daemon</em> [--verbose] [--syslog] [--export-all] |
Junio C Hamano | 4d04a40 | 2006-01-09 00:53:28 | [diff] [blame] | 277 | [--timeout=n] [--init-timeout=n] [--strict-paths] |
Junio C Hamano | 70fafca | 2006-02-06 08:02:01 | [diff] [blame] | 278 | [--base-path=path] [--user-path | --user-path=path] |
Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 279 | [--interpolated-path=pathtemplate] |
Junio C Hamano | 032c631 | 2006-09-28 07:39:18 | [diff] [blame] | 280 | [--reuseaddr] [--detach] [--pid-file=file] |
Junio C Hamano | 19ed368 | 2006-09-07 11:44:08 | [diff] [blame] | 281 | [--enable=service] [--disable=service] |
| 282 | [--allow-override=service] [--forbid-override=service] |
Junio C Hamano | 032c631 | 2006-09-28 07:39:18 | [diff] [blame] | 283 | [--inetd | [--listen=host_or_ipaddr] [--port=n] [--user=user [--group=group]] |
| 284 | [directory…]</div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 285 | </div> |
| 286 | <h2>DESCRIPTION</h2> |
| 287 | <div class="sectionbody"> |
| 288 | <p>A really simple TCP git daemon that normally listens on port "DEFAULT_GIT_PORT" |
Junio C Hamano | 19ed368 | 2006-09-07 11:44:08 | [diff] [blame] | 289 | aka 9418. It waits for a connection asking for a service, and will serve |
| 290 | that service if it is enabled.</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 291 | <p>It verifies that the directory has the magic file "git-daemon-export-ok", and |
| 292 | it will refuse to export any git directory that hasn't explicitly been marked |
| 293 | for export this way (unless the <em>--export-all</em> parameter is specified). If you |
| 294 | pass some directory paths as <em>git-daemon</em> arguments, you can further restrict |
| 295 | the offers to a whitelist comprising of those.</p> |
Junio C Hamano | 19ed368 | 2006-09-07 11:44:08 | [diff] [blame] | 296 | <p>By default, only <tt>upload-pack</tt> service is enabled, which serves |
Junio C Hamano | 1fbbbc1 | 2007-12-18 07:01:27 | [diff] [blame] | 297 | <tt>git-fetch-pack</tt> and <tt>git-ls-remote</tt> clients, which are invoked |
| 298 | from <tt>git-fetch</tt>, <tt>git-pull</tt>, and <tt>git-clone</tt>.</p> |
Junio C Hamano | 19ed368 | 2006-09-07 11:44:08 | [diff] [blame] | 299 | <p>This is ideally suited for read-only updates, i.e., pulling from |
| 300 | git repositories.</p> |
Junio C Hamano | a053d54 | 2006-10-27 09:29:13 | [diff] [blame] | 301 | <p>An <tt>upload-archive</tt> also exists to serve <tt>git-archive</tt>.</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 302 | </div> |
| 303 | <h2>OPTIONS</h2> |
| 304 | <div class="sectionbody"> |
| 305 | <dl> |
| 306 | <dt> |
| 307 | --strict-paths |
| 308 | </dt> |
| 309 | <dd> |
| 310 | <p> |
| 311 | Match paths exactly (i.e. don't allow "/foo/repo" when the real path is |
| 312 | "/foo/repo.git" or "/foo/repo/.git") and don't do user-relative paths. |
| 313 | git-daemon will refuse to start when this option is enabled and no |
| 314 | whitelist is specified. |
| 315 | </p> |
| 316 | </dd> |
| 317 | <dt> |
Junio C Hamano | 4d04a40 | 2006-01-09 00:53:28 | [diff] [blame] | 318 | --base-path |
| 319 | </dt> |
| 320 | <dd> |
| 321 | <p> |
| 322 | Remap all the path requests as relative to the given path. |
| 323 | This is sort of "GIT root" - if you run git-daemon with |
| 324 | <em>--base-path=/srv/git</em> on example.com, then if you later try to pull |
| 325 | <em>git://example.com/hello.git</em>, <tt>git-daemon</tt> will interpret the path |
Junio C Hamano | 70fafca | 2006-02-06 08:02:01 | [diff] [blame] | 326 | as <em>/srv/git/hello.git</em>. |
Junio C Hamano | 4d04a40 | 2006-01-09 00:53:28 | [diff] [blame] | 327 | </p> |
| 328 | </dd> |
| 329 | <dt> |
Junio C Hamano | 0ddc94d | 2007-08-01 08:42:39 | [diff] [blame] | 330 | --base-path-relaxed |
| 331 | </dt> |
| 332 | <dd> |
| 333 | <p> |
| 334 | If --base-path is enabled and repo lookup fails, with this option |
| 335 | <tt>git-daemon</tt> will attempt to lookup without prefixing the base path. |
| 336 | This is useful for switching to --base-path usage, while still |
| 337 | allowing the old paths. |
| 338 | </p> |
| 339 | </dd> |
| 340 | <dt> |
Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 341 | --interpolated-path=pathtemplate |
| 342 | </dt> |
| 343 | <dd> |
| 344 | <p> |
| 345 | To support virtual hosting, an interpolated path template can be |
| 346 | used to dynamically construct alternate paths. The template |
Junio C Hamano | 032c631 | 2006-09-28 07:39:18 | [diff] [blame] | 347 | supports %H for the target hostname as supplied by the client but |
| 348 | converted to all lowercase, %CH for the canonical hostname, |
| 349 | %IP for the server's IP address, %P for the port number, |
Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 350 | and %D for the absolute path of the named repository. |
Junio C Hamano | 032c631 | 2006-09-28 07:39:18 | [diff] [blame] | 351 | After interpolation, the path is validated against the directory |
| 352 | whitelist. |
Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 353 | </p> |
| 354 | </dd> |
| 355 | <dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 356 | --export-all |
| 357 | </dt> |
| 358 | <dd> |
| 359 | <p> |
| 360 | Allow pulling from all directories that look like GIT repositories |
| 361 | (have the <em>objects</em> and <em>refs</em> subdirectories), even if they |
| 362 | do not have the <em>git-daemon-export-ok</em> file. |
| 363 | </p> |
| 364 | </dd> |
| 365 | <dt> |
| 366 | --inetd |
| 367 | </dt> |
| 368 | <dd> |
| 369 | <p> |
| 370 | Have the server run as an inetd service. Implies --syslog. |
Junio C Hamano | 032c631 | 2006-09-28 07:39:18 | [diff] [blame] | 371 | Incompatible with --port, --listen, --user and --group options. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 372 | </p> |
| 373 | </dd> |
| 374 | <dt> |
Junio C Hamano | 032c631 | 2006-09-28 07:39:18 | [diff] [blame] | 375 | --listen=host_or_ipaddr |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 376 | </dt> |
| 377 | <dd> |
| 378 | <p> |
Junio C Hamano | 032c631 | 2006-09-28 07:39:18 | [diff] [blame] | 379 | Listen on an a specific IP address or hostname. IP addresses can |
| 380 | be either an IPv4 address or an IPV6 address if supported. If IPv6 |
| 381 | is not supported, then --listen=hostname is also not supported and |
| 382 | --listen must be given an IPv4 address. |
| 383 | Incompatible with <em>--inetd</em> option. |
| 384 | </p> |
| 385 | </dd> |
| 386 | <dt> |
| 387 | --port=n |
| 388 | </dt> |
| 389 | <dd> |
| 390 | <p> |
| 391 | Listen on an alternative port. Incompatible with <em>--inetd</em> option. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 392 | </p> |
| 393 | </dd> |
| 394 | <dt> |
| 395 | --init-timeout |
| 396 | </dt> |
| 397 | <dd> |
| 398 | <p> |
| 399 | Timeout between the moment the connection is established and the |
| 400 | client request is received (typically a rather low value, since |
| 401 | that should be basically immediate). |
| 402 | </p> |
| 403 | </dd> |
| 404 | <dt> |
| 405 | --timeout |
| 406 | </dt> |
| 407 | <dd> |
| 408 | <p> |
| 409 | Timeout for specific client sub-requests. This includes the time |
| 410 | it takes for the server to process the sub-request and time spent |
| 411 | waiting for next client's request. |
| 412 | </p> |
| 413 | </dd> |
| 414 | <dt> |
| 415 | --syslog |
| 416 | </dt> |
| 417 | <dd> |
| 418 | <p> |
| 419 | Log to syslog instead of stderr. Note that this option does not imply |
| 420 | --verbose, thus by default only error conditions will be logged. |
| 421 | </p> |
| 422 | </dd> |
| 423 | <dt> |
Junio C Hamano | 70fafca | 2006-02-06 08:02:01 | [diff] [blame] | 424 | --user-path, --user-path=path |
| 425 | </dt> |
| 426 | <dd> |
| 427 | <p> |
| 428 | Allow ~user notation to be used in requests. When |
| 429 | specified with no parameter, requests to |
| 430 | git://host/~alice/foo is taken as a request to access |
| 431 | <em>foo</em> repository in the home directory of user <tt>alice</tt>. |
| 432 | If <tt>--user-path=path</tt> is specified, the same request is |
| 433 | taken as a request to access <tt>path/foo</tt> repository in |
| 434 | the home directory of user <tt>alice</tt>. |
| 435 | </p> |
| 436 | </dd> |
| 437 | <dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 438 | --verbose |
| 439 | </dt> |
| 440 | <dd> |
| 441 | <p> |
| 442 | Log details about the incoming connections and requested files. |
| 443 | </p> |
| 444 | </dd> |
| 445 | <dt> |
Junio C Hamano | abb53dc | 2006-07-28 05:14:12 | [diff] [blame] | 446 | --reuseaddr |
| 447 | </dt> |
| 448 | <dd> |
| 449 | <p> |
| 450 | Use SO_REUSEADDR when binding the listening socket. |
| 451 | This allows the server to restart without waiting for |
| 452 | old connections to time out. |
| 453 | </p> |
| 454 | </dd> |
| 455 | <dt> |
| 456 | --detach |
| 457 | </dt> |
| 458 | <dd> |
| 459 | <p> |
| 460 | Detach from the shell. Implies --syslog. |
| 461 | </p> |
| 462 | </dd> |
| 463 | <dt> |
| 464 | --pid-file=file |
| 465 | </dt> |
| 466 | <dd> |
| 467 | <p> |
Junio C Hamano | 21e7f9c | 2007-08-31 07:56:26 | [diff] [blame] | 468 | Save the process id in <em>file</em>. Ignored when the daemon |
| 469 | is run under <tt>--inetd</tt>. |
Junio C Hamano | abb53dc | 2006-07-28 05:14:12 | [diff] [blame] | 470 | </p> |
| 471 | </dd> |
| 472 | <dt> |
Junio C Hamano | 9adfc6a | 2006-08-28 07:18:38 | [diff] [blame] | 473 | --user=user, --group=group |
| 474 | </dt> |
| 475 | <dd> |
| 476 | <p> |
| 477 | Change daemon's uid and gid before entering the service loop. |
| 478 | When only <tt>--user</tt> is given without <tt>--group</tt>, the |
| 479 | primary group ID for the user is used. The values of |
| 480 | the option are given to <tt>getpwnam(3)</tt> and <tt>getgrnam(3)</tt> |
| 481 | and numeric IDs are not supported. |
| 482 | </p> |
| 483 | <p>Giving these options is an error when used with <tt>--inetd</tt>; use |
| 484 | the facility of inet daemon to achieve the same before spawning |
| 485 | <tt>git-daemon</tt> if needed.</p> |
| 486 | </dd> |
| 487 | <dt> |
Junio C Hamano | fa0d4cf | 2007-01-25 02:23:58 | [diff] [blame] | 488 | --enable=service, --disable=service |
Junio C Hamano | 19ed368 | 2006-09-07 11:44:08 | [diff] [blame] | 489 | </dt> |
| 490 | <dd> |
| 491 | <p> |
| 492 | Enable/disable the service site-wide per default. Note |
| 493 | that a service disabled site-wide can still be enabled |
| 494 | per repository if it is marked overridable and the |
| 495 | repository enables the service with an configuration |
| 496 | item. |
| 497 | </p> |
| 498 | </dd> |
| 499 | <dt> |
Junio C Hamano | fa0d4cf | 2007-01-25 02:23:58 | [diff] [blame] | 500 | --allow-override=service, --forbid-override=service |
Junio C Hamano | 19ed368 | 2006-09-07 11:44:08 | [diff] [blame] | 501 | </dt> |
| 502 | <dd> |
| 503 | <p> |
| 504 | Allow/forbid overriding the site-wide default with per |
| 505 | repository configuration. By default, all the services |
| 506 | are overridable. |
| 507 | </p> |
| 508 | </dd> |
| 509 | <dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 510 | <directory> |
| 511 | </dt> |
| 512 | <dd> |
| 513 | <p> |
| 514 | A directory to add to the whitelist of allowed directories. Unless |
| 515 | --strict-paths is specified this will also include subdirectories |
| 516 | of each named directory. |
| 517 | </p> |
| 518 | </dd> |
| 519 | </dl> |
| 520 | </div> |
Junio C Hamano | 19ed368 | 2006-09-07 11:44:08 | [diff] [blame] | 521 | <h2>SERVICES</h2> |
| 522 | <div class="sectionbody"> |
Junio C Hamano | 21e7f9c | 2007-08-31 07:56:26 | [diff] [blame] | 523 | <p>These services can be globally enabled/disabled using the |
| 524 | command line options of this command. If a finer-grained |
| 525 | control is desired (e.g. to allow <tt>git-archive</tt> to be run |
| 526 | against only in a few selected repositories the daemon serves), |
| 527 | the per-repository configuration file can be used to enable or |
| 528 | disable them.</p> |
Junio C Hamano | 19ed368 | 2006-09-07 11:44:08 | [diff] [blame] | 529 | <dl> |
| 530 | <dt> |
| 531 | upload-pack |
| 532 | </dt> |
| 533 | <dd> |
| 534 | <p> |
Junio C Hamano | 1fbbbc1 | 2007-12-18 07:01:27 | [diff] [blame] | 535 | This serves <tt>git-fetch-pack</tt> and <tt>git-ls-remote</tt> |
Junio C Hamano | 19ed368 | 2006-09-07 11:44:08 | [diff] [blame] | 536 | clients. It is enabled by default, but a repository can |
| 537 | disable it by setting <tt>daemon.uploadpack</tt> configuration |
| 538 | item to <tt>false</tt>. |
| 539 | </p> |
| 540 | </dd> |
Junio C Hamano | a053d54 | 2006-10-27 09:29:13 | [diff] [blame] | 541 | <dt> |
| 542 | upload-archive |
| 543 | </dt> |
| 544 | <dd> |
| 545 | <p> |
Junio C Hamano | 21e7f9c | 2007-08-31 07:56:26 | [diff] [blame] | 546 | This serves <tt>git-archive --remote</tt>. It is disabled by |
| 547 | default, but a repository can enable it by setting |
| 548 | <tt>daemon.uploadarchive</tt> configuration item to <tt>true</tt>. |
| 549 | </p> |
| 550 | </dd> |
| 551 | <dt> |
| 552 | receive-pack |
| 553 | </dt> |
| 554 | <dd> |
| 555 | <p> |
| 556 | This serves <tt>git-send-pack</tt> clients, allowing anonymous |
| 557 | push. It is disabled by default, as there is _no_ |
| 558 | authentication in the protocol (in other words, anybody |
| 559 | can push anything into the repository, including removal |
| 560 | of refs). This is solely meant for a closed LAN setting |
| 561 | where everybody is friendly. This service can be |
| 562 | enabled by <tt>daemon.receivepack</tt> configuration item to |
| 563 | <tt>true</tt>. |
Junio C Hamano | a053d54 | 2006-10-27 09:29:13 | [diff] [blame] | 564 | </p> |
| 565 | </dd> |
Junio C Hamano | 19ed368 | 2006-09-07 11:44:08 | [diff] [blame] | 566 | </dl> |
| 567 | </div> |
Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 568 | <h2>EXAMPLES</h2> |
| 569 | <div class="sectionbody"> |
| 570 | <dl> |
| 571 | <dt> |
Junio C Hamano | a053d54 | 2006-10-27 09:29:13 | [diff] [blame] | 572 | We assume the following in /etc/services |
| 573 | </dt> |
| 574 | <dd> |
| 575 | <div class="listingblock"> |
| 576 | <div class="content"> |
| 577 | <pre><tt>$ grep 9418 /etc/services |
| 578 | git 9418/tcp # Git Version Control System</tt></pre> |
| 579 | </div></div> |
| 580 | </dd> |
| 581 | <dt> |
Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 582 | git-daemon as inetd server |
| 583 | </dt> |
| 584 | <dd> |
| 585 | <p> |
| 586 | To set up <tt>git-daemon</tt> as an inetd service that handles any |
| 587 | repository under the whitelisted set of directories, /pub/foo |
| 588 | and /pub/bar, place an entry like the following into |
| 589 | /etc/inetd all on one line: |
| 590 | </p> |
| 591 | <div class="listingblock"> |
| 592 | <div class="content"> |
| 593 | <pre><tt> git stream tcp nowait nobody /usr/bin/git-daemon |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 594 | git-daemon --inetd --verbose --export-all |
Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 595 | /pub/foo /pub/bar</tt></pre> |
| 596 | </div></div> |
| 597 | </dd> |
| 598 | <dt> |
| 599 | git-daemon as inetd server for virtual hosts |
| 600 | </dt> |
| 601 | <dd> |
| 602 | <p> |
| 603 | To set up <tt>git-daemon</tt> as an inetd service that handles |
| 604 | repositories for different virtual hosts, <tt>www.example.com</tt> |
| 605 | and <tt>www.example.org</tt>, place an entry like the following into |
| 606 | <tt>/etc/inetd</tt> all on one line: |
| 607 | </p> |
| 608 | <div class="listingblock"> |
| 609 | <div class="content"> |
| 610 | <pre><tt> git stream tcp nowait nobody /usr/bin/git-daemon |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 611 | git-daemon --inetd --verbose --export-all |
Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 612 | --interpolated-path=/pub/%H%D |
| 613 | /pub/www.example.org/software |
| 614 | /pub/www.example.com/software |
| 615 | /software</tt></pre> |
| 616 | </div></div> |
| 617 | <p>In this example, the root-level directory <tt>/pub</tt> will contain |
| 618 | a subdirectory for each virtual host name supported. |
| 619 | Further, both hosts advertise repositories simply as |
| 620 | <tt>git://www.example.com/software/repo.git</tt>. For pre-1.4.0 |
| 621 | clients, a symlink from <tt>/software</tt> into the appropriate |
| 622 | default repository could be made as well.</p> |
| 623 | </dd> |
Junio C Hamano | 032c631 | 2006-09-28 07:39:18 | [diff] [blame] | 624 | <dt> |
| 625 | git-daemon as regular daemon for virtual hosts |
| 626 | </dt> |
| 627 | <dd> |
| 628 | <p> |
| 629 | To set up <tt>git-daemon</tt> as a regular, non-inetd service that |
| 630 | handles repositories for multiple virtual hosts based on |
| 631 | their IP addresses, start the daemon like this: |
| 632 | </p> |
| 633 | <div class="listingblock"> |
| 634 | <div class="content"> |
| 635 | <pre><tt> git-daemon --verbose --export-all |
| 636 | --interpolated-path=/pub/%IP/%D |
| 637 | /pub/192.168.1.200/software |
| 638 | /pub/10.10.220.23/software</tt></pre> |
| 639 | </div></div> |
| 640 | <p>In this example, the root-level directory <tt>/pub</tt> will contain |
| 641 | a subdirectory for each virtual host IP address supported. |
| 642 | Repositories can still be accessed by hostname though, assuming |
| 643 | they correspond to these IP addresses.</p> |
| 644 | </dd> |
Junio C Hamano | dbb6459 | 2007-09-01 11:17:39 | [diff] [blame] | 645 | <dt> |
| 646 | selectively enable/disable services per repository |
| 647 | </dt> |
| 648 | <dd> |
| 649 | <p> |
| 650 | To enable <tt>git-archive --remote</tt> and disable <tt>git-fetch</tt> against |
| 651 | a repository, have the following in the configuration file in the |
| 652 | repository (that is the file <em>config</em> next to <em>HEAD</em>, <em>refs</em> and |
| 653 | <em>objects</em>). |
| 654 | </p> |
Junio C Hamano | 21e7f9c | 2007-08-31 07:56:26 | [diff] [blame] | 655 | <div class="listingblock"> |
| 656 | <div class="content"> |
Junio C Hamano | dbb6459 | 2007-09-01 11:17:39 | [diff] [blame] | 657 | <pre><tt> [daemon] |
| 658 | uploadpack = false |
| 659 | uploadarchive = true</tt></pre> |
Junio C Hamano | 21e7f9c | 2007-08-31 07:56:26 | [diff] [blame] | 660 | </div></div> |
Junio C Hamano | dbb6459 | 2007-09-01 11:17:39 | [diff] [blame] | 661 | </dd> |
| 662 | </dl> |
Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 663 | </div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 664 | <h2>Author</h2> |
| 665 | <div class="sectionbody"> |
| 666 | <p>Written by Linus Torvalds <torvalds@osdl.org>, YOSHIFUJI Hideaki |
| 667 | <yoshfuji@linux-ipv6.org> and the git-list <git@vger.kernel.org></p> |
| 668 | </div> |
| 669 | <h2>Documentation</h2> |
| 670 | <div class="sectionbody"> |
| 671 | <p>Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.</p> |
| 672 | </div> |
| 673 | <h2>GIT</h2> |
| 674 | <div class="sectionbody"> |
| 675 | <p>Part of the <a href="git.html">git(7)</a> suite</p> |
| 676 | </div> |
| 677 | <div id="footer"> |
| 678 | <div id="footer-text"> |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 679 | Last updated 07-Jan-2008 07:50:11 UTC |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 680 | </div> |
| 681 | </div> |
| 682 | </body> |
| 683 | </html> |