diff --git a/.circleci/config.yml b/.circleci/config.yml index 3db58f54fff56161dbce0514d3fe696430d1cad9..57ac2299d6d6b34217e578e73bfbd1a068284871 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ jobs: working_directory: /go/src/github.com/turt2live/matrix-media-repo steps: - checkout - - run: + - run: name: build binaries command: 'GOBIN=$PWD/`dirname $0`/bin go install -v ./cmd/...' - store_artifacts: diff --git a/api/custom/federation.go b/api/custom/federation.go index 61543fafa1250d0771f70fdd3645d48705ed08bc..728b3423efaf8f60b0b9b5eee0c6b0c4d9e77a9f 100644 --- a/api/custom/federation.go +++ b/api/custom/federation.go @@ -50,5 +50,5 @@ func GetFederationInfo(r *http.Request, log *logrus.Entry, user api.UserInfo) in resp["base_url"] = url resp["hostname"] = hostname resp["versions_response"] = out - return &api.DoNotCacheResponse{Payload:resp} + return &api.DoNotCacheResponse{Payload: resp} } diff --git a/api/custom/quarantine.go b/api/custom/quarantine.go index ce038099a8dffc40facdfd50b05d841e5c410e6a..f28a5c01f03bb569370c697adb2b07f68df96140 100644 --- a/api/custom/quarantine.go +++ b/api/custom/quarantine.go @@ -69,7 +69,7 @@ func QuarantineRoomMedia(r *http.Request, log *logrus.Entry, user api.UserInfo) total += resp.(*MediaQuarantinedResponse).NumQuarantined } - return &api.DoNotCacheResponse{Payload:&MediaQuarantinedResponse{NumQuarantined: total}} + return &api.DoNotCacheResponse{Payload: &MediaQuarantinedResponse{NumQuarantined: total}} } func QuarantineMedia(r *http.Request, log *logrus.Entry, user api.UserInfo) interface{} { @@ -94,7 +94,7 @@ func QuarantineMedia(r *http.Request, log *logrus.Entry, user api.UserInfo) inte } resp, _ := doQuarantine(r.Context(), log, server, mediaId, allowOtherHosts) - return &api.DoNotCacheResponse{Payload:resp} + return &api.DoNotCacheResponse{Payload: resp} } func doQuarantine(ctx context.Context, log *logrus.Entry, origin string, mediaId string, allowOtherHosts bool) (interface{}, bool) { diff --git a/appveyor.yml b/appveyor.yml index b3b2081265cbcfbc4ba10c0f98e23d56531a5ff8..a1d424a2eeb00288af6a7374532629948e34ee29 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ clone_folder: c:\gopath\src\github.com\turt2live\matrix-media-repo environment: GOPATH: c:\gopath GOVERSION: 1.12 - + branches: only: [master, develop] diff --git a/config.sample.yaml b/config.sample.yaml index 75d839e0455f2fa4e79f822340be2d68e4abb516..05ae3b86e18e029dc3df5756039ff203d09cdce2 100644 --- a/config.sample.yaml +++ b/config.sample.yaml @@ -99,7 +99,7 @@ uploads: # placed anywhere to match everything (eg: "image/*" matches all images). This will also # restrict which file types are downloaded from remote servers. allowedTypes: - - "*/*" + - "*/*" # Specific users can have their own set of allowed file types. These are applied instead # of those listed in the allowedTypes list when a user is found. Much like allowedTypes, diff --git a/controllers/preview_controller/preview_controller.go b/controllers/preview_controller/preview_controller.go index 02a6bf8be1be52793654615084cd8d23ede4b289..e0acd5afdc3151b08bccd64505b795b1b041e1bd 100644 --- a/controllers/preview_controller/preview_controller.go +++ b/controllers/preview_controller/preview_controller.go @@ -40,7 +40,7 @@ func GetPreview(urlStr string, onHost string, forUserId string, atTs int64, ctx now := util.NowMillis() atTsBk := stores.GetBucketTs(atTs) nowBk := stores.GetBucketTs(now) - if (now - atTs) > 60000 && atTsBk != nowBk { + if (now-atTs) > 60000 && atTsBk != nowBk { // Because we don't have a cached preview, we'll use the current time as the preview time. // We also give a 60 second buffer so we don't cause an infinite loop (considering we're // calling ourselves), and to give a lenient opportunity for slow execution.