apiEndpoint was used as both apiEndpoint and storage_api_uri, this commit separates them.
The storage_api_uri config is used to change the URL of accessing objects, not the API calls.
ApiEndpoint is used to change the actual rest API endpoint of the storageClient. I have not found a use-case to change the apiEndpoint, but this PR leaves it up to the user to change it or not.
Fixes #25
With this PR we're able to use bucketBoundHostnames again by setting the storage_api_uri config:
'gcs' => [
'driver' => 'gcs',
'key_file_path' => env('GOOGLE_CLOUD_KEY_FILE', null), // optional: /path/to/service-account.json
'key_file' => [], // optional: Array of data that substitutes the .json file (see below)
'project_id' => env('GOOGLE_CLOUD_PROJECT_ID', 'your-project-id'), // optional: is included in key file
'bucket' => env('GOOGLE_CLOUD_STORAGE_BUCKET', 'your-bucket'),
'path_prefix' => env('GOOGLE_CLOUD_STORAGE_PATH_PREFIX', ''), // optional: /default/path/to/apply/in/bucket
'storage_api_uri' => env('GOOGLE_CLOUD_STORAGE_API_URI', 'https://cdn.example.org'), // see: Public URLs below
'apiEndpoint' => env('GOOGLE_CLOUD_STORAGE_API_ENDPOINT', null), // set storageClient apiEndpoint
'visibility' => 'public', // optional: public|private
'metadata' => ['cacheControl'=> 'public,max-age=86400'], // optional: default metadata
],
apiEndpoint was used as both apiEndpoint and storage_api_uri, this commit separates them.
The storage_api_uri config is used to change the URL of accessing objects, not the API calls.
ApiEndpoint is used to change the actual rest API endpoint of the storageClient. I have not found a use-case to change the apiEndpoint, but this PR leaves it up to the user to change it or not.
Fixes #25
With this PR we're able to use
bucketBoundHostnames
again by setting thestorage_api_uri
config:And generate the correct
url()
andtemporaryUrl()
for example: https://cdn.example.org/cats.jpeg instead of https://storage.googleapis.com/your-bucket/cats.jpeg.A good default config would be: