minio-web

command module
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

github.com/e2fyi/minio-web

godoc dockerhub Docker Repository on Quay GitHub tag (latest SemVer)

A web server proxy for any S3-compatible storage.

Quickstart

Environment variables
# where config file is located
CONFIG_FILE_PATH=configs/config.json

# port for minio-web to listen to
SERVER_PORT=8080
# path to ssl cert and key files
SERVER_SSL_CERT=
SERVER_SLL_KEY=

# endpoint to call for the s3 compatible storage
MINIO_ENDPOINT=s3.amazonaws.com
# access key and secret key
MINIO_ACCESSKEY=
MINIO_SECRETKEY=
# ssl when calling endpoint
MINIO_SECURE=true
# aws s3 bucket region (optional)
MINIO_REGION=

# Extensions #
# bucket to serve if provided (http://minio-web/abc => endpoint/bucketname/abc)
# if not provided (http://minio-web/abc/efg => endpoint/abc/efg) where abc is the bucket
EXT_BUCKETNAME=

# prefix to add to query.
# e.g. EXT_PREFIX=foo/
# query to endpoint/abc -> query EXT_BUCKETNAME/foo/ab
EXT_PREFIX=

# if provided a list of default index files to return
# i.e http://minio-web/abc/ => http://minio-web/abc/index.html
EXT_DEFAULTHTML=index.html,README.md

# if provided, returns a default favicon if backend does not have one.
EXT_FAVICON=assets/favicon.ico

# if set, list the folders inside a folder
EXT_LISTFOLDER=true
# objects that match the glob expression will be listed. e.g. markdown files
EXT_LISTFOLDEROBJECTS=*.{md,html,jpg,jpeg,png,txt}

# if provided, renders any markdown resources as HTML with the template.
# template MUST have a placeholder {{ .Content }}
EXT_MARKDOWNTEMPLATE=assets/md-template.html
Config file
{
  "server": {
    "port": 8080,
    "ssl": {
      "cert": "",
      "key": ""
    }
  },
  "minio": {
    "endpoint": "s3.amazonaws.com",
    "accesskey": "",
    "secretkey": "",
    "secure": false,
    "region": ""
  },
  "ext": {
    "bucketname": "",
    "defaulthtml": "index.html,README.md",
    "favicon": "assets/favicon.ico",
    "markdowntemplate": "assets/md-template.html",
    "listfolder": true,
    "listfolderobjects": "*.{md,html,jpg,jpeg,png,txt}"
  }
}
Run demo locally
# starts a minio server
./scripts/start-minio-server.sh

# starts minio-web service
go run .

Alternatively, with docker compose:

# you can access the minio-store at localhost:9000
# and the minio-web at localhost:8080
docker-compose up -d
Docker image

Because of the pull limits by Dockerhub, image will now available in both Dockerhub and Quay.io.

  • e2fyi/minio-web:<tag>
  • quay.io/e2fyi/minio-web:<tag>

Free tier for docker hub automated build has been discontinued. Until I find time to setup GitHub actions, no new tags will be pushed to docker hub. i.e. All the latest releases can only be found in Quay.io

# build locally
docker build -t e2fyi/minio-web:latest .

# pull from dockerhub
docker pull e2fyi/minio-web:latest

# run docker container
docker run --rm -ti \
    -p 8080:8080 \
    --env-file .envfile \
    e2fyi/minio-web:latest

Kubernetes deployment (Kustomize)

kustomize k8s manifest for minio-web can be found in manifest/.

GoDoc

Documentation

Overview

Package main starts a web server which serve resources in S3 compatible backend with regular HTTP GET.

Directories

Path Synopsis
pkg
app
Package app provides an implementation of a http server app that is extended from core.
Package app provides an implementation of a http server app that is extended from core.
core
Package core provides an extensible core implementation as well as standard handlers for a http server.
Package core provides an extensible core implementation as well as standard handlers for a http server.
ext
Package ext contains a suite of extensions that can be applied on the app.
Package ext contains a suite of extensions that can be applied on the app.
minio
Package minio provides Helper type to initialize minio client, as well as retrieve resources or resource info with a url string.
Package minio provides Helper type to initialize minio client, as well as retrieve resources or resource info with a url string.

Jump to

Keyboard shortcuts

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