Skip to content

Commit

Permalink
Add public buckets doc
Browse files Browse the repository at this point in the history
  • Loading branch information
amozoss committed Aug 17, 2023
1 parent 1867aca commit 566c7ce
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
35 changes: 34 additions & 1 deletion app/dcs/buckets/public-buckets/page.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
---
title: Public Buckets
weight: 2
docId: cie0gae7voob2Weigh3c
---

🚧
Storj supports public access with a `LINKSHARINGKEY`, which similar to public buckets on S3 but has more [fine-grained controls](docId:tBnCSrmR1jbOewG38fIr4#flags).

To generate a `LINKSHARINGKEY` and make your bucket public:

{% tabs %}
{% tab label="uplink" %}

```shell
uplink share --url --readonly --disallow-lists --not-after=none sj://BUCKET
```

{% /tab %}
{% tab label="Web Console" %}

1. Navigate to Buckets

1. Select **Share Bucket** from the bucket menu

![](https://link.storjshare.io/raw/jua7rls6hkx5556qfcmhrqed2tfa/docs/images/cie0gae7voob2Weigh3c_public_buckets.png)

{% /tab %}
{% /tabs %}

## Embeddable Content

The share from above will give you a browser URL linking to the default Storj share page. It will be of the form `https://link.storjshare.io/LINKSHARINGKEY/BUCKET/`.

To make the content embeddable insert `/raw/` before `LINKSHARINGKEY` (you may need to swap `/s/` for `/raw/` instead). This prefix can then be used to access anything in the bucket.

For example, to access two different images:

https://link.storjshare.io/raw/LINKSHARINGKEY/BUCKET/my_image1.png
https://link.storjshare.io/raw/LINKSHARINGKEY/BUCKET/my_image2.png
6 changes: 4 additions & 2 deletions src/markdoc/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const nodes = {
const children = node.transformChildren(config)
if (attributes.href?.startsWith('docId')) {
let parts = attributes.href.split(':')
let docId = parts[1]
let [docId, fragment] = parts[1].split('#')
let entry = nodeBottomNav.find((o) => o.docId === docId)
if (!entry) {
entry = dcsBottomNav.find((o) => o.docId === docId)
Expand All @@ -97,7 +97,9 @@ const nodes = {

let tag = new Tag(
'a',
entry?.href ? { href: entry.href } : attributes,
entry?.href
? { href: `${entry.href}${fragment ? `#${fragment}` : ''}` }
: attributes,
children.length === 0 && entry?.title ? [entry.title] : children
)
return tag
Expand Down

0 comments on commit 566c7ce

Please sign in to comment.