Code Monkey home page Code Monkey logo

s3-directory-index's Introduction

S3 Directory Index

This script exploits the error document functionality of S3 static websites to create an Apache-style directory index of your bucket.

Bucket Setup

  1. Copy list.html into the S3 bucket where you want to serve a directory listing.

    • Edit s3Params to reflect the bucket name and appropriate S3 endpoint. (reference)
    • Edit ignoreList to exclude any files from the directory index.
  2. Grant Everyone List permissions.

  3. Enable Static Website Hosting.

    • Set the Index Document to index.html.
    • Set the Error Document to list.html.
    • Note the endpoint.
  4. Add the following CORS policy:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedOrigin>http://{{ endpoint }}</AllowedOrigin>
    </CORSRule>
</CORSConfiguration>

License

See LICENSE

Inspiration

Idea based on https://github.com/rgrp/s3-bucket-listing (which was itself based on http://aws.amazon.com/code/Amazon-S3/1713). Styles taken from the default vsftpd directory index template.

s3-directory-index's People

Contributors

cdemers avatar josephabrahams avatar

Watchers

 avatar  avatar  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.