Nova Resource:Google-api-proxy
Project Name | google-api-proxy |
---|---|
Details, admins/members |
openstack-browser |
Monitoring |
Google-api-proxy provides a static IP for communication with the Google Custom Search API.
Usage
- Get the Wikimedia Google API key from Community Tech
- Use
https://google-api-proxy.wmflabs.org/
instead ofhttps://www.googleapis.com/
when interacting with Google's Custom Search JSON/Atom API.
How it works
https://google-api-proxy.wmflabs.org
is a Cloud VPS web proxy pointing at an instance in the google-api-proxy project with a static IP address. The instance is running an Nginx web server configured as a reverse proxy. All HTTP requests sent to this proxy will be relayed to https://www.googleapis.com
and the upstream response will be provided back to the requesting client. Details of the Nginx configuration are available in our Puppet repo's role::labs::google_api_proxy module.
API keys using this proxy will need to whitelist the IP address 185.15.56.54
in the Google developer console.
Google OCR for Wikisource uses a similar proxy at https://googlevision-api-proxy.wmflabs.org/
that allows access to the Google Vision API.
Creating a new VM
- Create a new VM in Horizon using the latest Debian with the "g4.cores1.ram1.disk20" flavor.
- In Horizon, browse to the new instance and then to the "Puppet configuration" tab.
- Add
role::labs::google_api_proxy
as a Puppet Class, and add the following to the Hiera Config:role::labs::google_api_proxy::instances: google-api-proxy.wmflabs.org: default: true proxied: https://www.googleapis.com googlevision-api-proxy.wmflabs.org: proxied: https://vision.googleapis.com
- Force a puppet run on the new instance with
sudo -i puppet agent -tv
and make sure that everything applied properly. - Detach the floating IP and associate it with the new VM
- Update the google-api-proxy.wmflabs.org and googlevision-api-proxy.wmflabs.org web proxies to point to the new instance.
- Stop the old instance
- Test both proxies
- Delete the old instance
- Profit!
Tools using the proxy
- Wikimedia OCR (when using the Google engine)
- Earwig's copyvio detector (who's API is used by CopyPatrol)
- Kotz' bot "BotHasava"
Server admin log
2024-06-25
- 13:33 taavi@cloudcumin1001: END (PASS) - Cookbook wmcs.openstack.migrate_project_to_ovs (exit_code=0)
- 13:32 taavi@cloudcumin1001: START - Cookbook wmcs.openstack.migrate_project_to_ovs
2016-09-13
- 16:14 bd808: Rebooting google-api-proxy-02.google-api-proxy.eqiad.wmflabs for T141673
2016-09-06
- 19:41 bd808: Puppet disabled on google-api-proxy-02 until https://gerrit.wikimedia.org/r/#/c/308780/ is merged
- 17:15 bd808: Replacing manual config with role::labs::google_api_proxy
2016-06-02
- 23:17 YuviPanda: increase floating IP quota to 2 due to ... (more)