diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 9362fd790..ca9a19c77 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -26,8 +26,8 @@ ## Your Environment -* Version used: +* Version used (`minio version`): * Environment name and version (e.g. nginx 1.9.1): * Server type and version: -* Operating System and version: +* Operating System and version (`uname -a`): * Link to your project: diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000000000..8a3ae17d7 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,4 @@ +{ + "asi": true, + "esnext": true +} diff --git a/Dockerfile b/Dockerfile index cfe7c39b2..4fe0ccd8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,5 +15,13 @@ RUN \ rm -rf /go/pkg /go/src /usr/local/go && apk del .build-deps EXPOSE 9000 -ENTRYPOINT ["minio"] + +COPY buildscripts/docker-entrypoint.sh /usr/bin/ + +RUN chmod +x /usr/bin/docker-entrypoint.sh + +ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"] + VOLUME ["/export"] + +CMD ["minio"] diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 673d7ac0f..f43469913 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -15,5 +15,13 @@ RUN \ rm -rf /go/pkg /go/src /usr/local/go && apk del .build-deps EXPOSE 9000 -ENTRYPOINT ["minio"] + +COPY buildscripts/docker-entrypoint.sh /usr/bin/ + +RUN chmod +x /usr/bin/docker-entrypoint.sh + +ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"] + VOLUME ["/export"] + +CMD ["minio"] diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 3f363bb25..5fa43d9b8 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -15,5 +15,13 @@ RUN \ rm -rf /go/pkg /go/src /usr/local/go && apk del .build-deps EXPOSE 9000 -ENTRYPOINT ["minio"] + +COPY buildscripts/docker-entrypoint.sh /usr/bin/ + +RUN chmod +x /usr/bin/docker-entrypoint.sh + +ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"] + VOLUME ["/export"] + +CMD ["minio"] diff --git a/Makefile b/Makefile index f1aa98b6e..eed35762e 100644 --- a/Makefile +++ b/Makefile @@ -56,42 +56,55 @@ endif all: install checks: - @echo "Checking deps:" + @echo -n "Check deps: " @(env bash $(PWD)/buildscripts/checkdeps.sh) + @echo "Done." + @echo -n "Checking project is in GOPATH: " @(env bash $(PWD)/buildscripts/checkgopath.sh) + @echo "Done." getdeps: checks - @echo "Installing golint:" && go get -u github.com/golang/lint/golint - @echo "Installing gocyclo:" && go get -u github.com/fzipp/gocyclo - @echo "Installing deadcode:" && go get -u github.com/remyoudompheng/go-misc/deadcode - @echo "Installing misspell:" && go get -u github.com/client9/misspell/cmd/misspell - @echo "Installing ineffassign:" && go get -u github.com/gordonklaus/ineffassign + @echo -n "Installing golint: " && go get -u github.com/golang/lint/golint + @echo "Done." + @echo -n "Installing gocyclo: " && go get -u github.com/fzipp/gocyclo + @echo "Done." + @echo -n "Installing deadcode: " && go get -u github.com/remyoudompheng/go-misc/deadcode + @echo "Done." + @echo -n "Installing misspell: " && go get -u github.com/client9/misspell/cmd/misspell + @echo "Done." + @echo -n "Installing ineffassign: " && go get -u github.com/gordonklaus/ineffassign + @echo "Done." verifiers: vet fmt lint cyclo spelling vet: - @echo "Running $@:" - @go vet github.com/minio/minio/cmd/... - @go vet github.com/minio/minio/pkg/... + @echo -n "Running $@: " + @go tool vet -atomic -bool -copylocks -nilfunc -printf -shadow -rangeloops -unreachable -unsafeptr -unusedresult cmd + @go tool vet -atomic -bool -copylocks -nilfunc -printf -shadow -rangeloops -unreachable -unsafeptr -unusedresult pkg + @echo "Done." fmt: - @echo "Running $@:" + @echo -n "Running $@: " @gofmt -s -l cmd @gofmt -s -l pkg + @echo "Done." lint: - @echo "Running $@:" + @echo -n "Running $@: " @${GOPATH}/bin/golint -set_exit_status github.com/minio/minio/cmd... @${GOPATH}/bin/golint -set_exit_status github.com/minio/minio/pkg... + @echo "Done." ineffassign: - @echo "Running $@:" + @echo -n "Running $@: " @${GOPATH}/bin/ineffassign . + @echo "Done." cyclo: - @echo "Running $@:" + @echo -n "Running $@: " @${GOPATH}/bin/gocyclo -over 100 cmd @${GOPATH}/bin/gocyclo -over 100 pkg + @echo "Done." build: getdeps verifiers $(UI_ASSETS) @@ -104,18 +117,21 @@ spelling: @${GOPATH}/bin/misspell -error `find docs/` test: build - @echo "Running all minio testing:" + @echo -n "Running all minio testing: " @go test $(GOFLAGS) . @go test $(GOFLAGS) github.com/minio/minio/cmd... @go test $(GOFLAGS) github.com/minio/minio/pkg... + @echo "Done." coverage: build - @echo "Running all coverage for minio:" + @echo -n "Running all coverage for minio: " @./buildscripts/go-coverage.sh + @echo "Done." gomake-all: build - @echo "Installing minio:" + @echo -n "Installing minio at $(GOPATH)/bin/minio: " @go build --ldflags $(BUILD_LDFLAGS) -o $(GOPATH)/bin/minio + @echo "Done." pkg-add: ${GOPATH}/bin/govendor add $(PKG) @@ -138,7 +154,8 @@ experimental: verifiers @MINIO_RELEASE=EXPERIMENTAL ./buildscripts/build.sh clean: - @echo "Cleaning up all the generated files:" + @echo -n "Cleaning up all the generated files: " @find . -name '*.test' | xargs rm -fv @rm -rf build @rm -rf release + @echo "Done." diff --git a/README.md b/README.md index 38d3e9fc0..842214db4 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Install minio packages using [Homebrew](http://brew.sh/) brew install minio/stable/minio minio server ~/Photos ``` +Note: If you are upgrading minio on macOS, please see instructions [here](https://github.com/minio/minio/blob/master/docs/minio_homebrew.md). ### Binary Download | Platform| Architecture | URL| @@ -40,11 +41,11 @@ chmod 755 minio ### Binary Download | Platform| Architecture | URL| | ----------| -------- | ------| -|GNU/Linux|64-bit Intel|https://dl.minio.io/server/minio/release/linux-amd64/minio| -||32-bit Intel|https://dl.minio.io/server/minio/release/linux-386/minio| -||32-bit ARM|https://dl.minio.io/server/minio/release/linux-arm/minio| -||64-bit ARM|https://dl.minio.io/server/minio/release/linux-arm64/minio| -||32-bit ARMv6|https://dl.minio.io/server/minio/release/linux-arm6vl/minio| +|GNU/Linux|64-bit Intel|https://dl.minio.io/server/minio/release/linux-amd64/minio | +| |32-bit Intel|https://dl.minio.io/server/minio/release/linux-386/minio | +| |32-bit ARM|https://dl.minio.io/server/minio/release/linux-arm/minio | +| |64-bit ARM|https://dl.minio.io/server/minio/release/linux-arm64/minio | +| |32-bit ARMv6|https://dl.minio.io/server/minio/release/linux-arm6vl/minio | ```sh chmod +x minio ./minio server ~/Photos @@ -54,32 +55,38 @@ chmod +x minio ### Binary Download | Platform| Architecture | URL| | ----------| -------- | ------| -|Microsoft Windows|64-bit|https://dl.minio.io/server/minio/release/windows-amd64/minio.exe| -||32-bit|https://dl.minio.io/server/minio/release/windows-386/minio.exe| +|Microsoft Windows|64-bit|https://dl.minio.io/server/minio/release/windows-amd64/minio.exe | +| |32-bit|https://dl.minio.io/server/minio/release/windows-386/minio.exe | ```sh minio.exe server D:\Photos ``` ## FreeBSD +### Port +Install minio packages using [pkg](https://github.com/freebsd/pkg) + +```sh +pkg install minio +sysrc minio_enable=yes +sysrc minio_disks=/home/user/Photos +service minio start +``` + ### Binary Download | Platform| Architecture | URL| | ----------| -------- | ------| -|FreeBSD|64-bit|https://dl.minio.io/server/minio/release/freebsd-amd64/minio| +|FreeBSD|64-bit|https://dl.minio.io/server/minio/release/freebsd-amd64/minio | ```sh chmod 755 minio ./minio server ~/Photos ``` -You can run Minio on FreeBSD with FreeNAS storage-backend - see [here](https://docs.minio.io/docs/how-to-run-minio-in-freenas) for more details. - ## Install from Source Source installation is only intended for developers and advanced users. If you do not have a working Golang environment, please follow [How to install Golang](https://docs.minio.io/docs/how-to-install-golang). ```sh - go get -u github.com/minio/minio - ``` ## Test using Minio Browser diff --git a/browser/.babelrc b/browser/.babelrc index 9cd3d553f..f9e96ea25 100644 --- a/browser/.babelrc +++ b/browser/.babelrc @@ -1,8 +1,9 @@ { - "presets": [ - "es2015", - "react" - ], - - "plugins": ["transform-object-rest-spread"] -} + "presets": [ + "es2015", + "react" + ], + "plugins": [ + "transform-object-rest-spread" + ] +} \ No newline at end of file diff --git a/browser/app/index.js b/browser/app/index.js index 26a1cc1d3..e0a0a6e11 100644 --- a/browser/app/index.js +++ b/browser/app/index.js @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import 'babel-polyfill' import './less/main.less' @@ -44,7 +45,6 @@ import Web from './js/web' window.Web = Web import storage from 'local-storage-fallback' - const store = applyMiddleware(thunkMiddleware)(createStore)(reducer) const Browse = connect(state => state)(_Browse) const Login = connect(state => state)(_Login) diff --git a/browser/app/js/actions.js b/browser/app/js/actions.js index a39113dc6..7147ec0fe 100644 --- a/browser/app/js/actions.js +++ b/browser/app/js/actions.js @@ -26,6 +26,8 @@ export const SET_BUCKETS = 'SET_BUCKETS' export const ADD_BUCKET = 'ADD_BUCKET' export const SET_VISIBLE_BUCKETS = 'SET_VISIBLE_BUCKETS' export const SET_OBJECTS = 'SET_OBJECTS' +export const APPEND_OBJECTS = 'APPEND_OBJECTS' +export const RESET_OBJECTS = 'RESET_OBJECTS' export const SET_STORAGE_INFO = 'SET_STORAGE_INFO' export const SET_SERVER_INFO = 'SET_SERVER_INFO' export const SHOW_MAKEBUCKET_MODAL = 'SHOW_MAKEBUCKET_MODAL' @@ -240,15 +242,28 @@ export const setVisibleBuckets = visibleBuckets => { } } -export const setObjects = (objects, marker, istruncated) => { +const appendObjects = (objects, marker, istruncated) => { return { - type: SET_OBJECTS, + type: APPEND_OBJECTS, objects, marker, istruncated } } +export const setObjects = (objects) => { + return { + type: SET_OBJECTS, + objects, + } +} + +export const resetObjects = () => { + return { + type: RESET_OBJECTS + } +} + export const setCurrentBucket = currentBucket => { return { type: SET_CURRENT_BUCKET, @@ -316,7 +331,7 @@ export const listObjects = () => { object.name = object.name.replace(`${currentPath}`, ''); return object }) - dispatch(setObjects(objects, res.nextmarker, res.istruncated)) + dispatch(appendObjects(objects, res.nextmarker, res.istruncated)) dispatch(setPrefixWritable(res.writable)) dispatch(setLoadBucket('')) dispatch(setLoadPath('')) @@ -337,7 +352,7 @@ export const listObjects = () => { export const selectPrefix = prefix => { return (dispatch, getState) => { const {currentBucket, web} = getState() - dispatch(setObjects([], "", false)) + dispatch(resetObjects()) dispatch(setLoadPath(prefix)) web.ListObjects({ bucketName: currentBucket, @@ -352,7 +367,7 @@ export const selectPrefix = prefix => { object.name = object.name.replace(`${prefix}`, ''); return object }) - dispatch(setObjects( + dispatch(appendObjects( objects, res.nextmarker, res.istruncated diff --git a/browser/app/js/components/Browse.js b/browser/app/js/components/Browse.js index 85550ccb6..82acbc1b5 100644 --- a/browser/app/js/components/Browse.js +++ b/browser/app/js/components/Browse.js @@ -227,7 +227,12 @@ export default class Browse extends React.Component { removeObject() { const {web, dispatch, currentPath, currentBucket, deleteConfirmation, checkedObjects} = this.props - let objects = checkedObjects.length > 0 ? checkedObjects : [deleteConfirmation.object] + let objects = [] + if (checkedObjects.length > 0) { + objects = checkedObjects.map(obj => `${currentPath}${obj}`) + } else { + objects = [deleteConfirmation.object] + } web.RemoveObject({ bucketname: currentBucket, @@ -464,11 +469,11 @@ export default class Browse extends React.Component {