syncthing-globaldisco.7 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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" "Jun 02, 2024" "v1.27.7" "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. .EX
  43. {
  44. addresses: [\(dqtcp://192.0.2.45:22000\(dq, \(dqtcp://:22202\(dq, \(dqrelay://192.0.2.99:22028\(dq],
  45. }
  46. .EE
  47. .UNINDENT
  48. .UNINDENT
  49. .sp
  50. It’s OK for the “addresses” field to be either the empty list (\fB[]\fP),
  51. \fBnull\fP, or missing entirely. An announcement with the field missing
  52. or empty is however not useful…
  53. .sp
  54. Any empty or unspecified IP addresses (i.e. addresses like \fBtcp://:22000\fP,
  55. \fBtcp://0.0.0.0:22000\fP, \fBtcp://[::]:22000\fP) are interpreted as referring to
  56. the source IP address of the announcement.
  57. .sp
  58. The device ID of the announcing device is not part of the announcement.
  59. Instead, the server requires that the client perform certificate
  60. authentication. The device ID is deduced from the presented certificate.
  61. .sp
  62. The server response is empty, with code \fB204\fP (No Content) on success. If no
  63. certificate was presented, status \fB403\fP (Forbidden) is returned. If the
  64. posted data doesn’t conform to the expected format, \fB400\fP (Bad Request) is
  65. returned.
  66. .sp
  67. In successful responses, the server may return a \fBReannounce\-After\fP header
  68. containing the number of seconds after which the client should perform a new
  69. announcement.
  70. .sp
  71. In error responses, the server may return a \fBRetry\-After\fP header containing
  72. the number of seconds after which the client should retry.
  73. .sp
  74. Performing announcements significantly more often than indicated by the
  75. \fBReannounce\-After\fP or \fBRetry\-After\fP headers may result in the client being
  76. throttled. In such cases the server may respond with status code \fB429\fP (Too
  77. Many Requests).
  78. .SH QUERIES
  79. .sp
  80. Queries are performed as HTTPS GET requests to the announce server URL. The
  81. requested device ID is passed as the query parameter “device”, in canonical
  82. string form, i.e. \fBhttps://discovery.syncthing.net/?device=ABC12345\-....\fP
  83. .sp
  84. Successful responses will have status code \fB200\fP (OK) and carry a JSON payload
  85. of the same format as the announcement above. The response will not contain
  86. empty or unspecified addresses.
  87. .sp
  88. If the “device” query parameter is missing or malformed, the status code 400
  89. (Bad Request) is returned.
  90. .sp
  91. If the device ID is of a valid format but not found in the registry, 404 (Not
  92. Found) is returned.
  93. .sp
  94. If the client has exceeded a rate limit, the server may respond with 429 (Too
  95. Many Requests).
  96. .SH AUTHENTICATION
  97. .sp
  98. Global discovery is spoken over HTTPS and is protected against attackers in
  99. the same manner as other HTTPS traffic. However, there are a few Syncthing
  100. specific considerations on top of this. As mentioned above, for
  101. announcements the client must provide a certificate to prove ownership of
  102. the announced device ID.
  103. .sp
  104. In addition, Syncthing has a mechanism to verify the identity of the
  105. discovery server. While this would normally be accomplished by using a CA
  106. signed certificate, Syncthing often runs in environments with outdated or
  107. simply nonexistent root CA bundles. Instead, Syncthing can verify the
  108. discovery server certificate fingerprint using the device ID mechanism. This
  109. is certificate pinning and conveyed in the Syncthing configuration as a
  110. synthetic “id” parameter on the discovery server URL:
  111. \fBhttps://discovery.syncthing.net/?id=...\fP\&. The “id” parameter is not, in
  112. fact, sent to the discovery server \- it’s used by Syncthing itself to know
  113. which certificate to expect on the server side.
  114. .sp
  115. The public discovery network uses this authentication mechanism instead of
  116. CA signed certificates.
  117. .sp
  118. The discovery server prints its certificate ID in this manner on startup.
  119. .SH AUTHOR
  120. The Syncthing Authors
  121. .SH COPYRIGHT
  122. 2014-2019, The Syncthing Authors
  123. .\" Generated by docutils manpage writer.
  124. .