Skip to content
Extraits de code Groupes Projets
Valider 6cf8de94 rédigé par Raphael Sofaer's avatar Raphael Sofaer
Parcourir les fichiers

take secret token stuff out of chef scripts

parent dfa5d875
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -13,9 +13,7 @@ end ...@@ -13,9 +13,7 @@ end
execute "htop" do execute "htop" do
command "yum install -y htop psmisc screen" command "yum install -y htop psmisc screen"
end end
execute "JAVA!! for Jammit" do
command "yum install -y java"
end
execute "rvm deps" do execute "rvm deps" do
command "yum install -y bzip2" command "yum install -y bzip2"
end end
...@@ -35,3 +33,5 @@ def harden_ruby(ruby_string) ...@@ -35,3 +33,5 @@ def harden_ruby(ruby_string)
end end
harden_ruby("ree-1.8.7-2010.02") harden_ruby("ree-1.8.7-2010.02")
include_recipe "centos::post_bootstrap"
execute "JAVA!! for Jammit" do
command "yum install -y java"
end
def harden_ruby(ruby_string)
Dir.glob("/usr/local/rvm/wrappers/#{ruby_string}/*").each do |file|
link "/usr/local/bin/#{file.split('/').last}" do
to file
end
end
Dir.glob("/usr/local/rvm/gems/#{ruby_string}/bin/*").each do |file|
link "/usr/local/bin/#{file.split('/').last}" do
to file
end
end
end
harden_ruby("ree-1.8.7-2010.02")
include_recipe "centos::image_magick" include_recipe "centos::image_magick"
include_recipe "centos::mysql" include_recipe "centos::mysql"
include_recipe "common::main" include_recipe "common::main"
......
include_recipe "centos::java"
...@@ -6,13 +6,6 @@ execute "compile daemontools" do ...@@ -6,13 +6,6 @@ execute "compile daemontools" do
command "cd /package/admin/daemontools-0.76 && ./package/install" command "cd /package/admin/daemontools-0.76 && ./package/install"
end end
#execute "mongo run" do
# command "mkdir -p /service/mongo && echo '#!/bin/sh' > /service/mongo/run && echo 'exec /usr/bin/mongod' >> /service/mongo/run"
#end
#execute "executable" do
# command "chmod -R 755 /service/mongo"
#end
execute "mysql run" do execute "mysql run" do
command "mkdir -p /service/mysql && echo '#!/bin/sh' > /service/mysql/run && echo 'exec /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --user=mysql' >> /service/mysql/run" command "mkdir -p /service/mysql && echo '#!/bin/sh' > /service/mysql/run && echo 'exec /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --user=mysql' >> /service/mysql/run"
end end
...@@ -37,11 +30,6 @@ config['thins'].each do |thin| ...@@ -37,11 +30,6 @@ config['thins'].each do |thin|
end end
end end
#service for mongo tunnel
#execute "mongo ssh tunnel" do
#command "mkdir -p /service/mongo_ssh_tunnel && echo '#!/bin/sh' > /service/mongo_ssh_tunnel/run && echo 'exec ssh -N -f -L 27017:localhost:27017 caesar@184.106.233.43' >> /service/websocket/run"
#end
execute "websocket run" do execute "websocket run" do
command "mkdir -p /service/websocket && echo '#!/bin/sh' > /service/websocket/run && echo 'cd /usr/local/app/diaspora && RAILS_ENV=production exec /usr/local/bin/ruby /usr/local/app/diaspora/script/websocket_server.rb' >> /service/websocket/run" command "mkdir -p /service/websocket && echo '#!/bin/sh' > /service/websocket/run && echo 'cd /usr/local/app/diaspora && RAILS_ENV=production exec /usr/local/bin/ruby /usr/local/app/diaspora/script/websocket_server.rb' >> /service/websocket/run"
end end
......
include_recipe "common::iptables" include_recipe "common::iptables"
include_recipe "common::daemontools" include_recipe "common::daemontools"
include_recipe "common::secret_token"
include_recipe "common::splunk" include_recipe "common::splunk"
include_recipe "common::backup" include_recipe "common::backup"
require 'active_support'
template "/usr/local/app/diaspora/config/initializers/secret_token.rb" do
source "secret_token.rb.erb"
variables :secret_token => ActiveSupport::SecureRandom.hex(40)
end
...@@ -34,10 +34,10 @@ execute "Add monitor for diaspora" do ...@@ -34,10 +34,10 @@ execute "Add monitor for diaspora" do
not_if "splunk list monitor | grep diaspora" not_if "splunk list monitor | grep diaspora"
end end
#execute "Add monitor for nginx" do execute "Add monitor for nginx" do
#command "mkdir -p /usr/local/nginx/logs && splunk add monitor /usr/local/nginx/logs" command "mkdir -p /usr/local/nginx/logs && splunk add monitor /usr/local/nginx/logs"
#not_if "splunk list monitor | grep nginx" not_if "splunk list monitor | grep nginx"
#end end
execute 'Splunk Restart' do execute 'Splunk Restart' do
command "splunk restart" command "splunk restart"
......
Rails.application.config.secret_token = '<%= @secret_token %>'
...@@ -2,4 +2,3 @@ unless File.exists?( File.join(Rails.root, 'config', 'initializers', 'secret_tok ...@@ -2,4 +2,3 @@ unless File.exists?( File.join(Rails.root, 'config', 'initializers', 'secret_tok
`rake generate:secret_token` `rake generate:secret_token`
require File.join(Rails.root, 'config', 'initializers', 'secret_token.rb') require File.join(Rails.root, 'config', 'initializers', 'secret_token.rb')
end end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter