Skip to content

Commit a99467f

Browse files
committed
Add minio guide
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
1 parent eec2318 commit a99467f

6 files changed

Lines changed: 83 additions & 0 deletions

File tree

14.9 KB
Loading
20.7 KB
Loading
12.8 KB
Loading
71.5 KB
Loading
17.1 KB
Loading

docs/guides/minio-image-upload.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
Minio Guide for HackMD
2+
===
3+
4+
1. First of all you need to setup Minio itself.
5+
6+
Please refer to the [official Minio docs](https://docs.minio.io/) for an
7+
production setup.
8+
9+
For checking it out and development purposes a non-persistent setup is enough:
10+
```console
11+
docker run --name test-minio --rm -d -p 9000:9000 minio/minio server /data
12+
```
13+
14+
*Please notice this is not for productive use as all your data gets lost
15+
when you stop this container*
16+
17+
2. Next step is to get the credentials form the container:
18+
19+
```
20+
docker logs test-minio
21+
```
22+
23+
![docker logs](images/minio-image-upload/docker-logs.png)
24+
25+
3. Open http://localhost:9000 and login with the shown credentials.
26+
27+
![minio default view](images/minio-image-upload/default-view.png)
28+
29+
4. Create a bucket for HackMD
30+
31+
![minio create bucket](images/minio-image-upload/create-bucket.png)
32+
33+
5. Add a policy for the prefix `uploads` and make it read-only.
34+
35+
![minio edit policy](images/minio-image-upload/open-edit-policy.png)
36+
*Open policy editor*
37+
38+
![minio policy adding](images/minio-image-upload/create-policy.png)
39+
*Add policy for uploads*
40+
41+
6. Set credentials and configs for Minio in HackMD's `config.json`
42+
43+
```JSON
44+
"minio": {
45+
"accessKey": "888MXJ7EP4XXXXXXXXX",
46+
"secretKey": "yQS2EbM1Y6IJrp/1BUKWq2/XXXXXXXXXXXXXXX",
47+
"endPoint": "localhost",
48+
"port": 9000,
49+
"secure": false
50+
}
51+
```
52+
*You have to use different values for `endpoint` and `port` for a production
53+
setup. Keep in mind the `endpoint`-address has to be public accessible from
54+
your browser.*
55+
56+
7. Set bucket name
57+
58+
```JSON
59+
"s3bucket": "hackmd"
60+
```
61+
62+
8. Set upload type.
63+
64+
```JSON
65+
"imageUploadType": "minio"
66+
```
67+
68+
9. Review your config.
69+
70+
```json
71+
{
72+
// all your other config…
73+
"minio": {
74+
"accessKey": "888MXJ7EP4XXXXXXXXX",
75+
"secretKey": "yQS2EbM1Y6IJrp/1BUKWq2/XXXXXXXXXXXXXXX",
76+
"endPoint": "localhost",
77+
"port": 9000,
78+
"secure": false
79+
},
80+
"s3bucket": "hackmd",
81+
"imageUploadType": "minio"
82+
}
83+
```

0 commit comments

Comments
 (0)