discourse_mountable_sso 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +15 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +6 -0
  4. data/Rakefile +40 -0
  5. data/app/assets/javascripts/discourse_mountable_sso/application.js +15 -0
  6. data/app/assets/stylesheets/discourse_mountable_sso/application.css +13 -0
  7. data/app/controllers/discourse_mountable_sso/application_controller.rb +4 -0
  8. data/app/controllers/discourse_mountable_sso/discourse_sso_controller.rb +35 -0
  9. data/app/helpers/discourse_mountable_sso/application_helper.rb +4 -0
  10. data/app/views/layouts/discourse_mountable_sso/application.html.erb +14 -0
  11. data/config/routes.rb +3 -0
  12. data/lib/discourse_mountable_sso/configuration.rb +11 -0
  13. data/lib/discourse_mountable_sso/engine.rb +5 -0
  14. data/lib/discourse_mountable_sso/single_sign_on.rb +104 -0
  15. data/lib/discourse_mountable_sso/version.rb +3 -0
  16. data/lib/discourse_mountable_sso.rb +11 -0
  17. data/lib/tasks/discourse_mountable_sso_tasks.rake +4 -0
  18. data/test/discourse_mountable_sso_test.rb +7 -0
  19. data/test/dummy/README.rdoc +261 -0
  20. data/test/dummy/Rakefile +7 -0
  21. data/test/dummy/app/assets/images/header_bg.png +0 -0
  22. data/test/dummy/app/assets/images/rails.png +0 -0
  23. data/test/dummy/app/assets/images/ruby-source-logo.png +0 -0
  24. data/test/dummy/app/assets/javascripts/application.js +13 -0
  25. data/test/dummy/app/assets/javascripts/login.js +2 -0
  26. data/test/dummy/app/assets/stylesheets/application.css +91 -0
  27. data/test/dummy/app/assets/stylesheets/login.css +4 -0
  28. data/test/dummy/app/controllers/application_controller.rb +51 -0
  29. data/test/dummy/app/controllers/sessions_controller.rb +51 -0
  30. data/test/dummy/app/controllers/users_controller.rb +26 -0
  31. data/test/dummy/app/helpers/application_helper.rb +2 -0
  32. data/test/dummy/app/models/user.rb +42 -0
  33. data/test/dummy/app/views/layouts/application.html.erb +42 -0
  34. data/test/dummy/app/views/sessions/home.html.erb +1 -0
  35. data/test/dummy/app/views/sessions/login.html.erb +15 -0
  36. data/test/dummy/app/views/sessions/profile.html.erb +1 -0
  37. data/test/dummy/app/views/sessions/setting.html.erb +1 -0
  38. data/test/dummy/app/views/users/new.html.erb +32 -0
  39. data/test/dummy/config/application.rb +59 -0
  40. data/test/dummy/config/boot.rb +10 -0
  41. data/test/dummy/config/database.yml +42 -0
  42. data/test/dummy/config/environment.rb +5 -0
  43. data/test/dummy/config/environments/development.rb +37 -0
  44. data/test/dummy/config/environments/production.rb +67 -0
  45. data/test/dummy/config/environments/test.rb +37 -0
  46. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  47. data/test/dummy/config/initializers/discourse_config.rb +6 -0
  48. data/test/dummy/config/initializers/inflections.rb +15 -0
  49. data/test/dummy/config/initializers/mime_types.rb +5 -0
  50. data/test/dummy/config/initializers/secret_token.rb +7 -0
  51. data/test/dummy/config/initializers/session_store.rb +8 -0
  52. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  53. data/test/dummy/config/locales/en.yml +5 -0
  54. data/test/dummy/config/routes.rb +14 -0
  55. data/test/dummy/config.ru +4 -0
  56. data/test/dummy/db/migrate/20120319110639_create_users.rb +11 -0
  57. data/test/dummy/db/schema.rb +25 -0
  58. data/test/dummy/db/seeds.rb +7 -0
  59. data/test/dummy/log/development.log +8438 -0
  60. data/test/dummy/public/404.html +26 -0
  61. data/test/dummy/public/422.html +26 -0
  62. data/test/dummy/public/500.html +25 -0
  63. data/test/dummy/public/favicon.ico +0 -0
  64. data/test/dummy/script/rails +6 -0
  65. data/test/dummy/tmp/cache/assets/CAF/FF0/sprockets%2F7d59289db40c84ab90ba221598408d31 +0 -0
  66. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  67. data/test/dummy/tmp/cache/assets/CDE/490/sprockets%2F48dba258a70774e9038bbc1280fe8134 +0 -0
  68. data/test/dummy/tmp/cache/assets/D2D/420/sprockets%2F9a1401b402e78bf1b5e9c31c01fe760d +0 -0
  69. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  70. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  71. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  72. data/test/dummy/tmp/cache/assets/D69/D30/sprockets%2F34a9c65c0c96b635e0be0d76cd25af25 +0 -0
  73. data/test/dummy/tmp/cache/assets/D71/280/sprockets%2Fff59dd175fb96b014fe2bc490554d0f1 +0 -0
  74. data/test/dummy/tmp/cache/assets/D99/400/sprockets%2Fc4a46e4d6b50babbb4723883ae376e4f +0 -0
  75. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  76. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  77. data/test/integration/navigation_test.rb +10 -0
  78. data/test/test_helper.rb +15 -0
  79. metadata +203 -0
@@ -0,0 +1,91 @@
1
+ body{
2
+ background-color: #C4C1BD;
3
+ }
4
+ .Sign_Form{
5
+ text-align: center;
6
+ margin:auto;
7
+ margin-top:10px;
8
+ width:500px;
9
+ background-color: rgba(0, 0, 0, .2);
10
+ padding-bottom:20px;
11
+ padding-top:2px;
12
+ border-radius: 18px;
13
+ box-shadow: 5px 5px 5px #888888;
14
+
15
+ }
16
+
17
+ .Signup_Errors{
18
+ list-style-type: none;
19
+ text-align:left;
20
+ margin-left:66px;
21
+ color:red;
22
+ }
23
+
24
+ .Main_Header{
25
+ background-image: url('header_bg.png');
26
+ height:60px;
27
+ padding:0 20px;
28
+ border-radius: 18px;
29
+ box-shadow: 5px 5px 5px #888888;
30
+
31
+ }
32
+
33
+ .Main_Header h1{
34
+ float:left;
35
+ margin-top:8px;
36
+ color:#C4C1BD;
37
+ background-image: url('ruby-source-logo.png');
38
+ height:43px;
39
+ width:215px;
40
+ text-indent:-9999px;
41
+ }
42
+
43
+ .nav{
44
+ list-style-type: none;
45
+ float: right;
46
+ color:#C4C1BD;
47
+
48
+ }
49
+ .nav li{
50
+ display: inline;
51
+ margin-right:5px;
52
+
53
+ }
54
+ .nav_links{
55
+ color: #C4C1BD;
56
+ text-decoration: none;
57
+ }
58
+
59
+ .notice, .valid_notice, .invalid_notice{
60
+ height:35px;
61
+ width: 400px;
62
+ margin:auto;
63
+ margin-top:20px;
64
+ }
65
+ .notice, .invalid_notice p, .valid_notice p{
66
+ text-align:center;
67
+ margin-top:6px;
68
+ }
69
+
70
+ .notice{
71
+ background-color: transparent;
72
+ }
73
+
74
+ .invalid_notice{
75
+ background-color: #FFCCCC;
76
+ border:1px solid red;
77
+ }
78
+ .valid_notice{
79
+ background-color: #CCFFCC;
80
+ border:1px solid green;
81
+ }
82
+
83
+ .User_Header{
84
+
85
+ background-color: rgba(0, 0, 0, .2);
86
+ border-radius: 18px;
87
+ margin:auto;
88
+ width:220px;
89
+ text-align:center;
90
+ }
91
+
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,51 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+
6
+
7
+ protected
8
+ def authenticate_user
9
+ unless session[:user_id]
10
+ redirect_to(:controller => 'sessions', :action => 'login')
11
+ return false
12
+ else
13
+ # set current_user by the current user object
14
+ @current_user = User.find session[:user_id]
15
+ return true
16
+ end
17
+ end
18
+
19
+ def get_discourse_data
20
+ current_user = User.find session[:user_id] if session[:user_id]
21
+ discourse_data = {}
22
+ if current_user
23
+ discourse_data[:avatar_url] = "http://ftp.lemoow.com/avatars/1/original/_D8_AC.jpg"
24
+ discourse_data[:email] = current_user.email
25
+ discourse_data[:name] = current_user.username
26
+ discourse_data[:username] = current_user.username
27
+ discourse_data[:external_id] = current_user.id
28
+ end
29
+ discourse_data
30
+ end
31
+
32
+ def logged_in?
33
+ session[:user_id].present?
34
+ end
35
+
36
+ def return_to_url path
37
+ session[:return_to] = path
38
+ end
39
+
40
+
41
+ #This method for prevent user to access Signup & Login Page without logout
42
+ def save_login_state
43
+ if session[:user_id]
44
+ redirect_to(:controller => 'sessions', :action => 'home')
45
+ return false
46
+ else
47
+ return true
48
+ end
49
+ end
50
+
51
+ end
@@ -0,0 +1,51 @@
1
+ class SessionsController < ApplicationController
2
+
3
+ before_filter :authenticate_user, :except => [:index, :login, :login_attempt, :logout]
4
+ before_filter :save_login_state, :only => [:index, :login, :login_attempt]
5
+
6
+ def home
7
+ #Home Page
8
+ end
9
+
10
+ def profile
11
+ #Profile Page
12
+ end
13
+
14
+ def setting
15
+ #Setting Page
16
+ end
17
+
18
+ def login
19
+ #Login Form
20
+ end
21
+
22
+ def login_attempt
23
+ authorized_user = User.authenticate(params[:username_or_email],params[:login_password])
24
+ if authorized_user
25
+ session[:user_id] = authorized_user.id
26
+ flash[:notice] = "Wow Welcome again, you logged in as #{authorized_user.username}"
27
+ # binding.pry
28
+
29
+ if session[:return_to]
30
+ url = session[:return_to]
31
+ session[:return_to] = nil
32
+ redirect_to url
33
+ else
34
+ redirect_to(:action => 'home')
35
+ end
36
+
37
+ else
38
+ flash[:notice] = "Invalid Username or Password"
39
+ flash[:color]= "invalid"
40
+ render "login"
41
+ end
42
+ end
43
+
44
+
45
+ def logout
46
+ # binding.pry
47
+ session[:user_id] = nil
48
+ redirect_to :action => 'login'
49
+ end
50
+
51
+ end
@@ -0,0 +1,26 @@
1
+ class UsersController < ApplicationController
2
+
3
+ before_filter :save_login_state, :only => [:new, :create]
4
+
5
+ # def user_params
6
+ # params.require(:user).permit(:username, :email, :password, :password_confirmation)
7
+ # end
8
+
9
+ def new
10
+ #Signup Form
11
+ @user = User.new
12
+ end
13
+
14
+ def create
15
+ @user = User.new(params[:user])
16
+ if @user.save
17
+ flash[:notice] = "You Signed up successfully"
18
+ flash[:color]= "valid"
19
+ else
20
+ flash[:notice] = "Form is invalid"
21
+ flash[:color]= "invalid"
22
+ end
23
+ render "new"
24
+ end
25
+
26
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,42 @@
1
+ class User < ActiveRecord::Base
2
+
3
+ attr_accessor :password
4
+
5
+ before_save :encrypt_password
6
+ after_save :clear_password
7
+ attr_accessible :username, :email, :password, :password_confirmation
8
+ validates :username, :presence => true, :uniqueness => true, :length => { :in => 3..20 }
9
+ validates :password, :confirmation => true
10
+ validates_length_of :password, :in => 6..20, :on => :create
11
+
12
+
13
+
14
+ def self.authenticate(username_or_email="", login_password="")
15
+
16
+ user = User.find_by_username(username_or_email)
17
+
18
+ if user && user.match_password(login_password)
19
+ return user
20
+ else
21
+ return false
22
+ end
23
+ end
24
+
25
+ def match_password(login_password="")
26
+ encrypted_password == BCrypt::Engine.hash_secret(login_password, salt)
27
+ end
28
+
29
+
30
+
31
+ def encrypt_password
32
+ unless password.blank?
33
+ self.salt = BCrypt::Engine.generate_salt
34
+ self.encrypted_password = BCrypt::Engine.hash_secret(password, salt)
35
+ end
36
+ end
37
+
38
+ def clear_password
39
+ self.password = nil
40
+ end
41
+
42
+ end
@@ -0,0 +1,42 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>RubySource User Auth</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+ <div class="Main_Header">
11
+ <h1>Ruby Source</h1>
12
+ <%unless session[:user_id]%>
13
+ <ul class="nav">
14
+ <li><%= link_to :Signup , :signup, class: "nav_links"%></li>|
15
+ <li><%= link_to :Login , :login, class: "nav_links"%></li>
16
+ </ul>
17
+ <%else%>
18
+ <ul class="nav">
19
+ <li><%= link_to :Home , :home, class: "nav_links" %> |</li>
20
+ <li><%= link_to :Profile , :profile, class: "nav_links" %> |</li>
21
+ <li><%= link_to :Setting , :setting, class: "nav_links" %> |</li>
22
+ <li><%= link_to :Logout , :logout, class: "nav_links" %></li>
23
+ </ul>
24
+ <%end%>
25
+ </div>
26
+ <% if flash[:color]== "valid" %>
27
+ <div class="valid_notice">
28
+ <p><%= flash[:notice]%></p>
29
+ </div>
30
+ <% elsif flash[:color]== "invalid"%>
31
+ <div class="invalid_notice">
32
+ <p><%=flash[:notice]%></p>
33
+ </div>
34
+ <%else%>
35
+ <div class="notice">
36
+ <p><%=flash[:notice]%></p>
37
+ </div>
38
+ <%end%>
39
+ <%= yield %>
40
+
41
+ </body>
42
+ </html>
@@ -0,0 +1 @@
1
+ <h2 class='User_Header'><%=@current_user.username%> Home <h2>
@@ -0,0 +1,15 @@
1
+ <% @page_title = "UserAuth | Login" -%>
2
+ <div class= "Sign_Form">
3
+ <h1>Log in</h1>
4
+ <%= form_tag(:action => 'login_attempt') do %>
5
+ <p>
6
+ Username or Email:</br> <%= text_field_tag(:username_or_email) %>
7
+ </p>
8
+
9
+ <p>
10
+ Password:</br> <%= password_field_tag :login_password %>
11
+ </p>
12
+
13
+ <%= submit_tag("Log In") %>
14
+ <% end %>
15
+ </div>
@@ -0,0 +1 @@
1
+ <h2 class='User_Header'><%=@current_user.username%> Profile <h2>
@@ -0,0 +1 @@
1
+ <h2 class='User_Header'><%=@current_user.username%> Setting <h2>
@@ -0,0 +1,32 @@
1
+ <% @page_title = "UserAuth | Signup" -%>
2
+ <div class= "Sign_Form">
3
+ <h1>Sign Up</h1>
4
+ <%= form_for(:user, :url => {:controller => 'users', :action => 'create'}) do |f| %>
5
+
6
+ <p>
7
+ Username:</br> <%= f.text_field :username%>
8
+ </p>
9
+
10
+ <p>
11
+ Email:</br> <%= f.text_field :email%>
12
+ </p>
13
+
14
+ <p>
15
+ Password:</br> <%= f.password_field :password%>
16
+ </p>
17
+
18
+ <p>
19
+ Password Confirmation:</br> <%= f.password_field :password_confirmation%>
20
+ </p>
21
+
22
+ <%= f.submit :Signup %>
23
+ <% end %>
24
+
25
+ <% if @user.errors.any? %>
26
+ <ul class="Signup_Errors">
27
+ <% for message_error in @user.errors.full_messages %>
28
+ <li>* <%= message_error %></li>
29
+ <% end %>
30
+ </ul>
31
+ <% end %>
32
+ </div>
@@ -0,0 +1,59 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "discourse_mountable_sso"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Custom directories with classes and modules you want to be autoloadable.
15
+ # config.autoload_paths += %W(#{config.root}/extras)
16
+
17
+ # Only load the plugins named here, in the order given (default is alphabetical).
18
+ # :all can be used as a placeholder for all plugins not explicitly named.
19
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20
+
21
+ # Activate observers that should always be running.
22
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23
+
24
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
+ # config.time_zone = 'Central Time (US & Canada)'
27
+
28
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
+ # config.i18n.default_locale = :de
31
+
32
+ # Configure the default encoding used in templates for Ruby 1.9.
33
+ config.encoding = "utf-8"
34
+
35
+ # Configure sensitive parameters which will be filtered from the log file.
36
+ config.filter_parameters += [:password]
37
+
38
+ # Enable escaping HTML in JSON.
39
+ config.active_support.escape_html_entities_in_json = true
40
+
41
+ # Use SQL instead of Active Record's schema dumper when creating the database.
42
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
43
+ # like if you have constraints or database-specific column types
44
+ # config.active_record.schema_format = :sql
45
+
46
+ # Enforce whitelist mode for mass assignment.
47
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
48
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
49
+ # parameters by using an attr_accessible or attr_protected declaration.
50
+ config.active_record.whitelist_attributes = true
51
+
52
+ # Enable the asset pipeline
53
+ config.assets.enabled = true
54
+
55
+ # Version of your assets, change this if you want to expire all your assets
56
+ config.assets.version = '1.0'
57
+ end
58
+ end
59
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,42 @@
1
+ # MySQL. Versions 4.1 and 5.0 are recommended.
2
+ #
3
+ # Install the MYSQL driver
4
+ # gem install mysql2
5
+ #
6
+ # Ensure the MySQL gem is defined in your Gemfile
7
+ # gem 'mysql2'
8
+ #
9
+ # And be sure to use new-style password hashing:
10
+ # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11
+ development:
12
+ adapter: mysql2
13
+ encoding: utf8
14
+ reconnect: false
15
+ database: user_auth_development
16
+ pool: 5
17
+ username: root
18
+ password: root
19
+ socket: /tmp/mysql.sock
20
+
21
+ # Warning: The database defined as "test" will be erased and
22
+ # re-generated from your development database when you run "rake".
23
+ # Do not set this db to the same as development or production.
24
+ test:
25
+ adapter: mysql2
26
+ encoding: utf8
27
+ reconnect: false
28
+ database: user_auth_test
29
+ pool: 5
30
+ username: root
31
+ password: root
32
+ socket: /tmp/mysql.sock
33
+
34
+ production:
35
+ adapter: mysql2
36
+ encoding: utf8
37
+ reconnect: false
38
+ database: User_Auth_production
39
+ pool: 5
40
+ username: root
41
+ password: root
42
+ socket: /tmp/mysql.sock
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+ end
@@ -0,0 +1,67 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to nil and saved in location specified by config.assets.prefix
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,6 @@
1
+ DiscourseMountableSso.configuration.secret = "83IC~q<ITI#15n(6f515sw5crA?lF&"
2
+ DiscourseMountableSso.configuration.discourse_url = "http://localhost:3020/"
3
+ DiscourseMountableSso.configuration.login_path = "/login"
4
+ DiscourseMountableSso.configuration.discourse_data_method = "get_discourse_data"
5
+ DiscourseMountableSso.configuration.logged_in_check_method = "logged_in?"
6
+ DiscourseMountableSso.configuration.store_return_to_url_method = "return_to_url"
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone