Repository for a final year project at Monash University around ad transparency
- Create
.env
file underbot
directory with proper environment variables set. Seebot/.env.default
for an example. - Make sure the correct
chromedriver
is being used, seebot/driver/driver.py
and look forCHROMEDRIVER_PATH
. Similar steps if using Firefox driver
- Install Node and npm.
- Move to the
/db
directory and runnpm install
to install all dependencies. - Run project with
npm start
.
- Make sure you have the correct browser installed, depending on the driver you want to use. Currently Chrome and Firefox supported
- Move to the
/bot
directory and install all python requirements by runningpip install --upgrade -r requirements.txt
. - Ensure the DB Project is running.
- run
set "AD_USERNAME=<username>" && set "USE_PROXIES=0" && set "CHANGE_LOCATION=1" && set "NUM_TERMS=2" && set "DB_URL=http://localhost:8080" && set "UPLOAD_LOGS=0" && python app.py
. Where is the username of the google profile to run.
- Download and run the latest docker toolbox executable for your OS from here. Include VirtualBox and Kitematic if not already installed.
- Run the Docker Quickstart Terminal. The first time this is run it will add configuration variables to the computer.
- Confirm docker is working by typing the command:
docker run hello-world
- Ensure node dependencies are up to date by running
npm install
in/db
directory. - Ensure the correct bot is being used through the
AD_USERNAME
environment variable indocker-compose.yml
- Run
docker-compose up --build
. If node import error occurs, update the module locally and retry.
- With docker toolbox cmd still open. Open terminal in
/db
directory`. - Build the custom db docker image by running
docker build -t <image_name> .
. Where <image_name> is an arbitrary identifier you can set. - Run docker image in a container by running
docker run --rm <image_name>
. This container will be deleted once exited.
- With docker toolbox cmd still open. Open terminal in
/bot
directory`. - Build the custom bot docker image by running
docker build -t <image_name> .
. Where <image_name> is an arbitrary identifier you can set. - Ensure the DB Container is running.
- Run docker image in a container by running
docker run --rm --env AD_USERNAME=<username> <image_name>
. Where is the username of the google profile to run in this container. This container will be deleted once exited.
- Once a container is built, we can navigate as root with
docker run -it -rm <image_name> /bin/sh
. - List all docker images with
docker images
- Clear all old containers with
docker container prune
- Confirm that the proxy addresses are working by running
python bot/ip_check.py
.
- See README.md in
/aws
directory.
TODO: Automate the process of generating task-definition.json
file. Automate the running of tasks. Automate the stopping of tasks.