syncthing-globaldisco.7 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH "SYNCTHING-GLOBALDISCO" "7" "January 30, 2016" "v0.12" "Syncthing"
  4. .SH NAME
  5. syncthing-globaldisco \- Global Discovery Protocol v3
  6. .
  7. .nr rst2man-indent-level 0
  8. .
  9. .de1 rstReportMargin
  10. \\$1 \\n[an-margin]
  11. level \\n[rst2man-indent-level]
  12. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  13. -
  14. \\n[rst2man-indent0]
  15. \\n[rst2man-indent1]
  16. \\n[rst2man-indent2]
  17. ..
  18. .de1 INDENT
  19. .\" .rstReportMargin pre:
  20. . RS \\$1
  21. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  22. . nr rst2man-indent-level +1
  23. .\" .rstReportMargin post:
  24. ..
  25. .de UNINDENT
  26. . RE
  27. .\" indent \\n[an-margin]
  28. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  29. .nr rst2man-indent-level -1
  30. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  31. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  32. ..
  33. .SH ANNOUNCEMENTS
  34. .sp
  35. A device should announce itself at startup. It does this by an HTTPS POST to
  36. the announce server URL (with the path usually being "/", but this is of
  37. course up to the discovery server). The POST has a JSON payload listing direct
  38. connection addresses (if any) and relay addresses (if any):
  39. .INDENT 0.0
  40. .INDENT 3.5
  41. .sp
  42. .nf
  43. .ft C
  44. {
  45. direct: ["tcp://192.0.2.45:22000", "tcp://:22202"],
  46. relays: [{"url": "relay://192.0.2.99:22028", "latency": 142}]
  47. }
  48. .ft P
  49. .fi
  50. .UNINDENT
  51. .UNINDENT
  52. .sp
  53. It\(aqs OK for either of the "direct" or "relays" fields to be either the empty
  54. list (\fB[]\fP), \fBnull\fP, or missing entirely. An announcment with both fields missing
  55. or empty is however not useful...
  56. .sp
  57. Any empty or unspecified IP addresses (i.e. addresses like \fBtcp://:22000\fP,
  58. \fBtcp://0.0.0.0:22000\fP, \fBtcp://[::]:22000\fP) are interpreted as referring to
  59. the source IP address of the announcement.
  60. .sp
  61. The device ID of the announcing device is not part of the announcement.
  62. Instead, the server requires that the client perform certificate
  63. authentication. The device ID is deduced from the presented certificate.
  64. .sp
  65. The server response is empty, with code \fB204\fP (No Content) on success. If no
  66. certificate was presented, status \fB403\fP (Forbidden) is returned. If the
  67. posted data doesn\(aqt conform to the expected format, \fB400\fP (Bad Request) is
  68. returned.
  69. .sp
  70. In successfull responses, the server may return a \fBReannounce\-After\fP header
  71. containing the number of seconds after which the client should perform a new
  72. announcement.
  73. .sp
  74. In error responses, the server may return a \fBRetry\-After\fP header containing
  75. the number of seconds after which the client should retry.
  76. .sp
  77. Performing announcements significantly more often than indicated by the
  78. \fBReannounce\-After\fP or \fBRetry\-After\fP headers may result in the client being
  79. throttled. In such cases the server may respond with status code \fB429\fP (Too
  80. Many Requests).
  81. .SH QUERIES
  82. .sp
  83. Queries are performed as HTTPS GET requests to the announce server URL. The
  84. requested device ID is passed as the query parameter "device", in canonical
  85. string form, i.e. \fBhttps://announce.syncthing.net/?device=ABC12345\-....\fP
  86. .sp
  87. Successfull responses will have status code \fB200\fP (OK) and carry a JSON payload
  88. of the same format as the announcement above. The response will not contain
  89. empty or unspecified addresses.
  90. .sp
  91. If the "device" query parameter is missing or malformed, the status code 400
  92. (Bad Request) is returned.
  93. .sp
  94. If the device ID is of a valid format but not found in the registry, 404 (Not
  95. Found) is returned.
  96. .sp
  97. If the client has exceeded a rate limit, the server may respond with 429 (Too
  98. Many Requests).
  99. .SH AUTHOR
  100. The Syncthing Authors
  101. .SH COPYRIGHT
  102. 2015, The Syncthing Authors
  103. .\" Generated by docutils manpage writer.
  104. .