From 473c53a3db265140a6f2658d54c3db959d4de97a Mon Sep 17 00:00:00 2001 From: Travis Ralston <travpc@gmail.com> Date: Fri, 10 Nov 2017 23:49:58 -0700 Subject: [PATCH] Misc updates --- .gitignore | 2 + README.md | 4 +- config.sample.yaml | 37 +++++++++++++++++++ .../matrix-media-repo/client/r0/download.go | 2 +- 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 config.sample.yaml diff --git a/.gitignore b/.gitignore index 96733244..849fb6af 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 68bd725d..9b754d6f 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 00000000..5894f735 --- /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 6078a4ff..156f28b8 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) } -- GitLab