statixite 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b0cd53b7f1594a10523da4b8896e6ba08e817d2
4
- data.tar.gz: 80e01358dee7cacdfef413849d816abe21833c7b
3
+ metadata.gz: 40af4523487d193d339cddcd57f28599b907c605
4
+ data.tar.gz: e83d1595472cfda90c160bf5c96a319c334bdbba
5
5
  SHA512:
6
- metadata.gz: bf998c07bd46b128f32f3a02525d17aad5548d22606ebc84fcf9ea3204096e5d2dd954f9b59d5a5f5eee33ff3bc7976ad45a411c7172ec49226c34a6381b9c36
7
- data.tar.gz: 9859e0f7e2e879825816fe9e0508cd55829572e8154d81383554977a7a6f328938062944f67cc102a982b5c3b2370efbef849701b26d70198b946bc4bb37cd24
6
+ metadata.gz: f214ea7e9aa72d3553c53f5c193642629de347097c8a9ab36a7e422f5dfa794d3960cda0ffd25141d87f6c155492fb40f31a4d7ff09db0e894e8d39c3543f5b9
7
+ data.tar.gz: 929f0b275aa6e4cdc5e3571126917ebbaf526d1a85ddad04a5d925187758da22394bbbe092c63325a2e7aeebf1aceeabc69dbd66c39ebcde0cd20b6a15823606
data/README.rdoc CHANGED
@@ -57,8 +57,8 @@ This will generate the following file:
57
57
  # }
58
58
 
59
59
  # fog creds Rackspace Cloud Files example
60
- # config.fog_credentials {
61
- # :provider => 'Rackspace',
60
+ # config.fog_credentials = {
61
+ # :provider => 'Rackspace',
62
62
  # :rackspace_username => ENV['RACKSPACE_USERNAME'],
63
63
  # :rackspace_api_key => ENV['RACKSPACE_API_KEY'],
64
64
  # :rackspace_region => :dfw
@@ -130,7 +130,7 @@ Fog is a cloud service Ruby gem that can allow you to deploy sites to cloud cont
130
130
  config.deploy_sites_to = :fog
131
131
 
132
132
  # Amazon S3 example
133
- config.fog_crednentials {
133
+ config.fog_crednentials = {
134
134
  :provider => 'AWS',
135
135
  :aws_access_key_id => ENV["AWS_ACCESS_KEY_ID"],
136
136
  :aws_secret_access_key => ENV["AWS_SECRET_ACCESS_KEY"],
@@ -12,7 +12,6 @@
12
12
  = fields_for @site do |s|
13
13
  = s.label :domain_name
14
14
  = s.text_field :domain_name, placeholder: 'example.com', class: 'form-control'
15
- %p.help-block Every site is entitled to a statixite.com subdomain. Yours is <strong>#{@site.statixite_name}</strong>. In order for your custom domain to work, you will need to create a CNAME record. A hostname will be created after the first deployment which you can find on the #{link_to("settings page", settings_site_path(@site))}. If you would like to use a naked domain, then you may use <a href="https://dnsimple.com" target="_blank">DNSimple</a>, or use a naked domain redirect service provided by <a href="http://wwwizer.com/" target="_blank">wwwizer.com</a>
16
15
  .modal-footer
17
16
  %button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Cancel
18
17
  %button.btn.btn-primary{"data-dismiss" => "modal", type: "submit", 'v-on': 'click: addDeployment($event, true)'} Deploy
@@ -5,6 +5,12 @@
5
5
  %small
6
6
  = link_to "http://#{@site.domain_name}", target: "_blank" do
7
7
  %span.glyphicon.glyphicon-new-window
8
+ - elsif @site.hostname.present?
9
+ %h1
10
+ Deployments for #{@site.hostname}
11
+ %small
12
+ = link_to "http://#{@site.hostname}", target: "_blank" do
13
+ %span.glyphicon.glyphicon-new-window
8
14
  - else
9
15
  %h1
10
16
  Deployments for #{@site.statixite_name}
@@ -8,17 +8,3 @@
8
8
  %p
9
9
  The preview for #{@site.statixite_name} is ready and available at
10
10
  = link_to @site.preview_url, @site.preview_url, :target => "_blank"
11
- %p Site previews use a different authentication method. Feel free to change the login information below.
12
- - if @password
13
- %p You may use the following credentials to view the preview of your site. This will be the only time the password is available for viewing, but you may update the login credentials at anytime.
14
- %strong login: #{@site.site_name}
15
- %br
16
- %strong password: #{@password}
17
- %br
18
- %br
19
- .row
20
- .col-sm-4
21
- = bootstrap_form_tag url: preview_credentials_site_path(@site) do |f|
22
- = f.text_field :login
23
- = f.password_field :password
24
- = f.submit
@@ -62,7 +62,7 @@
62
62
  = stylesheet_link_tag "jsoneditor/dist/jsoneditor"
63
63
  %h1 Settings for #{@site.statixite_name}
64
64
  %hr
65
- %p The settings found here are equivalent to the settings found in a <kbd>_config.yml</kbd> file for a typical Jekyll Site. To use a custom domain, enter it here. Once you deploy your site for the first time, a hostname will be created. Use this hostname for create a cname for your domain. If you would like to use a naked domain, then you may use <a href="https://dnsimple.com" target="_blank">DNSimple</a>, or use a naked domain redirect service provided by <a href="http://wwwizer.com/" target="_blank">wwwizer.com</a>.
65
+ %p The settings found here are equivalent to the settings found in a <kbd>_config.yml</kbd> file for a typical Jekyll Site. To use a custom domain, enter it here. Once you deploy your site for the first time, a hostname will be created for configurations that use Amazon S3 or Rackspace Cloud Files. Use this hostname for create a cname for your domain. If you would like to use a naked domain, then you may use <a href="https://dnsimple.com" target="_blank">DNSimple</a>, or use a naked domain redirect service provided by <a href="http://wwwizer.com/" target="_blank">wwwizer.com</a>. Github Pages deployments will automatically set your baseurl setting to equal "/statixite-#{@site.site_name}"
66
66
 
67
67
  #jsoneditor
68
68
  %br
@@ -70,8 +70,16 @@
70
70
  .form-group
71
71
  .col-sm-8
72
72
  = f.text_field :domain_name, label: 'Domain Name', placeholder: 'example.com', label_col: "col-sm-4", control_col: "col-sm-8"
73
+ .col-sm-4
74
+ - if @site.domain_name.present?
75
+ = link_to "http://#{@site.domain_name}", target: "_blank" do
76
+ %span.glyphicon.glyphicon-new-window
73
77
  .col-sm-8
74
78
  = f.text_field :hostname, label: 'Host Name', label_col: "col-sm-4", control_col: "col-sm-8", placeholder: 'Hostname is created on the first deployment', disabled: ''
79
+ .col-sm-4
80
+ - if @site.hostname.present?
81
+ = link_to "http://#{@site.domain_name}", target: "_blank" do
82
+ %span.glyphicon.glyphicon-new-window
75
83
  = f.submit 'Save Settings', class: 'btn btn-primary'
76
84
  %i.glyphicon.glyphicon-ok.hidden
77
85
  %i.glyphicon.glyphicon-exclamation-sign.hidden
@@ -11,14 +11,31 @@ module Statixite
11
11
  @cloud_directory = @fog_client.directories.create :key => @container_name, :public => true
12
12
  case Statixite.config.fog_credentials[:provider]
13
13
  when 'AWS'
14
- @fog_client.put_bucket_website(@container_name, "index.html", :key => "404.html")
14
+ @fog_client.put_bucket_website(@container_name, IndexDocument: "index.html", ErrorDocument: "404.html")
15
+ @fog_client.put_bucket_policy(@container_name,
16
+ {
17
+ "Statement" => [
18
+ { "Sid" => "PublicReadGetObject",
19
+ "Effect" => "Allow",
20
+ "Principal" => "*",
21
+ "Action" => "s3:GetObject",
22
+ "Resource" => "arn:aws:s3:::#{@container_name}/*"
23
+ }
24
+ ]
25
+ }
26
+ )
15
27
  when 'Rackspace'
16
28
  @cloud_directory.metadata[:web_index] = "index.html"
17
29
  @cloud_directory.metadata[:web_error] = "error.html"
18
30
  end
19
31
  end
20
32
  if @site.hostname.nil? && @cloud_directory.public_url.present?
21
- @site.hostname = URI(@cloud_directory.public_url).host
33
+ case Statixite.config.fog_credentials[:provider]
34
+ when 'AWS'
35
+ @site.hostname = "#{@container_name}.s3-website-#{@fog_client.region}.amazonaws.com"
36
+ when 'Rackspace'
37
+ @site.hostname = URI(@cloud_directory.public_url).host
38
+ end
22
39
  @site.save
23
40
  end
24
41
  end
@@ -1,3 +1,3 @@
1
1
  module Statixite
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statixite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard LaFranchi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-13 00:00:00.000000000 Z
11
+ date: 2016-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails