Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
93 changes: 49 additions & 44 deletions app/(docs)/learn/self-host/gateway-st/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Direct Download
{% tab label="macOS" %}
Curl Download

```Text
```shell
curl -L https://github.com/storj/gateway-st/releases/latest/download/gateway_darwin_amd64.zip -O && unzip gateway_darwin_amd64.zip
chmod 755 gateway
sudo mv gateway /usr/local/bin/gateway
Expand All @@ -113,7 +113,7 @@ Direct Download

{% tab label="Docker" %}

```Text
```shell
docker pull storjlabs/gateway
```

Expand Down Expand Up @@ -162,7 +162,7 @@ gateway setup

{% tab label="Docker" %}

```dockerfile
```shell
docker run -it --rm --mount type=bind,source=/path/to/gateway-config-dir/,destination=/root/.local/share/storj/gateway/ --name gateway storjlabs/gateway setup
```

Expand Down Expand Up @@ -207,25 +207,29 @@ You can use two methods to obtain an Access Grant:

Now we got our access grant and can configure the gateway as follows:

{% code-group %}

```windows
{% tabs %}
{% tab label="Windows" %}
```powershell
./gateway setup --access 14aV.... --non-interactive
```

```linux
{% /tab %}
{% tab label="Linux" %}
```bash
gateway setup --access 14aV.... --non-interactive
```

```macos
{% /tab %}
{% tab label="macOS" %}
```shell
gateway setup --access 14aV.... --non-interactive
```
{% /tab %}
{% tab label="Docker" %}

```dockerfile
```shell
docker run -it --rm --mount type=bind,source=/path/to/gateway-config-dir/,destination=/root/.local/share/storj/gateway/ --name gateway storjlabs/gateway setup --access 14aV.... --non-interactive
```

{% /code-group %}
{% /tab %}
{% /tabs %}

This command will register the provided access as the default access in the gateway config file.

Expand All @@ -236,31 +240,31 @@ The gateway functions as a daemon. Start it and leave it running.
{% tabs %}
{% tab label="Windows" %}

```Text
```powershell
./gateway.exe run
```

{% /tab %}

{% tab label="Linux" %}

```Text
```bash
gateway run
```

{% /tab %}

{% tab label="macOS" %}

```Text
```shell
gateway run
```

{% /tab %}

{% tab label="Docker" %}

```Text
```shell
docker run -it --rm -p 127.0.0.1:7777:7777 --mount type=bind,source=/path/to/gateway-config-dir/,destination=/root/.local/share/storj/gateway/ --name gateway storjlabs/gateway run
```

Expand All @@ -282,15 +286,16 @@ Please make sure you have [AWS S3 CLI installed](https://docs.aws.amazon.com/cli

Once you do, in a new terminal session, configure it with your Gateway's credentials:

```Text
$ aws configure
```shell
# terminal
aws configure
---
AWS Access Key ID: [Enter your Gateway's Access Key]
AWS Secret Access Key: [Enter your Gateway's Secret Key]
Default region name: [null]
Default output format: [null]

$ aws configure set default.s3.multipart_threshold 64MB
# terminal
aws configure set default.s3.multipart_threshold 64MB
```

Then, test out some AWS S3 CLI commands!
Expand All @@ -303,39 +308,39 @@ See also [](docId:20zlQyfMD9gmHJOUPx3jh)

### Create a bucket

```none
```shell
aws s3 --endpoint=http://localhost:7777 mb s3://bucket-name
```

### Upload an object

```none
```shell
aws s3 --endpoint=http://localhost:7777 cp your-large-file.mp4 s3://bucket-name/your-large-file.mp4
```

### List objects in a bucket

```none
```shell
aws s3 --endpoint=http://localhost:7777 ls s3://bucket-name/
```

### Download an object

```none
```shell
aws s3 --endpoint=http://localhost:7777 cp s3://bucket-name/your-large-file.mp4 ~/Downloads/your-large-file.mp4
```

### Generate a URL for an object

```none
```shell
aws s3 --endpoint=http://localhost:7777 presign s3://bucket-name/your-large-file.mp4
```

(This URL will allow live video streaming through your browser or VLC)

### Delete an object

```none
```shell
aws s3 --endpoint=http://localhost:7777 rm s3://bucket-name/your-large-file.mp4
```

Expand Down Expand Up @@ -367,7 +372,7 @@ Advanced usage for the single-tenant Gateway

You can add several access grants to the `config.yaml`, using this format:

```Text
```shell
access: 14aV.... # default Access
accesses.site: 26NBm..... # the Access with name "site"
```
Expand All @@ -377,23 +382,23 @@ You can see the path to the default config file `config.yaml` with this command:
{% tabs %}
{% tab label="Windows" %}

```Text
```shell
./gateway help
```

{% /tab %}

{% tab label="Linux" %}

```Text
```shell
gateway help
```

{% /tab %}

{% tab label="macOS" %}

```Text
```shell
gateway help
```

Expand All @@ -407,31 +412,31 @@ You can run a gateway with specifying the access grant (or its name for example
{% tabs %}
{% tab label="Windows" %}

```Text
```shell
./gateway run --access 14aV....
```

{% /tab %}

{% tab label="Linux" %}

```Text
```shell
gateway run --access 14aV....
```

{% /tab %}

{% tab label="macOS" %}

```Text
```shell
gateway run --access 14aV....
```

{% /tab %}

{% tab label="Docker" %}

```Text
```shell
docker run -it --rm -p 127.0.0.1:7777:7777 --mount type=bind,source=/path/to/gateway-config-dir/,destination=/root/.local/share/storj/gateway/ --name gateway storjlabs/gateway run --access 14aV....
```

Expand All @@ -445,31 +450,31 @@ You can also run a gateway to handle a bucket as a static website.
{% tabs %}
{% tab label="Windows" %}

```Text
```shell
./gateway run --access 14aV.... --website
```

{% /tab %}

{% tab label="Linux" %}

```Text
```shell
gateway run --access 14aV.... --website
```

{% /tab %}

{% tab label="macOS" %}

```Text
```shell
gateway run --access 14aV.... --website
```

{% /tab %}

{% tab label="Docker" %}

```Text
```shell
docker run -it --rm -p 127.0.0.1:7777:7777 --mount type=bind,source=/path/to/gateway-config-dir/,destination=/root/.local/share/storj/gateway/ --name gateway storjlabs/gateway run --access 14aV.... --website
```

Expand All @@ -496,7 +501,7 @@ Export the environment variables before running the Gateway:
{% tab label="Windows" %}
Cache disks are not supported, because caching requires the [`atime`](https://kerolasa.github.io/filetimes.html) function to be enabled.

```Text
```powershell
$env:MINIO_CACHE="on"
$env:MINIO_CACHE_EXCLUDE="*.pdf,mybucket/*"
$env:MINIO_CACHE_QUOTA=80
Expand All @@ -509,7 +514,7 @@ $env:MINIO_CACHE_WATERMARK_HIGH=90

{% tab label="Linux" %}

```Text
```shell
export MINIO_CACHE="on"
export MINIO_CACHE_DRIVES="/mnt/drive1,/mnt/drive2,/mnt/cache{1...3}"
export MINIO_CACHE_EXCLUDE="*.pdf,mybucket/*"
Expand All @@ -523,7 +528,7 @@ export MINIO_CACHE_WATERMARK_HIGH=90

{% tab label="macOS" %}

```Text
```shell
export MINIO_CACHE="on"
export MINIO_CACHE_DRIVES="/mnt/drive1,/mnt/drive2,/mnt/cache{1...3}"
export MINIO_CACHE_EXCLUDE="*.pdf,mybucket/*"
Expand All @@ -538,7 +543,7 @@ export MINIO_CACHE_WATERMARK_HIGH=90
{% tab label="Docker" %}
You can create a file with environment variables, for example - `minio_vars` with such content:

```Text
```shell
MINIO_CACHE="on"
MINIO_CACHE_DRIVES="/mnt/drive1,/mnt/drive2,/mnt/cache{1...3}"
MINIO_CACHE_EXCLUDE="*.pdf,mybucket/*"
Expand All @@ -552,7 +557,7 @@ For Windows, the option `-e MINIO_CACHE_DRIVES` is useless due to the lack of an

Then add parameters `--env-file ./minio_vars --mount type=bind,src=/mnt/drive1,dst=/mnt/drive1 --mount type=bind,src=/mnt/drive2,dst=/mnt/drive2 --mount type=bind,src=/mnt/cache1,dst=/mnt/cache1 --mount type=bind,src=/mnt/cache2,dst=/mnt/cache2 --mount type=bind,src=/mnt/cache3,dst=/mnt/cache3` to the `docker run` section, for example:

```Text
```shell
docker run -it --rm -p 127.0.0.1:7777:7777 --env-file ./minio_vars --mount type=bind,src=/mnt/drive1,dst=/mnt/drive1 --mount type=bind,src=/mnt/drive2,dst=/mnt/drive2 --mount type=bind,src=/mnt/cache1,dst=/mnt/cache1 --mount type=bind,src=/mnt/cache2,dst=/mnt/cache2 --mount type=bind,src=/mnt/cache3,dst=/mnt/cache3 --mount type=bind,source=/path/to/gateway-config-dir/,destination=/root/.local/share/storj/gateway/ --name gateway storjlabs/gateway run --access site --website
```

Expand Down
Loading