satorix-rails 1.1.0 → 1.1.5

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: 3d1f056ae46c1a30b11c11a567472d7b254cef1f
4
- data.tar.gz: 2ac2d811653c9bbccde23798c2a95e5b168fe178
3
+ metadata.gz: 4876a5e6ee331480036e881d9f29f53bafe511f3
4
+ data.tar.gz: 564f4cde3b91cb9f722d54c1b87eb1ca410c9139
5
5
  SHA512:
6
- metadata.gz: 0fb99f81039e25fcc45cec5a6a3eea40f81c627572f4d0530fdda5005616a04b0ae62fa086b03173d6b1b8bb5fad797fc656a218d5b5d04006ae51fca026b09d
7
- data.tar.gz: 86f4beb0bb36105bc144778137776dddd93c74f97bd5d3cf59d39b23cdbfd8597cfb4b92e8505f83604da7d52d23d393257258027035698cb4477a60df80a437
6
+ metadata.gz: dedd5c9ac27adeacf3c2b003f028afdddbcc6a11b0f229f9abe4b9d1d4a762452b9418fa15f113ace2b24317d9b767492843786a1b9f24b46f940bbecf17c03b
7
+ data.tar.gz: 4ba09535c6e545f1271dade019f2abc3985944ade2f886943744badd09a97faa2f22ab525d60a3b03d47820a300e57113d31da9e8320b0686d49fe7040758b34
data/.gitignore CHANGED
@@ -7,3 +7,7 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+
11
+ # Rubymine files
12
+ /.idea
13
+ /config/initializers/rubymine_passenger_debug.rb
data/.gitlab-ci.yml CHANGED
@@ -14,10 +14,10 @@ cache:
14
14
  - 'tmp/satorix/cache' # To cache buildpack gems between runs.
15
15
 
16
16
 
17
- #rspec:
18
- # before_script:
19
- # - sed -i -e 's/add_development_dependency/add_dependency/g' satorix-rails.gemspec # To avoid an application dependency, but still be available for CI
20
- # <<: *satorix
17
+ rspec:
18
+ before_script:
19
+ - sed -i -e 's/add_development_dependency/add_dependency/g' satorix-rails.gemspec # To avoid an application dependency, but still be available for CI
20
+ <<: *satorix
21
21
 
22
22
 
23
23
  # This is a custom job, defined at satorix/CI/deploy/ie_gem_server.rb
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.4.1
1
+ ruby-2.4.5
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- ruby File.open("#{ File.dirname(__FILE__) }/.ruby-version", &:gets).strip[/ruby-(.+)/i, 1]
1
+ ruby "#{ File.open("#{ File.dirname(__FILE__) }/.ruby-version", &:gets).strip[/ruby-(.+)/i, 1] }"
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
@@ -13,7 +13,7 @@ module Satorix
13
13
 
14
14
  template 'install/config/passenger_standalone/nginx.conf.erb', 'config/passenger_standalone/nginx.conf.erb'
15
15
 
16
- template 'install/config/passenger_standalone/includes/htpasswd', 'config/passenger_standalone/includes/htpasswd'
16
+ template 'install/config/passenger_standalone/includes/htpasswd_source.erb', 'config/passenger_standalone/includes/htpasswd_source.erb'
17
17
  template 'install/config/passenger_standalone/includes/authentication.erb', 'config/passenger_standalone/includes/authentication.erb'
18
18
  template 'install/config/passenger_standalone/includes/page_level_redirects.erb', 'config/passenger_standalone/includes/page_level_redirects.erb'
19
19
  template 'install/config/passenger_standalone/includes/proxy_configuration.erb', 'config/passenger_standalone/includes/proxy_configuration.erb'
@@ -12,7 +12,7 @@ module Satorix
12
12
  # You can add your own logic to do whatever you want.
13
13
  def go
14
14
  # Uncomment the line below if you want to execute in the context of the app's buildpack.
15
- # Satorix::CI::Test::Shared::Buildpack.go
15
+ # Satorix::CI::Test::Shared::BuildpackManager.go
16
16
  puts "\n\nRunning BareBones#go..."
17
17
  end
18
18
 
@@ -13,7 +13,7 @@ module Satorix
13
13
  # You can add your own logic to do whatever you want.
14
14
  def go
15
15
  # Uncomment the line below if you want to execute in the context of the app's buildpack.
16
- # Satorix::CI::Test::Shared::Buildpack.go
16
+ # Satorix::CI::Test::Shared::BuildpackManager.go
17
17
 
18
18
  log_bench('Describing logging...') do
19
19
  describe_log
@@ -1,6 +1,6 @@
1
1
  # This Procfile defines the types of process that Flynn will run.
2
2
  # For more information, please see the documentation at http://gitlab.iexposure.com/satorix/satorix
3
3
 
4
- web: bundle exec passenger start -p $PORT --nginx-config-template config/passenger_standalone/nginx.conf.erb --max-pool-size 3
4
+ web: bundle exec passenger start -p $PORT --nginx-config-template config/passenger_standalone/nginx.conf.erb --log-file /dev/stdout
5
5
  # worker: rake jobs:work
6
6
  # clock: bundle exec clockwork config/clock.rb
@@ -1,14 +1,28 @@
1
-
2
1
  # Authentication
3
2
  #
4
3
  # Allow listed networks to access without auth, otherwise require password
4
+ <%%
5
+ password_files = {}
6
+
7
+ # Write out htpasswd file(s), from source files in config/passenger_standalone/includes
8
+ # to allow dynamically generated htpasswd file(s), most likely from env vars.
9
+ %w[htpasswd].each do |password_file|
10
+ passenger_standalone_includes = File.expand_path(__dir__)
11
+ password_files[password_file] = File.join( passenger_standalone_includes, password_file )
12
+ contents = include_passenger_custom_template("#{ password_file }_source.erb")
13
+ File.open(password_files[password_file], 'w') {|f| f.write(contents) }
14
+ end
15
+ %>
5
16
 
6
- satisfy any;
7
- <%% ENV['SATORIX_AUTHENTICATION_ALLOWED_IPS'].to_s.split(' ').each do |target| %>
17
+ location / {
18
+ satisfy any;
19
+ <%% ENV['SATORIX_AUTHENTICATION_ALLOWED_IPS'].to_s.split(' ').each do |target| -%>
8
20
  allow <%%= target %>;
9
- <%% end %>
10
- deny all;
11
- auth_basic "Please Log In";
12
- auth_basic_user_file /app/config/passenger_standalone/includes/htpasswd;
21
+ <%% end -%>
22
+ deny all;
23
+ auth_basic "Please Log In";
24
+ auth_basic_user_file <%%= password_files['htpasswd'] %>;
25
+ }
26
+
13
27
 
14
28
  # End Authentication
@@ -0,0 +1,6 @@
1
+ <%%# This value should include hashed username/password combinations, separated by whitespace -%>
2
+ <%%# These can be generated using the htpasswd application, or an online tool like http://www.htaccesstools.com/htpasswd-generator/ -%>
3
+ <%%# For more info, see: https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/ -%>
4
+ <%%= ENV['SATORIX_AUTHENTICATION_HTPASSWDS'].to_s.split.join("\n") %>
5
+
6
+
@@ -1,15 +1,15 @@
1
-
2
1
  # Page-level Redirects
3
2
  #
3
+ # Prevent Nginx from adding the internal app port to the rewrite, aka port 8080
4
+
5
+ port_in_redirect off;
6
+
4
7
  # Define your own custom page-level redirects below.
5
8
  #
6
9
  # Examples:
7
10
  # Standard single page redirects:
8
- # location = /old-page-1 { return 301 $scheme://$server_name/new-page-1; }
9
- # location = /old-page-2 { return 301 $scheme://$server_name/new-page-2; }
10
- # Do not work:
11
- # # Redirects to port 8080
12
- # location = /asdf2 { return 301 /process; }
11
+ # location = /old-page-1 { return 301 /new-page-1; }
12
+ # location = /old-page-2 { return 301 /new-page-2; }
13
13
 
14
14
 
15
15
 
@@ -21,7 +21,7 @@
21
21
  <%% end %>
22
22
 
23
23
  # Use the internal Flynn network set X-Forwarded-For header for access IPs.
24
- set_real_ip_from 100.100.0.0/16;
24
+ set_real_ip_from <%%= ENV['SATORIX_REAL_IP_FROM'].presence? || '100.100.0.0/16' %>;
25
25
  real_ip_header X-Forwarded-For;
26
26
 
27
27
  # End Proxy Configuration
@@ -1,6 +1,3 @@
1
- # passenger start --nginx-config-template config/passenger_standalone/nginx.conf.erb --debug-nginx-config
2
-
3
-
4
1
  ##########################################################################
5
2
  # Passenger Standalone is built on the same technology that powers
6
3
  # Passenger for Nginx, so any configuration option supported by Passenger
@@ -8,13 +5,12 @@
8
5
  # this by direct editing the Nginx configuration template that is used by
9
6
  # Passenger Standalone.
10
7
  #
11
- # This file is the original template. DO NOT EDIT THIS FILE DIRECTLY.
12
- # Instead, make a copy of this file and pass the `--nginx-config-template`
13
- # parameter to Passenger Standalone.
14
- #
15
8
  # Learn more about using the Nginx configuration template at:
16
9
  # https://www.phusionpassenger.com/library/config/standalone/intro.html#nginx-configuration-template
17
10
  #
11
+ # To test this configuration template run:
12
+ # passenger start --nginx-config-template config/passenger_standalone/nginx.conf.erb --debug-nginx-config
13
+ #
18
14
  # *** NOTE ***
19
15
  # If you customize the template file, make sure you keep an eye on the
20
16
  # original template file and merge any changes. New Phusion Passenger
@@ -22,8 +18,17 @@
22
18
  ##############################################################
23
19
 
24
20
  <%%
25
- def include_passenger_custom_template(template)
26
- ERB.new(File.read( File.join( File.dirname(__FILE__), 'includes', template ) )).result(binding)
21
+ def include_passenger_custom_template(template, indent = 0, the_binding = get_binding)
22
+ path = File.join(File.dirname(__FILE__), 'includes', template)
23
+ erb = ERB.new(File.read(path), nil, "-", next_eoutvar)
24
+ erb.filename = path
25
+ result = erb.result(the_binding)
26
+
27
+ # Set indenting
28
+ result.gsub!(/^/, " " * indent)
29
+ result.gsub!(/\A +/, '')
30
+
31
+ result
27
32
  end
28
33
 
29
34
  def use_canonical?
@@ -108,9 +113,9 @@ http {
108
113
  <%%= include_passenger_internal_template('server.erb', 8, true, binding) %>
109
114
  <%%= include_passenger_internal_template('rails_asset_pipeline.erb', 8, false) %>
110
115
 
111
- <%%= include_passenger_custom_template('page_level_redirects.erb') %>
112
- <%%= include_passenger_custom_template('proxy_configuration.erb') %>
113
- <%%= include_passenger_custom_template('authentication.erb') %>
116
+ <%%= include_passenger_custom_template('page_level_redirects.erb', 8, binding) %>
117
+ <%%= include_passenger_custom_template('proxy_configuration.erb', 8, binding) %>
118
+ <%%= include_passenger_custom_template('authentication.erb', 8, binding) %>
114
119
 
115
120
  ### BEGIN your own configuration options ###
116
121
  # This is a good place to put your own config options.
@@ -1,7 +1,7 @@
1
1
  module Satorix
2
2
  module Rails
3
3
  module Version
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.5'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: satorix-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Internet Exposure
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-17 00:00:00.000000000 Z
11
+ date: 2019-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: passenger
@@ -93,7 +93,7 @@ files:
93
93
  - lib/rails/generators/templates/install/.gitlab-ci.yml
94
94
  - lib/rails/generators/templates/install/Procfile
95
95
  - lib/rails/generators/templates/install/config/passenger_standalone/includes/authentication.erb
96
- - lib/rails/generators/templates/install/config/passenger_standalone/includes/htpasswd
96
+ - lib/rails/generators/templates/install/config/passenger_standalone/includes/htpasswd_source.erb
97
97
  - lib/rails/generators/templates/install/config/passenger_standalone/includes/page_level_redirects.erb
98
98
  - lib/rails/generators/templates/install/config/passenger_standalone/includes/proxy_configuration.erb
99
99
  - lib/rails/generators/templates/install/config/passenger_standalone/nginx.conf.erb
@@ -1 +0,0 @@
1
- iestaging:$apr1$b4UNgid/$jVoc0rRDzUfmldUp9.DK8.