Meetup Google OAuth Proxy

A nginx docker image for oauthing with google and
proxing some service through it. This is extended
from the very awesome CloudFlare project of the
same topic: https://github.com/cloudflare/nginx-google-oauth
Usage
Required env vars from the CloudFlare base are:
- NGO_CLIENT_ID
- NGO_CLIENT_SECRET
- NGO_TOKEN_SECRET
One from us:
The project also expects certificates to be mounted as:
/etc/nginx/certs/tls.crt
/etc/nginx/certs/tls.key
Or you can have it generate self signed certificates on startup by setting
example: openssl req -new -nodes -x509 -subj “/C=US/ST=New York/L=New York/O=IT/CN=*.domain.com” -days 365 -out /etc/nginx/certs/tls.crt -keyout /etc/nginx/certs/tls.key -extensions v3_ca
This proxy redirects http to https.
Base image
The image is built on the official nginx:1.30.7-alpine image. ngx_http_lua_module
and its ngx_devel_kit dependency are compiled as dynamic modules in a build stage,
and the CloudFlare OAuth Lua scripts are vendored under lua/. The upstream
cloudflare/nginx-google-oauth image this project used to extend is unmaintained
and pinned nginx 1.10.3.
To bump nginx, change NGINX_VERSION in the Dockerfile; the Lua module is rebuilt
against the same version and configure arguments.
Local Development and Testing
- Copy
secrets.env.template to secrets.env (gitignored) and populate environment variables. Secrets can be found in AWS Parameter Store under /classic/admin namespace, other values can be taken from the production CloudFormation stack gauth-proxy-prod
- Build and run a Docker container
$ make package
$ docker run --rm -p 443:443 --env-file secrets.env -it <image_id>
- Determine an IP address of the container by running
docker inspect <container_id>
- Add an alias to local
/etc/hosts
<container_ip> admin.meetup.com
- Open
https://admin.meetup.com/admin in a browser, dismiss the warning about an invalid certficate. If Chrome does not display ‘proceed’ option, type thisisunsafe on your keyboard to proceed.
- Sign in with your Meetup Google account. You should be redirected to the Meetup Admin website.
评论