Skip to content

Commit

Permalink
stable
Browse files Browse the repository at this point in the history
  • Loading branch information
besoeasy authored Nov 21, 2024
1 parent e82e48c commit aaebc51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ ENV TUNNELURL=http://pi.local:6799
ENV TELEGRAMBOT=Telegram-Bot-Token

# Start NGINX and aria2c, then the Node.js application
CMD sh -c "nginx && aria2c --enable-rpc --rpc-listen-all --rpc-listen-port=6800 --enable-dht --dht-listen-port=6881-6888 --seed-time=99 --bt-tracker='udp://tracker.opentrackr.org:1337,udp://opentracker.io:80/announce,udp://opentracker.io:6969/announce,udp://tracker.openbittorrent.com:80,udp://explodie.org:6969' & exec node index.js"
CMD sh -c "nginx && aria2c --enable-rpc --rpc-listen-all --rpc-listen-port=6800 --enable-dht --dht-listen-port=6881-6888 --seed-time=9 --bt-tracker='udp://tracker.opentrackr.org:1337,udp://opentracker.io:80/announce,udp://opentracker.io:6969/announce,udp://tracker.openbittorrent.com:80,udp://explodie.org:6969' & exec node index.js"
7 changes: 7 additions & 0 deletions func/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ function deleteOldestFile() {
});
}

function bytesToSize(bytes) {
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
if (bytes == 0) return "0 Byte";
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
}

module.exports = {
bytesToSize,
saveDirectory,
Expand Down

0 comments on commit aaebc51

Please sign in to comment.