Sign inSign up

iadev/s3-proxy

By iadev

Updated about 10 years ago

Reverse proxy for AWS S3 with basic authentication and symlink support.

Image
0

2.2K

iadev/s3-proxy repository overview

Reverse proxy for AWS S3 w/ basic authentication

** Forked from https://github.com/pottava/aws-s3-proxy ** Difference from the original is the ability to add a symlink.json to S3. This can then be included in the URL and the contents of the JSON file is used to replace the initial part of the URL. For instance adding symlink.json containing { "URL" : "/test2" } to folder /test1 in a bucket would mean the object /test2/hello could be accessed with the URL /test1/hello.

circleci status

Supported tags and respective Dockerfile links:
・latest (prod/1.5/Dockerfile)

Description

This is a reverse proxy for AWS S3, which is able to provide basic authentication as well.
You don't need to configure a Bucket for Website Hosting.

http://this-proxy.com/access/ -> s3://backet/access/index.html

(日本語はこちら)

Usage

1. Set environment variables
Environment VariablesDescriptionRequiredDefault
AWS_S3_BUCKETThe S3 bucket to be proxied with this app.*
AWS_S3_KEY_PREFIXYou can configure S3 object key prefix.-
AWS_REGIONThe AWS region where the S3 bucket exists.us-east-1
AWS_ACCESS_KEY_IDAWS access key for API access.EC2 Instance Role
AWS_SECRET_ACCESS_KEYAWS secret key for API access.EC2 Instance Role
HTTP_CACHE_CONTROLOverrides S3's HTTP Cache-Control header.S3 Object metadata
HTTP_EXPIRESOverrides S3's HTTP Expires header.S3 Object metadata
BASIC_AUTH_USERUser for basic authentication.-
BASIC_AUTH_PASSPassword for basic authentication.-
SSL_CERT_PATHTLS: cert.pem file path.-
SSL_KEY_PATHTLS: key.pem file path.-
APP_PORTThe port number to be assigned for listening.80
ACCESS_LOGSend access logs to /dev/stdout.false
2. Run the application

docker run -d -p 8080:80 -e AWS_REGION -e AWS_S3_BUCKET pottava/s3-proxy

  • with basic auth:

docker run -d -p 8080:80 -e AWS_REGION -e AWS_S3_BUCKET -e BASIC_AUTH_USER -e BASIC_AUTH_PASS pottava/s3-proxy

  • with TLS:

docker run -d -p 8080:80 -e AWS_REGION -e AWS_S3_BUCKET -e SSL_CERT_PATH -e SSL_KEY_PATH pottava/s3-proxy

  • with docker-compose.yml:
proxy:
  image: pottava/s3-proxy
  ports:
    - 8080:80
  environment:
    - AWS_REGION=ap-northeast-1
    - AWS_ACCESS_KEY_ID
    - AWS_SECRET_ACCESS_KEY
    - AWS_S3_BUCKET
    - BASIC_AUTH_USER=admin
    - BASIC_AUTH_PASS=password
    - ACCESS_LOG=true
  container_name: proxy

Code released under the MIT license.

Tag summary

Content type

Image

Digest

Size

5.5 MB

Last updated

about 10 years ago

docker pull iadev/s3-proxy