forked from e621ng/e621ng
update rails default files
This commit is contained in:
parent
341b29ce41
commit
c8f38350c3
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
||||||
require_relative '../config/boot'
|
require_relative '../config/boot'
|
||||||
require 'rails/commands'
|
require 'rails/commands'
|
||||||
|
29
bin/setup
Executable file
29
bin/setup
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
require 'pathname'
|
||||||
|
|
||||||
|
# path to your application root.
|
||||||
|
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
||||||
|
|
||||||
|
Dir.chdir APP_ROOT do
|
||||||
|
# This script is a starting point to setup your application.
|
||||||
|
# Add necessary setup steps to this file:
|
||||||
|
|
||||||
|
puts "== Installing dependencies =="
|
||||||
|
system "gem install bundler --conservative"
|
||||||
|
system "bundle check || bundle install"
|
||||||
|
|
||||||
|
# puts "\n== Copying sample files =="
|
||||||
|
# unless File.exist?("config/database.yml")
|
||||||
|
# system "cp config/database.yml.sample config/database.yml"
|
||||||
|
# end
|
||||||
|
|
||||||
|
puts "\n== Preparing database =="
|
||||||
|
system "bin/rake db:setup"
|
||||||
|
|
||||||
|
puts "\n== Removing old logs and tempfiles =="
|
||||||
|
system "rm -f log/*"
|
||||||
|
system "rm -rf tmp/cache"
|
||||||
|
|
||||||
|
puts "\n== Restarting application server =="
|
||||||
|
system "touch tmp/restart.txt"
|
||||||
|
end
|
@ -20,7 +20,7 @@ module Danbooru
|
|||||||
config.action_mailer.smtp_settings = {:enable_starttls_auto => false}
|
config.action_mailer.smtp_settings = {:enable_starttls_auto => false}
|
||||||
config.action_mailer.perform_deliveries = true
|
config.action_mailer.perform_deliveries = true
|
||||||
config.log_tags = [lambda {|req| "PID:#{Process.pid}"}]
|
config.log_tags = [lambda {|req| "PID:#{Process.pid}"}]
|
||||||
config.active_support.test_order = :random
|
config.active_record.raise_in_transactional_callbacks = true
|
||||||
end
|
end
|
||||||
|
|
||||||
I18n.enforce_available_locales = false
|
I18n.enforce_available_locales = false
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# Set up gems listed in the Gemfile.
|
|
||||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||||
|
|
||||||
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
require 'bundler/setup' # Set up gems listed in the Gemfile.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Load the rails application
|
# Load the Rails application.
|
||||||
require File.expand_path('../application', __FILE__)
|
require File.expand_path('../application', __FILE__)
|
||||||
|
|
||||||
# Initialize the rails application
|
# Initialize the Rails application.
|
||||||
Rails.application.initialize!
|
Rails.application.initialize!
|
||||||
|
@ -27,6 +27,10 @@ Rails.application.configure do
|
|||||||
# number of complex assets.
|
# number of complex assets.
|
||||||
config.assets.debug = true
|
config.assets.debug = true
|
||||||
|
|
||||||
|
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
||||||
|
# yet still be able to expire them through the digest params.
|
||||||
|
config.assets.digest = true
|
||||||
|
|
||||||
# Adds additional error checking when serving assets at runtime.
|
# Adds additional error checking when serving assets at runtime.
|
||||||
# Checks for improperly declared sprockets dependencies.
|
# Checks for improperly declared sprockets dependencies.
|
||||||
# Raises helpful error messages.
|
# Raises helpful error messages.
|
||||||
|
@ -16,11 +16,13 @@ Rails.application.configure do
|
|||||||
|
|
||||||
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
||||||
# Add `rack-cache` to your Gemfile before enabling this.
|
# Add `rack-cache` to your Gemfile before enabling this.
|
||||||
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
# For large-scale production use, consider using a caching reverse proxy like
|
||||||
|
# NGINX, varnish or squid.
|
||||||
# config.action_dispatch.rack_cache = true
|
# config.action_dispatch.rack_cache = true
|
||||||
|
|
||||||
# Disable Rails's static asset server (Apache or nginx will already do this).
|
# Disable serving static files from the `/public` folder by default since
|
||||||
config.serve_static_files = false
|
# Apache or NGINX already handles this.
|
||||||
|
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
||||||
|
|
||||||
# Compress JavaScripts and CSS.
|
# Compress JavaScripts and CSS.
|
||||||
config.assets.js_compressor = :uglifier
|
config.assets.js_compressor = :uglifier
|
||||||
@ -29,20 +31,21 @@ Rails.application.configure do
|
|||||||
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
||||||
config.assets.compile = true
|
config.assets.compile = true
|
||||||
|
|
||||||
# Generate digests for assets URLs.
|
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
||||||
|
# yet still be able to expire them through the digest params.
|
||||||
config.assets.digest = true
|
config.assets.digest = true
|
||||||
|
|
||||||
# Version of your assets, change this if you want to expire all your assets.
|
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
||||||
# config.assets.version = '1.0'
|
|
||||||
|
|
||||||
# Specifies the header that your server uses for sending files.
|
# 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-Sendfile' # for Apache
|
||||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
# 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.
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||||
# config.force_ssl = true
|
# config.force_ssl = true
|
||||||
|
|
||||||
# Set to :debug to see everything in the log.
|
# Use the lowest log level to ensure availability of diagnostic information
|
||||||
|
# when problems arise.
|
||||||
config.log_level = :error
|
config.log_level = :error
|
||||||
|
|
||||||
# Prepend all log lines with the following tags.
|
# Prepend all log lines with the following tags.
|
||||||
@ -52,14 +55,10 @@ Rails.application.configure do
|
|||||||
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
||||||
|
|
||||||
# Use a different cache store in production.
|
# Use a different cache store in production.
|
||||||
# config.cache_store = :dalli_store, Danbooru.config.memcached_servers
|
# config.cache_store = :mem_cache_store
|
||||||
|
|
||||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||||
# config.action_controller.asset_host = "http://assets.example.com"
|
# config.action_controller.asset_host = 'http://assets.example.com'
|
||||||
|
|
||||||
# Precompile additional assets.
|
|
||||||
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
|
||||||
config.assets.precompile += %w( *.png *.jpg *.gif )
|
|
||||||
|
|
||||||
# Ignore bad email addresses and do not raise email delivery errors.
|
# Ignore bad email addresses and do not raise email delivery errors.
|
||||||
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
||||||
@ -72,12 +71,10 @@ Rails.application.configure do
|
|||||||
# Send deprecation notices to registered listeners.
|
# Send deprecation notices to registered listeners.
|
||||||
config.active_support.deprecation = :notify
|
config.active_support.deprecation = :notify
|
||||||
|
|
||||||
# Disable automatic flushing of the log to improve performance.
|
|
||||||
# config.autoflush_log = false
|
|
||||||
|
|
||||||
# Use default logging formatter so that PID and timestamp are not suppressed.
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
||||||
config.log_formatter = ::Logger::Formatter.new
|
config.log_formatter = ::Logger::Formatter.new
|
||||||
|
|
||||||
# Do not dump schema after migrations.
|
# Do not dump schema after migrations.
|
||||||
config.active_record.dump_schema_after_migration = false
|
config.active_record.dump_schema_after_migration = false
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -12,8 +12,8 @@ Rails.application.configure do
|
|||||||
# preloads Rails for running tests, you may have to set it to true.
|
# preloads Rails for running tests, you may have to set it to true.
|
||||||
config.eager_load = false
|
config.eager_load = false
|
||||||
|
|
||||||
# Configure static asset server for tests with Cache-Control for performance.
|
# Configure static file server for tests with Cache-Control for performance.
|
||||||
config.serve_static_files = true
|
config.serve_static_files = true
|
||||||
config.static_cache_control = 'public, max-age=3600'
|
config.static_cache_control = 'public, max-age=3600'
|
||||||
|
|
||||||
# Show full error reports and disable caching.
|
# Show full error reports and disable caching.
|
||||||
@ -31,6 +31,9 @@ Rails.application.configure do
|
|||||||
# ActionMailer::Base.deliveries array.
|
# ActionMailer::Base.deliveries array.
|
||||||
config.action_mailer.delivery_method = :test
|
config.action_mailer.delivery_method = :test
|
||||||
|
|
||||||
|
# Randomize the order test cases are executed.
|
||||||
|
config.active_support.test_order = :random
|
||||||
|
|
||||||
# Print deprecation notices to the stderr.
|
# Print deprecation notices to the stderr.
|
||||||
config.active_support.deprecation = :stderr
|
config.active_support.deprecation = :stderr
|
||||||
|
|
||||||
|
@ -1 +1,11 @@
|
|||||||
Rails.application.config.assets.precompile += %w( stupidtable.js ugoira_player.js )
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
|
# Version of your assets, change this if you want to expire all your assets.
|
||||||
|
Rails.application.config.assets.version = '1.0'
|
||||||
|
|
||||||
|
# Add additional assets to the asset load path
|
||||||
|
# Rails.application.config.assets.paths << Emoji.images_path
|
||||||
|
|
||||||
|
# Precompile additional assets.
|
||||||
|
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
||||||
|
Rails.application.config.assets.precompile += %w( *.png *.jpg *.gif )
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
Rails.application.config.action_dispatch.cookies_serializer = :json
|
Rails.application.config.action_dispatch.cookies_serializer = :json
|
||||||
|
@ -10,5 +10,5 @@ end
|
|||||||
|
|
||||||
# To enable root element in JSON for ActiveRecord objects.
|
# To enable root element in JSON for ActiveRecord objects.
|
||||||
ActiveSupport.on_load(:active_record) do
|
ActiveSupport.on_load(:active_record) do
|
||||||
self.include_root_in_json = false
|
self.include_root_in_json = true
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user