summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph (Sheogorath) Kern2018-01-26 00:35:50 +0100
committerGitHub2018-01-26 00:35:50 +0100
commit6dae85f4aafe4cff5209a1b1756bdf50a55819ef (patch)
tree3af17347c9a535972fa7c256e171506f6c7b4625
parente52d7db96cffb89593ff496d0fc1620696553908 (diff)
parent587a6e22399045b4e44e073cdf9dd87f39b20356 (diff)
Merge pull request #698 from SISheogorath/docs/minio
Adding some docs for new Minio Feature
-rw-r--r--README.md8
-rw-r--r--config.json.example7
-rw-r--r--docs/guides/images/minio-image-upload/create-bucket.pngbin0 -> 15207 bytes
-rw-r--r--docs/guides/images/minio-image-upload/create-policy.pngbin0 -> 21156 bytes
-rw-r--r--docs/guides/images/minio-image-upload/default-view.pngbin0 -> 13061 bytes
-rw-r--r--docs/guides/images/minio-image-upload/docker-logs.pngbin0 -> 73263 bytes
-rw-r--r--docs/guides/images/minio-image-upload/open-edit-policy.pngbin0 -> 17514 bytes
-rw-r--r--docs/guides/minio-image-upload.md83
8 files changed, 97 insertions, 1 deletions
diff --git a/README.md b/README.md
index fb1f8e3d..f07d468f 100644
--- a/README.md
+++ b/README.md
@@ -193,6 +193,11 @@ There are some configs you need to change in the files below
| HMD_S3_SECRET_ACCESS_KEY | no example | AWS secret key |
| HMD_S3_REGION | `ap-northeast-1` | AWS S3 region |
| HMD_S3_BUCKET | no example | AWS S3 bucket name |
+| HMD_MINIO_ACCESS_KEY | no example | Minio access key |
+| HMD_MINIO_SECRET_KEY | no example | Minio secret key |
+| HMD_MINIO_ENDPOINT | `minio.example.org` | Address of your Minio endpoint/instance |
+| HMD_MINIO_PORT | `9000` | Port that is used for your minio instance |
+| HMD_MINIO_SECURE | `true` | If set to true HTTPS is used for minio |
| HMD_HSTS_ENABLE | ` true` | set to enable [HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) if HTTPS is also enabled (default is ` true`) |
| HMD_HSTS_INCLUDE_SUBDOMAINS | `true` | set to include subdomains in HSTS (default is `true`) |
| HMD_HSTS_MAX_AGE | `31536000` | max duration in seconds to tell clients to keep HSTS status (default is a year) |
@@ -242,8 +247,9 @@ There are some configs you need to change in the files below
| email | `true` or `false` | set to allow email signin |
| allowemailregister | `true` or `false` | set to allow email register (only applied when email is set, default is `true`) |
| imageUploadType | `imgur`(default), `s3` or `filesystem` | Where to upload image
+| minio | `{ "accessKey": "YOUR_MINIO_ACCESS_KEY", "secretKey": "YOUR_MINIO_SECRET_KEY", "endpoint": "YOUR_MINIO_HOST", port: 9000, secure: true }` | When `imageUploadType` is set to `minio`, you need to set this key. Also checkout our [Minio Image Upload Guide](docs/guides/minio-image-upload.md) |
| s3 | `{ "accessKeyId": "YOUR_S3_ACCESS_KEY_ID", "secretAccessKey": "YOUR_S3_ACCESS_KEY", "region": "YOUR_S3_REGION" }` | When `imageUploadType` be set to `s3`, you would also need to setup this key, check our [S3 Image Upload Guide](docs/guides/s3-image-upload.md) |
-| s3bucket | `YOUR_S3_BUCKET_NAME` | bucket name when `imageUploadType` is set to `s3` |
+| s3bucket | `YOUR_S3_BUCKET_NAME` | bucket name when `imageUploadType` is set to `s3` or `minio` |
## Third-party integration api key settings
diff --git a/config.json.example b/config.json.example
index f5ddf182..66a0227c 100644
--- a/config.json.example
+++ b/config.json.example
@@ -100,6 +100,13 @@
"imgur": {
"clientID": "change this"
},
+ "minio": {
+ "accessKey": "change this",
+ "secretKey": "change this",
+ "endPoint": "change this",
+ "secure": true,
+ "port": 9000
+ },
"s3": {
"accessKeyId": "change this",
"secretAccessKey": "change this",
diff --git a/docs/guides/images/minio-image-upload/create-bucket.png b/docs/guides/images/minio-image-upload/create-bucket.png
new file mode 100644
index 00000000..ccfb6715
--- /dev/null
+++ b/docs/guides/images/minio-image-upload/create-bucket.png
Binary files differ
diff --git a/docs/guides/images/minio-image-upload/create-policy.png b/docs/guides/images/minio-image-upload/create-policy.png
new file mode 100644
index 00000000..f9cbd3bf
--- /dev/null
+++ b/docs/guides/images/minio-image-upload/create-policy.png
Binary files differ
diff --git a/docs/guides/images/minio-image-upload/default-view.png b/docs/guides/images/minio-image-upload/default-view.png
new file mode 100644
index 00000000..fadb50a4
--- /dev/null
+++ b/docs/guides/images/minio-image-upload/default-view.png
Binary files differ
diff --git a/docs/guides/images/minio-image-upload/docker-logs.png b/docs/guides/images/minio-image-upload/docker-logs.png
new file mode 100644
index 00000000..a25f349a
--- /dev/null
+++ b/docs/guides/images/minio-image-upload/docker-logs.png
Binary files differ
diff --git a/docs/guides/images/minio-image-upload/open-edit-policy.png b/docs/guides/images/minio-image-upload/open-edit-policy.png
new file mode 100644
index 00000000..1dac7bea
--- /dev/null
+++ b/docs/guides/images/minio-image-upload/open-edit-policy.png
Binary files differ
diff --git a/docs/guides/minio-image-upload.md b/docs/guides/minio-image-upload.md
new file mode 100644
index 00000000..273bd8eb
--- /dev/null
+++ b/docs/guides/minio-image-upload.md
@@ -0,0 +1,83 @@
+Minio Guide for HackMD
+===
+
+1. First of all you need to setup Minio itself.
+
+ Please refer to the [official Minio docs](https://docs.minio.io/) for an
+ production setup.
+
+ For checking it out and development purposes a non-persistent setup is enough:
+ ```console
+ docker run --name test-minio --rm -d -p 9000:9000 minio/minio server /data
+ ```
+
+ *Please notice this is not for productive use as all your data gets lost
+ when you stop this container*
+
+2. Next step is to get the credentials form the container:
+
+ ```
+ docker logs test-minio
+ ```
+
+ ![docker logs](images/minio-image-upload/docker-logs.png)
+
+3. Open http://localhost:9000 and login with the shown credentials.
+
+ ![minio default view](images/minio-image-upload/default-view.png)
+
+4. Create a bucket for HackMD
+
+ ![minio create bucket](images/minio-image-upload/create-bucket.png)
+
+5. Add a policy for the prefix `uploads` and make it read-only.
+
+ ![minio edit policy](images/minio-image-upload/open-edit-policy.png)
+ *Open policy editor*
+
+ ![minio policy adding](images/minio-image-upload/create-policy.png)
+ *Add policy for uploads*
+
+6. Set credentials and configs for Minio in HackMD's `config.json`
+
+ ```JSON
+ "minio": {
+ "accessKey": "888MXJ7EP4XXXXXXXXX",
+ "secretKey": "yQS2EbM1Y6IJrp/1BUKWq2/XXXXXXXXXXXXXXX",
+ "endPoint": "localhost",
+ "port": 9000,
+ "secure": false
+ }
+ ```
+ *You have to use different values for `endpoint` and `port` for a production
+ setup. Keep in mind the `endpoint`-address has to be public accessible from
+ your browser.*
+
+7. Set bucket name
+
+ ```JSON
+ "s3bucket": "hackmd"
+ ```
+
+8. Set upload type.
+
+ ```JSON
+ "imageUploadType": "minio"
+ ```
+
+9. Review your config.
+
+ ```json
+ {
+ // all your other config…
+ "minio": {
+ "accessKey": "888MXJ7EP4XXXXXXXXX",
+ "secretKey": "yQS2EbM1Y6IJrp/1BUKWq2/XXXXXXXXXXXXXXX",
+ "endPoint": "localhost",
+ "port": 9000,
+ "secure": false
+ },
+ "s3bucket": "hackmd",
+ "imageUploadType": "minio"
+ }
+ ```