Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add manual for proxy with a login and password and a backup #159

Closed
farmdigit opened this issue Jul 31, 2024 · 10 comments
Closed
Labels
Enhancement New feature or request

Comments

@farmdigit
Copy link

Hi Phil! Thanks for everything you are doing.
Can you please explain in detail how to add a proxy with login and password, as well as how to delete backup, make backup, transfer and run backup on another server?
It's about docker on windows.
I have studied all the materials but nowhere found the necessary information.

@thebrumby
Copy link
Owner

Hi,

I'm pleased you are enjoying everything so far.

  1. There is no proxy support with login and password yet, we might add that this month, please follow the open issue for it.
  2. If you want to delete one or more game accounts, you can do so by following the instructions for using the status command.
  3. If you want to create a backup server without entering the accounts again, you could take a backup of the game accounts, but bear in mind you'd manually need to set up the tasks in PM2 again, which might mean it's easier just to set them up the normal way.

Backup the 3 game folders using docker CLI tools from outside the container:

Use Windows Command Prompt, PowerShell, Ubuntu, or other Linux distributions CLI

docker cp telegram-claim-bot:/usr/src/app/screenshots .
docker cp telegram-claim-bot:/usr/src/app/backup .
docker cp telegram-claim-bot:/usr/src/app/selenium .

Restore the 3 game folders using docker CLI tools from outside the container:

Use Windows Command Prompt or PowerShell or Ubuntu or other Linux distributions CLI

docker cp ./screenshots telegram-claim-bot:/usr/src/app/screenshots
docker cp ./backup telegram-claim-bot:/usr/src/app/backup
docker cp ./selenium telegram-claim-bot:/usr/src/app/selenium

@farmdigit
Copy link
Author

ty, Phil.
Please tell me what each point means?
pm2 set pm2-logrotate:max_size 1M
pm2 set pm2-logrotate:retain 10
pm2 set pm2-logrotate:compress true
pm2 set pm2-logrotate:dateFormat 'YYYY-MM-DD_HHH-mm-mm-ss'
pm2 set pm2-logrotate:workerInterval 30
pm2 set pm2-logrotate:rotateInterval '0 0 0 * * * * *' # Rotate daily
how to delete pm2-logrotate without terminating sessions?

Hi,

I'm pleased you are enjoying everything so far.

  1. There is no proxy support with login and password yet, we might add that this month, please follow the open issue for it.
  2. If you want to delete one or more game accounts, you can do so by following the instructions for using the status command.
  3. If you want to create a backup server without entering the accounts again, you could take a backup of the game accounts, but bear in mind you'd manually need to set up the tasks in PM2 again, which might mean it's easier just to set them up the normal way.

Backup the 3 game folders using docker CLI tools from outside the container:

Use Windows Command Prompt, PowerShell, Ubuntu, or other Linux distributions CLI

docker cp telegram-claim-bot:/usr/src/app/screenshots .
docker cp telegram-claim-bot:/usr/src/app/backup .
docker cp telegram-claim-bot:/usr/src/app/selenium .

Restore the 3 game folders using docker CLI tools from outside the container:

Use Windows Command Prompt or PowerShell or Ubuntu or other Linux distributions CLI

docker cp ./screenshots telegram-claim-bot:/usr/src/app/screenshots
docker cp ./backup telegram-claim-bot:/usr/src/app/backup
docker cp ./selenium telegram-claim-bot:/usr/src/app/selenium

ty, Phil.
Please tell me what each point means?
pm2 set pm2-logrotate:max_size 1M
pm2 set pm2-logrotate:retain 10
pm2 set pm2-logrotate:compress true
pm2 set pm2-logrotate:dateFormat 'YYYY-MM-DD_HHH-mm-mm-ss'
pm2 set pm2-logrotate:workerInterval 30
pm2 set pm2-logrotate:rotateInterval '0 0 0 * * * * *' # Rotate daily
how to delete pm2-logrotate without terminating sessions?

@thebrumby
Copy link
Owner

Here's what each PM2 Logrotate configuration command means:

  1. pm2 set pm2-logrotate:max_size 1M

    • Sets the maximum log file size to 1 megabyte. When a log file reaches this size, it will be rotated.
  2. pm2 set pm2-logrotate:retain 10

    • Retains the last 10 rotated log files and deletes older ones to save disk space.
  3. pm2 set pm2-logrotate:compress true

    • Enables compression for rotated log files, saving disk space.
  4. pm2 set pm2-logrotate:dateFormat 'YYYY-MM-DD_HH-mm-ss'

    • Sets the timestamp format for log file names to year-month-day_hour-minute-second.
  5. pm2 set pm2-logrotate:workerInterval 30

    • The log rotation worker checks every 30 seconds if any log file needs rotation based on size.
  6. pm2 set pm2-logrotate:rotateInterval '0 0 0 * * * * *'

    • Schedules log rotation to occur daily at midnight.

To delete pm2-logrotate without terminating sessions, follow these steps:

  1. Disable pm2-logrotate:
    pm2 set pm2-logrotate:enable false
  2. Uninstall pm2-logrotate:
    pm2 uninstall pm2-logrotate
    This will remove the pm2-logrotate module without affecting your running PM2 processes.

Best regards, Phil

@farmdigit
Copy link
Author

  • Retains the last 10 rotated log files and deletes older ones to save disk space.

What parameter should be set if for example there are 15 telegram accounts and each has 3 bots (Poketfi, Blum, Hot)? Explain please, this point is not clear.

@thebrumby
Copy link
Owner

  • Retains the last 10 rotated log files and deletes older ones to save disk space.

What parameter should be set if for example there are 15 telegram accounts and each has 3 bots (Poketfi, Blum, Hot)? Explain please, this point is not clear.

In this situation, 15 TG accounts multiply by 3 games each, then you would have 45 game sessions. In terms of PM2 logs, each of the 45 sessions would have 1 uncompressed log file (45 mb) and 9 compressed log files (maybe another 200 mb).

If you want to save more space and keep less data, reduce the number of saved settings.

@thebrumby thebrumby changed the title manual for proxy with a login and password and a backup Feature Request: Add manual for proxy with a login and password and a backup Aug 3, 2024
@farmdigit
Copy link
Author

each of the 45 sessions would have 1 uncompressed log file (45 mb) and 9 compressed log files (maybe another 200 mb).

Does that mean that in this case I should set the settings like this?

pm2 set pm2-logrotate:max_size 1M
pm2 set pm2-logrotate:retain 450
pm2 set pm2-logrotate:compress true
pm2 set pm2-logrotate:dateFormat 'YYYY-MM-DD_HHH-mm-mm-ss'
pm2 set pm2-logrotate:workerInterval 30
pm2 set pm2-logrotate:rotateInterval '0 0 0 * * * * *' # Rotate daily

Or am I misunderstanding?

@thebrumby
Copy link
Owner

The log rotate retain parameter is per process. So, in your example, it would save the most recent 450 logs for each of your 45 processes. If your goal is to minimize disk storage usage, it is best to use smaller numbers. Theoretically, you could even just have a single log file retained per process, though this might not provide enough historical data for troubleshooting. Adjust the number based on your needs for log retention versus disk space availability.

@thebrumby thebrumby added the Enhancement New feature or request label Aug 4, 2024
@farmdigit
Copy link
Author

The log rotate retain parameter is per process. So, in your example, it would save the most recent 450 logs for each of your 45 processes. If your goal is to minimize disk storage usage, it is best to use smaller numbers. Theoretically, you could even just have a single log file retained per process, though this might not provide enough historical data for troubleshooting. Adjust the number based on your needs for log retention versus disk space availability.

how to set up the log rotate as efficiently as possible in this case?

@thebrumby
Copy link
Owner

Hi,

You could set the number of retained logs to the bare minimum if your only concern is to fit the maximum number of sessions onto the single server, and you aren't interested it keeping any further history.

pm2 set pm2-logrotate:retain 1

@farmdigit
Copy link
Author

Hi,

You could set the number of retained logs to the bare minimum if your only concern is to fit the maximum number of sessions onto the single server, and you aren't interested it keeping any further history.

Thanks for the answer, Phil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants