syncthing-globaldisco.7 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .
  4. .nr rst2man-indent-level 0
  5. .
  6. .de1 rstReportMargin
  7. \\$1 \\n[an-margin]
  8. level \\n[rst2man-indent-level]
  9. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  10. -
  11. \\n[rst2man-indent0]
  12. \\n[rst2man-indent1]
  13. \\n[rst2man-indent2]
  14. ..
  15. .de1 INDENT
  16. .\" .rstReportMargin pre:
  17. . RS \\$1
  18. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  19. . nr rst2man-indent-level +1
  20. .\" .rstReportMargin post:
  21. ..
  22. .de UNINDENT
  23. . RE
  24. .\" indent \\n[an-margin]
  25. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  26. .nr rst2man-indent-level -1
  27. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  28. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  29. ..
  30. .TH "SYNCTHING-GLOBALDISCO" "7" "Jul 17, 2021" "v1" "Syncthing"
  31. .SH NAME
  32. syncthing-globaldisco \- Global Discovery Protocol v3
  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. Standard discovery currently requires the path to be
  37. “/v2/”, yet this can be up to the discovery server. The POST has a JSON payload
  38. listing connection addresses (if any):
  39. .INDENT 0.0
  40. .INDENT 3.5
  41. .sp
  42. .nf
  43. .ft C
  44. {
  45. addresses: ["tcp://192.0.2.45:22000", "tcp://:22202", "relay://192.0.2.99:22028"],
  46. }
  47. .ft P
  48. .fi
  49. .UNINDENT
  50. .UNINDENT
  51. .sp
  52. It’s OK for the “addresses” field to be either the empty list (\fB[]\fP),
  53. \fBnull\fP, or missing entirely. An announcement with the field missing
  54. or empty is however not useful…
  55. .sp
  56. Any empty or unspecified IP addresses (i.e. addresses like \fBtcp://:22000\fP,
  57. \fBtcp://0.0.0.0:22000\fP, \fBtcp://[::]:22000\fP) are interpreted as referring to
  58. the source IP address of the announcement.
  59. .sp
  60. The device ID of the announcing device is not part of the announcement.
  61. Instead, the server requires that the client perform certificate
  62. authentication. The device ID is deduced from the presented certificate.
  63. .sp
  64. The server response is empty, with code \fB204\fP (No Content) on success. If no
  65. certificate was presented, status \fB403\fP (Forbidden) is returned. If the
  66. posted data doesn’t conform to the expected format, \fB400\fP (Bad Request) is
  67. returned.
  68. .sp
  69. In successful responses, the server may return a \fBReannounce\-After\fP header
  70. containing the number of seconds after which the client should perform a new
  71. announcement.
  72. .sp
  73. In error responses, the server may return a \fBRetry\-After\fP header containing
  74. the number of seconds after which the client should retry.
  75. .sp
  76. Performing announcements significantly more often than indicated by the
  77. \fBReannounce\-After\fP or \fBRetry\-After\fP headers may result in the client being
  78. throttled. In such cases the server may respond with status code \fB429\fP (Too
  79. Many Requests).
  80. .SH QUERIES
  81. .sp
  82. Queries are performed as HTTPS GET requests to the announce server URL. The
  83. requested device ID is passed as the query parameter “device”, in canonical
  84. string form, i.e. \fBhttps://discovery.syncthing.net/?device=ABC12345\-....\fP
  85. .sp
  86. Successful responses will have status code \fB200\fP (OK) and carry a JSON payload
  87. of the same format as the announcement above. The response will not contain
  88. empty or unspecified addresses.
  89. .sp
  90. If the “device” query parameter is missing or malformed, the status code 400
  91. (Bad Request) is returned.
  92. .sp
  93. If the device ID is of a valid format but not found in the registry, 404 (Not
  94. Found) is returned.
  95. .sp
  96. If the client has exceeded a rate limit, the server may respond with 429 (Too
  97. Many Requests).
  98. .SH AUTHENTICATION
  99. .sp
  100. Global discovery is spoken over HTTPS and is protected against attackers in
  101. the same manner as other HTTPS traffic. However, there are a few Syncthing
  102. specific considerations on top of this. As mentioned above, for
  103. announcements the client must provide a certificate to prove ownership of
  104. the announced device ID.
  105. .sp
  106. In addition, Syncthing has a mechanism to verify the identity of the
  107. discovery server. While this would normally be accomplished by using a CA
  108. signed certificate, Syncthing often runs in environments with outdated or
  109. simply nonexistent root CA bundles. Instead, Syncthing can verify the
  110. discovery server certificate fingerprint using the device ID mechanism. This
  111. is certificate pinning and conveyed in the Syncthing configuration as a
  112. synthetic “id” parameter on the discovery server URL:
  113. \fBhttps://discovery.syncthing.net/?id=...\fP\&. The “id” parameter is not, in
  114. fact, sent to the discovery server \- it’s used by Syncthing itself to know
  115. which certificate to expect on the server side.
  116. .sp
  117. The public discovery network uses this authentication mechanism instead of
  118. CA signed certificates.
  119. .sp
  120. The discovery server prints its certificate ID in this manner on startup.
  121. .SH AUTHOR
  122. The Syncthing Authors
  123. .SH COPYRIGHT
  124. 2014-2019, The Syncthing Authors
  125. .\" Generated by docutils manpage writer.
  126. .