index.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Yggdrasil trackers</title>
  6. <base href="" target="_top" id="base">
  7. <script>base.href = document.location.href.replace("/media", "").replace("index.html", "").replace(/[&?]wrapper=False/, "").replace(/[&?]wrapper_nonce=[A-Za-z0-9]+/, "")</script>
  8. <link rel="stylesheet" href="css/normalize.css">
  9. <style>
  10. .tracker_red {
  11. color: red;
  12. }
  13. .tracker_green {
  14. color: green;
  15. }
  16. #tracker_location {
  17. margin: 5px;
  18. padding: 5px;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <h1>Yggdrasil trackers</h1>
  24. <div>
  25. <p>
  26. Zeronet needs Bittorrent Tracker to find other peers hosting a
  27. zite. In order for Zeronet to remain decentralized, there must
  28. be a large number of trackers. This zite lists trackers that can
  29. be reached via Yggdrasil.
  30. </p>
  31. <blockquote cite="https://yggdrasil-network.github.io/">
  32. Yggdrasil is an overlay network implementation of a new routing
  33. scheme for mesh networks. It is designed to be a future-proof
  34. decentralised alternative to the structured routing protocols
  35. commonly used today on the Internet and other networks.
  36. </blockquote>
  37. <p>
  38. To use these trackers, Yggdrasil must be installed and the
  39. following line must be inserted under
  40. <a href="http://127.0.0.1:43110/Config" target="_blank">ZeroNet
  41. config</a> -> Trackers files.<br>
  42. <code id="tracker_location">{data_dir}/1Bd2mgwbxQAHdHnWyDD7URBLDuwxxybw8t/yggdrasil_trackers.txt</code><button onclick="copyText(document.getElementById('tracker_location').innerHTML)">Copy</button><br>
  43. With Zeronet Mobile, the "Additional BitTorrent Trackers" option must also be disabled.
  44. </p>
  45. </div>
  46. <div>
  47. <h2>Links</h2>
  48. <ul>
  49. <li>Yggdrasil - <a href="https://yggdrasil-network.github.io/" target="_blank">https://yggdrasil-network.github.io/</a></li>
  50. <li>Another zite that has a tracker list - <a href="/15CEFKBRHFfAP9rmL6hhLmHoXrrgmw4B5o/" target="_blank">Syncronite</a></li>
  51. </ul>
  52. </div>
  53. <div>
  54. <h2>Current trackers</h2>
  55. These trackers help with finding peers for this zite:<br>
  56. <ul id="tracker_list">
  57. </ul>
  58. </div>
  59. <script src="js/ZeroFrame.js"></script>
  60. <script>
  61. const zf = new ZeroFrame();
  62. function htmlEncode(str) {
  63. return String(str).replace(/[^\w. ]/gi, (c) => {
  64. return '&#' + c.charCodeAt(0) + ';';
  65. });
  66. }
  67. function copyText(text) {
  68. navigator.clipboard.writeText(text).then((success) => {
  69. zf.cmd("wrapperNotification", ["done", "Copied.", 3500]);
  70. }, (error) => {
  71. zf.cmd("wrapperNotification", ["error", "Error - " + error]);
  72. });
  73. }
  74. function updateTrackers() {
  75. zf.cmd("announcerInfo", [], (info) => {
  76. const html_list = document.getElementById("tracker_list");
  77. html_list.innerHTML = "";
  78. Object.keys(info.stats).forEach((tracker) => {
  79. let html_class = (info.stats[tracker].status === "announced" ? "green" : "red");
  80. html_list.innerHTML += "<li>" + htmlEncode(tracker) + " - <strong class=\"tracker_" + html_class + "\">" + htmlEncode(info.stats[tracker].status) + "</strong></li>\n";
  81. });
  82. });
  83. }
  84. window.setInterval(updateTrackers, 10000);
  85. updateTrackers();
  86. </script>
  87. </body>
  88. </html>