GithubHelp home page GithubHelp logo

takenoko-gohan / storage-gateway Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 302 KB

Simple gateway server for static contents of S3 buckets.

License: MIT License

Rust 95.20% HTML 1.54% CSS 0.57% Dockerfile 2.69%

storage-gateway's Introduction

storage-gateway

Simple gateway server for static contents of S3 buckets.

Overview

Overview

Required permissions

storage-gateway must allow the following actions for the S3 buckets it accesses.

  • s3:ListBucket
  • s3:GetObject

Environment variables

Variable Description Required Default
GW_ALLOW_DOMAINS Comma separated list of domains to allow access to the gateway.
e.g. *.example.com,foo.example.net
yes
GW_ROOT_OBJECT The object to return when the root path is requested.
e.g. index.html
no
GW_SUBDIR_ROOT_OBJECT The object to return when a subdirectory is requested.
e.g. index.html
no
GW_NO_SUCH_KEY_REDIRECT_OBJECT The object to return when a key is not found.
e.g. index.html
no
GW_ALLOW_CROSS_ACCOUNT Allow cross account access no false
GW_GATEWAY_PORT The port to run the gateway on no 8000
GW_MANAGEMENT_PORT The port to run the management server on no 8080

Management server paths

Path Method Description
/health GET Health check. Always return status code 200.

Access S3 buckets of other AWS accounts

To access S3 buckets of other AWS accounts, you must set the GW_ALLOW_CROSS_ACCOUNT environment variable to true.
In this case, it is recommended to restrict which accounts can access with the following IAM policy.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Statement1",
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::*.example.com"
      ]
    },
    {
      "Sid": "Statement2",
      "Effect": "Allow",
      "Action": [
        "s3:GetObject"
      ],
      "Resource": [
        "arn:aws:s3:::*.example.com/*"
      ],
      "Condition": {
        "StringEquals": {
          "s3:ResourceAccount": [
            "012345678901",
            "123456789012"
          ]
        }
      }
    }
  ]
}

storage-gateway's People

Contributors

takenoko-gohan avatar

Stargazers

Shinichi Kogai avatar Fukaya Temma avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.