CTFd on appengine flex setup so that you can get the sp00dy autoscaling.
- Create a memorystore and cloud sql instances on google cloud and set up the connection information into the env vars
- Create an account with an email provider such as mailgun or amazon ses, and set the details into the env vars
- Make sure memorystore and cloudsql are on the same VPC, and change the setting under network.name to your VPC
- Set up the Google Cloud Storage bucket for hosting the challenge files. You need to first enable Interoperability
mode in order to get the S3 compatible key.
- Make sure the permissions for the bucket are also public. Grant
Storage Legacy Object Reader
toallUsers
on the bucket settings page.
- Make sure the permissions for the bucket are also public. Grant
- Run the below command
gcloud app deploy
You can place this setup behind a Google Cloud load balancer and CDN for caching of static files, which is what we did in our setup.
# create the serverless network endpoint group (NEG)
gcloud beta compute network-endpoint-groups create ctfd-gae-neg --network-endpoint-type serverless \
--app-engine-service=default --region australia-southeast1
# create the backend
gcloud beta compute backend-services add-backend ctfd-gae-backend \
--global \
--network-endpoint-group=ctfd-gae-neg \
--network-endpoint-group-region=australia-southeast1
We then used the GUI to create our load balancer with the above backend. Check out https://cloud.google.com/iap/docs/load-balancer-howto for more information.