Skip to content

Commit

Permalink
change dockerhub docs references
Browse files Browse the repository at this point in the history
  • Loading branch information
jackivanov committed Mar 17, 2023
1 parent 1c47de7 commit 45fe0f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion algo-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ usage() {
retcode="${1:-0}"
echo "To run algo from Docker:"
echo ""
echo "docker run --cap-drop=all -it -v <path to configurations>:"${DATA_DIR}" trailofbits/algo:latest"
echo "docker run --cap-drop=all -it -v <path to configurations>:"${DATA_DIR}" ghcr.io/trailofbits/algo:latest"
echo ""
exit ${retcode}
}
Expand Down
21 changes: 15 additions & 6 deletions docs/deploy-from-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,36 @@ While it is not possible to run your Algo server from within a Docker container,
2. Create a local directory to hold your VPN configs (e.g. `C:\Users\trailofbits\Documents\VPNs\`)
3. Create a local copy of [config.cfg](https://github.com/trailofbits/algo/blob/master/config.cfg), with required modifications (e.g. `C:\Users\trailofbits\Documents\VPNs\config.cfg`)
4. Run the Docker container, mounting your configurations appropriately (assuming the container is named `trailofbits/algo` with a tag `latest`):
- From Windows:

- From Windows:

```powershell
C:\Users\trailofbits> docker run --cap-drop=all -it \
-v C:\Users\trailofbits\Documents\VPNs:/data \
trailofbits/algo:latest
ghcr.io/trailofbits/algo:latest
```
- From Linux:

- From Linux:

```bash
$ docker run --cap-drop=all -it \
-v /home/trailofbits/Documents/VPNs:/data \
trailofbits/algo:latest
ghcr.io/trailofbits/algo:latest
```

5. When it exits, you'll be left with a fully populated `configs` directory, containing all appropriate configuration data for your clients, and for future server management

### Providing Additional Files

If you need to provide additional files -- like authorization files for Google Cloud Project -- you can simply specify an additional `-v` parameter, and provide the appropriate path when prompted by `algo`.

For example, you can specify `-v C:\Users\trailofbits\Documents\VPNs\gce_auth.json:/algo/gce_auth.json`, making the local path to your credentials JSON file `/algo/gce_auth.json`.

### Scripted deployment

Ansible variables (see [Deployment from Ansible](deploy-from-ansible.md)) can be passed via `ALGO_ARGS` environment variable.
_The leading `-e` (or `--extra-vars`) is required_, e.g.

```bash
$ ALGO_ARGS="-e
provider=digitalocean
Expand All @@ -50,19 +58,20 @@ $ ALGO_ARGS="-e
$ docker run --cap-drop=all -it \
-e "ALGO_ARGS=$ALGO_ARGS" \
-v /home/trailofbits/Documents/VPNs:/data \
trailofbits/algo:latest
ghcr.io/trailofbits/algo:latest
```

## Managing an Algo Server with Docker

Even though the container itself is transient, because you've persisted the configuration data, you can use the same Docker image to manage your Algo server. This is done by setting the environment variable `ALGO_ARGS`.

If you want to use Algo to update the users on an existing server, specify `-e "ALGO_ARGS=update-users"` in your `docker run` command:

```powershell
$ docker run --cap-drop=all -it \
-e "ALGO_ARGS=update-users" \
-v C:\Users\trailofbits\Documents\VPNs:/data \
trailofbits/algo:latest
ghcr.io/trailofbits/algo:latest
```

## GNU Makefile for Docker
Expand Down

0 comments on commit 45fe0f5

Please sign in to comment.