Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 210 lines (188 sloc) 6.963 kb
2aa29e2 Adding debian namespace and a bunch of cool helpers
Winton Welsh authored
1 Capistrano::Configuration.instance(:must_exist).load do
2
3 namespace :debian do
1411228 Adding really cool install_source helper along with a few debian:install...
Winton Welsh authored
4 desc "Configure and install a fresh Debian server"
2d67b51 Fixing Nginx 'one mongrel' vhost bug, reorganized some of the recipes
Winton Welsh authored
5 task :default do
bbd5804 Nearing 1.0
Winton Welsh authored
6 if yes("Have you created the user defined in config/deploy.rb? (See vendor/plugins/cookbook/README)")
2d67b51 Fixing Nginx 'one mongrel' vhost bug, reorganized some of the recipes
Winton Welsh authored
7 debian.aptitude.default
e437f7a Moving some recipe calls to more appropriate places, README update
Winton Welsh authored
8 debian.config.default
2d67b51 Fixing Nginx 'one mongrel' vhost bug, reorganized some of the recipes
Winton Welsh authored
9 debian.install.default
bbd5804 Nearing 1.0
Winton Welsh authored
10 end
11 end
12
13 namespace :aptitude do
2d67b51 Fixing Nginx 'one mongrel' vhost bug, reorganized some of the recipes
Winton Welsh authored
14 desc 'Run all tasks'
15 task :default do
16 aptitude.update
17 aptitude.upgrade
18 aptitude.essential
19 end
20
bbd5804 Nearing 1.0
Winton Welsh authored
21 desc 'Aptitude update'
22 task :update do
23 sudo_puts 'aptitude update -q -y'
24 end
25
26 desc 'Aptitude upgrade'
27 task :upgrade do
28 sudo_puts 'aptitude upgrade -q -y'
29 end
30
31 desc 'Aptitude install build-essential'
32 task :essential do
33 sudo_puts 'aptitude install build-essential -q -y'
81508ee Mostly helper improvements, some task rearranging
Winton Welsh authored
34 end
1411228 Adding really cool install_source helper along with a few debian:install...
Winton Welsh authored
35 end
2aa29e2 Adding debian namespace and a bunch of cool helpers
Winton Welsh authored
36
7f15326 Moving config erb into folders. Trying to get a functioning Postfix/Dove...
Winton Welsh authored
37 namespace :config do
2d67b51 Fixing Nginx 'one mongrel' vhost bug, reorganized some of the recipes
Winton Welsh authored
38 desc 'Run all tasks'
39 task :default do
40 debian.config.sshd_config
41 debian.config.iptables
42 debian.config.locales
43 debian.config.bash_profile
44 end
45
81508ee Mostly helper improvements, some task rearranging
Winton Welsh authored
46 desc "Uploads the bash_profile file in config/cookbook"
47 task :bash_profile do
48 question = [
49 "This task uploads the bash_profile file in config/cookbook.",
50 "OK?"
51 ]
52 if yes(question)
1411228 Adding really cool install_source helper along with a few debian:install...
Winton Welsh authored
53 usr = ask "Update bash_profile for which user? (default: #{user})", user
7f15326 Moving config erb into folders. Trying to get a functioning Postfix/Dove...
Winton Welsh authored
54 upload_from_erb "/home/#{usr}/.bash_profile", binding, :chown => usr, :folder => 'debian'
81508ee Mostly helper improvements, some task rearranging
Winton Welsh authored
55 end
2aa29e2 Adding debian namespace and a bunch of cool helpers
Winton Welsh authored
56 end
bbd5804 Nearing 1.0
Winton Welsh authored
57
81508ee Mostly helper improvements, some task rearranging
Winton Welsh authored
58 desc "Updates server iptables from the file in config/cookbook"
59 task :iptables do
60 question = [
61 "This task updates your server's iptables with the file in config/cookbook.",
62 "OK?"
63 ]
64 if yes(question)
7f15326 Moving config erb into folders. Trying to get a functioning Postfix/Dove...
Winton Welsh authored
65 upload_from_erb '/etc/iptables.rules', binding, :folder => 'debian'
66 sudo_each [
67 'iptables-restore < /etc/iptables.rules',
68 'rm /etc/iptables.rules'
69 ]
81508ee Mostly helper improvements, some task rearranging
Winton Welsh authored
70 end
2aa29e2 Adding debian namespace and a bunch of cool helpers
Winton Welsh authored
71 end
bbd5804 Nearing 1.0
Winton Welsh authored
72
73 desc "Updates server locales from the file in config/cookbook"
74 task :locales do
75 question = [
76 "This task updates the server's locales from the file in config/cookbook.",
77 "OK?"
78 ]
79 if yes(question)
80 upload_from_erb '/etc/locale.gen', binding, :chown => 'root', :chmod => '0644', :folder => 'debian'
81 sudo '/usr/sbin/locale-gen'
82 end
83 end
84
81508ee Mostly helper improvements, some task rearranging
Winton Welsh authored
85 desc "Updates sshd_config from the file in config/cookbook"
86 task :sshd_config do
87 question = [
88 "This task updates your server's sshd_config with the file in config/cookbook.",
89 "This task assumes your server's current ssh port is 22.",
90 "This task will change your ssh port to the one in config/deploy.rb.",
91 "OK?"
92 ]
93 if yes(question)
94 set :port, 22 # Comment out for testing
7f15326 Moving config erb into folders. Trying to get a functioning Postfix/Dove...
Winton Welsh authored
95 upload_from_erb '/etc/ssh/sshd_config', binding, :chown => 'root', :chmod => '0644', :folder => 'debian'
81508ee Mostly helper improvements, some task rearranging
Winton Welsh authored
96 sudo '/etc/init.d/ssh reload'
97 set :port, ssh_port
98 end
2aa29e2 Adding debian namespace and a bunch of cool helpers
Winton Welsh authored
99 end
100 end
1411228 Adding really cool install_source helper along with a few debian:install...
Winton Welsh authored
101
566e084 Cookbook now deploying Rails...still need to test PHP
Winton Welsh authored
102 namespace :install do
2d67b51 Fixing Nginx 'one mongrel' vhost bug, reorganized some of the recipes
Winton Welsh authored
103 desc 'Run all tasks'
104 task :default do
105 debian.install.git
106 debian.install.lighttpd
e3959a5 Adding MySecureShell to debian:install
Winton Welsh authored
107 debian.install.mysecureshell
2d67b51 Fixing Nginx 'one mongrel' vhost bug, reorganized some of the recipes
Winton Welsh authored
108 debian.install.mysql
109 debian.install.nginx
110 debian.install.php
111 debian.install.ruby
112 debian.install.rubygems
113 debian.install.sphinx
114 debian.install.monit
115 end
116
566e084 Cookbook now deploying Rails...still need to test PHP
Winton Welsh authored
117 desc "Install Git"
118 task :git, :roles => :app do
119 install_source(:git) do |path|
120 sudo_puts [
121 "aptitude install tcl8.4 tk8.4 gettext -q -y",
481d492 Just did a full Debian install with this commit (hardened)
Winton Welsh authored
122 ";cd #{path} && ./configure && make && sudo make install"
566e084 Cookbook now deploying Rails...still need to test PHP
Winton Welsh authored
123 ]
124 end
125 end
126
e437f7a Moving some recipe calls to more appropriate places, README update
Winton Welsh authored
127 desc "Install Lighttpd" # Lighttpd install is purely for spawn-fcgi
bbd5804 Nearing 1.0
Winton Welsh authored
128 task :lighttpd, :roles => :app do
7f15326 Moving config erb into folders. Trying to get a functioning Postfix/Dove...
Winton Welsh authored
129 sudo_puts 'aptitude install libpcre3-dev libbz2-dev -q -y'
130 install_source(:lighttpd) do |path|
481d492 Just did a full Debian install with this commit (hardened)
Winton Welsh authored
131 sudo_puts ";cd #{path} && ./configure && make && sudo make install"
7f15326 Moving config erb into folders. Trying to get a functioning Postfix/Dove...
Winton Welsh authored
132 end
133 end
134
5ae18c5 Adding Monit support, making fastcgi create a pid
Winton Welsh authored
135 desc 'Install Monit'
136 task :monit, :roles => :db do
137 sudo_puts 'aptitude install monit -q -y'
481d492 Just did a full Debian install with this commit (hardened)
Winton Welsh authored
138 ROOT.monit.config.default
5ae18c5 Adding Monit support, making fastcgi create a pid
Winton Welsh authored
139 end
140
e3959a5 Adding MySecureShell to debian:install
Winton Welsh authored
141 desc "Install MySecureShell"
142 task :mysecureshell, :roles => :app do
143 # http://www.howtoforge.com/mysecureshell_sftp_debian_etch
144 sudo_puts 'aptitude install libssl0.9.7 ssh openssh-server -q -y'
145 install_source(:mysecureshell) do |path|
c20b8ab Updating debian:install:mysecureshell
Winton Welsh authored
146 sudo_puts ";cd ~/sources/mysecureshell* && ./configure && make && sudo make install"
e3959a5 Adding MySecureShell to debian:install
Winton Welsh authored
147 end
148 end
149
bbd5804 Nearing 1.0
Winton Welsh authored
150 desc 'Install MySQL'
151 task :mysql, :roles => :db do
152 sudo_puts 'aptitude install mysql-server mysql-client libmysqlclient15-dev libmysql-ruby -q -y'
fb9675e Adding a bunch of tasks to get ebormerchant running properly, a few bug ...
Winton Welsh authored
153 ROOT.mysql.config
481d492 Just did a full Debian install with this commit (hardened)
Winton Welsh authored
154 ROOT.mysql.create.user
bbd5804 Nearing 1.0
Winton Welsh authored
155 puts [
8001321 Deploy example updates, README
Winton Welsh authored
156 '',
157 "It is highly recommended you run mysql_secure_installation manually.",
158 "See http://dev.mysql.com/doc/refman/5.1/en/mysql-secure-installation.html",
159 ''
bbd5804 Nearing 1.0
Winton Welsh authored
160 ].join("\n")
161 end
162
7f15326 Moving config erb into folders. Trying to get a functioning Postfix/Dove...
Winton Welsh authored
163 desc 'Install Nginx'
bbd5804 Nearing 1.0
Winton Welsh authored
164 task :nginx, :roles => :app do
7331d48 Monit recipes/config, including Nginx vhost for accessing Monit web admi...
Winton Welsh authored
165 # apache2-utils for htpasswd, rest for nginx build
166 sudo_puts 'aptitude install apache2-utils libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev -q -y'
7f15326 Moving config erb into folders. Trying to get a functioning Postfix/Dove...
Winton Welsh authored
167 install_source(:nginx) do |path|
481d492 Just did a full Debian install with this commit (hardened)
Winton Welsh authored
168 sudo_puts ";cd #{path} && ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module && make && sudo make install"
7f15326 Moving config erb into folders. Trying to get a functioning Postfix/Dove...
Winton Welsh authored
169 end
170 upload_from_erb '/etc/init.d/nginx', binding, :chown => 'root', :chmod => '+x', :folder => 'nginx'
171 sudo '/usr/sbin/update-rc.d -f nginx defaults'
2d67b51 Fixing Nginx 'one mongrel' vhost bug, reorganized some of the recipes
Winton Welsh authored
172 ROOT.nginx.config.run_once.default
7f15326 Moving config erb into folders. Trying to get a functioning Postfix/Dove...
Winton Welsh authored
173 end
174
66fdb15 Fuck postfix, a mail server can wait...and other restructuring
Winton Welsh authored
175 desc "Install PHP"
bbd5804 Nearing 1.0
Winton Welsh authored
176 task :php, :roles => :app do
25c806a Adding some necessary PHP packages
Winton Welsh authored
177 sudo_puts 'aptitude install php5-cli php5-cgi php5-mysql php5-xcache php-pear php-mail php-net-smtp -q -y'
66fdb15 Fuck postfix, a mail server can wait...and other restructuring
Winton Welsh authored
178 upload_from_erb [
179 '/usr/local/bin/php-fastcgi',
180 '/etc/init.d/init-fastcgi'
7331d48 Monit recipes/config, including Nginx vhost for accessing Monit web admi...
Winton Welsh authored
181 ], binding, :chown => 'root', :chmod => '+x', :folder => 'php'
66fdb15 Fuck postfix, a mail server can wait...and other restructuring
Winton Welsh authored
182 sudo '/usr/sbin/update-rc.d -f init-fastcgi defaults'
7f15326 Moving config erb into folders. Trying to get a functioning Postfix/Dove...
Winton Welsh authored
183 end
184
1411228 Adding really cool install_source helper along with a few debian:install...
Winton Welsh authored
185 desc 'Install Ruby'
bbd5804 Nearing 1.0
Winton Welsh authored
186 task :ruby, :roles => :app do
1411228 Adding really cool install_source helper along with a few debian:install...
Winton Welsh authored
187 install_source(:ruby) do |path|
481d492 Just did a full Debian install with this commit (hardened)
Winton Welsh authored
188 sudo_puts ";cd #{path} && ./configure && make && sudo make install"
1411228 Adding really cool install_source helper along with a few debian:install...
Winton Welsh authored
189 end
190 end
191
192 desc 'Install RubyGems'
bbd5804 Nearing 1.0
Winton Welsh authored
193 task :rubygems, :roles => :app do
1411228 Adding really cool install_source helper along with a few debian:install...
Winton Welsh authored
194 install_source(:rubygems) do |path|
481d492 Just did a full Debian install with this commit (hardened)
Winton Welsh authored
195 run_puts "cd #{path} && sudo ruby setup.rb"
1411228 Adding really cool install_source helper along with a few debian:install...
Winton Welsh authored
196 end
197 gems.update
2d67b51 Fixing Nginx 'one mongrel' vhost bug, reorganized some of the recipes
Winton Welsh authored
198 gems.install
1411228 Adding really cool install_source helper along with a few debian:install...
Winton Welsh authored
199 end
fb9675e Adding a bunch of tasks to get ebormerchant running properly, a few bug ...
Winton Welsh authored
200
201 desc 'Install Sphinx'
202 task :sphinx, :roles => :app do
203 install_source(:sphinx) do |path|
481d492 Just did a full Debian install with this commit (hardened)
Winton Welsh authored
204 sudo_puts ";cd #{path} && ./configure && make && sudo make install"
fb9675e Adding a bunch of tasks to get ebormerchant running properly, a few bug ...
Winton Welsh authored
205 end
206 end
1411228 Adding really cool install_source helper along with a few debian:install...
Winton Welsh authored
207 end
2aa29e2 Adding debian namespace and a bunch of cool helpers
Winton Welsh authored
208 end
209
210 end
Something went wrong with that request. Please try again.