Server implementation. ()

* Server implementation.

- Share the content of a folder as a magnet file.
- Web interface with all data needed for sharing data.
- New configuration to add several servers
- Every time the content of the server folder is changed, the magnet
file will be generated again.

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>

* Update dependencies

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>

* Use boltdb piece completion storage.

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
This commit is contained in:
Antonio Navarro Perez 2021-11-21 05:03:18 -08:00 committed by GitHub
parent 5d4e48f0f9
commit ddda39b22a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 541 additions and 67 deletions

View file

@ -71,4 +71,37 @@ routes:
# torrents:
# - magnet_uri: "magnet:?xt=urn:btih:9dea07ba660a722ae1008c4c8afdd303b6f6e53b&tr=http%3A%2F%2Facademictorrents.com%2Fannounce.php&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969"
# - magnet_uri: "magnet:?xt=urn:btih:d8b3a315172c8d804528762f37fa67db14577cdb&tr=http%3A%2F%2Facademictorrents.com%2Fannounce.php&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969"
# - magnet_uri: "magnet:?xt=urn:btih:1e0a00b9c606cf87c03e676f75929463c7756fb5&tr=http%3A%2F%2Facademictorrents.com%2Fannounce.php&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969"
# - magnet_uri: "magnet:?xt=urn:btih:1e0a00b9c606cf87c03e676f75929463c7756fb5&tr=http%3A%2F%2Facademictorrents.com%2Fannounce.php&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969"
# List of folders where the content will be transformed to a magnet link. You can share any content sending that magnet link to others.
servers:
- name: server
path: ./distribyted-data/served-folders/server
# Get trackers from web text file. The file will be loaded every time a magnet uri is generated,
# so all trackers will be up to date.
# tracker_url: "https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt"
# Trackers to be used to announce the served content. If tracker_url is set and it fails,
# this list will be used instead.
trackers:
- "http://p4p.arenabg.com:1337/announce"
- "udp://tracker.opentrackr.org:1337/announce"
- "udp://9.rarbg.com:2810/announce"
- "udp://open.tracker.cl:1337/announce"
- "udp://open.stealth.si:80/announce"
- "udp://exodus.desync.com:6969/announce"
- "http://openbittorrent.com:80/announce"
- "udp://www.torrent.eu.org:451/announce"
- "udp://vibe.sleepyinternetfun.xyz:1738/announce"
- "udp://udp-tracker.shittyurl.org:6969/announce"
- "udp://tracker1.bt.moack.co.kr:80/announce"
- "udp://tracker0.ufibox.com:6969/announce"
- "udp://tracker.zerobytes.xyz:1337/announce"
- "udp://tracker.torrent.eu.org:451/announce"
- "udp://tracker.tiny-vps.com:6969/announce"
- "udp://tracker.theoks.net:6969/announce"
- "udp://tracker.pomf.se:80/announce"
- "udp://tracker.moeking.me:6969/announce"
- "udp://tracker.leech.ie:1337/announce"
- "udp://tracker.altrosky.nl:6969/announce"

View file

@ -37,6 +37,16 @@
<span class="nav-text">Routes</span>
</a>
</li>
{{if eq . "served-folders"}}
<li class="active">
{{else}}
<li>
{{end}}
<a class="sidenav-item-link" href="/servers">
<i class="mdi mdi-folder-upload-outline"></i>
<span class="nav-text">Served Folders</span>
</a>
</li>
{{if eq . "logs"}}
<li class="active">
{{else}}
@ -47,16 +57,6 @@
<span class="nav-text">Logs</span>
</a>
</li>
<!-- {{if eq . "watched-folders"}}
<li class="active">
{{else}}
<li>
{{end}}
<a class="sidenav-item-link" href="/watched">
<i class="mdi mdi-folder-upload-outline"></i>
<span class="nav-text">Watched Folders</span>
</a>
</li> -->
</ul>
</div>

47
templates/servers.html Normal file
View file

@ -0,0 +1,47 @@
<!DOCTYPE html>
<head>
{{template "header.html" "Served Folders"}}
</head>
<body class="header-fixed sidebar-fixed sidebar-dark header-light" id="body">
<div class="wrapper">
{{template "navbar.html" "served-folders"}}
<div class="page-wrapper">
<!-- Header -->
<header class="main-header " id="header">
<nav class="navbar navbar-static-top navbar-expand-lg">
<!-- Sidebar toggle button -->
<button id="sidebar-toggler" class="sidebar-toggle">
<span class="sr-only">Toggle navigation</span>
</button>
</nav>
</header>
<div class="content-wrapper">
<div class="content" id="template_target">
</div>
<footer class="footer mt-auto">
<div class="copyright bg-white">
</div>
</footer>
</div>
{{template "footer.html"}}
<script src="assets/js/servers.js"></script>
<script>
Distribyted.servers.loadView();
setInterval(function () {
Distribyted.servers.loadView();
}, 5000)
</script>
<script>
</script>
</body>
</html>