Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 1.27 KB

File metadata and controls

26 lines (18 loc) · 1.27 KB

Setup guide

Set up the challenge

  1. Create a new project on GCP and note down the project_id
  2. Download the gcloud sdk on your machine and run gcloud auth application-default login
  3. Update terraform/terraform.tfvars with the project_id from step 1 and give two bucket names that haven't been used yet
  4. Update bot-src/index.js and update line 25 and 26 with the bucket names from step 3

Running the terraform

  1. Move into the terraform folder and run ./terraform init
  2. Run ./terraform plan and verify everything is ok
  3. Run ./terraform apply and type yes to create the infrastructure
  4. If some fail wait a few minutes and run ./terraform apply again to wait for the API's to be enabled properly

These steps are so the token isn't leaked (best effort)

  1. SSH into the machine with gcloud compute ssh discord-bot
  2. Run docker ps and note the name of the container
  3. Run docker attach <container_name> and then paste the Discord Bot Token in and hit enter
  4. CTRL+P, CTRL+Q to detach and then you can exit

Disable SSH on the machine

  1. Change line 107 in terraform.tf to true and run ./terraform apply to disallow ssh on the machine (DO THIS ONLY ONCE YOU HAVE CONFIRMED THE CHALLENGE IS UP AND RUNNING GOODLY)