https://github.com/afiore/gcs-proxy
Minimal web app to serve GCP storage objects via HTTP
https://github.com/afiore/gcs-proxy
Last synced: about 1 year ago
JSON representation
Minimal web app to serve GCP storage objects via HTTP
- Host: GitHub
- URL: https://github.com/afiore/gcs-proxy
- Owner: afiore
- Created: 2020-05-07T14:51:38.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-05T12:41:21.000Z (about 6 years ago)
- Last Synced: 2023-03-11T02:19:12.593Z (over 3 years ago)
- Language: Go
- Size: 10.4 MB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GCS store Proxy
A minimal web app to serve static assets stored in Google Clould storage buckets via HTTP.
## Rationale
I ended up writing this as I couldn't find a viable way to expose GCS objects via HTTP while at the same time
enforcing some form of authentication/authorisation. Hence I have resorted to writing a simple app to proxy HTTP requests
to one or several Google cloud storage bucket while restricting access to only members of a given domain/organisation using Google Auth.
## Building and running
```bash
# Build the executable
go build -o bin/gcs-proxy main/main.go
# running supplying the configuration file as it's sole argument
./bin/gcs-proxy config.toml
# Build docker image
docker build -t afiore/gcs-proxy:latest .
# Run containerized gcs-proxy making sure you mount a volume with the .toml file e.g.
docker run --rm --volume $(pwd):/tmp afiore/gcs-proxy:latest /tmp/config.toml
# supply your Google service account file and deploy the app through the provided Helm chart
GCP_SA=$(cat /path/to/my/gcp_sa.json|base64 -w 0)
helm install gcs-proxy charts/gcs-proxy/ --set gcp_sa_base64=$GCP_SA --set gcs_proxy.oauth.client_id=$CLIENT_ID --set gcs_proxy.oauth.client_secret=$CLIENT_SECRET --set gcs_proxy.oauth.session_secret=$SESSION_SECRET
```
## Configuration
The program expects a few mandatory configuration parameters to be supplied a `.toml` file.
Please refer to `config.toml` for a sample of the available configurable parameters.