cultofthepartyparrot.com/cloud-function
John Hobbs 3c4b897a20 Update cloud function for CVE-2020-9283 2023-02-16 11:38:28 -06:00
..
.gcloudignore Move primary branch from master to main. 2021-08-06 12:57:46 -05:00
.golangci.yaml Add Go lint and test to CircleCI 2021-09-28 14:34:59 -05:00
Makefile Move primary branch from master to main. 2021-08-06 12:57:46 -05:00
README.md Add cache clearing cloud-function source code. 2020-01-30 10:12:17 -06:00
example_env.yaml Add cache clearing cloud-function source code. 2020-01-30 10:12:17 -06:00
func.go Fix lint in go function. 2021-09-28 14:34:59 -05:00
func_test.go Move primary branch from master to main. 2021-08-06 12:57:46 -05:00
go.mod Update cloud function for CVE-2020-9283 2023-02-16 11:38:28 -06:00
go.sum Update cloud function for CVE-2020-9283 2023-02-16 11:38:28 -06:00
init.go Add cache clearing cloud-function source code. 2020-01-30 10:12:17 -06:00
jwt.go Add cache clearing cloud-function source code. 2020-01-30 10:12:17 -06:00
jwt_test.go Add cache clearing cloud-function source code. 2020-01-30 10:12:17 -06:00
shared_test.go Move primary branch from master to main. 2021-08-06 12:57:46 -05:00

README.md

Cult of the Party Parrot Cloud Function

The CotPP website is generated and hosted by Netlify. However, it uses a prohibitive amount of bandwidth for that platform.

To have our cake and eat it too, CloudFlare is installed in front of Netlify.

However, the aggressive caching of CloudFlare means we do not get fresh content on new master branch deploys out of the box.

This GCF function is called by a Netlify deploy hook, and purges the CloudFlare cache.

Testing

The function has fair coverage. You can execute the test suite with make test

Deploying

To deploy this for your own Netlify hook needs, you will need a few items.

First, copy example_env.yaml to env.yaml and set the variables inside.

Next, you will need to set two environment variables.

  • FUNCTION_NAME is the name of the function you want in GCP
  • PROJECT_ID is the project in GCP you will be deploying to

With all of this configured, make deploy will get the code up and running.