itamae-plugin-recipe-daddy 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3858b7daba5155c731a7213933da0e7dc65f37523e28bbb29351f79d607da9b1
4
- data.tar.gz: 25a7724f359586cd52347eeef09c0a8ada8dc22307c7ffd2996a69c2b4b6422f
3
+ metadata.gz: a9158d7ec94839e41b3aa50e4759d4ccf3105851e52bc190fd80101980e7d3f9
4
+ data.tar.gz: 60fbbf968ef8b825ca949c87cf60b7eff4dee69307a14c128de8403b71054a86
5
5
  SHA512:
6
- metadata.gz: 2974f7d7dcb395fb974875701ee3b261a2d2a11c9463e57809176a9015e33f0218b256b615268390a256601157da6614e5351840fe8075d616c29fd97b20d1ef
7
- data.tar.gz: 7027be10edbebffe03cf3d86f0109806a3a559e59aa6554f037f94f6a43c3d0aa64aa699c187a43a367b0ab1c667cae90b72b4dba5d6ed810a55ca7f09568f7b
6
+ metadata.gz: 649568fa96708b94b469a43f9d7959365329855289a5aa53508a7ff0401ea763c5f0a50d64942f5644c19ef6b3ddf2e9b4c313075b3cc520de663994a61a1956
7
+ data.tar.gz: ee54a27af44001a05db34b5c56c988779cef68a9328893eeb86208079748c3b6789d0a192f7a30cf938bec3eaf22dc79b1dc4c055c5c7606422b84490d385815
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- itamae-plugin-recipe-daddy (0.1.2)
4
+ itamae-plugin-recipe-daddy (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,15 @@
1
+ [mysqld]
2
+ datadir=/var/lib/mysql
3
+ socket=/var/lib/mysql/mysql.sock
4
+ user=mysql
5
+ # Disabling symbolic-links is recommended to prevent assorted security risks
6
+ symbolic-links=0
7
+
8
+ character-set-server = utf8
9
+
10
+ [mysql]
11
+ default-character-set = utf8
12
+
13
+ [mysqld_safe]
14
+ log-error=/var/log/mysqld.log
15
+ pid-file=/var/run/mysqld/mysqld.pid
@@ -7,8 +7,8 @@ directory 'tmp'
7
7
  # install destination
8
8
  %w{
9
9
  /opt/nginx
10
- /opt/nginx/cache
11
10
  /opt/nginx/shared
11
+ /opt/nginx/shared/letsencrypt
12
12
  /opt/nginx/shared/logs
13
13
  }.each do |name|
14
14
  directory name do
@@ -19,6 +19,17 @@ directory 'tmp'
19
19
  end
20
20
  end
21
21
 
22
+ %w{
23
+ /opt/nginx/cache
24
+ }.each do |name|
25
+ directory name do
26
+ user 'root'
27
+ owner 'nobody'
28
+ group 'root'
29
+ mode '755'
30
+ end
31
+ end
32
+
22
33
  # nginx source
23
34
  execute 'download nginx' do
24
35
  cwd 'tmp'
@@ -107,6 +118,10 @@ directory '/etc/nginx/conf.d/servers' do
107
118
  mode '755'
108
119
  end
109
120
 
121
+ if Daddy.config.app.type?
122
+ include_recipe File.join(File.dirname(File.dirname(__FILE__)), Daddy.config.app.type, 'install.rb')
123
+ end
124
+
110
125
  template '/lib/systemd/system/nginx.service' do
111
126
  user 'root'
112
127
  end
@@ -0,0 +1,21 @@
1
+ server_name = ENV['SERVER_NAME'] || Daddy.config.web.server_name
2
+ rails_env = ENV['RAILS_ENV'] || Daddy.config.rails_env? ? Daddy.config.rails_env : 'development'
3
+ rails_root = ENV['RAILS_ROOT'] || Daddy.config.rails_root? ? Daddy.config.rails_root : File.expand_path('.')
4
+
5
+ template "/etc/nginx/conf.d/servers/#{server_name}.conf" do
6
+ source ::File.join(File.dirname(__FILE__), 'templates', '_passenger.conf.erb')
7
+ user 'root'
8
+ owner 'root'
9
+ group 'root'
10
+ mode '644'
11
+ variables server_name: server_name, rails_env: rails_env, rails_root: rails_root
12
+ end
13
+
14
+ if rails_root.start_with?("/home/#{ENV['USER']}/")
15
+ directory "/home/#{ENV['USER']}" do
16
+ user 'root'
17
+ owner ENV['USER']
18
+ group ENV['USER']
19
+ mode '755'
20
+ end
21
+ end
@@ -0,0 +1,42 @@
1
+ <%-
2
+ @letsencrypt = system("sudo test -e /etc/letsencrypt/live/#{@server_name}/fullchain.pem")
3
+ @selfsigned = system('sudo test -e /etc/pki/tls/certs/localhost.crt')
4
+ @ssl = @letsencrypt || @selfsigned
5
+ -%>
6
+ server {
7
+ listen 80;
8
+ <%- if @ssl -%>
9
+ listen 443 ssl;
10
+ <%- end -%>
11
+ server_name <%= @server_name %>;
12
+ access_log /opt/nginx/shared/logs/<%= @server_name %>_access.log ltsv;
13
+
14
+ <%- if @letsencrypt -%>
15
+ ssl_certificate /etc/letsencrypt/live/<%= @server_name %>/fullchain.pem;
16
+ ssl_certificate_key /etc/letsencrypt/live/<%= @server_name %>/privkey.pem;
17
+
18
+ location ^~ /.well-known/acme-challenge/ {
19
+ default_type "text/plain";
20
+ root /opt/nginx/shared/letsencrypt;
21
+ }
22
+ <%- elsif @selfsigned -%>
23
+ ssl_certificate /etc/pki/tls/certs/localhost.crt;
24
+ ssl_certificate_key /etc/pki/tls/private/localhost.key;
25
+ <%- end -%>
26
+
27
+ location / {
28
+ root <%= ::File.join(@rails_root, 'public') %>;
29
+ passenger_enabled on;
30
+ passenger_app_env <%= @rails_env %>;
31
+ }
32
+
33
+ gzip on;
34
+ gzip_http_version 1.0;
35
+ gzip_proxied any;
36
+ gzip_min_length 500;
37
+ gzip_disable "MSIE [1-6]\.";
38
+ gzip_types text/plain text/xml text/css
39
+ text/comma-separated-values
40
+ text/javascript application/x-javascript
41
+ application/atom+xml;
42
+ }
@@ -1,5 +1,5 @@
1
1
  module ItamaePluginRecipeDaddy
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
 
4
4
  NGINX_VERSION = [
5
5
  NGINX_VERSION_MAJOR = '1',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-daddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-22 00:00:00.000000000 Z
11
+ date: 2018-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -59,6 +59,7 @@ files:
59
59
  - lib/itamae/plugin/recipe/daddy/mysql/install.rb
60
60
  - lib/itamae/plugin/recipe/daddy/mysql/mysql_secure_installation.sh
61
61
  - lib/itamae/plugin/recipe/daddy/mysql/templates/daddy.cnf.erb
62
+ - lib/itamae/plugin/recipe/daddy/mysql/templates/my.cnf.erb
62
63
  - lib/itamae/plugin/recipe/daddy/nginx/install.rb
63
64
  - lib/itamae/plugin/recipe/daddy/nginx/modules/nginx-rtmp-module.rb
64
65
  - lib/itamae/plugin/recipe/daddy/nginx/modules/passenger.rb
@@ -70,6 +71,8 @@ files:
70
71
  - lib/itamae/plugin/recipe/daddy/nginx/templates/etc/nginx/nginx.conf.erb
71
72
  - lib/itamae/plugin/recipe/daddy/nginx/templates/etc/tmpfiles.d/passenger.conf.erb
72
73
  - lib/itamae/plugin/recipe/daddy/nginx/templates/lib/systemd/system/nginx.service.erb
74
+ - lib/itamae/plugin/recipe/daddy/passenger/install.rb
75
+ - lib/itamae/plugin/recipe/daddy/passenger/templates/_passenger.conf.erb
73
76
  - lib/itamae/plugin/recipe/daddy/redis/install.rb
74
77
  - lib/itamae_plugin_recipe_daddy/daddy.rb
75
78
  - lib/itamae_plugin_recipe_daddy/version.rb
@@ -93,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
96
  version: '0'
94
97
  requirements: []
95
98
  rubyforge_project:
96
- rubygems_version: 2.7.6
99
+ rubygems_version: 2.7.7
97
100
  signing_key:
98
101
  specification_version: 4
99
102
  summary: itamae recipe collections