Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orsinium-labs/gcserve
Serve files from a GCP bucket
https://github.com/orsinium-labs/gcserve
gcp gcs go golang google google-cloud pypi static-server static-site
Last synced: about 2 months ago
JSON representation
Serve files from a GCP bucket
- Host: GitHub
- URL: https://github.com/orsinium-labs/gcserve
- Owner: orsinium-labs
- License: mit
- Created: 2021-04-15T08:50:47.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-04-15T08:52:14.000Z (over 3 years ago)
- Last Synced: 2024-06-19T04:17:25.981Z (7 months ago)
- Topics: gcp, gcs, go, golang, google, google-cloud, pypi, static-server, static-site
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GCServe
Serve files from a [Google Cloud Storage](https://cloud.google.com/storage) bucket.
There are already a few alternatives (namely, [gcsproxy](https://github.com/daichirata/gcsproxy) and [weasel](https://github.com/google/weasel)). Also, GCP allows to [make all bucket files public](https://cloud.google.com/storage/docs/hosting-static-website). The main difference is that GCServe provides [basic HTTP auth](https://en.wikipedia.org/wiki/Basic_access_authentication).
## Using as PyPI server
A possible use-case for GCServe is to host a private [PyPI](https://pypi.org/) instance. All you need is:
1. Download packages from pypi.org using [pip download](https://pip.pypa.io/en/stable/reference/pip_download/).
1. Upload packages into the bucket using [gsutil rsync](https://cloud.google.com/storage/docs/gsutil/commands/rsync).
1. Generate static index using [dumb-pypi](https://github.com/chriskuehl/dumb-pypi).
1. Serve the bucket with GCServe.This pipeline is much faster, smaller, and more reliable than a more dynamic solution, like [pypicloud](https://github.com/stevearc/pypicloud).
## Usage
Build and run using [Go](https://golang.org/) compiler:
```bash
go build -o gcserve.bin .
./gcserve.bin \
--bucket=test-bucket \
--username=test-user \
--password=test-pass \
--debug
```Build and run using [Docker](https://www.docker.com/):
```sh
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
```