diff --git a/.gitignore b/.gitignore index 96733244ab3f3a360b957d83181cc65fdcc1ede1..849fb6afa82a2afefe61f1fbbbee47d800941c7c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ /bin /pkg +media-repo.yaml + vendor/pkg vendor/src diff --git a/README.md b/README.md index 68bd725ddca08142482143d1b5e74bbb26a3062f..9b754d6fe82f6c8b629534a6d81a09186b9e981c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # matrix-media-repo -A domain-aware media repository for matrix +A host-aware media repository for Matrix. Designed for environments with multiple homeservers. + +Talk about it in [#media-repo:t2bot.io](https://matrix.to/#/#media-repo:t2bot.io). # Installing diff --git a/config.sample.yaml b/config.sample.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5894f735395a4703eebcc592e887c1c90f175287 --- /dev/null +++ b/config.sample.yaml @@ -0,0 +1,37 @@ +# NOT YET IMPLEMENTED +homeservers: + allowed: + - t2bot.io + - t2l.io + +# NOT YET IMPLEMENTED +database: + # Currently only "postgres" is supported. + postgres: "postgres://mediarepo:yourpassword@localhost/media-repository?sslmode=disable" + +uploads: + # A location will be picked based upon estimated folder size + # DISTRIBUTION NOT YET IMPLEMENTED + storagePaths: + - /var/matrix/media + maxBytes: 10485760 # 10MB default, 0 to disable + +# NOT YET IMPLEMENTED +thumbails: + dynamic: false + sizes: + - width: 32 + height: 32 + method: crop + - width: 96 + height: 96 + method: crop + - width: 320 + height: 240 + method: scale + - width: 640 + height: 480 + method: scale + - width: 800 + height: 600 + method: scale \ No newline at end of file diff --git a/src/github.com/turt2live/matrix-media-repo/client/r0/download.go b/src/github.com/turt2live/matrix-media-repo/client/r0/download.go index 6078a4ff204a857dd7f7017cf4388a29d85eaab3..156f28b8d76a3e9b7f5f300ef4d62c9784d2806a 100644 --- a/src/github.com/turt2live/matrix-media-repo/client/r0/download.go +++ b/src/github.com/turt2live/matrix-media-repo/client/r0/download.go @@ -25,5 +25,5 @@ func DownloadMedia(w http.ResponseWriter, r *http.Request) { filename = "testasdasdasd.jpg" } - io.WriteString(w, "Server = " + server + "; mediaId = " + mediaId +"; filename = " + filename) + io.WriteString(w, "Server = "+server+"; mediaId = "+mediaId+"; filename = "+filename+"; Host = "+r.Host) }