Skip to content

Commit

Permalink
Enable Tigris support for Laravel apps (#3866)
Browse files Browse the repository at this point in the history
* Enable tigris for Laravel apps: when s3 package detected in composer, set the proper secret names to use for tigris extension

* fix trailing whitespaces, use gofmt

---------

Co-authored-by: Kathryn Anne S Tan <kathryn@fly.io>
  • Loading branch information
KTanAug21 and Kathryn Anne S Tan authored Aug 18, 2024
1 parent fe8ed25 commit 0ee4071
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scanner/laravel.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@ func configureLaravel(sourceDir string, config *ScannerConfig) (*SourceInfo, err
s.DatabaseDesired = db
}

// Enable Object Storage( Tigris ) when
// * league/flysystem-aws-s3* found in composer.json
if checksPass(sourceDir, dirContains("composer.json", "league/flysystem-aws-s3")) {
s.ObjectStorageDesired = true
s.OverrideExtensionSecretKeyNames = make(map[string]map[string]string)
s.OverrideExtensionSecretKeyNames["tigris"] = make(map[string]string)

// Replace the following secret key names set from the tigris extension provisioning
// With their custom secret key name vales
s.OverrideExtensionSecretKeyNames["tigris"]["AWS_REGION"] = "AWS_DEFAULT_REGION"
s.OverrideExtensionSecretKeyNames["tigris"]["BUCKET_NAME"] = "AWS_BUCKET"
s.OverrideExtensionSecretKeyNames["tigris"]["AWS_ENDPOINT_URL_S3"] = "AWS_ENDPOINT"
}

return s, nil
}

Expand Down

0 comments on commit 0ee4071

Please sign in to comment.