Purged git history and removed sensitive information.

This commit is contained in:
Luke Barratt 2014-03-23 00:22:25 +00:00
commit 6bcc8dc76b
862 changed files with 25312 additions and 0 deletions

45
config/application.rb Normal file
View file

@ -0,0 +1,45 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups(:assets => %w(development test)))
module Ensl
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins nowt explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
config.time_zone = 'Amsterdam'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable the asset pipeline
config.assets.enabled = true
# il8n fix
config.i18n.fallbacks = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end
end

5
config/boot.rb Normal file
View file

@ -0,0 +1,5 @@
require 'rubygems'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])

23
config/database.yml Normal file
View file

@ -0,0 +1,23 @@
base: &db
adapter: mysql2
encoding: utf8
pool: 5
host: localhost
username: <%= ENV['MYSQL_USERNAME'] %>
password: <%= ENV['MYSQL_PASSWORD'] %>
development:
<<: *db
database: ensl_development
test:
<<: *db
database: ensl_test
staging:
database: ensl
<<: *db
production:
database: ensl
<<: *db

45
config/deploy.rb Normal file
View file

@ -0,0 +1,45 @@
lock '3.1.0'
set :application, 'ensl'
set :scm, :git
set :repo_url, 'git@github.com:ENSL/ensl.org.git'
set :keep_releases, 10
set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
set :normalize_asset_timestamps, %{public/images public/javascripts public/stylesheets}
set :rbenv_type, :user
set :rbenv_ruby, '2.1.1'
namespace :deploy do
desc 'Restart application'
task :restart do
foreman.export
foreman.restart
end
after :publishing, :restart
end
namespace :foreman do
desc "Export the Procfile to Ubuntu's upstart scripts"
task :export, :roles => :app do
run "cd #{current_path} && #{sudo} foreman export upstart /etc/init -a #{app_name} -u #{user} -l #{fetch(:deploy_to)}/shared/log"
end
desc "Start the application services"
task :start, :roles => :app do
run "#{sudo} service #{app_name} start"
end
desc "Stop the application services"
task :stop, :roles => :app do
run "#{sudo} service #{app_name} stop"
end
desc "Restart the application services"
task :restart, :roles => :app do
run "#{sudo} service #{app_name} start || #{sudo} service #{app_name} restart"
end
end

View file

@ -0,0 +1,10 @@
set :branch, 'master'
set :rails_env, 'production'
role :app, %w{deploy@ensl.org}
role :web, %w{deploy@ensl.org}
role :db, %w{deploy@ensl.org}
set :deploy_to, '/var/www/virtual/ensl.org/deploy'
server 'ensl.org', user: 'deploy', roles: %w{web app}

10
config/deploy/staging.rb Normal file
View file

@ -0,0 +1,10 @@
set :branch, 'develop'
set :rails_env, 'staging'
role :app, %w{deploy@staging.ensl.org}
role :web, %w{deploy@staging.ensl.org}
role :db, %w{deploy@staging.ensl.org}
set :deploy_to, '/var/www/virtual/ensl.org/deploy'
server 'staging.ensl.org', user: 'deploy', roles: %w{web app}

7
config/environment.rb Normal file
View file

@ -0,0 +1,7 @@
require File.expand_path('../application', __FILE__)
require 'verification'
require 'exceptions'
require 'extra'
Ensl::Application.initialize!

View file

@ -0,0 +1,30 @@
Ensl::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
end

View file

@ -0,0 +1,64 @@
Ensl::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
# Generate digests for assets URLs
config.assets.digest = true
# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH
# Specifies the header that your server uses for sending files
config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# See everything in the log (default is :info)
config.log_level = :error
# Use a different logger for distrwt ibuted setups
# config.logger = SyslogLogger.new
# Use a different cache store in production
config.cache_store = :dalli_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Use sendmail
config.action_mailer.delivery_method = :sendmail
config.action_mailer.raise_delivery_errors = true
# Enable threaded mode
# config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
end

View file

@ -0,0 +1,64 @@
Ensl::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
# Generate digests for assets URLs
config.assets.digest = true
# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH
# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# See everything in the log (default is :info)
config.log_level = :error
# Use a different logger for distrwt ibuted setups
# config.logger = SyslogLogger.new
# Use a different cache store in production
config.cache_store = :dalli_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Use sendmail
config.action_mailer.delivery_method = :sendmail
config.action_mailer.raise_delivery_errors = true
# Enable threaded mode
# config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
end

View file

@ -0,0 +1,35 @@
Ensl::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Log error messages when you accidentally call methods on nil
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
end

View file

@ -0,0 +1 @@
NewRelic::Agent.after_fork(:force_reconnect => true) if defined? Unicorn

View file

@ -0,0 +1,11 @@
module ActionDispatch
class Cookies
class SignedCookieJar
def initialize(parent_jar, secret)
ensure_secret_secure(secret)
@parent_jar = parent_jar
@verifier = MessageVerifier.new(secret,:serializer=>YAML)
end
end
end
end

View file

@ -0,0 +1 @@
Ensl::Application.config.secret_token = ENV['APP_SECRET']

View file

@ -0,0 +1,4 @@
Ensl::Application.config.session_store :active_record_store,
:key => '_ENSL_session_key',
:expire_after => 30.days.to_i

View file

@ -0,0 +1,7 @@
ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json]
end
ActiveSupport.on_load(:active_record) do
self.include_root_in_json = false
end

108
config/locales/en.yml Normal file
View file

@ -0,0 +1,108 @@
en:
access_denied: "Access denied, make sure you are logged in!"
articles_article_views: "Views"
bans_create: "Ban was successfully created."
bans_update: "Ban was successfully updated."
articles_create: "Article was successfully created."
articles_update: "Article was successfully updated."
articles_revert: "Article reverted to version: {{version}}"
articles_category: "Article category was successfully created."
articles_category_update: "Article category was successfully updated."
challenges_create: "Challenge was successfully created."
challenges_cleared: "Challenges cleared."
challenges_update: "Challenge was successfully updated."
comments_create: "Comment was successfully created."
comments_update: "Comment was successfully created."
comments_invalid: "Comment invalid: "
contests_create: "Contest was successfully created."
contests_update: "Contest was successfully updated."
contests_join: "Team successfully joined contest."
contests_contester_update: "Contester was successfully updated."
files_create: "File was successfully created."
files_update: "File was successfully updated."
directories_create: "Directory was successfully created."
directories_update: "Directory was successfully updated."
scores_recalc: "All scores recalculated."
groups_added: "Group added to the list."
groups_acl_update: "Group ACL updated."
forums_create: "Forum was successfully created."
forums_update: "Forum was successfully updated."
errors: "Errors: "
issues_create: "Issue was successfully created."
issues_update: "Issue was successfully updated."
topics_locked: "Topic locked."
logevent_create: "LogEvent was successfully created."
logevent_update: "LogEvent was successfully updated."
maps_create: "Map was successfully created."
maps_update: "Map was successfully updated."
matches_create: "Match was successfully created."
matches_update: "Match was successfully updated."
hltv_send: "Send HLTV"
hltv_move: "Move HLTV"
hltv_stop: "Stop HLTV"
hltv_recording: "HLTV recording."
hltv_stopped: "HLTV's stopped. Demos saved."
hltv_moved: "HLTV moved."
hltv_movedd: "HLTVs moved to: "
messages_create: "Message was successfully created."
movies_create: "Movie was successfully created."
movies_update: "Movie was successfully updated."
execute: "Executed: "
pcws_create: "Pcw was successfully saved."
matches_nofound: "Match cannot be found."
hltv_notavailable: "No HLTV's available."
hltv_sent: "SUCCESS. HLTV ({{hltv.ip}}:{{hltv.port}}) sent. Demo: {{hltv.recording}}"
polls_create: "Poll was successfully created."
polls_update: "Poll was successfully updated."
posts_create: "Post was successfully created."
posts_update: "Post was successfully updated."
predictions_create: "Prediction was successfully created."
servers_updated: "Servers updated."
servers_create: "Server was successfully created."
servers_update: "Server was successfully update."
invalid_message: "Invalid message."
sites_create: "Site was successfully created."
sites_update: "Site was successfully updated."
applying_team: "Applying for team: "
teams_create: "Team was successfully created."
teams_update: "Team was successfully updated."
topics_create: "Topic was successfully updated."
topics_update: "Topic was successfully updated."
tweets_refresh: "Tweetit refreshed."
users_update: "User was successfully updated."
accounts_locked: "Account locked."
login_successful: "Login Successful"
login_unsuccessful: "Login Unsuccessful"
login_out: "Logged out."
passwords_sent: "Password has been sent."
incorrect_information: "Incorrect Information."
weeks_create: "Week was successfully created."
weeks_update: "Week was successfully updated."
votes_success: "Voted successfully."
errors:
template:
header: "Please review the following errors:"
helpers:
submit:
user:
create: "Register"
activerecord:
attributes:
user:
username: "Username"
email: "Email"
raw_password: "Password"
steamid: "Steam ID"
errors:
models:
user:
attributes:
username:
too_short: "is too short"
invalid: "is invalid"
raw_password:
blank: "cannot be blank"
email:
invalid: "is invalid"
steamid:
invalid: "is invalid"

79
config/locales/fi.yml Normal file
View file

@ -0,0 +1,79 @@
fi:
access_denied: "Pääsy estetty, varmista että olet kirjautunut sisään!"
articles_article_views: "Luettu"
bans_create: "Banni on luotu."
bans_update: "Banni on päivitetty."
articles_create: "Artikkeli on luotu."
articles_update: "Artikkeli on päivitetty."
articles_revert: "Artikkeli on palautettu versioon: {{version}}"
articles_category: "Artikkelikategoria on luotu."
articles_category_update: "Artikkelikategoria on päivitetty."
challenges_create: "Haasteesi on luotu."
challenges_cleared: "Haasteet poistettu."
challenges_update: "Haasteesi on päivitetty."
comments_create: "Kommenttisi on lisätty."
comments_update: "Kommentisi on päivitetty."
comments_invalid: "Kommentti on virheellinen: "
contests_create: "Kilpailu on luotu."
contests_update: "Kilpailu on päivitetty."
contests_join: "Joukkue liittyi kilpailuun."
contests_contester_update: "Osallistuja on päivitetty."
files_create: "Tiedosto on luotu."
files_update: "Tiedosto on päivitetty."
directories_create: "Kansio on luotu."
directories_update: "Kansio on päivitetty."
scores_recalc: "Kaikki pisteet on laskettu uudelleen."
groups_added: "Ryhmä on lisätty listaan."
groups_acl_update: "Ryhmä ACL päivitetty."
forums_create: "Keskustelupalsta on luotu."
forums_update: "Keskustelupalsta on päivitetty."
errors: "Virheitä: "
issues_create: "Ongelmaraportti on luotu."
issues_update: "Ongelmaraportti on päivitetty."
topics_locked: "Aihe on lukittu."
logevent_create: "Lokitapahtuma on luotu."
logevent_update: "Lokitapahtuma on päivitetty."
maps_create: "Kartta on luotu."
maps_update: "Kartta on päivitetty."
matches_create: "Ottelu on luotu."
matches_update: "Ottelu on päivitetty."
hltv_send: "Lähetä HLTV"
hltv_move: "Siirrä HLTV"
hltv_stop: "Pysäytä HLTV"
hltv_recording: "HLTV nauhoittaa."
hltv_stopped: "HLTV on pysäytetty, demo on tallennettu."
hltv_moved: "HLTV on siirretty."
hltv_movedd: "HLTV:t siirretty: "
messages_create: "Viesti on luotu."
movies_create: "Video on luotu."
movies_update: "Video on päivitetty."
execute: "Suoritettu: "
pcws_create: "Harjoitusottelu on säästetty."
matches_nofound: "Ottelua ei löydetty."
hltv_notavailable: "HLTV:ä ei ole saatavilla."
hltv_sent: "Onnistui. HLTV ({{hltv.ip}}:{{hltv.port}}) lähetetty. Demo: {{hltv.recording}}"
polls_create: "Äänestys on luotu."
polls_update: "Äänestys on päivitetty."
posts_create: "Postaus on luotu."
posts_update: "Postaus on päivitetty."
predictions_create: "Ennuste on luotu."
servers_update: "Palvelimet on päivitetty"
invalid_message: "Viesti on virheellinen."
sites_create: "Sivusto on luotu."
sites_update: "Sivusto on päivitetty."
applying_team: "Haet tiimiin: "
teams_create: "Joukkue on luotu."
teams_update: "Joukkue on päivitetty."
topics_create: "Aihe on luotu."
topics_update: "Aihe on päivitetty."
tweets_refresh: "Tweets päivitetty."
users_update: "Käyttäjä on päivitetty."
accounts_locked: "Käyttäjätili on lukittu."
login_successful: "Kirjautuminen onnistui."
login_unsuccessful: "Kirjautuminen ei onnistunut."
login_out: "Kirjauduit ulos."
passwords_sent: "Salasana on lähetetty."
incorrect_information: "Väärät käyttäjätiedot."
weeks_create: "Viikko on luotu."
weeks_update: "Viikko on päivitetty."
votes_success: "Äänestys hyväksytty."

225
config/newrelic.yml Normal file
View file

@ -0,0 +1,225 @@
#
# This file configures the New Relic Agent. New Relic monitors
# Ruby, Java, .NET, PHP, and Python applications with deep visibility and low overhead.
# For more information, visit www.newrelic.com.
#
# Generated <%= Time.now.strftime('%B %d, %Y') %>, for version <%= NewRelic::VERSION::STRING %>
#
# <%= generated_for_user %>
# Here are the settings that are common to all environments
common: &default_settings
# ============================== LICENSE KEY ===============================
# You must specify the license key associated with your New Relic
# account. This key binds your Agent's data to your account in the
# New Relic service.
license_key: '<%= license_key %>'
# Agent Enabled (Ruby/Rails Only)
# Use this setting to force the agent to run or not run.
# Default is 'auto' which means the agent will install and run only
# if a valid dispatcher such as Mongrel is running. This prevents
# it from running with Rake or the console. Set to false to
# completely turn the agent off regardless of the other settings.
# Valid values are true, false and auto.
#
# agent_enabled: auto
# Application Name Set this to be the name of your application as
# you'd like it show up in New Relic. The service will then auto-map
# instances of your application into an "application" on your
# dashboard page. If you want to map this instance into multiple
# apps, like "AJAX Requests" and "All UI" then specify a semicolon
# separated list of up to three distinct names, or a yaml list.
# Defaults to the capitalized RAILS_ENV or RACK_ENV (i.e.,
# Production, Staging, etc)
#
# Example:
#
# app_name:
# - Ajax Service
# - All Services
#
app_name: <%= @app_name %>
# When "true", the agent collects performance data about your
# application and reports this data to the New Relic service at
# newrelic.com. This global switch is normally overridden for each
# environment below. (formerly called 'enabled')
monitor_mode: true
# Developer mode should be off in every environment but
# development as it has very high overhead in memory.
developer_mode: false
# The newrelic agent generates its own log file to keep its logging
# information separate from that of your application. Specify its
# log level here.
log_level: info
# Optionally set the path to the log file This is expanded from the
# root directory (may be relative or absolute, e.g. 'log/' or
# '/var/log/') The agent will attempt to create this directory if it
# does not exist.
# log_file_path: 'log'
# Optionally set the name of the log file, defaults to 'newrelic_agent.log'
# log_file_name: 'newrelic_agent.log'
# The newrelic agent communicates with the service via https by default. This
# prevents eavesdropping on the performance metrics transmitted by the agent.
# The encryption required by SSL introduces a nominal amount of CPU overhead,
# which is performed asynchronously in a background thread. If you'd prefer
# to send your metrics over http uncomment the following line.
# ssl: false
#============================== Browser Monitoring ===============================
# New Relic Real User Monitoring gives you insight into the performance real users are
# experiencing with your website. This is accomplished by measuring the time it takes for
# your users' browsers to download and render your web pages by injecting a small amount
# of JavaScript code into the header and footer of each page.
browser_monitoring:
# By default the agent automatically injects the monitoring JavaScript
# into web pages. Set this attribute to false to turn off this behavior.
auto_instrument: true
# Proxy settings for connecting to the New Relic server.
#
# If a proxy is used, the host setting is required. Other settings
# are optional. Default port is 8080.
#
# proxy_host: hostname
# proxy_port: 8080
# proxy_user:
# proxy_pass:
# The agent can optionally log all data it sends to New Relic servers to a
# separate log file for human inspection and auditing purposes. To enable this
# feature, change 'enabled' below to true.
# See: https://newrelic.com/docs/ruby/audit-log
audit_log:
enabled: false
# Tells transaction tracer and error collector (when enabled)
# whether or not to capture HTTP params. When true, frameworks can
# exclude HTTP parameters from being captured.
# Rails: the RoR filter_parameter_logging excludes parameters
# Java: create a config setting called "ignored_params" and set it to
# a comma separated list of HTTP parameter names.
# ex: ignored_params: credit_card, ssn, password
capture_params: false
# Transaction tracer captures deep information about slow
# transactions and sends this to the New Relic service once a
# minute. Included in the transaction is the exact call sequence of
# the transactions including any SQL statements issued.
transaction_tracer:
# Transaction tracer is enabled by default. Set this to false to
# turn it off. This feature is only available at the Professional
# and above product levels.
enabled: true
# Threshold in seconds for when to collect a transaction
# trace. When the response time of a controller action exceeds
# this threshold, a transaction trace will be recorded and sent to
# New Relic. Valid values are any float value, or (default) "apdex_f",
# which will use the threshold for an dissatisfying Apdex
# controller action - four times the Apdex T value.
transaction_threshold: apdex_f
# When transaction tracer is on, SQL statements can optionally be
# recorded. The recorder has three modes, "off" which sends no
# SQL, "raw" which sends the SQL statement in its original form,
# and "obfuscated", which strips out numeric and string literals.
record_sql: obfuscated
# Threshold in seconds for when to collect stack trace for a SQL
# call. In other words, when SQL statements exceed this threshold,
# then capture and send to New Relic the current stack trace. This is
# helpful for pinpointing where long SQL calls originate from.
stack_trace_threshold: 0.500
# Determines whether the agent will capture query plans for slow
# SQL queries. Only supported in mysql and postgres. Should be
# set to false when using other adapters.
# explain_enabled: true
# Threshold for query execution time below which query plans will
# not be captured. Relevant only when `explain_enabled` is true.
# explain_threshold: 0.5
# Error collector captures information about uncaught exceptions and
# sends them to New Relic for viewing
error_collector:
# Error collector is enabled by default. Set this to false to turn
# it off. This feature is only available at the Professional and above
# product levels.
enabled: true
# Rails Only - tells error collector whether or not to capture a
# source snippet around the place of the error when errors are View
# related.
capture_source: true
# To stop specific errors from reporting to New Relic, set this property
# to comma-separated values. Default is to ignore routing errors,
# which are how 404's get triggered.
ignore_errors: "ActionController::RoutingError,Sinatra::NotFound"
# If you're interested in capturing memcache keys as though they
# were SQL uncomment this flag. Note that this does increase
# overhead slightly on every memcached call, and can have security
# implications if your memcached keys are sensitive
# capture_memcache_keys: true
# Application Environments
# ------------------------------------------
# Environment-specific settings are in this section.
# For Rails applications, RAILS_ENV is used to determine the environment.
# For Java applications, pass -Dnewrelic.environment <environment> to set
# the environment.
# NOTE if your application has other named environments, you should
# provide newrelic configuration settings for these environments here.
development:
<<: *default_settings
# Turn on communication to New Relic service in development mode
monitor_mode: true
app_name: <%= @app_name %> (Development)
# Rails Only - when running in Developer Mode, the New Relic Agent will
# present performance information on the last 100 transactions you have
# executed since starting the mongrel.
# NOTE: There is substantial overhead when running in developer mode.
# Do not use for production or load testing.
developer_mode: true
# Enable textmate links
# textmate: true
test:
<<: *default_settings
# It almost never makes sense to turn on the agent when running
# unit, functional or integration tests or the like.
monitor_mode: false
# Turn on the agent in production for 24x7 monitoring. NewRelic
# testing shows an average performance impact of < 5 ms per
# transaction, you can leave this on all the time without
# incurring any user-visible performance degradation.
production:
<<: *default_settings
monitor_mode: true
# Many applications have a staging environment which behaves
# identically to production. Support for that environment is provided
# here. By default, the staging environment has the agent turned on.
staging:
<<: *default_settings
monitor_mode: true
app_name: <%= @app_name %> (Staging)

118
config/routes.rb Normal file
View file

@ -0,0 +1,118 @@
Ensl::Application.routes.draw do
root to: "articles#news_index"
resources :articles do
resources :versions
end
resources :contests do
get 'current', on: :collection
end
resources :log_events
resources :categories
resources :options
resources :polls
resources :comments
resources :shoutmsgs
resources :teamers
resources :teams
resources :gathers
resources :gatherers
resources :groups
resources :groupers
resources :forumers
resources :topics
resources :forums
resources :users
resources :locks
resources :contesters
resources :contests
resources :challenges
resources :servers
resources :predictions
resources :rounds
resources :matches
resources :maps
resources :logs
resources :log_files
resources :directories
resources :data_files
resources :predictions
resources :weeks
resources :movies
resources :messages
resources :sites
resources :bans
resources :tweets
resources :issues
resources :posts
resources :brackets
match 'about/action'
match 'about/staff'
match 'about/statistics'
match 'refresh', to: "application#refresh"
match 'search', to: "application#search"
match 'news', to: "articles#news_index"
match 'news/archive', to: "articles#news_archive"
match 'news/admin', to: "articles#admin"
match 'articles/cleanup'
match 'contests/historical', to: "contests#historical"
match 'data_files/admin'
match 'data_files/addFile'
match 'data_files/delFile'
match 'data_files/trash'
match 'contesters/recalc'
match 'contests/scores'
match 'contests/del_map'
match 'directories', to: "directories#show", id: 1
match 'forums/up'
match 'forums/down'
match 'gathers/refresh'
match 'gathers/latest/:game', to: "gathers#latest", via: :get
match 'gather', to: "gathers#latest", game: "ns2", via: :get
match 'groups/addUser'
match 'groups/delUser'
match 'movies/download'
match 'movies/preview'
match 'movies/snapshot'
match 'plugin/esi'
match 'plugin/user'
match 'plugin/ban'
match 'plugin/hltv_req'
match 'plugin/hltv_move'
match 'plugin/hltv_stop'
match 'users/forgot'
match 'users/recover'
match 'users/agenda'
match 'users/logout'
match 'users/login'
match 'posts/quote'
match 'users/agenda'
match 'users/login'
match 'users/logout'
match 'users/popup'
match 'users/forgot', to: "users#forgot"
match 'votes/create'
match ':controller/:action', requirements: { action: /A-Za-z/ }
match ':controller/:action/:id'
match ':controller/:action/:id.:format'
match ':controller/:action/:id/:id2'
end

22
config/unicorn.rb Normal file
View file

@ -0,0 +1,22 @@
worker_processes Integer(ENV['UNICORN_WORKERS'] || 3)
timeout 30
preload_app true
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end
after_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
end
defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end