You can add several access grants to the config.yaml, using this format:
Terminal
|
access: 14aV.... # default Access
accesses.site: 26NBm..... # the Access with name "site"
You can see the path to the default config file config.yaml with this command:
Windows
Linux
macOS
Terminal
|
./gateway help
Terminal
|
gateway help
Terminal
|
gateway help
Running options
Adding Access Grants
Running Gateway ST to host a static website
Running Gateway ST to host a static website with cache
You can run a gateway with specifying the access grant (or its name) with the option --access, for example:
Windows
Linux
macOS
Docker
Terminal
|
./gateway run --access 14aV....
or with the name of the access grant from your config (see Adding Access Grants)
Terminal
|
./gateway run --access site
Terminal
|
gateway run --access 14aV....
or with name of the access grant from your config (see Adding Access Grants)
Terminal
|
gateway run --access site
Terminal
|
gateway run --access 14aV....
or with name of the access grant from your config (see Adding Access Grants)
Terminal
|
gateway run --access site
Terminal
|
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....
or with name of the access grant from your config (see Adding Access Grants)
Terminal
|
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 site
Running Gateway ST to host a static website
You can also run a gateway to handle a bucket as a static website. Make sure to set Configuration options.
Windows
Linux
macOS
Docker
Terminal
|
./gateway run --access 14aV.... --website
or with the name of the access grant from your config (see Adding Access Grants)
Terminal
|
./gateway run --access site --website
Terminal
|
gateway run --access 14aV.... --website
or with name of the access grant from your config (see Adding Access Grants)
Terminal
|
gateway run --access site --website
Terminal
|
gateway run --access 14aV.... --website
or with name of the access grant from your config (see Adding Access Grants)
Terminal
|
gateway run --access site --website
Terminal
|
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
or with name of the access grant from your config (see Adding Access Grants)
Terminal
|
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 site --website
You can publish this page to the internet, but in this case, you should run your gateway with the option --server.address local_IP:local_Port (replacelocal_IPwith the local IP of your PC andlocal_Port with the port you want to expose).
If you uselocalhost or 127.0.0.1 as your local_IP, you will not be able to publish it directly (via port forwarding for example), instead, you will have to use a reverse proxy here.
Running Gateway ST to host a static website with cache
The following example uses /mnt/drive1, /mnt/drive2 ,/mnt/cache1 ... /mnt/cache3 for caching, while excluding all objects under bucket mybucket and all objects with '.pdf' extensions on a S3 Gateway setup. Objects are cached if they have been accessed three times or more. Cache max usage is restricted to 80% of disk capacity in this example. Garbage collection is triggered when the high watermark is reached (i.e. at 72% of cache disk usage) and will clear the least recently accessed entries until the disk usage drops to the low watermark - i.e. cache disk usage drops to 56% (70% of 80% quota).
Export the environment variables before running the Gateway:
Windows
Linux
macOS
Docker
Cache disks are not supported, because caching requires the atime function to be enabled.
For Windows, the option -e MINIO_CACHE_DRIVES is useless due to the lack of an atime function, and can be removed with mounts those drives to the docker container.
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:
Terminal
|
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
Setting MINIO_BROWSER=off env variable would disable the Minio browser. This would make sense if running the gateway as a static website in production.