Skip to content

Commit

Permalink
Merge pull request #131 from Ilhasoft/add-s3-logs-bucket-config
Browse files Browse the repository at this point in the history
add s3 logs bucket config
  • Loading branch information
rasoro authored Nov 29, 2024
2 parents b69596d + cb1a74c commit c5c240b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ FROM alpine:3.18
COPY --from=builder /go/bin/ /app/
COPY --from=builder /app/docs /app/docs

RUN apk add --no-cache tzdata

WORKDIR /app

EXPOSE 8000
Expand Down
1 change: 1 addition & 0 deletions mailroom.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (mr *Mailroom) Start() error {
}
mr.rt.AttachmentStorage = storage.NewS3(s3Client, mr.rt.Config.S3AttachmentsBucket, c.S3Region, s3.BucketCannedACLPublicRead, 32)
mr.rt.SessionStorage = storage.NewS3(s3Client, mr.rt.Config.S3SessionsBucket, c.S3Region, s3.ObjectCannedACLPrivate, 32)
mr.rt.LogStorage = storage.NewS3(s3Client, mr.rt.Config.S3LogsBucket, c.S3Region, s3.ObjectCannedACLPrivate, 32)
} else {
mr.rt.AttachmentStorage = storage.NewFS("_storage/attachments", 0766)
mr.rt.SessionStorage = storage.NewFS("_storage/sessions", 0766)
Expand Down
2 changes: 2 additions & 0 deletions runtime/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ type Config struct {
S3AttachmentsBucket string `help:"the S3 bucket we will write attachments to"`
S3AttachmentsPrefix string `help:"the prefix that will be added to attachment filenames"`
S3SessionsBucket string `help:"the S3 bucket we will write attachments to"`
S3LogsBucket string `help:"the S3 bucket we will write logs to"`
S3SessionPrefix string `help:"the prefix that will be added to attachment filenames"`
S3MediaPrefixZendesk string `help:"the prefix that will be added to file attachment names for Zendesk tickets"`
S3DisableSSL bool `help:"whether we disable SSL when accessing S3. Should always be set to False unless you're hosting an S3 compatible service within a secure internal network"`
Expand Down Expand Up @@ -124,6 +125,7 @@ func NewDefaultConfig() *Config {
S3AttachmentsBucket: "attachments-bucket",
S3AttachmentsPrefix: "attachments/",
S3SessionsBucket: "sessions-bucket",
S3LogsBucket: "logs-bucket",
S3DisableSSL: false,
S3ForcePathStyle: false,

Expand Down

0 comments on commit c5c240b

Please sign in to comment.