share
Shares restricted access to objects
Usage
An access generated using uplink share
with no arguments creates an access to your entire project with read permissions.
Flags
Flag | Description |
---|---|
--access string | the serialized access, or name of the access to use |
--auth-service string | url for shared auth service (default "https://auth.storjshare.io") |
--base-url string | the base URL for link sharing (default "https://link.storjshare.io") |
--disallow-deletes | if true, disallow deletes |
--disallow-lists | if true, disallow lists |
--disallow-reads | if true, disallow reads |
--disallow-writes | if true, disallow writes |
--dns string | specify your custom hostname. if set, returns dns settings for web hosting. implies --register and --public |
--export-to string | path to export the shared access to |
--help , -h | help for share |
--not-after | disallow access after this time (e.g. '+2h', '2020-01-02T15:01:01-01:00') |
--not-before | disallow access before this time (e.g. '+2h', '2020-01-02T15:01:01-01:00') |
--max-object-ttl | The object is automatically deleted after this period. (e.g. '1h30m', '24h', '720h') |
--public | if true, the access will be public. --dns and --url override this |
--readonly | implies --disallow-writes and --disallow-deletes |
--register | if true, creates and registers access grant |
--url | if true, returns a url for the shared path. implies --register and --public |
--writeonly | implies --disallow-reads and --disallow-lists |
Examples
Share a single object
Notice that by default, only download (read) and list operations are allowed.
Share a bucket with all permissions
As the --readonly
flag is set to false, uploads and deletes are allowed.
Register with Gateway MT
Generate credentials to use with our S3 multitenant gateway: Getting started
Notice the endpoint generated for Gateway MT: https://gateway.storjshare.io
.
Link Sharing
You can also generate a URL to share your projects/buckets/objects
Note that specifying --base-url
is optional, but the --not-after
is mandatory. If you do not want to specify date or offset - you can specify --not-after=none
.
See share for details.
Also note that the URL uses the same Gateway MT access key, so if you have that already, you don't necessarily need to run this command to generate a shareable link.
https://link.storjshare.io/s/<access key>/<object path>
To download content directly, use /raw/
in Linkshare URL ex: https://link.storjshare.io/raw/jxkfryh6anmtrcfhtio4q5lszuza/media%2FBig%20Buck%20Bunny%20Demo.mp4
To view the object location map, use /s/
in Linkshare URL ex: https://link.storjshare.io/s/jxkfryh6anmtrcfhtio4q5lszuza/media%2FBig%20Buck%20Bunny%20Demo.mp4
Webhosting
For more detail, visit the documentation on Static site hosting.
While you may share individual objects with the above linksharing instructions, you must share a bucket or object prefix for webhosting. Your web address will render the index.html file.
Use the generated DNS info to connect your domain name to your shared objects.
Note you can use any hostname in place of www.mysite.com
in the example. The base-url is also optional.