mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-22 20:54:52 +00:00
move trackers list to json config file
This commit is contained in:
parent
2e9ef16c33
commit
d0db358eba
@ -10,8 +10,11 @@ YGGtracker uses [Yggdrasil](https://github.com/yggdrasil-network/yggdrasil-go) I
|
||||
|
||||
#### Trackers
|
||||
|
||||
* `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/announce` [stats](http://[201:23b4:991a:634d:8359:4521:5576:15b7]/stats)
|
||||
* `http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/announce` [stats](http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/stats)
|
||||
Initial trackers defined in [trackers.json](#).
|
||||
|
||||
* Application appends trackers to all download links and magnet forms
|
||||
* Trackers not in list will be cropped by the application filter
|
||||
* Feel free to PR new yggdrasil tracker instance!
|
||||
|
||||
#### Requirements
|
||||
|
||||
@ -115,7 +118,7 @@ git checkout -b my-pr-branch-name
|
||||
|
||||
#### Feedback
|
||||
|
||||
Feel free to [share](https://github.com/YGGverse/YGGtracker/issues) your ideas and bug reports!
|
||||
[https://github.com/YGGverse/YGGtracker/issues](https://github.com/YGGverse/YGGtracker/issues)
|
||||
|
||||
#### Community
|
||||
|
||||
|
@ -109,27 +109,6 @@ define('COMMENT_DEFAULT_PUBLIC', false);
|
||||
define('COMMENT_MIN_LENGTH', 1);
|
||||
define('COMMENT_MAX_LENGTH', 1000);
|
||||
|
||||
// Trackers
|
||||
define('TRACKER_LINKS', (object)
|
||||
[
|
||||
'Tracker 1' => (object)
|
||||
[
|
||||
'url' => 'http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker',
|
||||
'announce' => 'http://[201:23b4:991a:634d:8359:4521:5576:15b7]/announce',
|
||||
'stats' => 'http://[201:23b4:991a:634d:8359:4521:5576:15b7]/stats',
|
||||
'scrape' => 'http://[201:23b4:991a:634d:8359:4521:5576:15b7]/scrape',
|
||||
],
|
||||
'Tracker 2' => (object)
|
||||
[
|
||||
'url' => false,
|
||||
'announce' => 'http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/announce',
|
||||
'stats' => 'http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/stats',
|
||||
'scrape' => 'http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/scrape',
|
||||
],
|
||||
// ...
|
||||
]
|
||||
);
|
||||
|
||||
// Yggdrasil
|
||||
define('YGGDRASIL_URL_REGEX', '/^0{0,1}[2-3][a-f0-9]{0,2}:/'); // thanks to @ygguser (https://github.com/YGGverse/YGGo/issues/1#issuecomment-1498182228 )
|
||||
|
||||
|
16
src/config/trackers.json
Normal file
16
src/config/trackers.json
Normal file
@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"description":"YGGtracker instance, yggdrasil-only connections",
|
||||
"url":"http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yggtracker",
|
||||
"announce":"http://[201:23b4:991a:634d:8359:4521:5576:15b7]/announce",
|
||||
"stats":"http://[201:23b4:991a:634d:8359:4521:5576:15b7]/stats",
|
||||
"scrape":"http://[201:23b4:991a:634d:8359:4521:5576:15b7]/scrape"
|
||||
},
|
||||
{
|
||||
"description":"Yggdrasil-only torrent tracker, operated by jeff",
|
||||
"url":false,
|
||||
"announce":"http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/announce",
|
||||
"stats":"http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/stats",
|
||||
"scrape":"http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/scrape"
|
||||
}
|
||||
]
|
@ -472,9 +472,10 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
||||
$link[] = $url;
|
||||
}
|
||||
|
||||
foreach (TRACKER_LINKS as $tracker => $value)
|
||||
// Append trackers.json
|
||||
foreach (json_decode(file_get_contents(__DIR__ . '/../config/trackers.json')) as $tracker)
|
||||
{
|
||||
$link[] = sprintf('tr=%s', urlencode($value->announce));
|
||||
$link[] = sprintf('tr=%s', urlencode($tracker->announce));
|
||||
}
|
||||
|
||||
/// Acceptable Source
|
||||
@ -759,11 +760,13 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="column width-100 text-center margin-y-8">
|
||||
<?php foreach (TRACKER_LINKS as $name => $value) { ?>
|
||||
<a href="<?php echo $value->announce ?>"><?php echo $name ?></a>
|
||||
/
|
||||
<a href="<?php echo $value->stats ?>"><?php echo _('Stats') ?></a>
|
||||
|
|
||||
<?php foreach (json_decode(file_get_contents(__DIR__ . '/../config/trackers.json')) as $i => $tracker) { ?>
|
||||
<?php if (!empty($tracker->announce) && !empty($tracker->stats)) { ?>
|
||||
<a href="<?php echo $tracker->announce ?>"><?php echo sprintf('Tracker %s', $i + 1) ?></a>
|
||||
/
|
||||
<a href="<?php echo $tracker->stats ?>"><?php echo _('Stats') ?></a>
|
||||
|
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<a href="<?php echo WEBSITE_URL ?>/node.php"><?php echo _('Node') ?></a>
|
||||
|
|
||||
|
@ -634,11 +634,13 @@ else {
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="column width-100 text-center margin-y-8">
|
||||
<?php foreach (TRACKER_LINKS as $name => $value) { ?>
|
||||
<a href="<?php echo $value->announce ?>"><?php echo $name ?></a>
|
||||
/
|
||||
<a href="<?php echo $value->stats ?>"><?php echo _('Stats') ?></a>
|
||||
|
|
||||
<?php foreach (json_decode(file_get_contents(__DIR__ . '/../config/trackers.json')) as $i => $tracker) { ?>
|
||||
<?php if (!empty($tracker->announce) && !empty($tracker->stats)) { ?>
|
||||
<a href="<?php echo $tracker->announce ?>"><?php echo sprintf('Tracker %s', $i + 1) ?></a>
|
||||
/
|
||||
<a href="<?php echo $tracker->stats ?>"><?php echo _('Stats') ?></a>
|
||||
|
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<a href="<?php echo WEBSITE_URL ?>/node.php"><?php echo _('Node') ?></a>
|
||||
|
|
||||
|
@ -395,11 +395,13 @@ echo '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL ?>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="column width-100 text-center margin-y-8">
|
||||
<?php foreach (TRACKER_LINKS as $name => $value) { ?>
|
||||
<a href="<?php echo $value->announce ?>"><?php echo $name ?></a>
|
||||
/
|
||||
<a href="<?php echo $value->stats ?>"><?php echo _('Stats') ?></a>
|
||||
|
|
||||
<?php foreach (json_decode(file_get_contents(__DIR__ . '/../config/trackers.json')) as $i => $tracker) { ?>
|
||||
<?php if (!empty($tracker->announce) && !empty($tracker->stats)) { ?>
|
||||
<a href="<?php echo $tracker->announce ?>"><?php echo sprintf('Tracker %s', $i + 1) ?></a>
|
||||
/
|
||||
<a href="<?php echo $tracker->stats ?>"><?php echo _('Stats') ?></a>
|
||||
|
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<a href="<?php echo WEBSITE_URL ?>/node.php"><?php echo _('Node') ?></a>
|
||||
|
|
||||
|
@ -466,11 +466,13 @@ echo '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL ?>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="column width-100 text-center margin-y-8">
|
||||
<?php foreach (TRACKER_LINKS as $name => $value) { ?>
|
||||
<a href="<?php echo $value->announce ?>"><?php echo $name ?></a>
|
||||
/
|
||||
<a href="<?php echo $value->stats ?>"><?php echo _('Stats') ?></a>
|
||||
|
|
||||
<?php foreach (json_decode(file_get_contents(__DIR__ . '/../config/trackers.json')) as $i => $tracker) { ?>
|
||||
<?php if (!empty($tracker->announce) && !empty($tracker->stats)) { ?>
|
||||
<a href="<?php echo $tracker->announce ?>"><?php echo sprintf('Tracker %s', $i + 1) ?></a>
|
||||
/
|
||||
<a href="<?php echo $tracker->stats ?>"><?php echo _('Stats') ?></a>
|
||||
|
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<a href="<?php echo WEBSITE_URL ?>/node.php"><?php echo _('Node') ?></a>
|
||||
|
|
||||
|
@ -182,17 +182,19 @@ else if (!$userId = $db->initUserId($_SERVER['REMOTE_ADDR'], USER_DEFAULT_APPROV
|
||||
<td class="padding-y-8 padding-b-8 border-bottom-default text-right" colspan="2">
|
||||
<?php echo _('Trackers') ?>
|
||||
</td>
|
||||
<?php foreach (TRACKER_LINKS as $name => $settings) { ?>
|
||||
<?php foreach (json_decode(file_get_contents(__DIR__ . '/../config/trackers.json')) as $i => $tracker) { ?>
|
||||
<tr>
|
||||
<td class="padding-t-16"><?php echo $name ?></td>
|
||||
<td class="padding-t-16"><?php echo sprintf('#%s', $i + 1) ?></td>
|
||||
</tr>
|
||||
<?php foreach ($settings as $key => $value) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="margin-l-16"><?php echo $key ?></span>
|
||||
</td>
|
||||
<td><?php echo $value ?></td>
|
||||
</tr>
|
||||
<?php foreach ($tracker as $key => $value) { ?>
|
||||
<?php if ($value) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="margin-l-16"><?php echo $key ?></span>
|
||||
</td>
|
||||
<td><?php echo $value ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
@ -210,11 +212,13 @@ else if (!$userId = $db->initUserId($_SERVER['REMOTE_ADDR'], USER_DEFAULT_APPROV
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="column width-100 text-center margin-y-8">
|
||||
<?php foreach (TRACKER_LINKS as $name => $value) { ?>
|
||||
<a href="<?php echo $value->announce ?>"><?php echo $name ?></a>
|
||||
/
|
||||
<a href="<?php echo $value->stats ?>"><?php echo _('Stats') ?></a>
|
||||
|
|
||||
<?php foreach (json_decode(file_get_contents(__DIR__ . '/../config/trackers.json')) as $i => $tracker) { ?>
|
||||
<?php if (!empty($tracker->announce) && !empty($tracker->stats)) { ?>
|
||||
<a href="<?php echo $tracker->announce ?>"><?php echo sprintf('Tracker %s', $i + 1) ?></a>
|
||||
/
|
||||
<a href="<?php echo $tracker->stats ?>"><?php echo _('Stats') ?></a>
|
||||
|
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<a href="<?php echo WEBSITE_URL ?>/node.php"><?php echo _('Node') ?></a>
|
||||
|
|
||||
|
Loading…
x
Reference in New Issue
Block a user