diff --git a/app/dcs/code/aws/php/page.md b/app/(docs)/dcs/code/aws/php/page.md similarity index 100% rename from app/dcs/code/aws/php/page.md rename to app/(docs)/dcs/code/aws/php/page.md diff --git a/app/(docs)/learn/self-host/gateway-st/page.md b/app/(docs)/learn/self-host/gateway-st/page.md index 8bdeb2806..0f7d4d7cd 100644 --- a/app/(docs)/learn/self-host/gateway-st/page.md +++ b/app/(docs)/learn/self-host/gateway-st/page.md @@ -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 @@ -113,7 +113,7 @@ Direct Download {% tab label="Docker" %} -```Text +```shell docker pull storjlabs/gateway ``` @@ -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 ``` @@ -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. @@ -236,7 +240,7 @@ The gateway functions as a daemon. Start it and leave it running. {% tabs %} {% tab label="Windows" %} -```Text +```powershell ./gateway.exe run ``` @@ -244,7 +248,7 @@ The gateway functions as a daemon. Start it and leave it running. {% tab label="Linux" %} -```Text +```bash gateway run ``` @@ -252,7 +256,7 @@ gateway run {% tab label="macOS" %} -```Text +```shell gateway run ``` @@ -260,7 +264,7 @@ gateway run {% 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 ``` @@ -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! @@ -303,31 +308,31 @@ 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 ``` @@ -335,7 +340,7 @@ aws s3 --endpoint=http://localhost:7777 presign s3://bucket-name/your-large-file ### Delete an object -```none +```shell aws s3 --endpoint=http://localhost:7777 rm s3://bucket-name/your-large-file.mp4 ``` @@ -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" ``` @@ -377,7 +382,7 @@ You can see the path to the default config file `config.yaml` with this command: {% tabs %} {% tab label="Windows" %} -```Text +```shell ./gateway help ``` @@ -385,7 +390,7 @@ You can see the path to the default config file `config.yaml` with this command: {% tab label="Linux" %} -```Text +```shell gateway help ``` @@ -393,7 +398,7 @@ gateway help {% tab label="macOS" %} -```Text +```shell gateway help ``` @@ -407,7 +412,7 @@ 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.... ``` @@ -415,7 +420,7 @@ You can run a gateway with specifying the access grant (or its name for example {% tab label="Linux" %} -```Text +```shell gateway run --access 14aV.... ``` @@ -423,7 +428,7 @@ gateway run --access 14aV.... {% tab label="macOS" %} -```Text +```shell gateway run --access 14aV.... ``` @@ -431,7 +436,7 @@ gateway run --access 14aV.... {% 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.... ``` @@ -445,7 +450,7 @@ 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 ``` @@ -453,7 +458,7 @@ You can also run a gateway to handle a bucket as a static website. {% tab label="Linux" %} -```Text +```shell gateway run --access 14aV.... --website ``` @@ -461,7 +466,7 @@ gateway run --access 14aV.... --website {% tab label="macOS" %} -```Text +```shell gateway run --access 14aV.... --website ``` @@ -469,7 +474,7 @@ gateway run --access 14aV.... --website {% 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 ``` @@ -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 @@ -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/*" @@ -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/*" @@ -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/*" @@ -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 ```