bonethug 0.0.88 → 0.0.89

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: 4ce96dd65bf299a1277f640f466f97d9ef588dd8
4
- data.tar.gz: f712f57099087df2a5637a1df0f007ec2c306585
3
+ metadata.gz: a71cdb3758ee1915ac34ab3fb16eae6ee884eacc
4
+ data.tar.gz: 2f4c876a1b86f6755a5f66dc54c9775c090f869a
5
5
  SHA512:
6
- metadata.gz: be9bf43739da5189f46932119000256d890a77e6cf4ce8b06306fe9c731ec67077469732b42e584a4cecea9d7e590f07c6757f1e7143e7ffa36c4a2f933b454a
7
- data.tar.gz: 95a6da3541929cbb055bd1966786ab76566f391db6d44af99798d3b53f7493b6a929aed27aa859a8de6e7199480de9be43f57a4d8c1969bb8cd74f6fdc54b9d9
6
+ metadata.gz: 226e48016738db0286b52f9e7fff1f21439fea15eb8eb3830bb4007a59728d39758f72e2cf808a484bb6d0b608478eaca72f81679512b399f56f28cff349467a
7
+ data.tar.gz: 8921f1c592f9d59804f91eddc5a98c2f504b9cdf612d529793cd70e2b7925ef50bf0ad0601c676d7eb80fda3552382cb0c1dfc47b0e4a1f7e0e2043a35878de0
data/TODO.txt CHANGED
@@ -10,4 +10,5 @@
10
10
  - nagios?
11
11
  - need more modular configuration of server components for setup scripts
12
12
  - thug vhost-local and thug deploy could share more code
13
- - log rotate
13
+ - log rotate
14
+ - SSL support
data/config/cnf.yml CHANGED
@@ -138,6 +138,9 @@ vhost:
138
138
  conf_path: /etc/apache2/sites-available
139
139
  type: apache
140
140
  version: 2.4
141
+ ssl_key: /etc/ssl/private/ssl-cert-snakeoil.key
142
+ ssl_crt: /etc/ssl/certs/ssl-cert-snakeoil.pem
143
+ ssl_ca_bundle:
141
144
  server_name: production.domain.com
142
145
  server_aliases:
143
146
  - www.production.domain.com
data/config/deploy.rb CHANGED
@@ -143,11 +143,16 @@ task :setup => :environment do
143
143
 
144
144
  end
145
145
 
146
+ desc "Run task"
147
+ task :run_task do
148
+ queue! %[export APPLICATION_ENV=#{env} && export RAILS_ENV=#{env} && cd "#{deploy_to}/current" && #{ENV['task']}]
149
+ end
150
+
146
151
  desc "Updates bundled dependencies"
147
152
  task :update_packages => :environment do
148
- invoke :'bundle:update'
149
- queue! %[php #{deploy_to}/shared/composer.phar update] if use_composer
150
- queue! %[php #{deploy_to}/current/public/framework/cli-script.php dev/build] if ['silverstripe','silverstripe3'].include? deploy.get('project_type')
153
+ queue! %[cd "#{deploy_to}/current" && bundle update]
154
+ queue! %[php "#{deploy_to}/shared/composer.phar" update] if use_composer
155
+ queue! %[php "#{deploy_to}/current/public/framework/cli-script.php" dev/build] if ['silverstripe','silverstripe3'].include? deploy.get('project_type')
151
156
  end
152
157
 
153
158
  desc "Sets up an environment"
@@ -170,8 +175,15 @@ task :init_db => :environment do
170
175
  dbs.each do |name,envs|
171
176
  if envs
172
177
  db = envs.get env
173
- cmd = Bonethug::Installer.init_mysql_db_script db, ENV['admin_user'], ENV['admin_pass']
174
- queue! %[#{cmd}]
178
+ if !db
179
+ puts "No db for env " + env + " found - check your config file"
180
+ exit
181
+ else
182
+ puts "Mysql user " + ENV['admin_user'] + " is creating db: " + db.get('name') + " and granting access to " + db.get('user') + "@" + db.get('host') + ", you may be prompted for the password for the user: " + ENV['admin_user']
183
+ puts "NB: You may be affected by this bug if your admin user pass is longer than 8 chars: http://dev.mysql.com/doc/refman/5.0/en/password-too-long.html"
184
+ cmd = Bonethug::Installer.init_mysql_db_script db, ENV['admin_user'], ENV['admin_pass']
185
+ queue! %[#{cmd}]
186
+ end
175
187
  end
176
188
  end
177
189
  end
data/lib/bonethug/cli.rb CHANGED
@@ -241,7 +241,7 @@ module Bonethug
241
241
  else
242
242
  case task
243
243
  when 'rake'
244
- cmd_task = 'rake'
244
+ cmd_task = 'bundle exec rake'
245
245
  when 'drush', 'drush-local'
246
246
  cmd_task = File.expand_path('./vendor/drush/drush/drush') + ' -r ' + File.expand_path('./public')
247
247
  when 'sake'
@@ -260,7 +260,7 @@ module Bonethug
260
260
  else
261
261
 
262
262
  # build command
263
- run = "\"run[#{cmd_task} #{args.join(' ')}]\""
263
+ run = "run_task task=\"#{cmd_task} #{args.join(' ')}\""
264
264
 
265
265
  # do it!
266
266
  exec "export to=#{environment} && bundle exec mina -f .bonethug/deploy.rb #{run} --verbose"
@@ -35,7 +35,7 @@ module Bonethug
35
35
 
36
36
  # server aliases
37
37
  server_aliases = ''
38
- aliases = vh_cnf.get('server_aliases')
38
+ aliases = vh_cnf.get 'server_aliases'
39
39
  if aliases
40
40
  aliases.each do |index, server_alias|
41
41
  server_aliases += 'ServerAlias ' + server_alias + "\n"
@@ -52,13 +52,26 @@ module Bonethug
52
52
  end
53
53
 
54
54
  # server admin
55
- admin = vh_cnf.get('server_admin')
55
+ admin = vh_cnf.get 'server_admin'
56
56
  server_admin = admin ? 'ServerAdmin ' + admin : ''
57
57
 
58
58
  # paths
59
59
  shared_path = is_remote ? '/shared' : ''
60
60
  current_path = is_remote ? '/current' : ''
61
61
 
62
+ # ssl key
63
+ ssl_key = vh_cnf.get 'ssl_key'
64
+ ssl_key = base_path + current_path + '/' + ssl_key if ssl_key and ssl_key[0...0] != '/'
65
+
66
+ # ssl crt
67
+ ssl_crt = vh_cnf.get 'ssl_crt'
68
+ ssl_crt = base_path + current_path + '/' + ssl_crt if ssl_crt and ssl_crt[0...0] != '/'
69
+
70
+ # ssl crt
71
+ ssl_ca_bundle = vh_cnf.get 'ssl_ca_bundle'
72
+ ssl_ca_bundle = base_path + current_path + '/' + ssl_ca_bundle if ssl_ca_bundle and ssl_ca_bundle[0...0] != '/'
73
+ ca_str = ssl_ca_bundle ? 'SSLCertificateChainFile ' + ssl_ca_bundle : ''
74
+
62
75
  case vh_cnf.get('type')
63
76
 
64
77
  when "nginx"
@@ -96,6 +109,49 @@ module Bonethug
96
109
 
97
110
  </VirtualHost>
98
111
  "
112
+
113
+ if ssl_key and ssl_crt
114
+
115
+ vh += "
116
+ <VirtualHost *:443>
117
+
118
+ ServerName #{vh_cnf.get('server_name')}
119
+ #{server_aliases}
120
+
121
+ #{server_admin}
122
+
123
+ DocumentRoot #{base_path + current_path}/public
124
+
125
+ #{env_vars}
126
+ PassEnv PATH
127
+
128
+ SSLEngine on
129
+ SSLCertificateFile #{ssl_crt}
130
+ SSLCertificateKeyFile #{ssl_key}
131
+ #{ca_str}
132
+
133
+ CustomLog #{base_path + shared_path}/log/bytes.log bytes
134
+ CustomLog #{base_path + shared_path}/log/combined.log combined
135
+ ErrorLog #{base_path + shared_path}/log/error.log
136
+
137
+ <Directory #{base_path + current_path}/public>
138
+
139
+ SSLOptions +StdEnvVars
140
+ Options Indexes MultiViews FollowSymLinks
141
+ AllowOverride All
142
+ #{access}
143
+
144
+ </Directory>
145
+
146
+ BrowserMatch \"MSIE [2-6]\" \
147
+ nokeepalive ssl-unclean-shutdown \
148
+ downgrade-1.0 force-response-1.0
149
+ BrowserMatch \"MSIE [17-9]\" ssl-unclean-shutdown
150
+
151
+ </VirtualHost>
152
+ "
153
+
154
+ end
99
155
  end
100
156
 
101
157
  vh
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Bonethug
3
- VERSION = "0.0.88"
4
- BUILD_DATE = "2014-08-12 20:19:45 +1200"
3
+ VERSION = "0.0.89"
4
+ BUILD_DATE = "2014-09-30 11:34:00 +1300"
5
5
  end
6
6
 
data/scripts/mail CHANGED
@@ -1,4 +1,4 @@
1
- # /bin/bash
1
+ #!/bin/bash
2
2
 
3
3
  cd /usr/share && sudo git clone https://github.com/joshdata/mailinabox
4
4
  sudo bash mailinabox/setup/start.sh
data/scripts/npm-bower CHANGED
@@ -1,3 +1,5 @@
1
+ #!/bin/bash
2
+
1
3
  # install npm
2
4
  sudo apt-get update && sudo apt-get upgrade
3
5
  sudo apt-get install g++ curl libssl-dev apache2-utils git-core
data/scripts/postgres ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+
3
+ sudo apt-get install postgresql-9.3 phppgadmin
4
+ sudo cp /etc/apache2/conf.d/phppgadmin /etc/apache2/conf-available/phppgadmin.conf
5
+ sudo sed -i -e "s/allow from 127.0.0.0\/255.0.0.0 ::1\/128/allow from all/g" /etc/apache2/conf-available/phppgadmin.conf
6
+ sudo a2enconf phppgadmin.conf
7
+ sudo service apache2 reload
data/scripts/ubuntu-12.04 CHANGED
@@ -1,4 +1,4 @@
1
- # /bin/bash
1
+ #!/bin/bash
2
2
 
3
3
  # -----------------------------------------------------
4
4
  # install native stuff
@@ -70,141 +70,12 @@ sudo sed -i -e "s/listen = \/var\/run\/php5-fpm.sock/listen = 127.0.0.1:9000/g"
70
70
  sudo mysql_secure_installation
71
71
 
72
72
  # node
73
- sudo ln -s /usr/bin/node /usr/bin/nodejs
73
+ sudo ln -s /usr/bin/nodejs /usr/bin/node
74
74
 
75
75
  # ruby
76
76
  update-alternatives --set gem /usr/bin/gem2.1
77
77
  update-alternatives --set ruby /usr/bin/ruby2.1
78
- # /bin/bash
79
78
 
80
- # -----------------------------------------------------
81
- # install native stuff
82
- # -----------------------------------------------------
83
-
84
- # install the repo adding scripts
85
- sudo apt-get install software-properties-common python-software-properties
86
-
87
- # add repos
88
- # sudo add-apt-repository ppa:richarvey/nodejs
89
- sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
90
- sudo add-apt-repository "deb-src http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
91
- sudo apt-add-repository ppa:brightbox/ruby-ng
92
- sudo add-apt-repository ppa:ondrej/apache2
93
- sudo add-apt-repository ppa:ondrej/php5
94
- sudo add-apt-repository ppa:ondrej/mysql-5.6
95
-
96
- # update
97
- sudo apt-get update && sudo apt-get upgrade
98
-
99
- # install
100
-
101
- # dev headers
102
- sudo apt-get install libcurl4-openssl-dev libssl-dev apache2-threaded-dev libapr1-dev libaprutil1-dev libapr1-dev libaprutil1-dev ruby2.1-dev
103
- sudo apt-get install libmysqlclient-dev libmagickwand-dev libsqlite3-dev libxml2-dev libxslt1-dev
104
-
105
- # regular packages
106
- sudo apt-get install apache2-mpm-worker
107
- sudo apt-get install libapache2-mod-qos libapache2-mod-spamhaus libapache2-mod-fastcgi libapache2-mod-evasive
108
- sudo apt-get install curl php5-fpm php5 php5-cli php5-curl php5-gd php5-imagick php-apc php5-mysql
109
- sudo apt-get install mysql-server mysql-client sqlite3
110
- sudo apt-get install imagemagick
111
- sudo apt-get install phpmyadmin
112
- sudo apt-get install sshpass
113
- sudo apt-get install libxml2 g++
114
- sudo apt-get install git ruby2.1 wkhtmltopdf nodejs npm at
115
-
116
-
117
- # -----------------------------------------------------
118
- # Configure stuff
119
- # -----------------------------------------------------
120
-
121
- # unix socket
122
- # echo "
123
- # <IfModule mod_fastcgi.c>
124
- # AddHandler php5-fcgi .php
125
- # Action php5-fcgi /php5-fcgi
126
- # Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
127
- # FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
128
- # </IfModule>
129
- # " > /etc/apache2/conf.d/php-fpm.conf
130
- # sed -i -e "s/listen = 127.0.0.1:9000/listen = \/var\/run\/php5-fpm.sock/g" /etc/php5/fpm/pool.d/www.conf
131
-
132
- ## TCP
133
- # echo "
134
- # <IfModule mod_fastcgi.c>
135
- # AddHandler php5-fcgi .php
136
- # Action php5-fcgi /php5-fcgi
137
- # Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
138
- # FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -idle-timeout 250 -pass-header Authorization
139
- # </IfModule>
140
- # " > /etc/apache2/conf.d/php-fpm.conf
141
- # sed -i -e "s/listen = \/var\/run\/php5-fpm.sock/listen = 127.0.0.1:9000/g" /etc/php5/fpm/pool.d/www.conf
142
-
143
- # php
144
- sudo sed -i -e "s/listen = \/var\/run\/php5-fpm.sock/listen = 127.0.0.1:9000/g" /etc/php5/fpm/pool.d/www.conf
145
-
146
- # secure mysql install
147
- sudo mysql_secure_installation
148
-
149
- # node
150
- sudo ln -s /usr/bin/node /usr/bin/nodejs
151
-
152
- # ruby
153
- update-alternatives --set gem /usr/bin/gem2.1
154
- update-alternatives --set ruby /usr/bin/ruby2.1
155
-
156
- # Apache
157
- # ------
158
-
159
- # config modules
160
-
161
- # php fpm
162
- sudo echo -e "<IfModule mod_fastcgi.c>\n AddHandler php5-fcgi .php\n Action php5-fcgi /php5-fcgi\n Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi\n FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -idle-timeout 250 -pass-header Authorization\n <Directory />\nRequire all granted\n </Directory>\n </IfModule>" > /etc/apache2/conf-available/php-fpm.conf
163
- sudo a2enconf php-fpm.conf
164
-
165
- # DDoS Protection
166
- sudo mkdir -p /var/log/apache2/evasive
167
- sudo chown -R www-data:root /var/log/apache2/evasive
168
- sudo echo -e "<IfModule mod_spamhaus.c>\n DOSHashTableSize 2048\n DOSPageCount 20 # maximum number of requests for the same page\n DOSSiteCount 300 # total number of requests for any object by the same client IP on the same listener\n DOSPageInterval 1.0 # interval for the page count threshold\n DOSSiteInterval 1.0 # interval for the site count threshold\n DOSBlockingPeriod 10.0 # time that a client IP will be blocked for\n DOSLogDir “/var/log/apache2/evasive”\n DOSEmailNotify root@localhost\n</IfModule>" > /etc/apache2/conf-available/mod-evasive.conf
169
- sudo a2enconf mod-evasive.conf
170
-
171
- # DNS Injection
172
- sudo touch /etc/spamhaus.wl
173
- sudo echo -e "<IfModule mod_spamhaus.c>\n MS_METHODS POST,PUT,OPTIONS,CONNECT\n MS_WhiteList /etc/spamhaus.wl\n MS_CacheSize 256\n</IfModule>" > /etc/apache2/conf-available/spamhaus.conf
174
- sudo a2enconf spamhauf.conf
175
-
176
- # enable modules
177
- sudo a2enmod actions fastcgi alias rewrite headers qos spamhaus evasive cache cache_disk
178
-
179
- # phpmyadmin apache 2.4
180
- sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
181
- sudo a2enconf phpmyadmin.conf
182
-
183
- # -----------------------------------------------------
184
- # Install Gems
185
- # -----------------------------------------------------
186
-
187
- # install some gems - yes gem1.9.3 - wtf - use rbenv
188
- # sudo gem1.9.3 install mina bundler whenever astrails-safe
189
-
190
- # install passenger
191
- sudo gem install passenger
192
- sudo passenger-install-apache2-module
193
- sudo touch /etc/apache2/mods-available/passenger.load
194
- sudo touch /etc/apache2/mods-available/passenger.confc
195
-
196
- # -----------------------------------------------------
197
- # Node.js related
198
- # -----------------------------------------------------
199
-
200
- sudo npm install bower -g
201
-
202
- # -----------------------------------------------------
203
- # Restart stuff
204
- # -----------------------------------------------------
205
-
206
- sudo service apache2 restart
207
- sudo service php5-fpm restart
208
79
  # Apache
209
80
  # ------
210
81
 
@@ -226,7 +97,7 @@ sudo echo -e "<IfModule mod_spamhaus.c>\n MS_METHODS POST,PUT,OPTIONS,CONNECT\n
226
97
  sudo a2enconf spamhauf.conf
227
98
 
228
99
  # enable modules
229
- sudo a2enmod actions fastcgi alias rewrite headers qos spamhaus evasive cache cache_disk
100
+ sudo a2enmod actions fastcgi alias rewrite headers qos spamhaus evasive cache cache_disk ssl
230
101
 
231
102
  # phpmyadmin apache 2.4
232
103
  sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
@@ -237,7 +108,7 @@ sudo a2enconf phpmyadmin.conf
237
108
  # -----------------------------------------------------
238
109
 
239
110
  # install some gems - yes gem1.9.3 - wtf - use rbenv
240
- # sudo gem1.9.3 install mina bundler whenever astrails-safe
111
+ sudo gem install bundler
241
112
 
242
113
  # install passenger
243
114
  sudo gem install passenger
data/scripts/ubuntu-14.04 CHANGED
@@ -1,86 +1,12 @@
1
- # /bin/bash
1
+ #!/bin/bash
2
2
 
3
3
  # -----------------------------------------------------
4
4
  # install native stuff
5
5
  # -----------------------------------------------------
6
6
 
7
- # install the repo adding scripts
8
- sudo apt-get install software-properties-common python-software-properties
9
-
10
- # add repos
11
- # sudo add-apt-repository ppa:richarvey/nodejs
12
- sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
13
- sudo add-apt-repository "deb-src http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
14
- sudo apt-add-repository ppa:brightbox/ruby-ng
15
- sudo add-apt-repository ppa:ondrej/apache2
16
- sudo add-apt-repository ppa:ondrej/php5
17
- sudo add-apt-repository ppa:ondrej/mysql-5.6
18
-
19
7
  # update
20
8
  sudo apt-get update && sudo apt-get upgrade
21
9
 
22
- # install
23
-
24
- # dev headers
25
- sudo apt-get install libcurl4-openssl-dev libssl-dev apache2-threaded-dev libapr1-dev libaprutil1-dev libapr1-dev libaprutil1-dev ruby2.1-dev
26
- sudo apt-get install libmysqlclient-dev libmagickwand-dev libsqlite3-dev libxml2-dev libxslt1-dev
27
-
28
- # regular packages
29
- sudo apt-get install apache2-mpm-workery
30
- sudo apt-get install libapache2-mod-qos libapache2-mod-spamhaus libapache2-mod-fastcgi libapache2-mod-evasive
31
- sudo apt-get install curl php5-fpm php5 php5-cli php5-curl php5-gd php5-imagick php-apc php5-mysql
32
- sudo apt-get install mysql-server mysql-client sqlite3
33
- sudo apt-get install imagemagick
34
- sudo apt-get install phpmyadmin
35
- sudo apt-get install sshpass
36
- sudo apt-get install libxml2 g++
37
- sudo apt-get install git ruby2.1 wkhtmltopdf nodejs npm at
38
-
39
-
40
- # -----------------------------------------------------
41
- # Configure stuff
42
- # -----------------------------------------------------
43
-
44
- # unix socket
45
- # echo "
46
- # <IfModule mod_fastcgi.c>
47
- # AddHandler php5-fcgi .php
48
- # Action php5-fcgi /php5-fcgi
49
- # Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
50
- # FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
51
- # </IfModule>
52
- # " > /etc/apache2/conf.d/php-fpm.conf
53
- # sed -i -e "s/listen = 127.0.0.1:9000/listen = \/var\/run\/php5-fpm.sock/g" /etc/php5/fpm/pool.d/www.conf
54
-
55
- ## TCP
56
- # echo "
57
- # <IfModule mod_fastcgi.c>
58
- # AddHandler php5-fcgi .php
59
- # Action php5-fcgi /php5-fcgi
60
- # Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
61
- # FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -idle-timeout 250 -pass-header Authorization
62
- # </IfModule>
63
- # " > /etc/apache2/conf.d/php-fpm.conf
64
- # sed -i -e "s/listen = \/var\/run\/php5-fpm.sock/listen = 127.0.0.1:9000/g" /etc/php5/fpm/pool.d/www.conf
65
-
66
- # php
67
- sudo sed -i -e "s/listen = \/var\/run\/php5-fpm.sock/listen = 127.0.0.1:9000/g" /etc/php5/fpm/pool.d/www.conf
68
-
69
- # secure mysql install
70
- sudo mysql_secure_installation
71
-
72
- # node
73
- sudo ln -s /usr/bin/node /usr/bin/nodejs
74
-
75
- # ruby
76
- update-alternatives --set gem /usr/bin/gem2.1
77
- update-alternatives --set ruby /usr/bin/ruby2.1
78
- # /bin/bash
79
-
80
- # -----------------------------------------------------
81
- # install native stuff
82
- # -----------------------------------------------------
83
-
84
10
  # install the repo adding scripts
85
11
  sudo apt-get install software-properties-common python-software-properties
86
12
 
@@ -147,64 +73,13 @@ sudo sed -i -e "s/listen = \/var\/run\/php5-fpm.sock/listen = 127.0.0.1:9000/g"
147
73
  sudo mysql_secure_installation
148
74
 
149
75
  # node
150
- sudo ln -s /usr/bin/node /usr/bin/nodejs
76
+ sudo ln -s /usr/bin/nodejs /usr/bin/node
151
77
 
152
78
  # ruby
153
79
  update-alternatives --set gem /usr/bin/gem2.1
154
80
  update-alternatives --set ruby /usr/bin/ruby2.1
155
81
 
156
- # Apache
157
- # ------
158
-
159
- # config modules
160
-
161
- # php fpm
162
- sudo echo -e "<IfModule mod_fastcgi.c>\n AddHandler php5-fcgi .php\n Action php5-fcgi /php5-fcgi\n Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi\n FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -idle-timeout 250 -pass-header Authorization\n <Directory />\nRequire all granted\n </Directory>\n </IfModule>" > /etc/apache2/conf-available/php-fpm.conf
163
- sudo a2enconf php-fpm.conf
164
-
165
- # DDoS Protection
166
- sudo mkdir -p /var/log/apache2/evasive
167
- sudo chown -R www-data:root /var/log/apache2/evasive
168
- sudo echo -e "<IfModule mod_spamhaus.c>\n DOSHashTableSize 2048\n DOSPageCount 20 # maximum number of requests for the same page\n DOSSiteCount 300 # total number of requests for any object by the same client IP on the same listener\n DOSPageInterval 1.0 # interval for the page count threshold\n DOSSiteInterval 1.0 # interval for the site count threshold\n DOSBlockingPeriod 10.0 # time that a client IP will be blocked for\n DOSLogDir “/var/log/apache2/evasive”\n DOSEmailNotify root@localhost\n</IfModule>" > /etc/apache2/conf-available/mod-evasive.conf
169
- sudo a2enconf mod-evasive.conf
170
-
171
- # DNS Injection
172
- sudo touch /etc/spamhaus.wl
173
- sudo echo -e "<IfModule mod_spamhaus.c>\n MS_METHODS POST,PUT,OPTIONS,CONNECT\n MS_WhiteList /etc/spamhaus.wl\n MS_CacheSize 256\n</IfModule>" > /etc/apache2/conf-available/spamhaus.conf
174
- sudo a2enconf spamhauf.conf
175
82
 
176
- # enable modules
177
- sudo a2enmod actions fastcgi alias rewrite headers qos spamhaus evasive cache cache_disk
178
-
179
- # phpmyadmin apache 2.4
180
- sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
181
- sudo a2enconf phpmyadmin.conf
182
-
183
- # -----------------------------------------------------
184
- # Install Gems
185
- # -----------------------------------------------------
186
-
187
- # install some gems - yes gem1.9.3 - wtf - use rbenv
188
- # sudo gem1.9.3 install mina bundler whenever astrails-safe
189
-
190
- # install passenger
191
- sudo gem install passenger
192
- sudo passenger-install-apache2-module
193
- sudo touch /etc/apache2/mods-available/passenger.load
194
- sudo touch /etc/apache2/mods-available/passenger.confc
195
-
196
- # -----------------------------------------------------
197
- # Node.js related
198
- # -----------------------------------------------------
199
-
200
- sudo npm install bower -g
201
-
202
- # -----------------------------------------------------
203
- # Restart stuff
204
- # -----------------------------------------------------
205
-
206
- sudo service apache2 restart
207
- sudo service php5-fpm restart
208
83
  # Apache
209
84
  # ------
210
85
 
@@ -217,7 +92,7 @@ sudo a2enconf php-fpm.conf
217
92
  # DDoS Protection
218
93
  sudo mkdir -p /var/log/apache2/evasive
219
94
  sudo chown -R www-data:root /var/log/apache2/evasive
220
- sudo echo -e "<IfModule mod_spamhaus.c>\n DOSHashTableSize 2048\n DOSPageCount 20 # maximum number of requests for the same page\n DOSSiteCount 300 # total number of requests for any object by the same client IP on the same listener\n DOSPageInterval 1.0 # interval for the page count threshold\n DOSSiteInterval 1.0 # interval for the site count threshold\n DOSBlockingPeriod 10.0 # time that a client IP will be blocked for\n DOSLogDir “/var/log/apache2/evasive”\n DOSEmailNotify root@localhost\n</IfModule>" > /etc/apache2/conf-available/mod-evasive.conf
95
+ sudo echo -e "<IfModule mod_spamhaus.c>\n DOSHashTableSize 2048\n DOSPageCount 20\n DOSSiteCount 300\n DOSPageInterval 1.0\n DOSSiteInterval 1.0\n DOSBlockingPeriod 10.0\n DOSLogDir “/var/log/apache2/evasive”\n DOSEmailNotify root@localhost\n</IfModule>" > /etc/apache2/conf-available/mod-evasive.conf
221
96
  sudo a2enconf mod-evasive.conf
222
97
 
223
98
  # DNS Injection
@@ -226,7 +101,7 @@ sudo echo -e "<IfModule mod_spamhaus.c>\n MS_METHODS POST,PUT,OPTIONS,CONNECT\n
226
101
  sudo a2enconf spamhauf.conf
227
102
 
228
103
  # enable modules
229
- sudo a2enmod actions fastcgi alias rewrite headers qos spamhaus evasive cache cache_disk
104
+ sudo a2enmod actions fastcgi alias rewrite headers qos spamhaus evasive cache cache_disk ssl
230
105
 
231
106
  # phpmyadmin apache 2.4
232
107
  sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
@@ -237,7 +112,7 @@ sudo a2enconf phpmyadmin.conf
237
112
  # -----------------------------------------------------
238
113
 
239
114
  # install some gems - yes gem1.9.3 - wtf - use rbenv
240
- # sudo gem1.9.3 install mina bundler whenever astrails-safe
115
+ sudo gem install bundler
241
116
 
242
117
  # install passenger
243
118
  sudo gem install passenger
@@ -1,4 +1,4 @@
1
- # /bin/bash
1
+ #!/bin/bash
2
2
 
3
3
  # -----------------------------------------------------
4
4
  # install native stuff
@@ -67,13 +67,13 @@ sudo echo -e "<IfModule mod_fastcgi.c>\n AddHandler php5-fcgi .php\n Action php5
67
67
  sudo a2enconf php-fpm.conf
68
68
 
69
69
  # node
70
- sudo ln -s /usr/bin/node /usr/bin/nodejs
70
+ sudo ln -s /usr/bin/nodejs /usr/bin/node
71
71
 
72
72
  # Apache
73
73
  # ------
74
74
 
75
75
  # modules
76
- sudo a2enmod actions fastcgi alias rewrite headers
76
+ sudo a2enmod actions fastcgi alias rewrite headers ssl
77
77
 
78
78
  # phpmyadmin apache 2.4
79
79
  sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
@@ -84,7 +84,7 @@ sudo a2enconf phpmyadmin.conf
84
84
  # -----------------------------------------------------
85
85
 
86
86
  # install some gems - yes gem1.9.3 - wtf - use rbenv
87
- # sudo gem1.9.3 install mina bundler whenever astrails-safe
87
+ sudo gem install bundler
88
88
 
89
89
  # install passenger
90
90
  sudo gem install passenger
data/scripts/ubuntu.sh CHANGED
@@ -1,4 +1,4 @@
1
- # /bin/bash
1
+ #!/bin/bash
2
2
 
3
3
  # -----------------------------------------------------
4
4
  # install native stuff
@@ -66,7 +66,8 @@ class Load {
66
66
  $cnf = Yaml::parse($base_dir . '/config/cnf.yml');
67
67
 
68
68
  // expected urls
69
- $url = 'http://' . $cnf['apache'][APPLICATION_ENV]['server_name'];
69
+ $apache = empty($cnf['apache']) ? $cnf['vhost'] : $cnf['apache'];
70
+ $url = 'http://' . $apache[APPLICATION_ENV]['server_name'];
70
71
 
71
72
  // load db settings
72
73
  $db = (object) $cnf['dbs']['default'][APPLICATION_ENV];
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bonethug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.88
4
+ version: 0.0.89
5
5
  platform: ruby
6
6
  authors:
7
7
  - azt3k
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-12 00:00:00.000000000 Z
11
+ date: 2014-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -342,6 +342,7 @@ files:
342
342
  - scripts/mail
343
343
  - scripts/npm-bower
344
344
  - scripts/optimise-mysql
345
+ - scripts/postgres
345
346
  - scripts/ubuntu-12.04
346
347
  - scripts/ubuntu-14.04
347
348
  - scripts/ubuntu-14.04-dev