stan 0.2.4 → 0.3.0

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
- SHA1:
3
- metadata.gz: 1e2e04264507f2023e3192172c8ac5dfccc649be
4
- data.tar.gz: 5b0193cad7489bf823111a022f6f795dab72219e
2
+ SHA256:
3
+ metadata.gz: e172728eeb8446955b6fef92d03f9a3b556f4297b153eab654f19f6ff6103b0b
4
+ data.tar.gz: 65cd92cd45a41940d7184e6222f6a0702eafe3f2d06cb87ceb590cb9c2c27d01
5
5
  SHA512:
6
- metadata.gz: 01da0d7c4dc8623479f6aaa026adc955de1efef1d739a894e9bcab37ac277bc45ae68ee82950c8dbf8734bb2903fa647a842fb55fecd030c5956673e2c5a65a5
7
- data.tar.gz: 3127110d2a1eacf2f73b694c2e7e22fca8ff0ed0c201c303cf5549b7921724bb105c5552bce9854ce64cd32bc442684ddcb7041a0761a4ff54d22bb02a60d322
6
+ metadata.gz: 9a6640b2957f09aef7682fffda741f72fa3898a4f8c4f2e0ca2a9b11b0a5fc1cb7934bbe36ff1aaa05f8fa2375085ac2af2afa1026bed08300bd446983ad9d53
7
+ data.tar.gz: 8ebaaf098426637f3681dfe6eb6b025dbd1e18c16be58b77d3896611719a4a080740e0b04ab8f37c9523cf5b89c0b2eae158096c7682ebca8b09fa44756bbd7f
data/README.md CHANGED
@@ -1,4 +1,13 @@
1
- # Stan
1
+ <img src=stan-logo.png width=50% />
2
+
3
+ * [Installation](#installation)
4
+ * [Usage](#usage)
5
+ + [Server](#server)
6
+ - [Example Nginx configuration](#example-nginx-configuration)
7
+ + [Client](#client)
8
+ * [Development](#development)
9
+ * [Contributing](#contributing)
10
+ * [License](#license)
2
11
 
3
12
  Stan is a little tool that helps you to deploy static sites to a centralized host.
4
13
 
@@ -31,8 +40,45 @@ There are a few variables you have to set:
31
40
  * `STAN_BIND=127.0.0.1` is the ip to bind to.
32
41
  * `STAN_PORT=4567` is the port to use.
33
42
 
34
- Please note that Stan will create a public directory and a directory for each deployed site within that folder.
35
- The final site will then be deployed to `/srv/stan/public/my-site` for example.
43
+ Please note that Stan will create a directory for each deployed site within that folder.
44
+ The final site will then be deployed to `/srv/stan/my-site` for example.
45
+
46
+ #### Example Nginx configuration
47
+
48
+ ```
49
+ upstream pages {
50
+ server localhost:4567 fail_timeout=0;
51
+ }
52
+
53
+ server {
54
+ listen 443;
55
+ listen [::]:443;
56
+
57
+ # replace with server name config and ssl settings
58
+
59
+ client_max_body_size 100m;
60
+
61
+ location / {
62
+ root /srv/stan;
63
+ }
64
+
65
+ location /upload {
66
+ proxy_read_timeout 300;
67
+ proxy_connect_timeout 300;
68
+ proxy_redirect off;
69
+
70
+ proxy_http_version 1.1;
71
+
72
+ proxy_set_header Host $host;
73
+ proxy_set_header X-Real-IP $remote_addr;
74
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
75
+ proxy_set_header X-Forwarded-Proto https;
76
+
77
+ proxy_pass http://pages/upload;
78
+ }
79
+ }
80
+
81
+ ```
36
82
 
37
83
  ### Client
38
84
 
@@ -54,3 +100,5 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/Flipez
54
100
  ## License
55
101
 
56
102
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
103
+
104
+ Look at the awesome logo I made at: <a href='https://onlinelogomaker.com' title='Online Logo Maker'>onlinelogomaker.com</a>
@@ -1,5 +1,16 @@
1
+ class Thorough < Thor
2
+ ENV["THOR_DEBUG"] = "1"
3
+ check_unknown_options!
4
+ private
5
+ def subcommand(*_) super subcommand(*_)
6
+ rescue Thor::Error => e
7
+ $stderr.puts e.message
8
+ exit 1
9
+ end
10
+ end
11
+
1
12
  module Stan
2
- class Cli < Thor
13
+ class Cli < Thorough
3
14
  desc 'version', 'display the stan version'
4
15
  def version
5
16
  puts('Stan version ' + Stan::VERSION.to_s)
@@ -2,7 +2,7 @@ require 'typhoeus'
2
2
  module Stan
3
3
  class Deployer
4
4
  def self.deploy(source, name, keep: false)
5
- url = ENV.fetch('STAN_SERVER')
5
+ url = ENV.fetch('STAN_SERVER')
6
6
  puts "Going to deploy `#{name}` to #{url}"
7
7
  res = Typhoeus.post(
8
8
  "#{url}/upload",
@@ -14,10 +14,11 @@ module Stan
14
14
  )
15
15
  if res.success?
16
16
  puts "Successfully deployed `#{name}`"
17
- puts "Your site should be reachable at `#{url}/#{name}`"
17
+ puts "Your site should be reachable at `#{url}/#{name}`"
18
18
  else
19
19
  puts "Something went wrong. (#{res.response_code})"
20
- puts res.inspect if Stan::CI
20
+ puts res.inspect if Stan::CI
21
+ exit 1
21
22
  end
22
23
  FileUtils.rm(source) unless keep
23
24
  end
@@ -1,3 +1,3 @@
1
1
  module Stan
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flipez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-16 00:00:00.000000000 Z
11
+ date: 2018-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -102,6 +102,7 @@ files:
102
102
  - lib/stan/deployer.rb
103
103
  - lib/stan/server.rb
104
104
  - lib/stan/version.rb
105
+ - stan-logo.png
105
106
  - stan.gemspec
106
107
  homepage: https://github.com/Flipez/static-stan
107
108
  licenses:
@@ -123,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
124
  version: '0'
124
125
  requirements: []
125
126
  rubyforge_project:
126
- rubygems_version: 2.6.11
127
+ rubygems_version: 2.7.6
127
128
  signing_key:
128
129
  specification_version: 4
129
130
  summary: Static Site Deployment