Skip to content

Commit

Permalink
chore: Update Dockerfile and README.md for TeleAria server port change
Browse files Browse the repository at this point in the history
  • Loading branch information
besoeasy committed Jul 1, 2024
1 parent 0efe5cd commit edb7dce
Show file tree
Hide file tree
Showing 6 changed files with 409 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN apt-get update && apt-get install -y aria2
RUN mkdir -p /downloads && chmod -R 777 /downloads

# Expose the required ports for aria2c and the Telegram bot
EXPOSE 6800 6881-7999
EXPOSE 6600 6800 6881-7999

# Set environment variables (you can override these at runtime)
ENV TELEGRAMBOT=your-telegram-bot-token
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ With TeleAria, downloading has never been easier or more efficient. Perfect for
docker run -d \
--name telearia \
--restart unless-stopped \
-p 6600:6600 \
-p 6800:6800 \
-p 6881-7999:6881-7999 \
-e TELEGRAMBOT=your-telegram-bot-token \
Expand Down
14 changes: 13 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ const {
getDownloadStatus,
getOngoingDownloads,
cancelDownload,
server,
} = require("./x/aria2.js");

const { bytesToSize, ariaconfig } = require("./x/utils.js");

// Check for required environment variable
if (!process.env.TELEGRAMBOT) {
console.error("Error: TELEGRAMBOT environment variable is not set.");
process.exit(1);
Expand Down Expand Up @@ -173,3 +174,14 @@ bot.launch({
interval: 3000,
},
});

server.listen(6600, () => {
console.log("Server started on http://localhost:6600");
});

process.once("SIGINT", () => {
console.log("SIGINT received. Exiting...");
bot.stop("SIGINT");
aria2c.kill("SIGINT");
process.exit();
});
Loading

0 comments on commit edb7dce

Please sign in to comment.