Skip to content

Commit

Permalink
Make v3 standard operation (#160)
Browse files Browse the repository at this point in the history
* Make v3 standard operation

* Update README.md

Co-authored-by: W. Leighton Dawson <[email protected]>

---------

Co-authored-by: W. Leighton Dawson <[email protected]>
  • Loading branch information
jayjb and wleightond authored Dec 11, 2023
1 parent 59a647f commit 02a46d9
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 167 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ to [email protected].

## Migrating to v3

* Depending on whether you're using letsencrypt: `docker compose -f docker-compose.yml down`
or `docker compose -f docker-compose-letsencrypt.yml down`
* If running on an older version of Docker, you will need to [upgrade](https://docs.docker.com/engine/install/).
* `docker-compose` no longer works, and you will need to run `docker network prune` before bringing up your Canarytokens instance with `docker compose`. Canarytokens v2 will still work.
* Pull the latest version of the `canarytokens-docker` repo.
* Depending on whether you're using letsencrypt: `docker compose -f docker-compose.yml down`
or `docker compose -f docker-compose-letsencrypt.yml down`
* And correspondingly: `docker compose -f docker-compose-v3.yml up -d`
or `docker compose -f docker-compose-v3-letsencrypt.yml up -d`
* And correspondingly: `docker compose -f docker-compose.yml up -d`
or `docker compose -f docker-compose-letsencrypt.yml up -d`

NB: The updated `canarytokens-docker` repo no longer has the Dockerfile for Canarytokens v2, so running that requires using the tagged image `thinkst/canarytokens:v2_latest`.
NB: The updated `canarytokens-docker` repo no longer has the Dockerfile for Canarytokens v2, so running that requires using the tagged image `thinkst/canarytokens:v2_latest`. We highly recommend moving to v3. Please contact us if you're battling with the migration.

## Setup (in Ubuntu)

Expand Down
45 changes: 25 additions & 20 deletions docker-compose-letsencrypt.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,63 @@
version: '2'
version: '3'
services:
redis:
restart: always
image: redis:7.0.10
volumes:
- ./data:/data/
- ./data:/data/
container_name: redis
command: redis-server --appendonly yes --protected-mode no --save 60 1
frontend:
restart: always
image: thinkst/canarytokens:v2_latest
image: thinkst/canarytokens
build: ./canarytokens
links:
- redis
ports:
- "8082:8082"
env_file:
- frontend.env
volumes:
- ./uploads:/uploads/
- log-volume:/logs
- ./frontend.env:/srv/frontend/frontend.env:ro
- ./switchboard.env:/srv/switchboard/switchboard.env:ro
- ./uploads:/uploads/
- log-volume:/logs
container_name: frontend
command: bash -c "rm -f frontend.pid; twistd -noy frontend.tac --pidfile=frontend.pid"
command: bash -c "cd frontend; poetry run python -m uvicorn app:app --host 0.0.0.0 --port 8082"
switchboard:
restart: always
image: thinkst/canarytokens:v2_latest
image: thinkst/canarytokens
build: ./canarytokens
ports:
- "53:53"
- "53:53/udp"
- "25:25"
- "25:2500"
- "3306:3306"
- "53:5354"
- "53:5354/udp"
- "6443:6443"
- "8083:8083"
- "51820:51820/udp"
links:
- redis
env_file:
- switchboard.env
volumes_from:
- frontend
volumes:
- ./frontend.env:/srv/frontend/frontend.env:ro
- ./switchboard.env:/srv/switchboard/switchboard.env:ro
- ./uploads:/uploads/
- log-volume:/logs
container_name: switchboard
command: bash -c "rm -f switchboard.pid; twistd -noy switchboard.tac --pidfile=switchboard.pid"
command: bash -c "cd switchboard; rm -f switchboard.pid; poetry run twistd -noy switchboard.tac --pidfile=switchboard.pid"
nginx:
restart: always
image: thinkst/certbot-nginx
build: ./certbot-nginx
ports:
- "80:80"
- "443:443"
links:
- frontend
- switchboard
depends_on:
- "frontend"
- "switchboard"
container_name: nginx
env_file:
- certbot.env
volumes:
- /etc/letsencrypt/:/etc/letsencrypt/
- ./nginx/conf.d:/etc/nginx/conf.d/
volumes:
log-volume:
63 changes: 0 additions & 63 deletions docker-compose-v3-letsencrypt.yml

This file was deleted.

60 changes: 0 additions & 60 deletions docker-compose-v3.yml

This file was deleted.

44 changes: 25 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,59 @@
version: '2'
version: '3'
services:
redis:
restart: always
image: redis:7.0.10
volumes:
- ./data:/data/
- ./data:/data/
container_name: redis
command: redis-server --appendonly yes --protected-mode no --save 60 1
frontend:
restart: always
image: thinkst/canarytokens:v2_latest
image: thinkst/canarytokens
build: ./canarytokens
links:
- redis
ports:
- "8082:8082"
env_file:
- frontend.env
volumes:
- ./uploads:/uploads/
- log-volume:/logs
- ./frontend.env:/srv/frontend/frontend.env:ro
- ./switchboard.env:/srv/switchboard/switchboard.env:ro
- ./uploads:/uploads/
- log-volume:/logs
container_name: frontend
command: bash -c "rm -f frontend.pid; twistd -noy frontend.tac --pidfile=frontend.pid"
command: bash -c "cd frontend; poetry run python -m uvicorn app:app --host 0.0.0.0 --port 8082 --log-config log.ini"
switchboard:
restart: always
image: thinkst/canarytokens:v2_latest
image: thinkst/canarytokens
build: ./canarytokens
ports:
- "53:53"
- "53:53/udp"
- "25:25"
- "3306:3306"
- "53:5354"
- "53:5354/udp"
- "6443:6443"
- "8083:8083"
- "51820:51820/udp"
links:
- redis
env_file:
- switchboard.env
volumes_from:
- frontend
volumes:
- ./frontend.env:/srv/frontend/frontend.env:ro
- ./switchboard.env:/srv/switchboard/switchboard.env:ro
- ./uploads:/uploads/
- log-volume:/logs
container_name: switchboard
command: bash -c "rm -f switchboard.pid; twistd -noy switchboard.tac --pidfile=switchboard.pid"
command: bash -c "cd switchboard; rm -f switchboard.pid; poetry run twistd -noy switchboard.tac --pidfile=switchboard.pid"
nginx:
restart: always
image: thinkst/canarytokens_nginx
build: ./nginx
ports:
- "80:80"
links:
- frontend
- switchboard
depends_on:
- "frontend"
- "switchboard"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d/
container_name: nginx
command: /usr/sbin/nginx -c /etc/nginx/nginx.conf -g "daemon off;"
volumes:
Expand Down

0 comments on commit 02a46d9

Please sign in to comment.