From 34ad5bbd4eeafc45842888f5ed9df753b13b8166 Mon Sep 17 00:00:00 2001 From: Edin Skeja Date: Thu, 9 Dec 2021 19:11:05 +0100 Subject: [PATCH] Fix minio docs (#901) * Add minio links to sidebar * Minio plugin page * Fixed some typos --- docs/content/add-plugins/minio.md | 53 +++++++++++++++++++ docs/content/add-plugins/s3.md | 2 +- docs/content/add-plugins/spaces.md | 2 +- .../how-to/uploading-images-to-minio.md | 4 +- docs/content/how-to/uploading-images-to-s3.md | 2 +- .../how-to/uploading-images-to-spaces.md | 2 +- www/docs/sidebars.js | 9 ++++ 7 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 docs/content/add-plugins/minio.md diff --git a/docs/content/add-plugins/minio.md b/docs/content/add-plugins/minio.md new file mode 100644 index 0000000000..09c7a3e78c --- /dev/null +++ b/docs/content/add-plugins/minio.md @@ -0,0 +1,53 @@ +# MinIO + +In order to work with images in Medusa, you need a file service plugin responsible for hosting. Following this guide will allow you to upload images to MinIO bucket. + +### Before you start + +At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusa-commerce.com/tutorial/set-up-your-development-environment) for setting up your local environment. + +### Set up MinIO + +#### Create an MinIO bucket + +In the MinIO console create a new bucket, then click into that bucket and change the `Access Policy` to `public`. + +Be aware, that this will allow for anyone to acces your bucket. Avoid storing sensitive data. + +#### Generate access keys + +Navigate to users and perform the following steps: + +- Enter new `Access Key` and `Secret Key` +- Select readwrite policy +- Submit the details + +### Installation + +First, install the plugin using your preferred package manager: + +``` +yarn add medusa-file-minio +``` + +Then configure your `medusa-config.js` to include the plugin alongside the required options: + +```=javascript +{ + resolve: `medusa-file-minio`, + options: { + endpoint: "minio.server.com", + bucket: "test", + access_key_id: "YOUR-ACCESS-KEY", + secret_access_key: "YOUR-SECRET-KEY", + }, +}, +``` + +The two access keys in the options are the ones created in the previous section. + +> Make sure to use an environment variable for the secret key in a live environment. + +### Try it out + +Finally, run your Medusa server alongside our admin system to try out your new file service. Upon editing or creating products, you can now upload thumbnails and images, that are stored in an MinIO server. diff --git a/docs/content/add-plugins/s3.md b/docs/content/add-plugins/s3.md index 964c2683d6..25755189fe 100644 --- a/docs/content/add-plugins/s3.md +++ b/docs/content/add-plugins/s3.md @@ -6,7 +6,7 @@ In order to work with images in Medusa, you need a file service plugin responsib At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusa-commerce.com/tutorial/set-up-your-development-environment) for setting up your local environment. -### Set up up AWS +### Set up AWS #### Create an S3 bucket diff --git a/docs/content/add-plugins/spaces.md b/docs/content/add-plugins/spaces.md index 33d6abe737..c925d896ea 100644 --- a/docs/content/add-plugins/spaces.md +++ b/docs/content/add-plugins/spaces.md @@ -6,7 +6,7 @@ In order to work with images in Medusa, you need a file service plugin responsib At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusa-commerce.com/tutorial/set-up-your-development-environment) for setting up your local environment. -### Set up up DigitalOcean +### Set up DigitalOcean #### Create a Space diff --git a/docs/content/how-to/uploading-images-to-minio.md b/docs/content/how-to/uploading-images-to-minio.md index 269bdb23dc..180c7e0177 100644 --- a/docs/content/how-to/uploading-images-to-minio.md +++ b/docs/content/how-to/uploading-images-to-minio.md @@ -6,7 +6,7 @@ In order to work with images in Medusa, you need a file service plugin responsib At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusa-commerce.com/tutorial/set-up-your-development-environment) for setting up your local environment. -### Set up up AWS +### Set up MinIO #### Create an MinIO bucket @@ -50,4 +50,4 @@ The two access keys in the options are the ones created in the previous section. ### Try it out -Finally, run your Medusa server alongside our admin system to try out your new file service. Upon editing or creating products, you can now upload thumbnails and images, that are stored in an MiniO server. +Finally, run your Medusa server alongside our admin system to try out your new file service. Upon editing or creating products, you can now upload thumbnails and images, that are stored in an MinIO server. diff --git a/docs/content/how-to/uploading-images-to-s3.md b/docs/content/how-to/uploading-images-to-s3.md index f6b8fec896..6544d81aac 100644 --- a/docs/content/how-to/uploading-images-to-s3.md +++ b/docs/content/how-to/uploading-images-to-s3.md @@ -6,7 +6,7 @@ In order to work with images in Medusa, you need a file service plugin responsib At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusajs.com/tutorial/set-up-your-development-environment) for setting up your local environment. -### Set up up AWS +### Set up AWS #### Create an S3 bucket diff --git a/docs/content/how-to/uploading-images-to-spaces.md b/docs/content/how-to/uploading-images-to-spaces.md index 88a1588a8a..71f217a06c 100644 --- a/docs/content/how-to/uploading-images-to-spaces.md +++ b/docs/content/how-to/uploading-images-to-spaces.md @@ -6,7 +6,7 @@ In order to work with images in Medusa, you need a file service plugin responsib At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusajs.com/tutorial/set-up-your-development-environment) for setting up your local environment. -### Set up up DigitalOcean +### Set up DigitalOcean #### Create a Space diff --git a/www/docs/sidebars.js b/www/docs/sidebars.js index 874f745c26..f4cde36fa4 100644 --- a/www/docs/sidebars.js +++ b/www/docs/sidebars.js @@ -95,6 +95,10 @@ module.exports = { type: "doc", id: "how-to/uploading-images-to-s3", }, + { + type: "doc", + id: "how-to/uploading-images-to-minio", + }, ], }, { @@ -158,6 +162,11 @@ module.exports = { id: "add-plugins/s3", label: "File: S3", }, + { + type: "doc", + id: "add-plugins/minio", + label: "File: MinIO", + }, { type: "doc", id: "add-plugins/stripe",