Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 475
- Log:
Set secure flag for cookies in Production.
- Author:
- rool
- Date:
- Wed Jun 19 05:47:12 +0100 2019
- Size:
- 2645 Bytes
1 | ##### |
2 | # Bootstrap the Rails environment, frameworks, and default configuration |
3 | #### |
4 | |
5 | RAILS_GEM_VERSION = '2.3.15' unless defined? RAILS_GEM_VERSION |
6 | |
7 | # Make sure we are using the latest rexml |
8 | rexml_versions = ['', File.join(File.dirname(__FILE__), '..', 'vendor', 'plugins', 'rexml', 'lib', '')].collect { |v| |
9 | `ruby -r "#{v + 'rexml/rexml'}" -e 'p REXML::VERSION'`.split('.').collect {|n| n.to_i} } |
10 | $:.unshift(File.join(File.dirname(__FILE__), '..', 'vendor', 'plugins', 'rexml', 'lib')) if (rexml_versions[0] <=> rexml_versions[1]) == -1 |
11 | |
12 | require File.join(File.dirname(__FILE__), 'boot') |
13 | |
14 | require 'active_support/secure_random' |
15 | |
16 | Rails::Initializer.run do |config| |
17 | |
18 | # Secret session key |
19 | # The secret session key is automatically generated, and stored |
20 | # in a file, for reuse between server restarts. If you want to |
21 | # change the key, just delete the file, and it will be regenerated |
22 | # on the next restart. Doing so will invalitate all existing sessions. |
23 | secret_file = Rails.root.join("secret") |
24 | if File.exist?(secret_file) |
25 | secret = secret_file.read |
26 | else |
27 | secret = ActiveSupport::SecureRandom.hex(64) |
28 | File.open(secret_file, 'w', 0600) { |f| f.write(secret) } |
29 | end |
30 | config.action_controller.session = { |
31 | :key => "_instikiapp_session_id", |
32 | :secret => secret, |
33 | :secure => RAILS_ENV == 'production', |
34 | :httponly => true |
35 | } |
36 | |
37 | # Don't do file system STAT calls to check to see if the templates have changed. |
38 | #config.action_view.cache_template_loading = true |
39 | |
40 | # Skip frameworks you're not going to use |
41 | config.frameworks -= [ :action_web_service, :action_mailer ] |
42 | |
43 | # Use the database for sessions instead of the file system |
44 | # (create the session table with 'rake create_sessions_table') |
45 | #config.action_controller.session_store = :active_record_store |
46 | |
47 | # Enable page/fragment caching by setting a file-based store |
48 | # (remember to create the caching directory and make it readable to the application) |
49 | config.cache_store = :file_store, "#{RAILS_ROOT}/cache" |
50 | |
51 | # Activate observers that should always be running |
52 | config.active_record.observers = :page_observer |
53 | |
54 | # Use Active Record's schema dumper instead of SQL when creating the test database |
55 | # (enables use of different database adapters for development and test environments) |
56 | config.active_record.schema_format = :sql |
57 | |
58 | File.umask(0026) |
59 | end |
60 | |
61 | #require 'jcode' |
62 | |
63 | # Miscellaneous monkey patches (here be dragons ...) |
64 | require 'caching_stuff' |
65 | require 'logging_stuff' |
66 | require 'rack_stuff' |
67 | |
68 | #Additional Mime-types |
69 | mime_types = YAML.load_file(File.join(File.dirname(__FILE__), 'mime_types.yml')) |
70 | Rack::Mime::MIME_TYPES.merge!(mime_types) |