Code Monkey home page Code Monkey logo

s3-static-site-generator's Introduction

S3 Static Website Generator

The S3 Static Website Generator is a script to set up hosting a secure and scalable website on Amazon's AWS S3.

Why

Websites are needed for just about everything these days. The problem is hosting a simple, secure, and scalable website is not as cheap and easy as it should be.

Amazon's AWS S3 service enables you to host a website that's cheap and scales well, but configuring this yourself is still not that simple. You still need to be familiar with AWS and know about provisioning SSL certificates and DNS hosting, and even if you are familiar, you still have to manually do it each time you want to host a new website.

The S3 Static Website Generator was made to make launching a secure and scalable website on S3 as simple as possible. Running the script will handle everything from setting up your DNS, providing your site a SSL certificate, and creating a S3 bucket for your website's code.

How to use

First, you'll need an AWS account. If you don't already have one, you can sign up for one here.

This script also assumes you have created an IAM user with admin access permissions (here's how to do this) and have stored that user's credentials locally under the ~/.aws directory or have set those credentials as environment variables (read more here).

Second, you'll have to have Ruby 2.0 or higher installed on your machine (how to install Ruby).

Once you have AWS and Ruby set up, all you have to do is clone this repository:

git clone [email protected]:acmeyer/s3-static-site-generator.git

go into the directory:

cd s3-static-site-generator

install the AWS SDK (if you don't already have it installed):

gem install aws-sdk

and run the script (replace yourdomain.com below with your domain name):

ruby create_site.rb yourdomain.com

That's it!

The script will run and let you know it's progress. It can take up to 20 minutes to complete. Go grab yourself a much deserved coffee!

When it's finished, it will print the url of your site, the S3 bucket to upload your website code to, and the name servers to point your DNS to. You'll have to point your DNS name servers to these name servers in order to see your site when accessing it's url. This also may take some time before you can access your site.

Contributing

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution

TODOs

  • Add script to remove site
  • Handle S3 bucket names not available
  • Handle non-root domain name
  • Handle script errors
  • Handle multiple runs on same domain name
  • Add automatic uploading of website code

License

Released under the MIT License. See http://opensource.org/licenses/MIT for more information.

Help

If you need help with this script send me an email. I'll try my best to help you out.

s3-static-site-generator's People

Contributors

acmeyer avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

habibtalib

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.