Skip to content

Instantly share code, notes, and snippets.

@adiwids
Created March 12, 2018 11:43
Show Gist options
  • Save adiwids/116b4caa4efd840316755e73eb00aa5e to your computer and use it in GitHub Desktop.
Save adiwids/116b4caa4efd840316755e73eb00aa5e to your computer and use it in GitHub Desktop.
require "#{File.dirname(__FILE__)}/../../vendor/plugins/moonshine/lib/moonshine.rb"
class ApplicationManifest < Moonshine::Manifest::Rails
# The majority of your configuration should be in <tt>config/moonshine.yml</tt>
# If necessary, you may provide extra configuration directly in this class
# using the configure method. The hash passed to the configure method is deep
# merged with what is in <tt>config/moonshine.yml</tt>. This could be used,
# for example, to store passwords and/or private keys outside of your SCM, or
# to query a web service for configuration data.
#
# In the example below, the value configuration[:custom][:random] can be used in
# your moonshine settings or templates.
#
# require 'net/http'
# require 'json'
# random = JSON::load(Net::HTTP.get(URI.parse('http://twitter.com/statuses/public_timeline.json'))).last['id']
# configure({
# :custom => { :random => random }
# })
LIMIT =<<-EOF
<Directory /srv/incite2/current/public>
LimitRequestBody 15000000
</Directory>
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
EOF
configure(:passenger => { :vhost_extra => LIMIT },
:apache => { :trace_enable => 'off' },
:ssl => { :protocol => '-ALL +SSLv3 +TLSv1' },
:memcached => {
:max_memory => '256', # default is 64
:client => '1.8.5'
}
)
# The default_stack recipe install Rails, Apache, Passenger, the database from
# database.yml, Postfix, Cron, logrotate and NTP. See lib/moonshine/manifest/rails.rb
# for details. To customize, remove this recipe and specify the components you want.
recipe :default_stack
# Add your application's custom requirements here
def application_packages
#backup database
#:command => "/usr/bin/mysqldump [options you chose earlier] --result-file='$HOME/mysql-backup-`date +\%m\%d\%Y\%H\%M\%S`.sql",
cron 'nightly mysql dumps',
:command => "bash /srv/incite2/current/db_backup.sh",
:hour => 4,
:minute => 0
# If you've already told Moonshine about a package required by a gem with
# :apt_gems in <tt>moonshine.yml</tt> you do not need to include it here.
# package 'some_native_package', :ensure => :installed
# some_rake_task = "/usr/bin/rake -f #{configuration[:deploy_to]}/current/Rakefile custom:task RAILS_ENV=#{ENV['RAILS_ENV']}"
# cron 'custom:task', :command => some_rake_task, :user => configuration[:user], :minute => 0, :hour => 0
# %w( root rails ).each do |user|
# mailalias user, :recipient => '[email protected]'
# end
# farm_config = <<-CONFIG
# MOOCOWS = 3
# HORSIES = 10
# CONFIG
# file '/etc/farm.conf', :ensure => :present, :content => farm_config
# Logs for Rails, MySQL, and Apache are rotated by default
# logrotate '/var/log/some_service.log', :options => %w(weekly missingok compress), :postrotate => '/etc/init.d/some_service restart'
# Only run the following on the 'testing' stage using capistrano-ext's multistage functionality.
# on_stage 'testing' do
# file '/etc/motd', :ensure => :file, :content => "Welcome to the TEST server!"
# end
end
# The following line includes the 'application_packages' recipe defined above
recipe :application_packages
recipe :memcached
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment