ayaka14732 / ChatGPTAPIFree

A simple and open-source proxy API that allows you to access OpenAI's ChatGPT API for free!
Creative Commons Zero v1.0 Universal
3.3k stars 774 forks source link

Google Cloud Armor Rules #24

Open argidenise opened 1 year ago

argidenise commented 1 year ago

Hi Ayaka,

I want to self-host my own API endpoint, please kindly share what Google Cloud Armor rules did you use?

Thank you.

ayaka14732 commented 1 year ago

Note that the second and the third rules are not safe at all, because simply changing the "User-Agent" header will bypass them. However, the rules are set to show that developers should use this API appropriately and should not use programming methods to call this API on a large scale. Otherwise the free API will be exhausted very quickly.

argidenise commented 1 year ago

Thank you! I have successfully created the rules, may I know how to connect this to my Cloud Run? I have been trying :(

ayaka14732 commented 1 year ago

Yes, I also think the setup is confusing :(

  1. In Load balancing, create a load balancer.

  1. In Cloud Armor - "Apply policy to targets", apply to the load balancer we've just created.

If you are willing to contribute, feel free to create a PR with the steps for the configuration!