Archive: ComponentOwl Rails app, DB backups, go redirect script
This commit is contained in:
14
config/initializers/action_mailer.rb
Normal file
14
config/initializers/action_mailer.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
ActionMailer::Base.delivery_method = :smtp
|
||||
|
||||
ActionMailer::Base.smtp_settings = {
|
||||
:address => "smtp.emailsrvr.com",
|
||||
:port => 587,
|
||||
:domain => "dextronet.com",
|
||||
:authentication => :login,
|
||||
:user_name => "mailer@dextronet.com",
|
||||
:password => "5hB9MYMe"
|
||||
}
|
||||
|
||||
ActionMailer::Base.perform_deliveries = true
|
||||
ActionMailer::Base.raise_delivery_errors = true
|
||||
ActionMailer::Base.default_charset = "utf-8"
|
||||
1
config/initializers/asset_packager.rb
Normal file
1
config/initializers/asset_packager.rb
Normal file
@@ -0,0 +1 @@
|
||||
Synthesis::AssetPackage.merge_environments = ["production", "preproduction"]
|
||||
7
config/initializers/backtrace_silencers.rb
Normal file
7
config/initializers/backtrace_silencers.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
||||
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
||||
|
||||
# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
|
||||
# Rails.backtrace_cleaner.remove_silencers!
|
||||
13
config/initializers/cloudfront_asset_host.rb
Normal file
13
config/initializers/cloudfront_asset_host.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
CloudfrontAssetHost.configure do |config|
|
||||
if Rails.env.production?
|
||||
config.bucket = "componentowl-assets"
|
||||
config.cname = "http://assets%d.componentowl.com"
|
||||
else
|
||||
config.bucket = "componentowl-assets-dev"
|
||||
config.cname = "http://assets%d.componentowl.dev.netcreates.com"
|
||||
end
|
||||
|
||||
config.plain_prefix = "s"
|
||||
|
||||
#config.enabled = true if Rails.env.production? || Rails.env.preproduction?
|
||||
end
|
||||
7
config/initializers/db2s3.rb
Normal file
7
config/initializers/db2s3.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
DB2S3::Config.instance_eval do
|
||||
S3 = {
|
||||
:access_key_id => 'AKIAJO5TCO43GDBNG3ZQ',
|
||||
:secret_access_key => 'AadKou++JNS9LleLzjaSyMpjVHGCgSPN2RvN5JuO',
|
||||
:bucket => 'componentowl-db-backup'
|
||||
}
|
||||
end
|
||||
10
config/initializers/inflections.rb
Normal file
10
config/initializers/inflections.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Add new inflection rules using the following format
|
||||
# (all these examples are active by default):
|
||||
# ActiveSupport::Inflector.inflections do |inflect|
|
||||
# inflect.plural /^(ox)$/i, '\1en'
|
||||
# inflect.singular /^(ox)en/i, '\1'
|
||||
# inflect.irregular 'person', 'people'
|
||||
# inflect.uncountable %w( fish sheep )
|
||||
# end
|
||||
6
config/initializers/mime_types.rb
Normal file
6
config/initializers/mime_types.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Add new mime types for use in respond_to blocks:
|
||||
# Mime::Type.register "text/richtext", :rtf
|
||||
# Mime::Type.register_alias "text/html", :iphone
|
||||
Mime::Type.register "text/plain", :txt
|
||||
19
config/initializers/new_rails_defaults.rb
Normal file
19
config/initializers/new_rails_defaults.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# These settings change the behavior of Rails 2 apps and will be defaults
|
||||
# for Rails 3. You can remove this initializer when Rails 3 is released.
|
||||
|
||||
if defined?(ActiveRecord)
|
||||
# Include Active Record class name as root for JSON serialized output.
|
||||
ActiveRecord::Base.include_root_in_json = true
|
||||
|
||||
# Store the full class name (including module namespace) in STI type column.
|
||||
ActiveRecord::Base.store_full_sti_class = true
|
||||
end
|
||||
|
||||
# Use ISO 8601 format for JSON serialized times and dates.
|
||||
ActiveSupport.use_standard_json_time_format = true
|
||||
|
||||
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
|
||||
# if you're including raw json in an HTML page.
|
||||
ActiveSupport.escape_html_entities_in_json = false
|
||||
16
config/initializers/paperclip.rb
Normal file
16
config/initializers/paperclip.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
Paperclip.interpolates(:product_code) do |attachment, style|
|
||||
attachment.instance.product.code
|
||||
end
|
||||
|
||||
Paperclip.interpolates(:size) do |attachment, style|
|
||||
attachment.instance.size
|
||||
end
|
||||
|
||||
Paperclip.interpolates(:timestamp) do |attachment, style|
|
||||
attachment.instance_read(:updated_at).in_time_zone(7).strftime("%s")
|
||||
end
|
||||
|
||||
Paperclip.interpolates(:s3_url) do |attachment, style|
|
||||
path = attachment.path(style)
|
||||
"#{attachment.s3_protocol}://#{Settings.uploadable_asset_host % (path.hash % 4)}/#{path.gsub(%r{^/}, "")}"
|
||||
end
|
||||
21
config/initializers/session_store.rb
Normal file
21
config/initializers/session_store.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Your secret key for verifying cookie session data integrity.
|
||||
# If you change this key, all old sessions will become invalid!
|
||||
# Make sure the secret is at least 30 characters and all random,
|
||||
# no regular words or you'll be exposed to dictionary attacks.
|
||||
ActionController::Base.session = {
|
||||
:key => '_dextronet_session',
|
||||
:secret => 'c088c1cac65e99187c3af8316642155f96a998348b94dd2b9a3ca99b0f2da8e3297f3d18c34c4a142debf9dc6352539187f2398d5ae7b3690d73ef78b69c0b15'
|
||||
}
|
||||
|
||||
ActionController::Dispatcher.middleware.insert_before(
|
||||
ActionController::Session::CookieStore,
|
||||
FlashSessionCookieMiddleware,
|
||||
ActionController::Base.session_options[:key]
|
||||
)
|
||||
|
||||
# Use the database for sessions instead of the cookie-based default,
|
||||
# which shouldn't be used to store highly confidential information
|
||||
# (create the session table with "rake db:sessions:create")
|
||||
# ActionController::Base.session_store = :active_record_store
|
||||
11
config/initializers/super_exception_notifier.rb
Normal file
11
config/initializers/super_exception_notifier.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
#ExceptionNotifier.configure_exception_notifier do |config|
|
||||
# config[:app_name] = "[ComponentOwl]"
|
||||
# config[:sender_address] = %("ComponentOwl - Application Error" <error@componentowl.com>)
|
||||
# config[:exception_recipients] = "zabojnik@dextronet.com"
|
||||
# config[:subject_prepend] = "[ComponentOwl - ERROR] "
|
||||
# config[:skip_local_notification] = false
|
||||
# config[:view_path] = 'app/views/error'
|
||||
# #config[:send_email_error_codes] = %w( 400 404 405 500 503 )
|
||||
#end
|
||||
|
||||
ExceptionNotification::Notifier.exception_recipients = %w(bgalura+co@gmail.com)
|
||||
7
config/initializers/twitter.rb
Normal file
7
config/initializers/twitter.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
Twitter::Client.configure do |conf|
|
||||
conf.oauth_consumer_token = 'ezZAVdpWuCtIZL4WXhb7w'
|
||||
conf.oauth_consumer_secret = 'qT3yAQYhfBwgQw4IUCDOVYt3rIY5rXJEM1aCDu0fo4Q'
|
||||
end
|
||||
TWITTER_LOGIN = 'ComponentOwl'
|
||||
TWITTER_ACCESS_KEY = '175738067-n3o76BAf3r2Ud3t6v9oxWYWPjFz3FTNojT1r8RZL'
|
||||
TWITTER_ACCESS_SECRET = 'bZBPkbQqWrqnEWCBU1zOAtVqqkEFOI7VT4aRf4JpQ'
|
||||
Reference in New Issue
Block a user