• Stars
    star
    138
  • Rank 264,508 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reverse proxy for Google Cloud Storage

gcsproxy

Reverse proxy for Google Cloud Storage.

Description

This is a reverse proxy for Google Cloud Storage for performing limited disclosure (IP address restriction etc...). Gets the URL of the GCS object through its internal API. Therefore, it is possible to make GCS objects private and deliver limited content.

 +---------------------------------------+
 |                Nginx                  |
 |    access control (basic auth/ip)     |
 +-----+---------------------------------+
       |
-----------------------------------------+
       |
       |
+------v-----+          +---------------+
|            |          |               |
|  gcsproxy  | +------> | Google Cloud  |
|            |          |    Storage    |
+------------+          +---------------+

Usage

Usage of gcsproxy:
  -b string
    	Bind address (default "127.0.0.1:8080")
  -c string
    	The path to the keyfile. If not present, client will use your default application credentials.
  -v	Show access log

The gcsproxy routing configuration is shown below.

"/{bucket:[0-9a-zA-Z-_.] +}/{object:. *}"

If you are running gcsproxy on localhost:8080 and you want to access the file gs://test-bucket/your/file/path.txt in GCS via gcsproxy, you can use the URL You can access the file via gcsproxy at the URL http://localhost:8080/test-bucket/your/file/path.txt.

Configurations

Dockerfile example

FROM debian:buster-slim AS build

WORKDIR /tmp
ENV GCSPROXY_VERSION=0.3.1

RUN apt-get update \
    && apt-get install --no-install-suggests --no-install-recommends --yes ca-certificates wget \
    && wget https://github.com/daichirata/gcsproxy/releases/download/v${GCSPROXY_VERSION}/gcsproxy-${GCSPROXY_VERSION}-linux-amd64.tar.gz \
    && tar zxf gcsproxy-${GCSPROXY_VERSION}-linux-amd64.tar.gz \
    && cp ./gcsproxy-${GCSPROXY_VERSION}-linux-amd64/gcsproxy .

FROM gcr.io/distroless/base
COPY --from=build /tmp/gcsproxy /gcsproxy
CMD ["/gcsproxy"]

systemd example

[Unit]
Description=gcsproxy

[Service]
Type=simple
ExecStart=/opt/gcsproxy/gcsproxy -v
ExecStop=/bin/kill -SIGTERM $MAINPID

[Install]
WantedBy = multi-user.target

nginx.conf

upstream gcsproxy {
    server '127.0.0.1:8080';
}

server {
    listen 8081;
    server_name _;

    # Logs
    access_log off;
    error_log /var/log/nginx/gcsproxy.error.log error;

    if ($request_method !~ "GET|HEAD|PURGE") {
        return 405;
    }

    location / {
        proxy_pass http://gcsproxy$uri;
    }
}

More Repositories

1

emacs-rotate

Rotate the layout of emacs.
Emacs Lisp
76
star
2

hammer

🛠 hammer is a command-line tool to schema management for Google Cloud Spanner.
Go
74
star
3

fluent-plugin-gcs

Google Cloud Storage output plugin for Fluentd.
Ruby
42
star
4

vue-sanitize

Whitelist-based HTML sanitizer (sanitize-html) for Vue.js apps.
JavaScript
36
star
5

tetris-rb

Ruby
15
star
6

fluent-plugin-uri-parser

This is a Fluentd plugin to parse uri and query string in log messages.
Ruby
11
star
7

lokka-link_url_replace

Expand the URL, and replace.
Ruby
5
star
8

rurepl

Rurema read-eval-print loop
CoffeeScript
5
star
9

yaml2env

Pass the value from the yaml file to the environment variable.
Go
5
star
10

pjax-sample

http://a-newcomer.com
Ruby
5
star
11

paperclip-gcs

Extends Paperclip with Google Cloud Storage
Ruby
4
star
12

rack-var-dump

rack-var-dump provides a method for debugging like var_dump() of php.
Ruby
4
star
13

vuex-turbolinks

A Turbolinks adapter for Vuex store
JavaScript
4
star
14

lokka-tweet_feed

CMS Lokka update is contributed to Twitter automatically.
Ruby
3
star
15

lokka-static

You will be able to create a static page.
Ruby
3
star
16

octowatcher

See readme for github repository easily
Ruby
3
star
17

lokka-syntax_highlighter

This is a Lokka plugin for source code syntax highlight
JavaScript
3
star
18

secateurs

✂️ Secateurs is a tool to manage Elasticsearch Index Template.
Ruby
2
star
19

press

This is a Theme for Cloud CMS Lokka.
Ruby
2
star
20

lokka-tag_cloud

provide tag cloud
Ruby
2
star
21

rurea

Rurema API
R
2
star
22

ralias

can be defined like the alias of shell
Ruby
2
star
23

lokka-image_manager

Ruby
2
star
24

grace

This is a Theme for Cloud CMS Lokka.
JavaScript
2
star
25

lokka-popular_pages

using google analytics api, to get the most accessed entry for the specified period
Ruby
2
star
26

fluent-logger-go

Fast, structured, async logger for Fluentd in Go.
Go
1
star
27

paperclip-streamio-ffmpeg

Video Transcoder for Paperclip using streamio/streamio-ffmpeg.
Ruby
1
star
28

lokka-theme_helper_loader

Ruby
1
star
29

ding

web server for my learning
Ruby
1
star
30

programmer_clock

JavaScript
1
star
31

trindle

Simple Emacs LISP management extension
Emacs Lisp
1
star
32

node_sample

node.js sample program
JavaScript
1
star
33

swagger-axios

JavaScript
1
star
34

rspec1.3-progress-formatter

RSpec1.3 Formatter of Progress Bar
Ruby
1
star
35

restaurant

chanko sample
JavaScript
1
star
36

keysnail_plugin

keysnail plugin
JavaScript
1
star
37

ap_dark8

8色 Terminal 用の色設定と vim 用の色設定の自作
Vim Script
1
star
38

sicp

my learning
Scheme
1
star
39

post.it

Ruby
1
star
40

vimrc

my vim config
Vim Script
1
star
41

cstrike16-server-list-jp

source of cstrike-jp.heroku.com
Ruby
1
star
42

emacs-get-wild

Emacs Lisp
1
star