foreman-export-nginx 0.0.31 → 0.0.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YjM3OGEyM2RmMWJiZWM4OGUxYmZhZWRhOWY1YjM5NWZhMDMwNDYyNA==
5
- data.tar.gz: !binary |-
6
- MzE0MTUzZjJlNzMzNmRhMmQ3NmRlZTNmNTY1NTE1MzNmMmJiNjQwMQ==
2
+ SHA1:
3
+ metadata.gz: fb5868f084e37268bd6a2180f4914a7532a120ec
4
+ data.tar.gz: e171352f2179c42677d94077f61766b8c3d2552a
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZDg5NDI1ZGYzNGYzNjExMWRlMTUwMDBiZWRmYzc5YzEyOTIyYjU5OTg0NWRm
10
- NmU4YzcxMjg1YzUzYWUyYmJlYjAyODdkODI0MDlhZjdjODVjZmUyY2Q2ZWJk
11
- YjQwMWNmZGRjYWU3ZDEyNTI2ZDljNDJlOTQ5MWQxMWU5ODhlMmI=
12
- data.tar.gz: !binary |-
13
- M2NlZDlhMzE3NjEwNzhlMDVhZmNiZWEzNjU2OGQ4NjQxMTczYTc3MDIzNTM5
14
- YmEyZDU5NDBhY2VjM2MwZTE1NTQ2Mzk2MTg5MWRlMDVmMjUwNzI1YzVjMDNl
15
- Mzg0OGMyOThiZWNjYTUwMmRkZjdhZTE1NWFhMjQ5ZmNhZTA3ZTE=
6
+ metadata.gz: d1179b3d60e787a18778bb03451c678c2d36366f63d6f8619e4b17e6fa6a008ecab1e818b3372347e7a990506e74a00fbcf2cc88c287a7f622a062b97f7a4bbf
7
+ data.tar.gz: 8b3da305fa9e6e3f78c21a51cf80ea75449231d9a0923d949e3197748dcb6280e280338a4ce2f90a0de7a6bf9920879a8f7371d8478af652a327ac039861f885
@@ -1,8 +1,10 @@
1
+ <% if ports.length > 0 %>
1
2
  upstream <%= app %> {
2
3
  <% ports.each do |port| %>
3
4
  server localhost:<%= port %> fail_timeout=0;
4
5
  <% end %>
5
6
  }
7
+ <% end %>
6
8
 
7
9
  server {
8
10
  access_log <%= log %>/<%= app %>-nginx-access.log combined buffer=2k;
@@ -38,7 +40,10 @@ server {
38
40
  include <%= engine.root %>/.nginx;
39
41
  <% end %>
40
42
 
43
+ <% if ports.length > 0 %>
41
44
  try_files $uri/index.html $uri.html $uri @app;
45
+ <% else %>
46
+ try_files $uri/index.html $uri.html $uri;
42
47
 
43
48
  location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
44
49
  try_files $uri @app;
@@ -46,6 +51,7 @@ server {
46
51
  expires max;
47
52
  }
48
53
 
54
+ <% if ports.length > 0 %>
49
55
  location @app {
50
56
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
51
57
  proxy_set_header X-Forwarded-Proto $scheme;
@@ -54,4 +60,5 @@ server {
54
60
 
55
61
  proxy_pass http://<%= app %>;
56
62
  }
63
+ <% end %>
57
64
  }
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "foreman-export-nginx"
7
- gem.version = '0.0.31'
7
+ gem.version = '0.0.32'
8
8
  gem.authors = ["Pete Keen"]
9
9
  gem.email = ["pete@bugsplat.info"]
10
10
  gem.description = %q{Export Nginx configs using Foreman}
@@ -12,28 +12,26 @@ module Foreman
12
12
  def export
13
13
  super
14
14
 
15
- engine.each_process do |name, process|
16
- next unless name == 'web'
15
+ next if engine.formation['web'].nil?
17
16
 
18
- base_domain = env_var('BASE_DOMAIN') or raise "Need a BASE_DOMAIN"
19
- additional_domains = (env_var('ADDITIONAL_DOMAINS') || '').split(',').join(' ')
20
- use_ssl = !!env_var('USE_SSL')
21
- ssl_cert_path = env_var('SSL_CERT_PATH')
22
- ssl_key_path = env_var('SSL_KEY_PATH')
23
- force_ssl = !!env_var('FORCE_SSL')
24
- force_domain = env_var('FORCE_DOMAIN')
25
- default_server = !!env_var('DEFAULT_SERVER')
26
- listen_address = env_var('LISTEN_ADDRESS') || '*'
17
+ base_domain = env_var('BASE_DOMAIN') or raise "Need a BASE_DOMAIN"
18
+ additional_domains = (env_var('ADDITIONAL_DOMAINS') || '').split(',').join(' ')
19
+ use_ssl = !!env_var('USE_SSL')
20
+ ssl_cert_path = env_var('SSL_CERT_PATH')
21
+ ssl_key_path = env_var('SSL_KEY_PATH')
22
+ force_ssl = !!env_var('FORCE_SSL')
23
+ force_domain = env_var('FORCE_DOMAIN')
24
+ default_server = !!env_var('DEFAULT_SERVER')
25
+ listen_address = env_var('LISTEN_ADDRESS') || '*'
27
26
 
28
- ports = []
29
- 1.upto(engine.formation[name]) do |num|
30
- ports << engine.port_for(process, num)
31
- end
32
-
33
- content = File.read(File.expand_path("../../../../data/export/nginx/nginx.erb", __FILE__))
34
- result = ERB.new(content, nil, '-').result(binding)
35
- write_file "#{app}.conf", result
27
+ ports = []
28
+ 1.upto(engine.formation['web']) do |num|
29
+ ports << engine.port_for(process, num)
36
30
  end
31
+
32
+ content = File.read(File.expand_path("../../../../data/export/nginx/nginx.erb", __FILE__))
33
+ result = ERB.new(content, nil, '-').result(binding)
34
+ write_file "#{app}.conf", result
37
35
  end
38
36
  end
39
37
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-export-nginx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Keen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-27 00:00:00.000000000 Z
11
+ date: 2018-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  description: Export Nginx configs using Foreman
@@ -32,8 +32,8 @@ executables:
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
- - .gitignore
36
- - .repo.yml
35
+ - ".gitignore"
36
+ - ".repo.yml"
37
37
  - Gemfile
38
38
  - LICENSE.txt
39
39
  - README.md
@@ -51,17 +51,17 @@ require_paths:
51
51
  - lib
52
52
  required_ruby_version: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ! '>='
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  requirements: []
63
63
  rubyforge_project:
64
- rubygems_version: 2.2.2
64
+ rubygems_version: 2.6.13
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: Export Nginx confguration files using Foreman