diff --git a/deep-dive/tigris.html.markerb b/deep-dive/tigris.html.markerb index b34e311605..4be913c415 100644 --- a/deep-dive/tigris.html.markerb +++ b/deep-dive/tigris.html.markerb @@ -10,6 +10,6 @@ order: 6 [Tigris](https://fly.io/docs/tigris/) is a globally distributed object storage service. It essentially requires no configuration, and seamlessly handles multi-regions. If you upload an audio file to a host in Virginia, you can access it from Amsterdam. Even better: subsequent accesses from regions other than the primary region are served locally. -Unlike relational databases, there may be reasons why you want to make your object store available via the internet. In this demo, the object store starts out private, but you can make it [public](/docs/tigris/#public-buckets) if you want. +Unlike relational databases, there may be reasons why you want to make your object store available via the internet. In this demo, the object store starts out private, but you can make it [public](/docs/tigris/#public-buckets) if you want. Public buckets serve objects without authentication at `https://bucket-name.t3.tigrisfiles.io/key-name`. And if you happen to have an existing S3 object store, check out [shadow buckets](/docs/tigris/#migrating-to-tigris-with-shadow-buckets), which enable you to incrementally migrate your data. diff --git a/laravel/the-basics/laravel-tigris-file-storage.html.markerb b/laravel/the-basics/laravel-tigris-file-storage.html.markerb index e550c57f37..930799c2e7 100644 --- a/laravel/the-basics/laravel-tigris-file-storage.html.markerb +++ b/laravel/the-basics/laravel-tigris-file-storage.html.markerb @@ -100,4 +100,10 @@ Now that we have our Tigris Bucket, let's connect it with our Laravel app. Storage::disk('s3')->put('example.txt', 'Contents'); } ``` - Calling the function above should upload a new file in your bucket. \ No newline at end of file + Calling the function above should upload a new file in your bucket. + +## Serving public files + +If your bucket is [public](/docs/tigris/#public-buckets), uploaded objects are accessible without authentication at `https://bucket-name.t3.tigrisfiles.io/key-name`. You can use this URL directly in your Blade templates for images, CSS, JavaScript, and other assets. No credentials or pre-signed URLs are needed. + +For production use, we recommend setting up a [custom domain](https://www.tigrisdata.com/docs/buckets/custom-domain/) so your public URLs stay stable. See the [Tigris Public Bucket docs](https://www.tigrisdata.com/docs/buckets/public-bucket/) for details on all available public domains. \ No newline at end of file diff --git a/partials/tigris/_tigris-storage-create.erb b/partials/tigris/_tigris-storage-create.erb index 7644a78467..fda7a8edf4 100644 --- a/partials/tigris/_tigris-storage-create.erb +++ b/partials/tigris/_tigris-storage-create.erb @@ -28,4 +28,18 @@ You can also make a public bucket private. fly storage update mybucket --private ``` +Objects in a public bucket can be accessed by anyone without authentication. Public content is served from dedicated domains using the bucket name as a subdomain: + +* `https://mybucket.t3.tigrisfiles.io/key-name` (primary) +* `https://mybucket.t3.tigrisbucket.io/key-name` +* `https://mybucket.t3.tigrisblob.io/key-name` + +No credentials or pre-signed URLs are needed. For production use, we recommend setting up a custom domain so your public URLs stay stable: + +```cmd +flyctl storage update mybucket --custom-domain assets.example.com +``` + +Then create a CNAME record for `assets.example.com` pointing to `mybucket.t3.tigrisbucket.io`. See the [Tigris Custom Domain docs](https://www.tigrisdata.com/docs/buckets/custom-domain/) for full setup instructions and the [Tigris Public Bucket docs](https://www.tigrisdata.com/docs/buckets/public-bucket/) for details on all available public domains. + Currently, buckets must be public or private. ACL settings will be ignored by the Tigris API. \ No newline at end of file