gcserve

command module
v0.0.0-...-0f1382e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 12 Imported by: 0

README

GCServe

Serve files from a Google Cloud Storage bucket.

There are already a few alternatives (namely, gcsproxy and weasel). Also, GCP allows to make all bucket files public. The main difference is that GCServe provides basic HTTP auth.

Using as PyPI server

A possible use-case for GCServe is to host a private PyPI instance. All you need is:

  1. Download packages from pypi.org using pip download.
  2. Upload packages into the bucket using gsutil rsync.
  3. Generate static index using dumb-pypi.
  4. Serve the bucket with GCServe.

This pipeline is much faster, smaller, and more reliable than a more dynamic solution, like pypicloud.

Usage

Build and run using Go compiler:

go build -o gcserve.bin .
./gcserve.bin \
    --bucket=test-bucket \
    --username=test-user \
    --password=test-pass \
    --debug

Build and run using Docker:

sudo docker build -t gcserve:latest .
sudo docker run \
    -v /path/to/google/credentials.json:/mnt/cred.json \
    -it gcserve:latest \
    --bucket=test-bucket \
    --username=test-user \
    --password=test-pass \
    --debug

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL