Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add s3 logs bucket config #131

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading