Skip to content

Commit

Permalink
web: Removing dependency for gpg and downloading assets.
Browse files Browse the repository at this point in the history
Assets are vendorized from now on and updated for each release.
  • Loading branch information
Harshavardhana committed Feb 23, 2016
1 parent 997141d commit 2181003
Show file tree
Hide file tree
Showing 11 changed files with 945 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ site/
/.idea/
/Minio.iml
**/access.log
ui-assets.go
ui-assets.asc
build
isa-l
isa-l
vendor/**/*.js
vendor/**/*.json
10 changes: 0 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ DOCKER_BIN := $(shell which docker)
DOCKER_LDFLAGS := '$(LDFLAGS) -extldflags "-static"'
BUILD_LDFLAGS := '$(LDFLAGS)'
TAG := latest
UI_ASSETS := ui-assets.go
UI_ASSETS_ARMOR := ui-assets.asc

HOST ?= $(shell uname)
CPU ?= $(shell uname -m)
Expand Down Expand Up @@ -69,12 +67,6 @@ getdeps: checkdeps checkgopath
@go get -u github.com/remyoudompheng/go-misc/deadcode && echo "Installed deadcode:"
@go get -u github.com/client9/misspell/cmd/misspell && echo "Installed misspell:"

$(UI_ASSETS):
@curl -s https://dl.minio.io/assets/server/ui/$(UI_ASSETS_ARMOR) 2>&1 > $(UI_ASSETS_ARMOR) && echo "Downloading signature file $(UI_ASSETS_ARMOR) for verification:"
@gpg --batch --no-tty --yes --keyserver pgp.mit.edu --recv-keys F9AAC728 2>&1 > /dev/null && echo "Importing public key:"
@curl -s https://dl.minio.io/assets/server/ui/$@ 2>&1 > $@ && echo "Downloading UI assets file $@:"
@gpg --batch --no-tty --verify $(UI_ASSETS_ARMOR) $@ 2>&1 > /dev/null && echo "Verifying signature of downloaded assets."

verifiers: getdeps vet fmt lint cyclo spelling

vet:
Expand Down Expand Up @@ -151,7 +143,5 @@ clean:
@echo "Cleaning up all the generated files:"
@rm -fv minio minio.test cover.out
@find . -name '*.test' | xargs rm -fv
@rm -fv ui-assets.go
@rm -fv ui-assets.asc
@rm -rf isa-l
@rm -rf build
6 changes: 0 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ environment:
GOPATH: c:\gopath
GO_EXTLINK_ENABLED: 0
GO15VENDOREXPERIMENT: 1
UI_ASSETS: ui-assets.go
UI_ASSETS_ARMOR: ui-assets.asc

# scripts that run after cloning repository
install:
Expand All @@ -36,10 +34,6 @@ install:

# to run your custom scripts instead of automatic MSBuild
build_script:
- curl -fsSL -o ui-assets.go https://dl.minio.io/assets/server/ui/%UI_ASSETS%
- curl -fsSL -o ui-assets.asc https://dl.minio.io/assets/server/ui/%UI_ASSETS_ARMOR%
- gpg --batch --no-tty --yes --keyserver pgp.mit.edu --recv-keys F9AAC728
- gpg --batch --no-tty --verify %UI_ASSETS_ARMOR% %UI_ASSETS%
- go generate github.com/minio/minio/pkg/crypto/sha1
- go test .
- go test -race .
Expand Down
11 changes: 0 additions & 11 deletions buildscripts/checkdeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ _init() {
GIT_VERSION="1.0"
YASM_VERSION="1.2.0"
CURL_VERSION="7.12.0"
GPG_VERSION="1.3"
GO_VERSION="1.5.1"
OSX_VERSION="10.8"
UNAME=$(uname -sm)
Expand Down Expand Up @@ -184,16 +183,6 @@ check_deps() {
MISSING="${MISSING} git"
fi

check_version "$(env gpg --version 2>/dev/null | sed -e 's/^.* \([0-9.\].*\).*$/\1/' -e 's/^\([0-9.\]*\).*/\1/g' | head -1)" "${GPG_VERSION}"
if [ $? -ge 2 ]; then
MISSING="${MISSING} gpg"
fi

check_version "$(env curl --version 2>/dev/null | sed -e 's/^.* \([0-9.\].*\).*$/\1/' -e 's/^\([0-9.\]*\).*/\1/g' | head -1)" "${CURL_VERSION}"
if [ $? -ge 2 ]; then
MISSING="${MISSING} curl"
fi

check_version "$(env yasm --version 2>/dev/null | sed 's/^.* \([0-9.]*\).*$/\1/' | head -1)" "${YASM_VERSION}"
if [ $? -ge 2 ]; then
MISSING="${MISSING} yasm(${YASM_VERSION})"
Expand Down
13 changes: 13 additions & 0 deletions routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ import (
"net"
"net/http"

"github.com/elazarl/go-bindata-assetfs"
router "github.com/gorilla/mux"
jsonrpc "github.com/gorilla/rpc/v2"
"github.com/gorilla/rpc/v2/json2"
"github.com/minio/minio-go"
"github.com/minio/minio/pkg/fs"
"github.com/minio/minio/pkg/probe"
"github.com/minio/minio/pkg/s3/signature4"
"github.com/minio/miniobrowser"
)

// storageAPI container for S3 compatible API.
Expand Down Expand Up @@ -67,6 +69,17 @@ func (h indexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.handler.ServeHTTP(w, r)
}

const assetPrefix = "production"

func assetFS() *assetfs.AssetFS {
return &assetfs.AssetFS{
Asset: miniobrowser.Asset,
AssetDir: miniobrowser.AssetDir,
AssetInfo: miniobrowser.AssetInfo,
Prefix: assetPrefix,
}
}

// registerAPIHandlers - register all the handlers to their respective paths
func registerAPIHandlers(mux *router.Router, a storageAPI, w *webAPI) {
// Minio rpc router
Expand Down
84 changes: 84 additions & 0 deletions vendor/github.com/minio/miniobrowser/INSTALLGO.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2181003

Please sign in to comment.