Skip to content
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
24 changes: 23 additions & 1 deletion taco/internal/storage/s3store.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,18 @@ type s3Store struct {

// NewS3Store creates a new S3-backed unit store.
// Region can be empty to use the default AWS config chain.
// Supports custom endpoints via AWS_ENDPOINT environment variable (for Tigris, MinIO, etc.)
func NewS3Store(ctx context.Context, bucket, prefix, region string) (UnitStore, error) {
if bucket == "" {
return nil, fmt.Errorf("s3 bucket is required")
}

var (
cfg aws.Config
err error
)

// Load default config with region
if region != "" {
cfg, err = config.LoadDefaultConfig(ctx, config.WithRegion(region))
} else {
Expand All @@ -50,7 +54,25 @@ func NewS3Store(ctx context.Context, bucket, prefix, region string) (UnitStore,
if err != nil {
return nil, err
}
cli := s3.NewFromConfig(cfg)

// Check for custom endpoint (for S3-compatible storage like Tigris, MinIO, etc.)
endpoint := os.Getenv("AWS_ENDPOINT")
var cli *s3.Client

if endpoint != "" {
// Use custom endpoint for S3-compatible storage
cli = s3.NewFromConfig(cfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String(endpoint)
// Force path-style addressing for S3-compatible storage
o.UsePathStyle = true
})
fmt.Printf("S3Store: Using custom endpoint: %s (path-style)\n", endpoint)
} else {
// Standard AWS S3
cli = s3.NewFromConfig(cfg)
fmt.Printf("S3Store: Using AWS S3 in region: %s\n", cfg.Region)
}

return &s3Store{client: cli, bucket: bucket, prefix: strings.Trim(prefix, "/")}, nil
}

Expand Down
5 changes: 3 additions & 2 deletions ui/src/routes/api/auth/workos/webhooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ export const Route = createFileRoute('/api/auth/workos/webhooks')({
}

if (userInvitations.length > 0) {
const orgDetails = await getOrganisationDetails(orgId);
let orgName = orgDetails.name;
for (const invitation of userInvitations) {
const orgDetails = await getOrganisationDetails(invitation.organizationId!);
let orgName = orgDetails.name;
console.log(`Syncing organization ${orgName} to backend and statesman`);
try {
await syncOrgToBackend(invitation.organizationId!, orgName, null);
await syncOrgToStatesman(invitation.organizationId!, orgName, personalOrgDisplayName, invitation.userId!, invitation.userEmail!);
Expand Down
Loading