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

Add support for Tor proxies using docker compose #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oleander
Copy link

Hi guys,

This PR adds a Docker Compose configuration for running the bot through a Tor proxy. The Tor proxy rotates its IP address every 60 seconds and uses Germany as its exit point, reducing the risk of being blocked. Some minor adjustments were necessary for compatibility with the proxy:

Changes Made

  • Environment Variables Added:

    • DELAY_EACH_RETRY_IN_SEC: Limits the rate of requests in playwright test to avoid excessive retries.
    • RETRIES: Sets the retry count for Playwright; must be greater than zero. The bot will restart through Docker Compose if retries are exhausted.
    • TIMEOUT_IN_SEC: Prevents MailSlurp from freezing during extended bot operation.
  • Booking Process Update:

    • Added testInfo.skip(); at the end of the booking process. This ensures the bot exits with a status code of 0 upon a successful booking, preventing Docker Compose from restarting it. Without this, the bot exits with 1 due to page.close() calls that interrupt connections and cause test failures.
  • Playwright Update:

    • Updated Playwright to ensure compatibility and prevent crashes on M3 MacBook Pros.

Additional Information

The Tor server may take up to 60 seconds to initialize and build its cache on the first run.

Setup Instructions

  1. Extract stealth evasions:

    npx extract-stealth-evasions
  2. Copy and edit the environment variables file:

    cp .env.example .env
    # Then edit .env with your preferred settings
  3. Build and start the Docker Compose setup:

    docker compose up --build

Let me know if you have any questions!

@daniel-cortez-stevenson
Copy link
Collaborator

Looks like something I'd do ;) I'll have a look.

@oleander
Copy link
Author

I'm happy to help if are experiencing any problems.

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

Successfully merging this pull request may close these issues.

None yet

2 participants