From 4c041ffb03653a4081439dda8dfd7b581fefe26a Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 19 Sep 2023 21:43:53 +0300 Subject: [PATCH] add public peers registry to not abuse third party yggdrasil nodes by traffic usage --- .gitignore | 9 +++++---- src/config/peers.json | 7 +++++++ src/crontab/export/feed.php | 1 + src/public/node.php | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 src/config/peers.json diff --git a/.gitignore b/.gitignore index 21c589b..9a6ca43 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,11 @@ /src/public/api/*.json -/src/config/ -!/src/config/bootstrap.php -!/src/config/nodes.php -!/src/config/trackers.php +/src/config/* +!/src/config/bootstrap.json +!/src/config/nodes.json +!/src/config/trackers.json +!/src/config/peers.json /src/public/sitemap.xml diff --git a/src/config/peers.json b/src/config/peers.json new file mode 100644 index 0000000..abfa9e3 --- /dev/null +++ b/src/config/peers.json @@ -0,0 +1,7 @@ +[ + { + "description":"YGGtracker public peer instance without traffic limit", + "url":"http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggstate", + "address":"tls://94.140.114.241:4708" + } +] \ No newline at end of file diff --git a/src/crontab/export/feed.php b/src/crontab/export/feed.php index f639b43..f895dd2 100644 --- a/src/crontab/export/feed.php +++ b/src/crontab/export/feed.php @@ -193,6 +193,7 @@ try ], 'trackers' => (object) json_decode(file_get_contents(__DIR__ . '/../../config/trackers.json')), 'nodes' => (object) json_decode(file_get_contents(__DIR__ . '/../../config/nodes.json')), + 'peers' => (object) json_decode(file_get_contents(__DIR__ . '/../../config/peers.json')), ]; /// Dump feed diff --git a/src/public/node.php b/src/public/node.php index 34778f0..08df253 100644 --- a/src/public/node.php +++ b/src/public/node.php @@ -457,6 +457,42 @@ else if (is_null($user->public)) + + + + + + + + + + + + + $peer) { ?> + + + + $value) { ?> + + + + + + + + + + + + + + + + + + +