/Honeygaindockerlinux

A python script to auto-start your Honeygain docker image on reboot using Linux's crontab

Primary LanguagePythonMIT LicenseMIT

Honeygain JumpTask Mode | Honeygain Sign Up

Installation

  • Run the project locally by first cloning this repository and cd into its main directory.

    # clone the repository
    git clone https://github.com/IanMaguithi/Honeygaindockerlinux.git
    # Navigate to the newly cloned directory
    cd Honeygaindockerlinux

Then:

  1. Create a new virtual environment:

  2. Install the project requirements by running this command on your project terminal:

    pip install -r requirements.txt 

Important: depending on your system, make sure to use pip3 and python3 instead.

Docker Installation

  1. Install and setup Docker here if you do not already have it installed in your machine.

  2. All information on how to use Honeygain with Docker can be found in this link here.

  • Before running the Honeygain Docker Image, get the current copy of ToU by running:

    docker run honeygain/honeygain -tou-get

Running honeygaindoockerlinux

  1. Initialise the script by running the following command:

    python3 initialize.py your_email your_password your_device_name
  2. Find the path to where the project is located. Do this by running the following command:

    # print working directory
    pwd
  • An example of the output of this command. /home/user/folder/Honeygaindockerlinux/
  1. Execute the following command to make our script executable:

    chmod +x main.py

Crontab Task Schedule

  1. Setting up a crontab to run on reboot. Open the crontask list by using the following command:

    crontab -e
  2. You will be prompted to select an editor to update the cron task with if you have multiple text editors. Choose your preferred option. In this case, however, we'll use the default option nano.

  3. Use the following command to set our script to run at every system boot. @reboot [path to venv] [path to project] I'll use an example to elaborate using the path we had obtained earlier in step 4 and assuming our virtual environment is in the same root folder honey.

    @reboot /home/user/folder/Honeygaindockerlinux/venv/bin/python /home/user/folder/Honeygaindockerlinux/main.py >> ~/cron.log 2>&1
  4. '>> ~/cron.log 2>&1' This extra step in the command above logs errors into cron.log. You can view the output of the logs by running the following command on your terminal.

    cat cron.log
  5. Check out this link for further information if you run into errors.

  6. Finally, save changes by pressing Control + S and exit Nano by pressing Control + X

  7. Your script is now ready. Restart your machine, open your terminal, and run the following to confirm that your Honeygain docker image is up.

    docker ps
  8. After the script has started you should see your new device running on your dashboard.

Manually executing the script

  • You can run the script manually without a crontab task by executing the following command in the project terminal.

    python3 main.py

Support

Do you need help?

If you should encounter any issue, please first search for similar issues, and only if you can't find any, create a new issue.