diff --git a/cmd/tusd/cli/composer.go b/cmd/tusd/cli/composer.go index 2d17f858..70004761 100644 --- a/cmd/tusd/cli/composer.go +++ b/cmd/tusd/cli/composer.go @@ -80,7 +80,7 @@ func CreateComposer() { // GCS_SERVICE_ACCOUNT_FILE environment variable. gcsSAF := os.Getenv("GCS_SERVICE_ACCOUNT_FILE") if gcsSAF == "" { - stderr.Fatalf("No service account file provided for Google Cloud Storage using the GCS_SERVICE_ACCOUNT_FILE environment variable.\n") + stdout.Printf("Attempting to use default GCS credentials because no GCS_SERVICE_ACCOUNT_FILE env var was provided\n") } service, err := gcsstore.NewGCSService(gcsSAF) diff --git a/go.mod b/go.mod index b278b776..094cbb58 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,9 @@ module github.com/tus/tusd/v2 // Specify the Go version needed for the Heroku deployment // See https://github.com/heroku/heroku-buildpack-go#go-module-specifics // +heroku goVersion go1.22 -go 1.21.0 -toolchain go1.22.7 +go 1.22.1 + +toolchain go1.23.1 require ( cloud.google.com/go/storage v1.43.0 diff --git a/pkg/gcsstore/gcsservice.go b/pkg/gcsstore/gcsservice.go index de9a00ef..9f50ef86 100644 --- a/pkg/gcsstore/gcsservice.go +++ b/pkg/gcsstore/gcsservice.go @@ -81,7 +81,12 @@ type GCSService struct { // NewGCSService returns a GCSService object given a GCloud service account file path. func NewGCSService(filename string) (*GCSService, error) { ctx := context.Background() - client, err := storage.NewClient(ctx, option.WithCredentialsFile(filename)) + var opts []option.ClientOption + if filename != "" { + opts = append(opts, option.WithCredentialsFile(filename)) + } + client, err := storage.NewClient(ctx, opts...) + if err != nil { return nil, err }