diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 44094969a..9576395db 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -51,4 +51,3 @@ jobs: make crosscompile make verify make verify-healing - cd browser && npm install && npm run test && cd .. diff --git a/.nancy-ignore b/.nancy-ignore index 772b01620..58a249af8 100644 --- a/.nancy-ignore +++ b/.nancy-ignore @@ -1 +1,4 @@ -CVE-2020-26160 \ No newline at end of file +CVE-2020-26160 +CVE-2020-15136 +CVE-2020-15115 +CVE-2020-15114 diff --git a/README.md b/README.md index 1c61406d4..f53d97c30 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Run the following command to run the latest stable image of MinIO on a Docker co docker run -p 9000:9000 minio/minio server /data ``` -The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Browser, an embedded -web-based object browser built into MinIO Server. Point a web browser running on the host machine to http://127.0.0.1:9000 and log in with the +The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Console, an embedded +object browser built into MinIO Server. Point a web browser running on the host machine to http://127.0.0.1:9000 and log in with the root credentials. You can use the Browser to create buckets, upload objects, and browse the contents of the MinIO server. You can also connect using any S3-compatible tool, such as the MinIO Client `mc` commandline tool. See @@ -45,7 +45,7 @@ Run the following command to run the bleeding-edge image of MinIO on a Docker co docker run -p 9000:9000 minio/minio:edge server /data ``` -The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Browser, an embedded +The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Console, an embedded web-based object browser built into MinIO Server. Point a web browser running on the host machine to http://127.0.0.1:9000 and log in with the root credentials. You can use the Browser to create buckets, upload objects, and browse the contents of the MinIO server. @@ -82,7 +82,7 @@ brew uninstall minio brew install minio/stable/minio ``` -The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Browser, an embedded +The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Console, an embedded web-based object browser built into MinIO Server. Point a web browser running on the host machine to http://127.0.0.1:9000 and log in with the root credentials. You can use the Browser to create buckets, upload objects, and browse the contents of the MinIO server. @@ -100,7 +100,7 @@ chmod +x minio ./minio server /data ``` -The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Browser, an embedded +The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Console, an embedded web-based object browser built into MinIO Server. Point a web browser running on the host machine to http://127.0.0.1:9000 and log in with the root credentials. You can use the Browser to create buckets, upload objects, and browse the contents of the MinIO server. @@ -130,7 +130,7 @@ The following table lists supported architectures. Replace the `wget` URL with t | 64-bit PowerPC LE (ppc64le) | https://dl.min.io/server/minio/release/linux-ppc64le/minio | | IBM Z-Series (S390X) | https://dl.min.io/server/minio/release/linux-s390x/minio | -The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Browser, an embedded +The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Console, an embedded web-based object browser built into MinIO Server. Point a web browser running on the host machine to http://127.0.0.1:9000 and log in with the root credentials. You can use the Browser to create buckets, upload objects, and browse the contents of the MinIO server. @@ -158,7 +158,7 @@ Use the following command to run a standalone MinIO server on the Windows host. minio.exe server D:\ ``` -The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Browser, an embedded +The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Console, an embedded web-based object browser built into MinIO Server. Point a web browser running on the host machine to http://127.0.0.1:9000 and log in with the root credentials. You can use the Browser to create buckets, upload objects, and browse the contents of the MinIO server. @@ -190,7 +190,7 @@ Use the following commands to compile and run a standalone MinIO server from sou GO111MODULE=on go install github.com/minio/minio@latest ``` -The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Browser, an embedded +The MinIO deployment starts using default root credentials `minioadmin:minioadmin`. You can test the deployment using the MinIO Console, an embedded web-based object browser built into MinIO Server. Point a web browser running on the host machine to http://127.0.0.1:9000 and log in with the root credentials. You can use the Browser to create buckets, upload objects, and browse the contents of the MinIO server. @@ -270,10 +270,12 @@ The above statement is also valid for all gateway backends. # Test MinIO Connectivity -## Test using MinIO Browser +## Test using MinIO Console MinIO Server comes with an embedded web based object browser. Point your web browser to http://127.0.0.1:9000 to ensure your server has started successfully. -![Screenshot](https://github.com/minio/minio/blob/master/docs/screenshots/minio-browser.png?raw=true) +| Dashboard | Creating a bucket | +| ------------- | ------------- | +| ![Dashboard](https://github.com/minio/minio/blob/master/docs/screenshots/pic1.png?raw=true) | ![Dashboard](https://github.com/minio/minio/blob/master/docs/screenshots/pic2.png?raw=true) | ## Test using MinIO Client `mc` `mc` provides a modern alternative to UNIX commands like ls, cat, cp, mirror, diff etc. It supports filesystems and Amazon S3 compatible cloud storage services. Follow the MinIO Client [Quickstart Guide](https://docs.min.io/docs/minio-client-quickstart-guide) for further instructions. diff --git a/browser/.babelrc b/browser/.babelrc deleted file mode 100644 index f9e96ea25..000000000 --- a/browser/.babelrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "presets": [ - "es2015", - "react" - ], - "plugins": [ - "transform-object-rest-spread" - ] -} \ No newline at end of file diff --git a/browser/.editorconfig b/browser/.editorconfig deleted file mode 100644 index 3674a17f4..000000000 --- a/browser/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -# editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.json] -indent_size = 2 - -[*.md] -trim_trailing_whitespace = false diff --git a/browser/.esformatter b/browser/.esformatter deleted file mode 100644 index 1677d7c4b..000000000 --- a/browser/.esformatter +++ /dev/null @@ -1,23 +0,0 @@ -{ - "plugins": [ - "esformatter-jsx" - ], - // Copied from https://github.com/royriojas/esformatter-jsx - "jsx": { - "formatJSX": true, //Duh! that's the default - "attrsOnSameLineAsTag": false, // move each attribute to its own line - "maxAttrsOnTag": 3, // if lower or equal than 3 attributes, they will be kept on a single line - "firstAttributeOnSameLine": true, // keep the first attribute in the same line as the tag - "formatJSXExpressions": true, // default true, if false jsxExpressions won't be recursively formatted - "JSXExpressionsSingleLine": true, // default true, if false the JSXExpressions might span several lines - "alignWithFirstAttribute": false, // do not align attributes with the first tag - "spaceInJSXExpressionContainers": " ", // default to one space. Make it empty if you don't like spaces between JSXExpressionContainers - "removeSpaceBeforeClosingJSX": false, // default false. if true => - "closingTagOnNewLine": false, // default false. if true attributes on multiple lines will close the tag on a new line - "JSXAttributeQuotes": "", // possible values "single" or "double". Leave it as empty string if you don't want to modify the attributes' quotes - "htmlOptions": { - // put here the options for js-beautify.html - } - } -} - diff --git a/browser/.gitignore b/browser/.gitignore deleted file mode 100644 index 38edf38cf..000000000 --- a/browser/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -**/*.swp -cover.out -*~ -minio -!*/ -site/ -**/*.test -**/*.sublime-workspace -/.idea/ -/Minio.iml -**/access.log -build -vendor/**/*.js -vendor/**/*.json -.DS_Store -*.syso -coverage.txt -node_modules diff --git a/browser/.prettierrc b/browser/.prettierrc deleted file mode 100644 index cce9d3c08..000000000 --- a/browser/.prettierrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "semi": false -} diff --git a/browser/LICENSE b/browser/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/browser/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/browser/README.md b/browser/README.md deleted file mode 100644 index 3023a86e4..000000000 --- a/browser/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# MinIO File Browser - -``MinIO Browser`` provides minimal set of UI to manage buckets and objects on ``minio`` server. - - -## Installation - -### Install node -```sh -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash -exec -l $SHELL -nvm install stable -``` - -### Install node dependencies -```sh -npm install -``` - -## Generating Assets - -> NOTE: if you are not part of MinIO organization please do not run this yourself and submit in a PR. Static assets in PRs are allowed only for authorized users. - -```sh -npm run release -``` - -This generates `release` in the current directory. - - -## Run MinIO Browser with live reload - -### Run MinIO Browser with live reload - -```sh -npm run dev -``` - -Open [http://localhost:8080/minio/](http://localhost:8080/minio/) in your browser to play with the application. - -### Run MinIO Browser with live reload on custom port - -Edit `browser/webpack.config.js` - -```diff -diff --git a/browser/webpack.config.js b/browser/webpack.config.js -index 3ccdaba..9496c56 100644 ---- a/browser/webpack.config.js -+++ b/browser/webpack.config.js -@@ -58,6 +58,7 @@ var exports = { - historyApiFallback: { - index: '/minio/' - }, -+ port: 8888, - proxy: { - '/minio/webrpc': { - target: 'http://localhost:9000', -@@ -97,7 +98,7 @@ var exports = { - if (process.env.NODE_ENV === 'dev') { - exports.entry = [ - 'webpack/hot/dev-server', -- 'webpack-dev-server/client?http://localhost:8080', -+ 'webpack-dev-server/client?http://localhost:8888', - path.resolve(__dirname, 'app/index.js') - ] - } -``` - -```sh -npm run dev -``` - -Open [http://localhost:8888/minio/](http://localhost:8888/minio/) in your browser to play with the application. - -### Run MinIO Browser with live reload on any IP - -Edit `browser/webpack.config.js` - -```diff -diff --git a/browser/webpack.config.js b/browser/webpack.config.js -index 8bdbba53..139f6049 100644 ---- a/browser/webpack.config.js -+++ b/browser/webpack.config.js -@@ -71,6 +71,7 @@ var exports = { - historyApiFallback: { - index: '/minio/' - }, -+ host: '0.0.0.0', - proxy: { - '/minio/webrpc': { - target: 'http://localhost:9000', -``` - -```sh -npm run dev -``` - -Open [http://IP:8080/minio/](http://IP:8080/minio/) in your browser to play with the application. - - -## Run tests - - npm run test diff --git a/browser/app/css/loader.css b/browser/app/css/loader.css deleted file mode 100644 index bba70295f..000000000 --- a/browser/app/css/loader.css +++ /dev/null @@ -1,98 +0,0 @@ -.page-load { - position: fixed; - width: 100%; - height: 100%; - top: 0; - left: 0; - background: #002a37; - z-index: 100; - transition: opacity 200ms; - -webkit-transition: opacity 200ms; -} - -.pl-0{ - opacity: 0; -} - -.pl-1 { - display: none; -} - -.pl-inner { - position: absolute; - width: 100px; - height: 100px; - left: 50%; - margin-left: -50px; - top: 50%; - margin-top: -50px; - text-align: center; - -webkit-animation: fade-in 500ms; - animation: fade-in 500ms; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - animation-delay: 350ms; - -webkit-animation-delay: 350ms; - -webkit-backface-visibility: visible; - backface-visibility: visible; -} - -.pl-inner:before { - content: ''; - position: absolute; - width: 100%; - height: 100%; - left: 0; - top: 0; - display: block; - -webkit-animation: spin 1000ms infinite linear; - animation: spin 1000ms infinite linear; - border: 1px solid rgba(255, 255, 255, 0.2);; - border-left-color: #fff; - border-radius: 50%; -} - -.pl-inner > img { - width: 30px; - margin-top: 21px; -} - -@-webkit-keyframes fade-in { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} - -@keyframes fade-in { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} - -@-webkit-keyframes spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} - -@keyframes spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} diff --git a/browser/app/fonts/lato/lato-normal.woff b/browser/app/fonts/lato/lato-normal.woff deleted file mode 100755 index f2317755c..000000000 Binary files a/browser/app/fonts/lato/lato-normal.woff and /dev/null differ diff --git a/browser/app/fonts/lato/lato-normal.woff2 b/browser/app/fonts/lato/lato-normal.woff2 deleted file mode 100755 index 2a119ebd5..000000000 Binary files a/browser/app/fonts/lato/lato-normal.woff2 and /dev/null differ diff --git a/browser/app/img/arrow.svg b/browser/app/img/arrow.svg deleted file mode 100644 index fb5574ff8..000000000 --- a/browser/app/img/arrow.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/browser/app/img/browsers/chrome.png b/browser/app/img/browsers/chrome.png deleted file mode 100644 index 278ef4d15..000000000 Binary files a/browser/app/img/browsers/chrome.png and /dev/null differ diff --git a/browser/app/img/browsers/firefox.png b/browser/app/img/browsers/firefox.png deleted file mode 100644 index 2803f10a7..000000000 Binary files a/browser/app/img/browsers/firefox.png and /dev/null differ diff --git a/browser/app/img/browsers/safari.png b/browser/app/img/browsers/safari.png deleted file mode 100644 index 4ed52b904..000000000 Binary files a/browser/app/img/browsers/safari.png and /dev/null differ diff --git a/browser/app/img/favicon/favicon-16x16.png b/browser/app/img/favicon/favicon-16x16.png deleted file mode 100644 index 1ef69e777..000000000 Binary files a/browser/app/img/favicon/favicon-16x16.png and /dev/null differ diff --git a/browser/app/img/favicon/favicon-32x32.png b/browser/app/img/favicon/favicon-32x32.png deleted file mode 100644 index 24f73811b..000000000 Binary files a/browser/app/img/favicon/favicon-32x32.png and /dev/null differ diff --git a/browser/app/img/favicon/favicon-96x96.png b/browser/app/img/favicon/favicon-96x96.png deleted file mode 100644 index 7410eca4c..000000000 Binary files a/browser/app/img/favicon/favicon-96x96.png and /dev/null differ diff --git a/browser/app/img/login-img-bck.svg b/browser/app/img/login-img-bck.svg deleted file mode 100644 index 2dd8593c5..000000000 --- a/browser/app/img/login-img-bck.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - Untitled - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/browser/app/img/logo.svg b/browser/app/img/logo.svg deleted file mode 100644 index 504777e9d..000000000 --- a/browser/app/img/logo.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - logo - Created with Sketch. - - - - - \ No newline at end of file diff --git a/browser/app/img/more-h-light.svg b/browser/app/img/more-h-light.svg deleted file mode 100644 index 0c2e2da60..000000000 --- a/browser/app/img/more-h-light.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/browser/app/img/more-h.svg b/browser/app/img/more-h.svg deleted file mode 100644 index cf69dcf6b..000000000 --- a/browser/app/img/more-h.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/browser/app/img/select-caret.svg b/browser/app/img/select-caret.svg deleted file mode 100644 index b2b26b86b..000000000 --- a/browser/app/img/select-caret.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/browser/app/index.html b/browser/app/index.html deleted file mode 100644 index 61cc6e39d..000000000 --- a/browser/app/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - MinIO Browser - - - - - - - - - -
-
- -
-
-
- - - - - - - diff --git a/browser/app/index.js b/browser/app/index.js deleted file mode 100644 index 4856f0a11..000000000 --- a/browser/app/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import "babel-polyfill" -import "./less/main.less" -import "@fortawesome/fontawesome-free/css/all.css" -import "material-design-iconic-font/dist/css/material-design-iconic-font.min.css" - -import React from "react" -import ReactDOM from "react-dom" -import { Router, Route } from "react-router-dom" -import { Provider } from "react-redux" - -import history from "./js/history" -import configureStore from "./js/store/configure-store" -import hideLoader from "./js/loader" -import App from "./js/App" - -const store = configureStore() - -ReactDOM.render( - - - - - , - document.getElementById("root") -) - -hideLoader() diff --git a/browser/app/js/App.js b/browser/app/js/App.js deleted file mode 100644 index 825661b43..000000000 --- a/browser/app/js/App.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import { Route, Switch, Redirect } from "react-router-dom" -import Browser from "./browser/Browser" -import Login from "./browser/Login" -import OpenIDLogin from "./browser/OpenIDLogin" -import web from "./web" - -export const App = () => { - return ( - - - - - - ) -} - -export default App diff --git a/browser/app/js/__tests__/App.test.js b/browser/app/js/__tests__/App.test.js deleted file mode 100644 index 4084a089c..000000000 --- a/browser/app/js/__tests__/App.test.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import { shallow, mount } from "enzyme" -import { MemoryRouter } from "react-router-dom" -import App from "../App" - -jest.mock("../browser/Login", () => () =>
Login
) -jest.mock("../browser/Browser", () => () =>
Browser
) - -describe("App", () => { - it("should render without crashing", () => { - shallow() - }) - - it("should render Login component for '/login' route", () => { - const wrapper = mount( - - - - ) - expect(wrapper.text()).toBe("Login") - }) - - it("should render Browser component for '/' route", () => { - const wrapper = mount( - - - - ) - expect(wrapper.text()).toBe("Browser") - }) - - it("should render Browser component for '/bucket' route", () => { - const wrapper = mount( - - - - ) - expect(wrapper.text()).toBe("Browser") - }) - - it("should render Browser component for '/bucket/a/b/c' route", () => { - const wrapper = mount( - - - - ) - expect(wrapper.text()).toBe("Browser") - }) -}) diff --git a/browser/app/js/__tests__/jsonrpc-test.js b/browser/app/js/__tests__/jsonrpc-test.js deleted file mode 100644 index cc2c34e9e..000000000 --- a/browser/app/js/__tests__/jsonrpc-test.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import JSONrpc from "../jsonrpc" - -describe("jsonrpc", () => { - it("should fail with invalid endpoint", done => { - try { - let jsonRPC = new JSONrpc({ - endpoint: "htt://localhost:9000", - namespace: "Test" - }) - } catch (e) { - done() - } - }) - it("should succeed with valid endpoint", () => { - let jsonRPC = new JSONrpc({ - endpoint: "http://localhost:9000/webrpc", - namespace: "Test" - }) - expect(jsonRPC.version).toEqual("2.0") - expect(jsonRPC.host).toEqual("localhost") - expect(jsonRPC.port).toEqual("9000") - expect(jsonRPC.path).toEqual("/webrpc") - expect(jsonRPC.scheme).toEqual("http") - }) -}) diff --git a/browser/app/js/alert/Alert.js b/browser/app/js/alert/Alert.js deleted file mode 100644 index 7603a19d8..000000000 --- a/browser/app/js/alert/Alert.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import AlertComponent from "react-bootstrap/lib/Alert" - -const Alert = ({ show, type, message, onDismiss }) => ( - -
{message}
-
-) - -export default Alert diff --git a/browser/app/js/alert/AlertContainer.js b/browser/app/js/alert/AlertContainer.js deleted file mode 100644 index fd1e4ebe9..000000000 --- a/browser/app/js/alert/AlertContainer.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import { connect } from "react-redux" -import Alert from "./Alert" -import * as alertActions from "./actions" - -export const AlertContainer = ({ alert, clearAlert }) => { - if (!alert.message) { - return "" - } - return -} - -const mapStateToProps = state => { - return { - alert: state.alert - } -} - -const mapDispatchToProps = dispatch => { - return { - clearAlert: () => dispatch(alertActions.clear()) - } -} - -export default connect(mapStateToProps, mapDispatchToProps)(AlertContainer) diff --git a/browser/app/js/alert/__tests___/Alert.test.js b/browser/app/js/alert/__tests___/Alert.test.js deleted file mode 100644 index 62eaa27b8..000000000 --- a/browser/app/js/alert/__tests___/Alert.test.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import { shallow, mount } from "enzyme" -import Alert from "../Alert" - -describe("Alert", () => { - it("should render without crashing", () => { - shallow() - }) - - it("should call onDismiss when close button is clicked", () => { - const onDismiss = jest.fn() - const wrapper = mount( - - ) - wrapper.find("button").simulate("click", { preventDefault: jest.fn() }) - expect(onDismiss).toHaveBeenCalled() - }) -}) diff --git a/browser/app/js/alert/__tests___/AlertContainer.test.js b/browser/app/js/alert/__tests___/AlertContainer.test.js deleted file mode 100644 index ced273540..000000000 --- a/browser/app/js/alert/__tests___/AlertContainer.test.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import { shallow, mount } from "enzyme" -import { AlertContainer } from "../AlertContainer" - -describe("Alert", () => { - it("should render without crashing", () => { - shallow( - - ) - }) - - it("should render nothing if message is empty", () => { - const wrapper = shallow( - - ) - expect(wrapper.find("Alert").length).toBe(0) - }) -}) diff --git a/browser/app/js/alert/__tests___/actions.test.js b/browser/app/js/alert/__tests___/actions.test.js deleted file mode 100644 index b7b561f69..000000000 --- a/browser/app/js/alert/__tests___/actions.test.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import configureStore from "redux-mock-store" -import thunk from "redux-thunk" -import * as actionsAlert from "../actions" - -const middlewares = [thunk] -const mockStore = configureStore(middlewares) - -jest.useFakeTimers() - -describe("Alert actions", () => { - it("creates alert/SET action", () => { - const store = mockStore() - const expectedActions = [ - { - type: "alert/SET", - alert: { id: 0, message: "Test alert", type: "danger" } - } - ] - store.dispatch(actionsAlert.set({ message: "Test alert", type: "danger" })) - const actions = store.getActions() - expect(actions).toEqual(expectedActions) - }) - - it("creates alert/CLEAR action for non danger alerts", () => { - const store = mockStore() - const expectedActions = [ - { - type: "alert/SET", - alert: { id: 1, message: "Test alert" } - }, - { - type: "alert/CLEAR", - alert: { id: 1 } - } - ] - store.dispatch(actionsAlert.set({ message: "Test alert" })) - jest.runAllTimers() - const actions = store.getActions() - expect(actions).toEqual(expectedActions) - }) - - it("creates alert/CLEAR action directly", () => { - const store = mockStore() - const expectedActions = [ - { - type: "alert/CLEAR" - } - ] - store.dispatch(actionsAlert.clear()) - const actions = store.getActions() - expect(actions).toEqual(expectedActions) - }) -}) diff --git a/browser/app/js/alert/__tests___/reducer.test.js b/browser/app/js/alert/__tests___/reducer.test.js deleted file mode 100644 index 19c7ac7bb..000000000 --- a/browser/app/js/alert/__tests___/reducer.test.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import reducer from "../reducer" -import * as actionsAlert from "../actions" - -describe("alert reducer", () => { - it("should return the initial state", () => { - expect(reducer(undefined, {})).toEqual({ - show: false, - type: "danger" - }) - }) - - it("should handle SET_ALERT", () => { - expect( - reducer(undefined, { - type: actionsAlert.SET, - alert: { id: 1, type: "danger", message: "Test message" } - }) - ).toEqual({ - show: true, - id: 1, - type: "danger", - message: "Test message" - }) - }) - - it("should clear alert if id not passed", () => { - expect( - reducer( - { show: true, type: "danger", message: "Test message" }, - { - type: actionsAlert.CLEAR - } - ) - ).toEqual({ - show: false, - type: "danger" - }) - }) - - it("should clear alert if id is matching", () => { - expect( - reducer( - { show: true, id: 1, type: "danger", message: "Test message" }, - { - type: actionsAlert.CLEAR, - alert: { id: 1 } - } - ) - ).toEqual({ - show: false, - type: "danger" - }) - }) - - it("should not clear alert if id is not matching", () => { - expect( - reducer( - { show: true, id: 1, type: "danger", message: "Test message" }, - { - type: actionsAlert.CLEAR, - alert: { id: 2 } - } - ) - ).toEqual({ - show: true, - id: 1, - type: "danger", - message: "Test message" - }) - }) -}) diff --git a/browser/app/js/alert/actions.js b/browser/app/js/alert/actions.js deleted file mode 100644 index d602039ee..000000000 --- a/browser/app/js/alert/actions.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const SET = "alert/SET" -export const CLEAR = "alert/CLEAR" - -export let alertId = 0 - -export const set = alert => { - const id = alertId++ - return (dispatch, getState) => { - if (alert.type !== "danger" || alert.autoClear) { - setTimeout(() => { - dispatch({ - type: CLEAR, - alert: { - id - } - }) - }, 5000) - } - dispatch({ - type: SET, - alert: Object.assign({}, alert, { - id - }) - }) - } -} - -export const clear = () => { - return { type: CLEAR } -} diff --git a/browser/app/js/alert/reducer.js b/browser/app/js/alert/reducer.js deleted file mode 100644 index 4fae949a5..000000000 --- a/browser/app/js/alert/reducer.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as actionsAlert from "./actions" - -const initialState = { - show: false, - type: "danger" -} -export default (state = initialState, action) => { - switch (action.type) { - case actionsAlert.SET: - return { - show: true, - id: action.alert.id, - type: action.alert.type, - message: action.alert.message - } - case actionsAlert.CLEAR: - if (action.alert && action.alert.id != state.id) { - return state - } else { - return initialState - } - default: - return state - } -} diff --git a/browser/app/js/browser/AboutModal.js b/browser/app/js/browser/AboutModal.js deleted file mode 100644 index 63591cff9..000000000 --- a/browser/app/js/browser/AboutModal.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import { Modal } from "react-bootstrap" -import logo from "../../img/logo.svg" - -export const AboutModal = ({ serverInfo, hideAbout }) => { - const { version, platform, runtime } = serverInfo - return ( - - -
-
- - - -
-
-
    -
  • -
    Version
    - {version} -
  • -
  • -
    Platform
    - {platform} -
  • -
  • -
    Runtime
    - {runtime} -
  • -
-
-
-
- ) -} - -export default AboutModal diff --git a/browser/app/js/browser/Browser.js b/browser/app/js/browser/Browser.js deleted file mode 100644 index a1930f887..000000000 --- a/browser/app/js/browser/Browser.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import classNames from "classnames" -import { connect } from "react-redux" -import SideBar from "./SideBar" -import MainContent from "./MainContent" -import AlertContainer from "../alert/AlertContainer" - -class Browser extends React.Component { - render() { - return ( -
- - - -
- ) - } -} - -export default connect(state => state)(Browser) diff --git a/browser/app/js/browser/BrowserDropdown.js b/browser/app/js/browser/BrowserDropdown.js deleted file mode 100644 index ed1bdd917..000000000 --- a/browser/app/js/browser/BrowserDropdown.js +++ /dev/null @@ -1,135 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import { connect } from "react-redux" -import { Dropdown } from "react-bootstrap" -import * as browserActions from "./actions" -import web from "../web" -import history from "../history" -import AboutModal from "./AboutModal" -import ChangePasswordModal from "./ChangePasswordModal" - -export class BrowserDropdown extends React.Component { - constructor(props) { - super(props) - this.state = { - showAboutModal: false, - showChangePasswordModal: false - } - } - showAbout(e) { - e.preventDefault() - this.setState({ - showAboutModal: true - }) - } - hideAbout() { - this.setState({ - showAboutModal: false - }) - } - showChangePassword(e) { - e.preventDefault() - this.setState({ - showChangePasswordModal: true - }) - } - hideChangePassword() { - this.setState({ - showChangePasswordModal: false - }) - } - componentDidMount() { - const { fetchServerInfo } = this.props - fetchServerInfo() - } - logout(e) { - e.preventDefault() - web.Logout() - history.replace("/login") - } - render() { - const { serverInfo } = this.props - return ( -
  • - - - - - -
  • - - Change Password - - {this.state.showChangePasswordModal && ( - - )} -
  • -
  • - - Documentation - -
  • -
  • - - GitHub - -
  • -
  • - - Get Support - -
  • -
  • - - About - - {this.state.showAboutModal && ( - - )} -
  • -
  • - - Logout - -
  • - - - - ) - } -} - -const mapStateToProps = state => { - return { - serverInfo: state.browser.serverInfo - } -} - -const mapDispatchToProps = dispatch => { - return { - fetchServerInfo: () => dispatch(browserActions.fetchServerInfo()) - } -} - -export default connect(mapStateToProps, mapDispatchToProps)(BrowserDropdown) diff --git a/browser/app/js/browser/ChangePasswordModal.js b/browser/app/js/browser/ChangePasswordModal.js deleted file mode 100644 index b21464c13..000000000 --- a/browser/app/js/browser/ChangePasswordModal.js +++ /dev/null @@ -1,260 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import { connect } from "react-redux" -import web from "../web" -import * as alertActions from "../alert/actions" -import { getRandomAccessKey, getRandomSecretKey } from "../utils" -import jwtDecode from "jwt-decode" -import classNames from "classnames" - -import { Modal, ModalBody, ModalHeader } from "react-bootstrap" -import InputGroup from "./InputGroup" -import { ACCESS_KEY_MIN_LENGTH, SECRET_KEY_MIN_LENGTH } from "../constants" - -export class ChangePasswordModal extends React.Component { - constructor(props) { - super(props) - this.state = { - currentAccessKey: "", - currentSecretKey: "", - currentSecretKeyVisible: false, - newAccessKey: "", - newSecretKey: "", - newSecretKeyVisible: false - } - } - // When its shown, it loads the access key from JWT token - componentWillMount() { - const token = jwtDecode(web.GetToken()) - this.setState({ - currentAccessKey: token.sub, - newAccessKey: token.sub - }) - } - - // Save the auth params and set them. - setAuth(e) { - const { showAlert } = this.props - - if (this.canUpdateCredentials()) { - const currentAccessKey = this.state.currentAccessKey - const currentSecretKey = this.state.currentSecretKey - const newAccessKey = this.state.newAccessKey - const newSecretKey = this.state.newSecretKey - web - .SetAuth({ - currentAccessKey, - currentSecretKey, - newAccessKey, - newSecretKey - }) - .then(data => { - showAlert({ - type: "success", - message: "Credentials updated successfully." - }) - }) - .catch(err => { - showAlert({ - type: "danger", - message: err.message - }) - }) - } - } - - generateAuth(e) { - const { serverInfo } = this.props - this.setState({ - newSecretKey: getRandomSecretKey(), - newSecretKeyVisible: true - }) - } - - canChangePassword() { - const { serverInfo } = this.props - // Password change is not allowed for temporary users(STS) - if(serverInfo.userInfo.isTempUser) { - return false - } - - // Password change is only allowed for regular users - if (!serverInfo.userInfo.isIAMUser) { - return false - } - - return true - } - - canUpdateCredentials() { - return ( - this.state.currentAccessKey.length > 0 && - this.state.currentSecretKey.length > 0 && - this.state.newAccessKey.length >= ACCESS_KEY_MIN_LENGTH && - this.state.newSecretKey.length >= SECRET_KEY_MIN_LENGTH - ) - } - - render() { - const { hideChangePassword, serverInfo } = this.props - const allowChangePassword = this.canChangePassword() - - if (!allowChangePassword) { - return ( - - Change Password - - Credentials of this user cannot be updated through MinIO Browser. - -
    - -
    -
    - ) - } - - return ( - - Change Password - -
    - - - { - this.setState({ - currentSecretKeyVisible: !this.state.currentSecretKeyVisible - }) - }} - className={ - "toggle-password fas fa-eye " + - (this.state.currentSecretKeyVisible ? "toggled" : "") - } - /> - { - this.setState({ currentSecretKey: e.target.value }) - }} - id="currentSecretKey" - label="Current Secret Key" - name="currentSecretKey" - type={this.state.currentSecretKeyVisible ? "text" : "password"} - spellCheck="false" - required="required" - autoComplete="false" - align="ig-left" - /> -
    - -
    - { - this.setState({ - newSecretKeyVisible: !this.state.newSecretKeyVisible - }) - }} - className={ - "toggle-password fas fa-eye " + - (this.state.newSecretKeyVisible ? "toggled" : "") - } - /> - { - this.setState({ newSecretKey: e.target.value }) - }} - id="newSecretKey" - label="New Secret Key" - name="newSecretKey" - type={this.state.newSecretKeyVisible ? "text" : "password"} - spellCheck="false" - required="required" - autoComplete="false" - align="ig-left" - onChange={e => { - this.setState({ newSecretKey: e.target.value }) - }} - /> -
    -
    -
    - - - -
    -
    - ) - } -} - -const mapStateToProps = state => { - return { - serverInfo: state.browser.serverInfo - } -} - -const mapDispatchToProps = dispatch => { - return { - showAlert: alert => dispatch(alertActions.set(alert)) - } -} - -export default connect( - mapStateToProps, - mapDispatchToProps -)(ChangePasswordModal) diff --git a/browser/app/js/browser/ConfirmModal.js b/browser/app/js/browser/ConfirmModal.js deleted file mode 100644 index 3d7e6402f..000000000 --- a/browser/app/js/browser/ConfirmModal.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import { Modal, ModalBody } from "react-bootstrap" - -let ConfirmModal = ({ - baseClass, - icon, - text, - sub, - okText, - cancelText, - okHandler, - cancelHandler, - show -}) => { - return ( - - -
    - -
    -
    {text}
    -
    {sub}
    -
    -
    - - -
    -
    - ) -} - -export default ConfirmModal diff --git a/browser/app/js/browser/Header.js b/browser/app/js/browser/Header.js deleted file mode 100644 index f9266ff81..000000000 --- a/browser/app/js/browser/Header.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import ObjectsSearch from "../objects/ObjectsSearch" -import Path from "../objects/Path" -import StorageInfo from "./StorageInfo" -import BrowserDropdown from "./BrowserDropdown" -import web from "../web" -import { minioBrowserPrefix } from "../constants" - -export const Header = () => { - const loggedIn = web.LoggedIn() - return ( -
    - - {loggedIn && } - {loggedIn && } - -
    - ) -} - -export default Header diff --git a/browser/app/js/browser/Host.js b/browser/app/js/browser/Host.js deleted file mode 100644 index 010fdd4a5..000000000 --- a/browser/app/js/browser/Host.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" - -export const Host = () => ( - -) - -export default Host diff --git a/browser/app/js/browser/InputGroup.js b/browser/app/js/browser/InputGroup.js deleted file mode 100644 index 3d82389d7..000000000 --- a/browser/app/js/browser/InputGroup.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" - -let InputGroup = ({ - label, - id, - name, - value, - onChange, - type, - spellCheck, - required, - readonly, - autoComplete, - align, - className -}) => { - var input = ( - - ) - if (readonly) - input = ( - - ) - return ( -
    - {input} - - -
    - ) -} - -export default InputGroup diff --git a/browser/app/js/browser/Login.js b/browser/app/js/browser/Login.js deleted file mode 100644 index 39b84e446..000000000 --- a/browser/app/js/browser/Login.js +++ /dev/null @@ -1,187 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import { connect } from "react-redux" -import logo from "../../img/logo.svg" -import Alert from "../alert/Alert" -import * as actionsAlert from "../alert/actions" -import InputGroup from "./InputGroup" -import web from "../web" -import { Redirect, Link } from "react-router-dom" -import OpenIDLoginButton from './OpenIDLoginButton' - -export class Login extends React.Component { - constructor(props) { - super(props) - this.state = { - accessKey: "", - secretKey: "", - discoveryDoc: {}, - clientId: "" - } - } - - // Handle field changes - accessKeyChange(e) { - this.setState({ - accessKey: e.target.value - }) - } - - secretKeyChange(e) { - this.setState({ - secretKey: e.target.value - }) - } - - handleSubmit(event) { - event.preventDefault() - const { showAlert, clearAlert, history } = this.props - let message = "" - if (this.state.accessKey === "") { - message = "Access Key cannot be empty" - } - if (this.state.secretKey === "") { - message = "Secret Key cannot be empty" - } - if (message) { - showAlert("danger", message) - return - } - web - .Login({ - username: this.state.accessKey, - password: this.state.secretKey - }) - .then(res => { - // Clear alerts from previous login attempts - clearAlert() - - history.push("/") - }) - .catch(e => { - showAlert("danger", e.message) - }) - } - - componentWillMount() { - const { clearAlert } = this.props - // Clear out any stale message in the alert of previous page - clearAlert() - document.body.classList.add("is-guest") - } - - componentDidMount() { - web.GetDiscoveryDoc().then(({ DiscoveryDoc, clientId }) => { - this.setState({ - clientId, - discoveryDoc: DiscoveryDoc - }) - }) - } - - componentWillUnmount() { - document.body.classList.remove("is-guest") - } - - render() { - const { clearAlert, alert } = this.props - if (web.LoggedIn()) { - return - } - let alertBox = - // Make sure you don't show a fading out alert box on the initial web-page load. - if (!alert.message) alertBox = "" - - const showOpenID = Boolean(this.state.discoveryDoc && this.state.discoveryDoc.authorization_endpoint) - return ( -
    - {alertBox} -
    -
    - - - - - {showOpenID && ( -
    -
    or
    - { - this.state.clientId ? ( - - Log in with OpenID - - ) : ( - - Log in with OpenID - - ) - } -
    - )} -
    -
    - - - -
    {window.location.host}
    -
    -
    - ) - } -} - -const mapDispatchToProps = dispatch => { - return { - showAlert: (type, message) => - dispatch(actionsAlert.set({ type: type, message: message })), - clearAlert: () => dispatch(actionsAlert.clear()) - } -} - -export default connect( - state => state, - mapDispatchToProps -)(Login) diff --git a/browser/app/js/browser/MainActions.js b/browser/app/js/browser/MainActions.js deleted file mode 100644 index 44145c3a6..000000000 --- a/browser/app/js/browser/MainActions.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from "react" -import { connect } from "react-redux" -import { Dropdown, OverlayTrigger, Tooltip } from "react-bootstrap" -import web from "../web" -import * as actionsBuckets from "../buckets/actions" -import * as uploadsActions from "../uploads/actions" -import { getPrefixWritable } from "../objects/selectors" - -export const MainActions = ({ - prefixWritable, - uploadFile, - showMakeBucketModal -}) => { - const uploadTooltip = Upload file - const makeBucketTooltip = ( - Create bucket - ) - const onFileUpload = e => { - e.preventDefault() - let files = e.target.files - let filesToUploadCount = files.length - for (let i = 0; i < filesToUploadCount; i++) { - uploadFile(files.item(i)) - } - e.target.value = null - } - - const loggedIn = web.LoggedIn() - - if (loggedIn || prefixWritable) { - return ( - - - - - - - - - - - - - - {loggedIn && ( - - { - e.preventDefault() - showMakeBucketModal() - }} - > - - - - )} - - - ) - } else { - return