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

Fix install readme #6107

Merged
merged 2 commits into from
Jul 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 34 additions & 31 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- [pip](https://pip.pypa.io/en/stable/installing/)
- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [virtualenv](https://virtualenv.pypa.io/en/stable/installation/) (Recommended)
- [hashing key](http://hashing.pogodev.org) - if you want use latest API, not the old, 0.45
- [hashing key](http://hashing.pogodev.org) - Hashing key now required for bot operation

### Easy installation
1. Clone the git: `git clone https://github.com/PokemonGoF/PokemonGo-Bot`
Expand All @@ -27,13 +27,13 @@
This will reset and makes sure you have no changes made to any code since it will overide it
3. Rerun the bot `./run.sh`

for manual installation please refer to [here](https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/manual_installation.md)
For manual installation please refer to [here](https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/manual_installation.md)

# Windows
We do recommend Windows users to use [Docker](#docker) this will work much easier and smoother (also safer)

## Requirements
- [hashing key](http://hashing.pogodev.org) - if you want use latest API, not the old, 0.45
- [hashing key](http://hashing.pogodev.org) - Hashing key now required for bot operation

### Easy Installation
1. Download [PokemonGo-Bot-Install.bat](https://github.com/PokemonGoF/PokemonGo-Bot/blob/master/windows_bat/PokemonGo-Bot-Install.bat)
Expand All @@ -51,70 +51,73 @@ This will check for an update and will start the bot afterwards.

### Easy installation
Start by downloading for your platform:

- [Mac](https://www.docker.com/products/docker#/mac)
- [Windows](https://www.docker.com/products/docker#/windows)
- [Linux](https://www.docker.com/products/docker#/linux)

Once you have Docker installed, simply create the various config files for your different accounts (e.g. `configs/config.json`, `configs/userdata.js`) and then create a Docker image for PokemonGo-Bot using the Dockerfile in this repo.

- Once you have Docker installed, simply create the various config files for your different accounts (e.g. `configs/config.json`, `configs/userdata.js`) and then create a Docker image for PokemonGo-Bot using the Dockerfile in this repo.

```
cd PokemonGo-Bot
docker build -t pokemongo-bot .
```

By default our Dockerfile ensures that the "master" branch will be used for building the docker container, if you want to use the "dev" branch then you should build the container with below build command:
- By default our Dockerfile ensures that the "master" branch will be used for building the docker container, if you want to use the "dev" branch then you should build the container with below build command:

```
docker build --build-arg BUILD_BRANCH=dev -t pokemongo-bot .
```



After build process you can verify that the image was created with:
- After build process you can verify that the image was created with:

```
docker images
```

To run the bot container with the PokemonGo-Bot Docker image you've created:
- To run the bot container with the PokemonGo-Bot Docker image you've created:

```
docker run --name=bot1-pokego --rm -it -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json pokemongo-bot
```

Optionally you can set your timezone with the -e option (default is Etc/UTC). You can find an exhaustive list of timezone here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- Optionally you can set your timezone with the -e option (default is Etc/UTC). You can find an exhaustive list of timezone here: [https://en.wikipedia.org/wiki/List_of_tz_database_time_zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).

```
docker run --name=bot1-pokego --rm -it -e TZ=Asia/Taipei -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json pokemongo-bot
```

>In the case you configured authentification to be handled by auth.json file make sure you mount that file as a volume also
- In the case you configured authentication to be handled by auth.json file make sure you mount that file as a volume also.

>```
```
docker run --name=bot1-pokego --rm -it -v $(pwd)/configs/auth.json:/usr/src/app/configs/auth.json -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json -v $(pwd)/web/:/usr/src/app/web/ pokemongo-bot
```

>or for a simplified version mount your whole configs/ subdir to /usr/src/app/configs
- For a simplified version mount your whole configs/ subdir to /usr/src/app/configs.

>```
```
docker run --name=bot1-pokego --rm -it -v $(pwd)/configs:/usr/src/app/configs -v $(pwd)/web/:/usr/src/app/web/ pokemongo-bot
```
>

Run a second container provided with the OpenPoGoBotWeb view:
- Run a second container provided with the OpenPoGoBotWeb view:

```
docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/src/app/web/config/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer
```
The OpenPoGoWeb will be served on `http://<your host>:8000`

- The OpenPoGoWeb will be served on `http://<your host>:8000`

### Using proxy with docker:

- https proxy
```

```
docker run --name=bot1-pokego -e "https_proxy=https://PROXY_IP:PORT" --rm -it -v $(pwd)/configs:/usr/src/app/configs -v $(pwd)/web/:/usr/src/app/web/ pokemongocc-bot
```
- http proxy

* http proxy

```
docker run --name=bot1-pokego -e "http_proxy=http://PROXY_IP:PORT" --rm -it -v $(pwd)/configs:/usr/src/app/configs -v $(pwd)/web/:/usr/src/app/web/ pokemongo-bot
```
Expand All @@ -139,14 +142,14 @@ docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:800
- Retrieve your host address:

```
docker-machine ip default
docker-machine ip default
```


Then, with your containers running and your host address, you can access the web view in your browser:
- Then, with your containers running and your host address, you can access the web view in your browser:

`http://<your host address>:8000` (e.g. http://192.168.99.100:8000)

`http://<your host address>:8000 (eg http://192.168.99.100:8000)`
```
#### Errors

- An error occurred trying to connect:
Expand All @@ -164,37 +167,37 @@ Make sure that the name of the image is correct.

### Using Docker compose

if docker-compose [installed](https://docs.docker.com/compose/install/) you can alternatively run the PokemonGo-Bot ecosystem with one simple command:
- If docker-compose [installed](https://docs.docker.com/compose/install/) you can alternatively run the PokemonGo-Bot ecosystem with one simple command:
(by using the docker-compose.yml configuration in this repo)

```
docker-compose up
```

An example of routing the bot's traffic through a tor proxy can be found within the docker-compose_tor.yml file. To use a different file, supply the file name to docker-compose. The d flag is used to run this in detached mode as the tor logs overwhelm any bot logs you might wish to view. The bot logs can still be seen through `docker logs` command.
- An example of routing the bot's traffic through a tor proxy can be found within the docker-compose_tor.yml file. To use a different file, supply the file name to docker-compose. The d flag is used to run this in detached mode as the tor logs overwhelm any bot logs you might wish to view. The bot logs can still be seen through `docker logs` command.

```
docker-compose -f docker-compose_tor.yml up -d
```

Also run one single service from the compose configuration is possible:
- Also run one single service from the compose configuration is possible:

```
docker-compose run --rm bot1-pokego
```



command to stop and remove all stopped containers: `docker-compose down`
- command to stop and remove all stopped containers: `docker-compose down`

TODO: Add infos / configuration for running multiple bot instances.

Do not push your image to a registry with your config.json and account details in it!

### Bug reporting when using docker:

Please include output of below command:
* Please include output of below command:

```
docker inspect --format='{{.Created}} {{.ContainerConfig.Labels}}' container_tag_or_id
```
container_tag_or_id being the final tag_id of container or the id of the intermediary layer at which the docker build failed.

`container_tag_or_id` being the final tag_id of container or the id of the intermediary layer at which the docker build failed.