ponyhost 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +53 -7
- data/bin/ponyhost +20 -23
- data/lib/ponyhost.rb +4 -3
- metadata +5 -5
data/README.md
CHANGED
@@ -1,9 +1,55 @@
|
|
1
|
-
ponyHost
|
1
|
+
# ponyHost #
|
2
|
+
## Description ##
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
$ ponyhost push foobar
|
7
|
-
$ open http://foobar.ponyho.st
|
4
|
+
ponyHost lets you to easily create Amazon S3 website buckets,
|
5
|
+
push files to them and make them available under a *.ponyho.st or custom domain.
|
6
|
+
A small HTTP server is also included.
|
8
7
|
|
9
|
-
|
8
|
+
## Installation ##
|
9
|
+
|
10
|
+
To use ponyHost all you need to have is an Amazon S3
|
11
|
+
account and the [access key id and secret](https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key).
|
12
|
+
|
13
|
+
The installation is as simple as:
|
14
|
+
|
15
|
+
gem install ponyhost
|
16
|
+
|
17
|
+
## Commands ##
|
18
|
+
### Create ###
|
19
|
+
|
20
|
+
ponyhost create your-site
|
21
|
+
|
22
|
+
Will create the S3 bucket with a website configuration.
|
23
|
+
Per default index.html will be the index document and 404.html the error document.
|
24
|
+
|
25
|
+
If the passed name doesn't include a '.' the default domain 'ponyho.st' will be used and your bucket will be named
|
26
|
+
'your-site.ponyho.st'.
|
27
|
+
|
28
|
+
If you prefer to use a custom domain just pass the name accordingly.
|
29
|
+
|
30
|
+
ponyhost create foo.yoursite.com
|
31
|
+
|
32
|
+
You'll have to setup a DNS CNAME record for foo.yoursite.com to s3-website-us-east-1.amazonaws.com.
|
33
|
+
It's also possible to use a naked domain like yoursite.com.
|
34
|
+
For that you have to point the @ record for yoursite.com to
|
35
|
+
one of the IP's that s3-website-us-east-1.amazonaws.com points to (72.21.207.127) (not so good, but works :)
|
36
|
+
|
37
|
+
### Push ###
|
38
|
+
|
39
|
+
Will compare the md5 sum for each file in the current directory with the remote file and push the file if necessary.
|
40
|
+
Currently it won't delete files in the bucket.
|
41
|
+
|
42
|
+
### Server ###
|
43
|
+
|
44
|
+
Runs a very basic HTTP server for the current directory on http://localhost:9090
|
45
|
+
|
46
|
+
### Destroy ###
|
47
|
+
|
48
|
+
Will delete the bucket and all files on S3.
|
49
|
+
|
50
|
+
## ToDo ##
|
51
|
+
|
52
|
+
* Implement a autopush command
|
53
|
+
* Implement a robust HTTP server
|
54
|
+
* Support other availability zones
|
55
|
+
* Delete files in bucket
|
data/bin/ponyhost
CHANGED
@@ -21,8 +21,7 @@ elsif command == "list" || (["create", "push", "destroy", "show", "version"].in
|
|
21
21
|
elsif(command == "push")
|
22
22
|
PonyHost.push(bucketname, ".")
|
23
23
|
elsif(command == "autopush")
|
24
|
-
|
25
|
-
# monitor cwd and push automatically?
|
24
|
+
puts "Not Yet Implemented"
|
26
25
|
elsif(command == "destroy")
|
27
26
|
print "Do you really wanna destroy '#{bucketname}' (type 'YES'):"
|
28
27
|
PonyHost.destroy(bucketname) if STDIN.gets.chop == "YES"
|
@@ -31,30 +30,28 @@ elsif command == "list" || (["create", "push", "destroy", "show", "version"].in
|
|
31
30
|
PonyHost.list.each do |name|
|
32
31
|
puts "http://#{name}"
|
33
32
|
end
|
34
|
-
elsif(command == "show")
|
35
|
-
# deprecated?
|
36
|
-
PonyHost.show(bucketname)
|
37
33
|
elsif(command == "version")
|
38
34
|
puts "ponyhost version #{PonyHost::VERSION}"
|
39
35
|
puts "created by Johannes Wagener http://johannes.wagener.cc"
|
40
36
|
end
|
41
37
|
else
|
42
|
-
puts
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
38
|
+
puts <<-EOF
|
39
|
+
usage: ponyhost <command> [<sitename>]
|
40
|
+
|
41
|
+
available commands:
|
42
|
+
list Lists all sites/buckets from your S3 account
|
43
|
+
create [name] Creates a new bucket for your site
|
44
|
+
push [name] Pushes the current directory to the specified bucket/site
|
45
|
+
destroy [name] Removes all files and destroys the bucket
|
46
|
+
server Runs a local HTTP server for the current directory
|
47
|
+
|
48
|
+
Notes: if the name contains no '.' it will be suffixed with the default domain #{PonyHost::DEFAULT_DOMAIN}
|
49
|
+
To use a custom domain you have to set up the DNS correctly:
|
50
|
+
For a site under a subdomain like www.foobar.com you have to create a CNAME record for www.foobar.com to s3-website-us-east-1.amazonaws.com
|
51
|
+
For a site under a domain like foobar.com you have to create an A record pointing to 72.21.214.197
|
52
|
+
Once thats done you just have to create the site with the correct name:
|
53
|
+
$ ponyhost create www.foobar.com
|
54
|
+
|
55
|
+
For details have a look at the README.
|
56
|
+
EOF
|
60
57
|
end
|
data/lib/ponyhost.rb
CHANGED
@@ -13,8 +13,9 @@ end
|
|
13
13
|
|
14
14
|
class PonyHost
|
15
15
|
S3_CREDENTIAL_FILES = ["~/.ponyhost.yml"]
|
16
|
+
S3_CREDENTIAL_LINK = "https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key"
|
16
17
|
DEFAULT_DOMAIN = "ponyho.st"
|
17
|
-
VERSION = "0.
|
18
|
+
VERSION = "0.3.0"
|
18
19
|
class << self
|
19
20
|
|
20
21
|
|
@@ -25,8 +26,8 @@ class PonyHost
|
|
25
26
|
else
|
26
27
|
puts "AWS Credentials file '#{credential_file}' missing. We'll create one."
|
27
28
|
puts "You'll find your Amazon AWS credentials here:"
|
28
|
-
puts
|
29
|
-
|
29
|
+
puts S3_CREDENTIAL_LINK
|
30
|
+
|
30
31
|
credentials = {}
|
31
32
|
print "Your AWS Access Key ID: "
|
32
33
|
credentials[:access_key_id] = STDIN.gets.chop
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ponyhost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.3.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Johannes Wagener
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
version: "0"
|
25
25
|
type: :runtime
|
26
26
|
version_requirements: *id001
|
27
|
-
description: ponyHost
|
27
|
+
description: " ponyHost lets you to easily create Amazon S3 website buckets,\n push files to them and make them available under a *.ponyho.st or custom domain.\n A small HTTP server is also included.\n"
|
28
28
|
email:
|
29
29
|
- johannes@wagener.cc
|
30
30
|
executables:
|
@@ -39,8 +39,8 @@ files:
|
|
39
39
|
- bin/ponyhost
|
40
40
|
has_rdoc: true
|
41
41
|
homepage: http://ponyho.st
|
42
|
-
licenses:
|
43
|
-
|
42
|
+
licenses:
|
43
|
+
- MIT
|
44
44
|
post_install_message:
|
45
45
|
rdoc_options: []
|
46
46
|
|
@@ -64,6 +64,6 @@ rubyforge_project: ponyhost
|
|
64
64
|
rubygems_version: 1.6.2
|
65
65
|
signing_key:
|
66
66
|
specification_version: 3
|
67
|
-
summary: Create
|
67
|
+
summary: Create and deploy Amazon S3 powered websites
|
68
68
|
test_files: []
|
69
69
|
|