• Stars
    star
    181
  • Rank 212,110 (Top 5 %)
  • Language
    HTML
  • License
    MIT License
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Single page application to browse AWS S3 bucket content

AWS S3 Bucket Browser Sparkline

-

Single HTML file to browse AWS S3 buckets

Demo

Features

  • Compatible Providers: GCP IBM DigitalOcean
  • List all files in a table view
  • Treat and display / in keys as folders
  • Render preview for Makrdown files
  • Show Install button for manifest.plist on iOS devices

Installation

Self-Hosted

  • Just download index.html and upload it to your bucket.
    • Adjust config within index.html if needed, e.g.
      const config = {
        title: 'Bucket Browser', // prefix value with `HTML> ` to render as html, see subtitle
        subtitle: 'HTML>made with ♥ by <b><a href="https://qoo.monster">qoomon</a></b>', // prefix value with `HTML> ` to render as html
        logo: 'https://qoomon.github.io/aws-s3-bucket-browser/logo.png',
        favicon: 'https://qoomon.github.io/aws-s3-bucket-browser/favicon.ico',
        primaryColor: '#167df0',
        
        bucketUrl: undefined,
        // If bucketUrl is undefined, this script tries to determine bucket Rest API URL from this file location itself.
        //   This will only work for locations like these
        //   * https://s3.BUCKET-REGION.amazonaws.com/BUCKET-NAME/index.html
        //   * http://BUCKET-NAME.s3-website-BUCKET-REGION.amazonaws.com/index.html
        //   * https://storage.googleapis.com/BUCKET-NAME/index.html
        //   * https://BUCKET-NAME.s3-web.BUCKET-REGION.cloud-object-storage.appdomain.cloud/
        //   * https://BUCKET-NAME.BUCKET-REGION.digitaloceanspaces.com
        //   * https://BUCKET-NAME.BUCKET-REGION.cdn.digitaloceanspaces.com
        // If bucketUrl is set manually, ensure this is the bucket Rest API URL, e.g.
        //   * https://s3.BUCKET-REGION.amazonaws.com/BUCKET-NAME
        //   * https://storage.googleapis.com/BUCKET-NAME
        //   The URL should return an XML document with <ListBucketResult> as root element.
        rootPrefix: undefined, // e.g. 'subfolder/'
        keyExcludePatterns: [/^index\.html$/], // matches againt object key relative to rootPrefix
        pageSize: 50,
        
        bucketMaskUrl: undefined, 
        // If bucketMaskUrl is set file urls will be changed from ${bucketUrl}/${file} to ${bucketMaskUrl}/${file}
        //   bucketMaskUrl: 'https://example.org'
        //     => https://example.org/foo/bar.txt 
        //   bucketMaskUrl: document.location.origin
        //     => ${document.location.origin}/foo/bar.txt 
        
        defaultOrder: 'name-asc' // (name|size|dateModified)-(asc|desc)
      }
  • ⚠️ Ensure Bucket Permissions
    • Go to https://s3.console.aws.amazon.com/s3/buckets/<YOUR BUCKET NAME>/?tab=permissions
    • Grant public read permission by Access Control List or Bucket Policy
      • Access Control List
        • Enable List objects for Everyone
      • Bucket Policy
        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Sid": "PublicRead",
                    "Principal": "*",
                    "Effect": "Allow",
                    "Action": [
                        "s3:ListBucket",
                        "s3:GetObject"
                    ],
                    "Resource": [
                        "arn:aws:s3:::<YOUR BUCKET NAME>",
                        "arn:aws:s3:::<YOUR BUCKET NAME>/*"
                    ]
                }
            ]
        }
  • ⚠️ Ensure Bucket CORS
    • Depending on your setup you may need need to ensure following CORS Configuration
    • Go to https://s3.console.aws.amazon.com/s3/buckets/<YOUR BUCKET NAME>/?tab=permissions
    • Grant Cross Origin Access by following CORS Configuration, replace http://www.example.com by your address of bucket browser index.html
      • e.g http://example.s3-website-eu-central-1.amazonaws.com/index.html
      [
        {
            "AllowedHeaders": [
                "*"
            ],
            "AllowedMethods": [
                "GET"
            ],
            "AllowedOrigins": [
                "http://www.example.com"
            ],
            "ExposeHeaders": [
                "x-amz-server-side-encryption",
                "x-amz-request-id",
                "x-amz-id-2"
            ],
            "MaxAgeSeconds": 3000
        }
      ]
  • Open <YOUR BUCKET URL>/index.html in your browser.

Hosted

CloudFront Setup

If you use CloudFront in upfront of your S3 bucket ensure following CloudFront settings.

  • Allowed/Cached HTTP Methods: GET, HEAD, OPTIONS
  • Cached Based on Selected Headers: Whitelist
    • Access-Control-Request-Headers
    • Access-Control-Request-Method
    • Origin
  • Query String Forwarding and Caching: Forward all

IBM Cloud Object Storage Setup

IBM Cloud Object storage only supports virtual host-style addressing, i.e. https://<bucket-name>s3-web.<region>.cloud-object-storage.appdomain.cloud/ for static website hosting. Otherwise follow the instructions in this tutorial to configure your bucket. In addition, you may need to configure CORS for your bucket.

<CORSConfiguration>
  <CORSRule>
      <AllowedOrigin>*</AllowedOrigin>
      <AllowedMethod>GET</AllowedMethod>
      <AllowedHeader>*</AllowedHeader>
  </CORSRule>
</CORSConfiguration>

More Repositories

1

docker-host

A docker sidecar container to forward all traffic to local docker host or any other host
Shell
1,027
star
2

maven-git-versioning-extension

This extension will set project version, based on current Git branch or tag.
Java
278
star
3

git-conventional-commits

Git Conventional Commits Util to generate Semantic Version and Markdown Change Log and Validate Commit Messag
JavaScript
211
star
4

aws-ssm-ec2-proxy-command

AWS SSM EC2 SSH Proxy Command
PowerShell
180
star
5

otp-authenticator-webapp

A 'Google Authenticator' like Single Page Application
JavaScript
93
star
6

zsh-lazyload

zsh plugin for lazy load commands and speed up start up time of zsh
Shell
78
star
7

gradle-git-versioning-plugin

This extension will set project version, based on current Git branch or tag.
Java
77
star
8

Jira-Issue-Card-Printer

Beautiful Issue Card Printer
JavaScript
69
star
9

banking-swift-messages-java

Banking SWIFT Library, MT Format Message Parser Writer SWIFT(Society for Worldwide Interbank Financial Telecommunication)
Java
29
star
10

time-timer-webapp

A CountDown and CountUp Timer
JavaScript
25
star
11

smart-life-webapp

JavaScript
20
star
12

my-zsh

handy and beautiful ZSH config
Shell
17
star
13

github-actions-access-manager

Manage access from GitHub actions workflows.
JavaScript
11
star
14

zjump

Simplify zsh directory navigation; jump to already visited, parent or sub folders.
Shell
10
star
15

zgem

zsh dependency manager 🐚 💎
Shell
10
star
16

unchecked-exceptions-java

Throw any Java Exception anywhere without the need of catching them nor wrapping them into RuntimeException
Java
7
star
17

aws-session

A CLI to generate and store session credentials in ~/.aws/credentials file, based on ~/.aws/config profiles
Python
6
star
18

aws-ec2-ssh-iam

AWS IAM managed EC2 SSH access
JavaScript
4
star
19

vercel-cors-proxy

JavaScript
3
star
20

gmail-rss-feed

Google Scripts Project to generate a RSS feed based on labeled emails
JavaScript
3
star
21

chrome-tab-multiselect-extension

JavaScript
3
star
22

meeting-cash-creep

Vue
3
star
23

userscript-kleinanzeigen-duplicate-ad

JavaScript
3
star
24

actions-publish-to-github-pages

GitHub Action to Publish Directory to GitHub Pages
Shell
3
star
25

chrome-tab-shift-extension

This extension will add a shortcuts to shift tabs.
JavaScript
2
star
26

junit-extension

Java JUnit Utils and Extentions
Java
2
star
27

domain-value-java

Domain Values
Java
2
star
28

zsh-theme-qoomon

zsh prompt theme
Shell
2
star
29

qoomon

About
2
star
30

zsh-history-search

zsh-history-search
Shell
2
star
31

aws-configure

A CLI to configure AWS named profiles in ~/.aws/config and ~/.aws/credentials files
Python
2
star
32

threema-web-desktop-app

Threema Standalone Web App with Dark and Light Mode Support
JavaScript
2
star
33

userscript-jira-dependency-indicators

JavaScript
2
star
34

kotlin-examples

Kotlin
2
star
35

userscript-aws-visual-account-indicator

This userscript reads the aws-userInfo cookie and adds account name and color indicator
JavaScript
2
star
36

aws-lambda-gitlab-webhook-to-datadog

JavaScript
2
star
37

userscript-jira-colored-labels

JavaScript
2
star
38

maven-enforcer-rules

maven-enforcer-rules
Java
2
star
39

chrome-tab-toggle-extension

This extension will add a shortcut to toggle through recent active tabs.
JavaScript
2
star
40

.github

1
star
41

chrome-new-tab-extension

Open neat blank page as 'New Tab' Page
HTML
1
star
42

chrome-search-engine-blocker-extension

Prevents Chrome from adding new search engines by opensearch link and search auto detection
JavaScript
1
star
43

diceware-webapp

HTML
1
star
44

userscript-disable-open-search

JavaScript
1
star
45

yolo-secret

TypeScript
1
star
46

chrome-show-password-extension

JavaScript
1
star
47

actions--set-env

TypeScript
1
star
48

cdn

cdn
JavaScript
1
star
49

self-signed-https-proxy

Shell
1
star
50

passphrase-generator

dice passphrase generator
Shell
1
star
51

google-chrome-launcher

Shell
1
star
52

chrome-tab-duplicate-extension

This extension will add a shortcut to duplicate tab.
JavaScript
1
star