Skip to content

Commit

Permalink
update README and add supervisor configs for Tailscale
Browse files Browse the repository at this point in the history
  • Loading branch information
activeshadow committed Dec 3, 2024
1 parent 3809730 commit 70dc298
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 18 deletions.
40 changes: 26 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
# Branches
# Modules

* [branch-00](#previous-wind-turbine-branch-00)
* [branch-01](#connecting-your-turbine-to-the-wind-farm-branch-01)
* [module-0](#previous-wind-turbine-module-0)
* [module-1](#connecting-your-turbine-to-the-wind-farm-module-1)

# Previous wind turbine (branch-00)
# Previous Wind Turbine (module-0)

Re-familiarize yourself with the wind turbine from the last lab. Recall, it has an adversary container and a Grafana container for ground truth.
In this module:

In the next branch, you will set up this wind turbine in a larger wind farm. Change the two `{{FIX_ME}}` entries in the URL below with the values provided by your instructor. Then, start the next branch.
* You will re-familiarize yourself with the wind turbine from the last lab.
Recall, it has an adversary container and a Grafana container for ground truth.

> There will be a Q&A session at the module’s end. Stop the current Gitpod workspace and deploy the next branch in Gitpod using this URL: https://gitpod.io/HOSTNAME={{FIX_ME}},OTSIM_TAILSCALE_AUTHKEY=tskey-auth-{{FIX_ME}}/https://github.com/patsec/uiuc-farm/tree/branch-01
In the next module, you will set up this wind turbine in a larger wind farm.
Change the two `{{FIX_ME}}` entries in the URL below with the values provided
by your instructor. Then, start the next branch.

# Connecting Your Turbine to the Wind Farm (branch-01)
> There will be a Q&A session at the module’s end. Stop the current Gitpod
> workspace and deploy the next branch in Gitpod using this URL:
> https://gitpod.io/#HOSTNAME={{FIX_ME}},OTSIM_TAILSCALE_AUTHKEY=tskey-auth-{{FIX_ME}}/https://github.com/patsec/uiuc-farm/tree/module-1
In this branch:
# Connecting Your Turbine to the Wind Farm (module-1)

In this module:

* You will confirm access to the lab’s wind farm.

## Steps for connecting to the wind farm
## Steps for Connecting to the Wind Farm

1. Ensure all containers are running in the Gitpod workspace.
2. Confirm with the lab instructor that your wind turbine is connected to the farm.
3. Feather the turbine blades and confirm with the instructor that they are visible.
2. Confirm with the lab instructor that your wind turbine is connected to the
farm.
3. Feather the turbine blades and confirm with the instructor that they are
visible.

Use the `{{FIX_ME}}` values from the previous branch in the URL below. Then, start the next branch.
Use the `{{FIX_ME}}` values from the previous branch in the URL below. Then,
start the next module.

> There will be a Q&A session at the module’s end. Stop the current Gitpod workspace and deploy the next branch in Gitpod using this URL: https://gitpod.io/HOSTNAME={{FIX_ME}},OTSIM_TAILSCALE_AUTHKEY=tskey-auth-{{FIX_ME}}/https://github.com/patsec/uiuc-farm/tree/branch-02
> There will be a Q&A session at the module’s end. Stop the current Gitpod
> workspace and deploy the next module in Gitpod using this URL:
> https://gitpod.io/#HOSTNAME={{FIX_ME}},OTSIM_TAILSCALE_AUTHKEY=tskey-auth-{{FIX_ME}}/https://github.com/patsec/uiuc-farm/tree/module-2
8 changes: 8 additions & 0 deletions configs/docker/tailscale.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[program:tailscale]
priority=900
command=/usr/bin/tailscale --socket=/tmp/tailscaled.sock up --authkey="%(ENV_OTSIM_TAILSCALE_AUTHKEY)s" --accept-dns=true
autorestart=unexpected
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true

8 changes: 8 additions & 0 deletions configs/docker/tailscaled.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[program:tailscaled]
priority=100
command=/usr/bin/tailscaled --socket=/tmp/tailscaled.sock --state=mem: --statedir=/tmp
autorestart=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true

29 changes: 25 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
version: '3.8'

services:
wireshark:
build:
context: .
dockerfile: ./Dockerfile.tools
image: ghcr.io/patsec/wind-turbine/tools:main
image: ghcr.io/patsec/uiuc-farm/tools:main
init: true
privileged: true # required for capturing traffic on host interfaces
network_mode: host
volumes:
- ./configs/docker/tigervnc-wireshark.conf:/etc/supervisor/conf.d/tigervnc-wireshark.conf
- ./configs/docker/wireshark.conf:/etc/supervisor/conf.d/wireshark.conf
adversary:
build:
context: .
dockerfile: ./Dockerfile.tools
image: ghcr.io/patsec/uiuc-farm/tools:main
init: true
cap_add:
- NET_ADMIN # for Tailscale
volumes:
- /lib/modules:/lib/modules:ro # for Tailscale
- /dev/net/tun:/dev/net/tun # for Tailscale
- ./configs/docker/tigervnc-adversary.conf:/etc/supervisor/conf.d/tigervnc-adversary.conf
- ./configs/docker/tailscaled.conf:/etc/supervisor/conf.d/tailscaled.conf
- ./configs/docker/tailscale.conf:/etc/supervisor/conf.d/tailscale.conf
ports:
- 8090:8080
environment:
- OTSIM_TAILSCALE_AUTHKEY=${OTSIM_TAILSCALE_AUTHKEY} # for Tailscale
hostname: ${HOSTNAME}-adversary # for Tailscale
networks:
vpc:
ipv4_address: 10.11.12.200
main-controller:
image: ghcr.io/patsec/ot-sim/ot-sim:main
init: true
Expand All @@ -23,6 +43,7 @@ services:
- blade-1
- blade-2
- blade-3
- opensearch
volumes:
- /lib/modules:/lib/modules:ro # for Tailscale
- /dev/net/tun:/dev/net/tun # for Tailscale
Expand All @@ -36,7 +57,7 @@ services:
networks:
vpc:
ipv4_address: 10.11.12.100
yaw-controller:
yaw-ctlr:
image: ghcr.io/patsec/ot-sim/ot-sim:main
init: true
depends_on:
Expand Down

0 comments on commit 70dc298

Please sign in to comment.