storj.io/minio@v0.0.0-20230509071714-0cbc90f649b1/browser/README.md (about)

     1  # MinIO File Browser
     2  
     3  ``MinIO Browser`` provides minimal set of UI to manage buckets and objects on ``minio`` server. ``MinIO Browser`` is written in javascript and released under [Apache 2.0 License](./LICENSE).
     4  
     5  
     6  ## Installation
     7  
     8  ### Install node
     9  ```sh
    10  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
    11  exec -l $SHELL
    12  nvm install stable
    13  ```
    14  
    15  ### Install node dependencies
    16  ```sh
    17  npm install
    18  ```
    19  
    20  ## Generating Assets
    21  
    22  ```sh
    23  npm run release
    24  ```
    25  
    26  This generates `production` in the current directory. 
    27  
    28  
    29  ## Run MinIO Browser with live reload
    30  
    31  ### Run MinIO Browser with live reload
    32  
    33  ```sh
    34  npm run dev
    35  ```
    36  
    37  Open [http://localhost:8080/minio/](http://localhost:8080/minio/) in your browser to play with the application.
    38  
    39  ### Run MinIO Browser with live reload on custom port
    40  
    41  Edit `browser/webpack.config.js`
    42  
    43  ```diff
    44  diff --git a/browser/webpack.config.js b/browser/webpack.config.js
    45  index 3ccdaba..9496c56 100644
    46  --- a/browser/webpack.config.js
    47  +++ b/browser/webpack.config.js
    48  @@ -58,6 +58,7 @@ var exports = {
    49       historyApiFallback: {
    50         index: '/minio/'
    51       },
    52  +    port: 8888,
    53       proxy: {
    54         '/minio/webrpc': {
    55           target: 'http://localhost:9000',
    56  @@ -97,7 +98,7 @@ var exports = {
    57   if (process.env.NODE_ENV === 'dev') {
    58     exports.entry = [
    59       'webpack/hot/dev-server',
    60  -    'webpack-dev-server/client?http://localhost:8080',
    61  +    'webpack-dev-server/client?http://localhost:8888',
    62       path.resolve(__dirname, 'app/index.js')
    63     ]
    64   }
    65  ```
    66  
    67  ```sh
    68  npm run dev
    69  ```
    70  
    71  Open [http://localhost:8888/minio/](http://localhost:8888/minio/) in your browser to play with the application.
    72  
    73  ### Run MinIO Browser with live reload on any IP
    74  
    75  Edit `browser/webpack.config.js`
    76  
    77  ```diff
    78  diff --git a/browser/webpack.config.js b/browser/webpack.config.js
    79  index 8bdbba53..139f6049 100644
    80  --- a/browser/webpack.config.js
    81  +++ b/browser/webpack.config.js
    82  @@ -71,6 +71,7 @@ var exports = {
    83       historyApiFallback: {
    84         index: '/minio/'
    85       },
    86  +    host: '0.0.0.0',
    87       proxy: {
    88         '/minio/webrpc': {
    89           target: 'http://localhost:9000',
    90  ```
    91  
    92  ```sh
    93  npm run dev
    94  ```
    95  
    96  Open [http://IP:8080/minio/](http://IP:8080/minio/) in your browser to play with the application.
    97  
    98  
    99  ## Run tests
   100  
   101      npm run test
   102  
   103  
   104  ## Docker development environment
   105  
   106  This approach will download the sources on your machine such that you are able to use your IDE or editor of choice.
   107  A Docker container will be used in order to provide a controlled build environment without messing with your host system.
   108  
   109  ### Prepare host system
   110  
   111  Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Docker](https://docs.docker.com/get-docker/).
   112  
   113  ### Development within container
   114  
   115  Prepare and build container
   116  ```
   117  git clone git@github.com:minio/minio.git
   118  cd minio
   119  docker build -t minio-dev -f Dockerfile.dev.browser .
   120  ```
   121  
   122  Run container, build and run core
   123  ```sh
   124  docker run -it --rm --name minio-dev -v "$PWD":/minio minio-dev
   125  
   126  cd /minio/browser
   127  npm install
   128  npm run release
   129  cd /minio
   130  make
   131  ./minio server /data
   132  ```
   133  Note `Endpoint` IP (the one which is _not_ `127.0.0.1`), `AccessKey` and `SecretKey` (both default to `minioadmin`) in order to enter them in the browser later.
   134  
   135  
   136  Open another terminal.
   137  Connect to container
   138  ```sh
   139  docker exec -it minio-dev bash
   140  ```
   141  
   142  Apply patch to allow access from outside container
   143  ```sh
   144  cd /minio
   145  git apply --ignore-whitespace <<EOF
   146  diff --git a/browser/webpack.config.js b/browser/webpack.config.js
   147  index 8bdbba53..139f6049 100644
   148  --- a/browser/webpack.config.js
   149  +++ b/browser/webpack.config.js
   150  @@ -71,6 +71,7 @@ var exports = {
   151       historyApiFallback: {
   152         index: '/minio/'
   153       },
   154  +    host: '0.0.0.0',
   155       proxy: {
   156         '/minio/webrpc': {
   157           target: 'http://localhost:9000',
   158  EOF
   159  ```
   160  
   161  Build and run frontend with auto-reload
   162  ```sh
   163  cd /minio/browser
   164  npm install
   165  npm run dev
   166  ```
   167  
   168  Open [http://IP:8080/minio/](http://IP:8080/minio/) in your browser to play with the application.
   169