HackMD/docs/guides/minio-image-upload.md
Sheogorath bd92010dd2
Remove camel case from imageuploadtype in config
This removes the only camel cased option of the config options
**we** added to the config.json.

In auth provider's config parts are a lot of camel cased options
provided. We shouldn't touch them to keep them as similar as
possible to the examples.

Fixes #315

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-01-27 23:50:15 +01:00

2 KiB

Minio Guide for HackMD

  1. First of all you need to setup Minio itself.

    Please refer to the official Minio docs for an production setup.

    For checking it out and development purposes a non-persistent setup is enough:

    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

  3. Open http://localhost:9000 and login with the shown credentials.

    minio default view

  4. Create a bucket for HackMD

    minio create bucket

  5. Add a policy for the prefix uploads and make it read-only.

    minio edit policy Open policy editor

    minio policy adding Add policy for uploads

  6. Set credentials and configs for Minio in HackMD's config.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

    "s3bucket": "hackmd"
    
  8. Set upload type.

    "imageuploadtype": "minio"
    
  9. Review your config.

    {
      // all your other config…
      "minio": {
        "accessKey": "888MXJ7EP4XXXXXXXXX",
        "secretKey": "yQS2EbM1Y6IJrp/1BUKWq2/XXXXXXXXXXXXXXX",
        "endPoint": "localhost",
        "port": 9000,
        "secure": false
      },
      "s3bucket": "hackmd",
      "imageuploadtype": "minio"
    }