GithubHelp home page GithubHelp logo

jmetzner / staticsite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacwright/staticsite

0.0 2.0 1.0 2.08 MB

Static Site is a Javascript-based content management system for building and managing a website on Amazon S3

Home Page: http://staticsite.org/

License: Apache License 2.0

CoffeeScript 13.10% CSS 14.12% HTML 2.84% JavaScript 69.93%

staticsite's Introduction

Client-side-only HTML5 content management system for S3

Static Site, or S2, is an HTML5 content management system hosted completely from Amazon S3. Websites are administered and pages are edited directly on S3 through a Javascript client. There is no server-side component other than your S3 bucket.

S2 includes security and provides many features other traditional content management systems provide such as templates. AES is used to securely store your S3 key and secret so a memorable username and password may be used instead. Web pages are rendered in-memory using Javascript templating and stored to their rightful location in S3.

Still under development. Right now the most you can do is register your user account and later sign in.

Getting Started

There could be a simple service to do all this for you, but until then you have to handle it manually.

To get started sign up for an Amazon web services account and S3 if you aren't already.

You may then create a new S3 bucket from Amazon's console. You need to set the policy file on the bucket. To do this right-click on the bucket in the console and choose "Properties". Choose the "Add bucket policy" link in the properties and paste this in (be sure to replace "mybucket" with your bucket's name:

{
	"Version": "2008-10-17",
	"Id": "1",
	"Statement": [
		{
			"Sid": "1",
			"Effect": "Allow",
			"Principal": {
				"AWS": "*"
			},
			"Action": "s3:GetObject",
			"NotResource": "arn:aws:s3:::mybucket/api/*"
		}
	]
}

Then select the "Website" tab, check "Enabled" and put in "index.html" and "error.html" for the two fields.

From the "Website" tab you'll see the S3 domain you must use to have the website feature. If your bucket is called "www.example.com" you can point your www.example.com domain's DNS to this S3 domain using CNAME to access your S3 website from http://www.example.com/.

Finally upload the contents of the public directory of your cloned git project to your S3 bucket (make them public-read and set their content-type appropriately, e.g. text/html, text/css, text/js).

You should be able to go to the url http://www.example.com/admin/ or https://s3.amazonaws.com/www.example.com/admin/ and be presented with the login page. Click Register and put in your info, then you'll be taken to the blank dashboard page. Later you can come here and login with the username/password you registered with. Note that because Amazon only allows GETs for the website URL (www.example.com) you are redirected to https://s3.amazonaws.com/www.example.com/admin/ when you go to the admin directory at http://www.example.com/admin/.

You can see www.staticsite.org set up with the code and if you go to www.staticsite.org/admin you'll be redirected to the correct URL for logging in, though you won't be able to register with that bucket.

Building

To build the project you need node.js installed, npm, and CoffeeScript. You can get instructions on installing node.js from their website and npm from their website. To install CoffeeScript run npm install -g coffee-script with the global flag.

Once everything is installed go to the root of your project and run npm install to install required modules. Then you can run cake make to compile the coffeescript in the src/ folder, and cake -k aws_key -s aws_secret -b www.example.com make to compile and upload the files to your bucket.

If you have any problems or issues you're on your own. Sorry. It's still early.

staticsite's People

Contributors

jacwright avatar

Watchers

 avatar  avatar

Forkers

hynespm-zz

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.