Skip to content

Commit e1ec059

Browse files
authored
Merge pull request #677 from nyaruka/latest_gocommon
Update to latest gocommon
2 parents 03f449b + b4758c9 commit e1ec059

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

core/models/sessions.go

-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"path"
1111
"time"
1212

13-
"github.com/aws/aws-sdk-go/service/s3"
1413
"github.com/gomodule/redigo/redis"
1514
"github.com/jmoiron/sqlx"
1615
"github.com/lib/pq"
@@ -807,7 +806,6 @@ func WriteSessionOutputsToStorage(ctx context.Context, rt *runtime.Runtime, sess
807806
Path: s.StoragePath(rt.Config),
808807
Body: []byte(s.Output()),
809808
ContentType: "application/json",
810-
ACL: s3.ObjectCannedACLPrivate,
811809
}
812810
}
813811

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/jmoiron/sqlx v1.3.5
1616
github.com/lib/pq v1.10.6
1717
github.com/nyaruka/ezconf v0.2.1
18-
github.com/nyaruka/gocommon v1.31.0
18+
github.com/nyaruka/gocommon v1.32.0
1919
github.com/nyaruka/goflow v0.172.5
2020
github.com/nyaruka/logrus_sentry v0.8.2-0.20190129182604-c2962b80ba7d
2121
github.com/nyaruka/null v1.2.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ github.com/naoina/toml v0.1.1 h1:PT/lllxVVN0gzzSqSlHEmP8MJB4MY2U7STGxiouV4X8=
218218
github.com/naoina/toml v0.1.1/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E=
219219
github.com/nyaruka/ezconf v0.2.1 h1:TDXWoqjqYya1uhou1mAJZg7rgFYL98EB0Tb3+BWtUh0=
220220
github.com/nyaruka/ezconf v0.2.1/go.mod h1:ey182kYkw2MIi4XiWe1FR/mzI33WCmTWuceDYYxgnQw=
221-
github.com/nyaruka/gocommon v1.31.0 h1:eVRxmyTZxRQ4mBs3JoYaPe33LlNuQD63pxq2M+eHQA8=
222-
github.com/nyaruka/gocommon v1.31.0/go.mod h1:PApT/06fP5Tzs4/kbkJ+rVoyOc9Lbqm1lR0ow8Vqzp0=
221+
github.com/nyaruka/gocommon v1.32.0 h1:No9EGpym15WvWmbdNcKytvgQTpnEjTEyEf+doaaysSY=
222+
github.com/nyaruka/gocommon v1.32.0/go.mod h1:PApT/06fP5Tzs4/kbkJ+rVoyOc9Lbqm1lR0ow8Vqzp0=
223223
github.com/nyaruka/goflow v0.172.5 h1:bfoW99cRGuLYnXz47RpLhl64WPqYwaNP47pF5Cd2G2g=
224224
github.com/nyaruka/goflow v0.172.5/go.mod h1:5yvNaDXx/C/OFJ9W3F9OL6zh3pOocroK7jN2aF80sJE=
225225
github.com/nyaruka/librato v1.0.0 h1:Vznj9WCeC1yZXbBYyYp40KnbmXLbEkjKmHesV/v2SR0=

mailroom.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"sync"
88
"time"
99

10+
"github.com/aws/aws-sdk-go/service/s3"
1011
"github.com/nyaruka/gocommon/analytics"
1112
"github.com/nyaruka/gocommon/storage"
1213
"github.com/nyaruka/mailroom/core/queue"
@@ -128,11 +129,11 @@ func (mr *Mailroom) Start() error {
128129
if err != nil {
129130
return err
130131
}
131-
mr.rt.MediaStorage = storage.NewS3(s3Client, mr.rt.Config.S3MediaBucket, c.S3Region, 32)
132-
mr.rt.SessionStorage = storage.NewS3(s3Client, mr.rt.Config.S3SessionBucket, c.S3Region, 32)
132+
mr.rt.MediaStorage = storage.NewS3(s3Client, mr.rt.Config.S3MediaBucket, c.S3Region, s3.BucketCannedACLPublicRead, 32)
133+
mr.rt.SessionStorage = storage.NewS3(s3Client, mr.rt.Config.S3SessionBucket, c.S3Region, s3.ObjectCannedACLPrivate, 32)
133134
} else {
134-
mr.rt.MediaStorage = storage.NewFS("_storage")
135-
mr.rt.SessionStorage = storage.NewFS("_storage")
135+
mr.rt.MediaStorage = storage.NewFS("_storage", 0766)
136+
mr.rt.SessionStorage = storage.NewFS("_storage", 0766)
136137
}
137138

138139
// test our media storage

testsuite/testsuite.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ func Get() (context.Context, *runtime.Runtime, *sqlx.DB, *redis.Pool) {
7171
ReadonlyDB: db,
7272
RP: rp,
7373
ES: nil,
74-
MediaStorage: storage.NewFS(MediaStorageDir),
75-
SessionStorage: storage.NewFS(SessionStorageDir),
74+
MediaStorage: storage.NewFS(MediaStorageDir, 0766),
75+
SessionStorage: storage.NewFS(SessionStorageDir, 0766),
7676
Config: runtime.NewDefaultConfig(),
7777
}
7878

0 commit comments

Comments
 (0)