chr 0.5.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coffeescript-style.json +98 -0
- data/.hound.yml +16 -0
- data/.ruby-style.yml +239 -0
- data/.scss-style.yml +145 -0
- data/.travis.yml +2 -2
- data/README.md +10 -3
- data/app/assets/javascripts/chr/chr.coffee +4 -25
- data/app/assets/javascripts/chr/chr_router.coffee +2 -14
- data/app/assets/javascripts/chr/item.coffee +2 -19
- data/app/assets/javascripts/chr/list.coffee +6 -18
- data/app/assets/javascripts/chr/list_config.coffee +3 -10
- data/app/assets/javascripts/chr/list_pagination.coffee +1 -9
- data/app/assets/javascripts/chr/list_reorder.coffee +1 -8
- data/app/assets/javascripts/chr/list_search.coffee +2 -10
- data/app/assets/javascripts/chr/list_tabs.coffee +42 -0
- data/app/assets/javascripts/chr/module-categories.coffee +0 -2
- data/app/assets/javascripts/chr/module.coffee +1 -19
- data/app/assets/javascripts/chr/utils.coffee +0 -6
- data/app/assets/javascripts/chr/view.coffee +37 -36
- data/app/assets/javascripts/chr/view_tabs.coffee +19 -8
- data/app/assets/javascripts/stores/rest-array.coffee +23 -36
- data/app/assets/stylesheets/chr/layout.scss +17 -13
- data/app/assets/stylesheets/chr/themes/basic.scss +13 -13
- data/lib/chr/version.rb +1 -1
- data/templates/character_admin.coffee.erb +1 -1
- data/test/integration/article_fullsize_test.rb +5 -5
- data/test/integration/article_test.rb +2 -2
- data/test/integration/magazine_article_test.rb +5 -5
- data/test/integration/restricted_article_test.rb +3 -3
- data/test/integration/sport_article_test.rb +2 -2
- data/test/rails_app/.gitignore +15 -0
- data/test/rails_app/.ruby-version +1 -0
- data/test/rails_app/.sample.env +6 -0
- data/test/rails_app/Procfile +1 -0
- data/test/rails_app/README.md +45 -0
- data/test/rails_app/Rakefile +1 -1
- data/test/rails_app/app/assets/images/.keep +0 -0
- data/test/rails_app/app/assets/javascripts/admin.coffee +82 -102
- data/test/rails_app/app/assets/javascripts/application.coffee +2 -0
- data/test/rails_app/app/assets/stylesheets/admin.scss +4 -1
- data/test/rails_app/app/assets/stylesheets/application.scss +1 -0
- data/test/rails_app/app/controllers/admin/base_controller.rb +5 -0
- data/test/rails_app/app/controllers/admin/devise_overrides/passwords_controller.rb +9 -0
- data/test/rails_app/app/controllers/admin/devise_overrides/sessions_controller.rb +11 -0
- data/test/rails_app/app/controllers/concerns/.keep +0 -0
- data/test/rails_app/app/helpers/body_class_helper.rb +15 -0
- data/test/rails_app/app/mailers/.keep +0 -0
- data/test/rails_app/app/models/.keep +0 -0
- data/test/rails_app/app/models/article.rb +0 -4
- data/test/rails_app/app/models/concerns/.keep +0 -0
- data/test/rails_app/app/uploaders/article_image_uploader.rb +0 -4
- data/test/rails_app/app/views/admin/devise_overrides/passwords/edit.html.erb +31 -0
- data/test/rails_app/app/views/admin/devise_overrides/passwords/new.html.erb +19 -0
- data/test/rails_app/app/views/admin/devise_overrides/sessions/new.html.erb +29 -0
- data/test/rails_app/app/views/admin/index.html.erb +1 -3
- data/test/rails_app/app/views/application/_analytics.html.erb +9 -0
- data/test/rails_app/app/views/application/_flashes.html.erb +7 -0
- data/test/rails_app/app/views/application/_javascript.html.erb +12 -0
- data/test/rails_app/app/views/layouts/admin.html.erb +13 -11
- data/test/rails_app/app/views/layouts/application.html.erb +22 -7
- data/test/rails_app/bin/rails +3 -2
- data/test/rails_app/bin/rake +3 -2
- data/test/rails_app/bin/setup +28 -22
- data/test/rails_app/bin/spring +6 -6
- data/test/rails_app/config/application.rb +12 -1
- data/test/rails_app/config/boot.rb +1 -2
- data/test/rails_app/config/environments/development.rb +2 -0
- data/test/rails_app/config/environments/production.rb +16 -1
- data/test/rails_app/config/environments/staging.rb +9 -0
- data/test/rails_app/config/environments/test.rb +1 -3
- data/test/rails_app/config/initializers/assets.rb +2 -3
- data/test/rails_app/config/initializers/carrierwave.rb +23 -4
- data/test/rails_app/config/initializers/devise.rb +265 -0
- data/test/rails_app/config/initializers/errors.rb +34 -0
- data/test/rails_app/config/initializers/json_encoding.rb +1 -0
- data/test/rails_app/config/locales/devise.en.yml +62 -0
- data/test/rails_app/config/mongoid.yml +131 -8
- data/test/rails_app/config/newrelic.yml +34 -0
- data/test/rails_app/config/puma.rb +18 -0
- data/test/rails_app/config/routes.rb +86 -0
- data/test/rails_app/config/secrets.yml +8 -16
- data/test/rails_app/config/smtp.rb +9 -0
- data/test/rails_app/lib/assets/.keep +0 -0
- data/test/rails_app/lib/tasks/.keep +0 -0
- data/test/rails_app/lib/tasks/bundler_audit.rake +12 -0
- data/test/rails_app/lib/tasks/dev.rake +12 -0
- data/test/rails_app/public/404.html +4 -2
- data/test/rails_app/public/422.html +4 -2
- data/test/rails_app/public/500.html +4 -2
- data/test/rails_app/vendor/assets/javascripts/.keep +0 -0
- data/test/rails_app/vendor/assets/stylesheets/.keep +0 -0
- data/test/support/character_front_end.rb +10 -9
- data/test/support/chr/list_pagination.rb +8 -8
- data/test/support/chr/list_reorder.rb +4 -1
- data/test/support/chr/view.rb +4 -3
- data/test/support/stores/rest-array.rb +3 -3
- data/test/test_helper.rb +13 -7
- metadata +77 -6
- data/test/rails_app/app/assets/javascripts/application.js +0 -1
- data/test/rails_app/app/assets/stylesheets/application.css +0 -1
@@ -39,8 +39,6 @@ Rails.application.configure do
|
|
39
39
|
|
40
40
|
# Raises error for missing translations
|
41
41
|
# config.action_view.raise_on_missing_translations = true
|
42
|
-
Rails.application.configure do
|
43
|
-
config.active_support.test_order = :sorted
|
44
|
-
end
|
45
42
|
|
43
|
+
config.action_mailer.default_url_options = { host: "www.example.com" }
|
46
44
|
end
|
@@ -1,12 +1,11 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
3
|
# Version of your assets, change this if you want to expire all your assets.
|
4
|
-
Rails.application.config.assets.version =
|
4
|
+
Rails.application.config.assets.version = (ENV["ASSETS_VERSION"] || "1.0")
|
5
5
|
|
6
6
|
# Add additional assets to the asset load path
|
7
7
|
# Rails.application.config.assets.paths << Emoji.images_path
|
8
8
|
|
9
9
|
# Precompile additional assets.
|
10
10
|
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
11
|
-
|
12
|
-
Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
11
|
+
Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
@@ -1,5 +1,24 @@
|
|
1
1
|
CarrierWave.configure do |config|
|
2
|
-
config.
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
config.cache_dir = "#{Rails.root}/public/uploads/tmp"
|
3
|
+
|
4
|
+
# DEVELOPMENT
|
5
|
+
if Rails.env.development?
|
6
|
+
config.storage = :file
|
7
|
+
end
|
8
|
+
|
9
|
+
# TEST
|
10
|
+
if Rails.env.test?
|
11
|
+
config.cache_dir = "#{Rails.root}/public/uploads/tmp/test"
|
12
|
+
config.enable_processing = false
|
13
|
+
|
14
|
+
# PRODUCTION & STAGING
|
15
|
+
elsif Rails.env.production? || Rails.env.staging?
|
16
|
+
config.storage = :fog
|
17
|
+
config.fog_directory = ENV.fetch('FOG_DIRECTORY')
|
18
|
+
config.fog_credentials = {
|
19
|
+
provider: 'AWS',
|
20
|
+
aws_access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
|
21
|
+
aws_secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,265 @@
|
|
1
|
+
# # Use this hook to configure devise mailer, warden hooks and so forth.
|
2
|
+
# # Many of these configuration options can be set straight in your model.
|
3
|
+
# Devise.setup do |config|
|
4
|
+
# # The secret key used by Devise. Devise uses this key to generate
|
5
|
+
# # random tokens. Changing this key will render invalid all existing
|
6
|
+
# # confirmation, reset password and unlock tokens in the database.
|
7
|
+
# # Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
|
8
|
+
# # by default. You can change it below and use your own secret key.
|
9
|
+
# # config.secret_key = '0841cd61e6b15671acfb40ee24cc0707179adf65309797360fdbb64cf79e6b92d8d78a9e7a876749ec64ad8b062f7b776a7d2525e276ed5606893b2b868e4b71'
|
10
|
+
|
11
|
+
# # ==> Mailer Configuration
|
12
|
+
# # Configure the e-mail address which will be shown in Devise::Mailer,
|
13
|
+
# # note that it will be overwritten if you use your own mailer class
|
14
|
+
# # with default "from" parameter.
|
15
|
+
# config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
16
|
+
|
17
|
+
# # Configure the class responsible to send e-mails.
|
18
|
+
# # config.mailer = 'Devise::Mailer'
|
19
|
+
|
20
|
+
# # ==> ORM configuration
|
21
|
+
# # Load and configure the ORM. Supports :active_record (default) and
|
22
|
+
# # :mongoid (bson_ext recommended) by default. Other ORMs may be
|
23
|
+
# # available as additional gems.
|
24
|
+
# require 'devise/orm/mongoid'
|
25
|
+
|
26
|
+
# # ==> Configuration for any authentication mechanism
|
27
|
+
# # Configure which keys are used when authenticating a user. The default is
|
28
|
+
# # just :email. You can configure it to use [:username, :subdomain], so for
|
29
|
+
# # authenticating a user, both parameters are required. Remember that those
|
30
|
+
# # parameters are used only when authenticating and not when retrieving from
|
31
|
+
# # session. If you need permissions, you should implement that in a before filter.
|
32
|
+
# # You can also supply a hash where the value is a boolean determining whether
|
33
|
+
# # or not authentication should be aborted when the value is not present.
|
34
|
+
# # config.authentication_keys = [:email]
|
35
|
+
|
36
|
+
# # Configure parameters from the request object used for authentication. Each entry
|
37
|
+
# # given should be a request method and it will automatically be passed to the
|
38
|
+
# # find_for_authentication method and considered in your model lookup. For instance,
|
39
|
+
# # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
40
|
+
# # The same considerations mentioned for authentication_keys also apply to request_keys.
|
41
|
+
# # config.request_keys = []
|
42
|
+
|
43
|
+
# # Configure which authentication keys should be case-insensitive.
|
44
|
+
# # These keys will be downcased upon creating or modifying a user and when used
|
45
|
+
# # to authenticate or find a user. Default is :email.
|
46
|
+
# config.case_insensitive_keys = [:email]
|
47
|
+
|
48
|
+
# # Configure which authentication keys should have whitespace stripped.
|
49
|
+
# # These keys will have whitespace before and after removed upon creating or
|
50
|
+
# # modifying a user and when used to authenticate or find a user. Default is :email.
|
51
|
+
# config.strip_whitespace_keys = [:email]
|
52
|
+
|
53
|
+
# # Tell if authentication through request.params is enabled. True by default.
|
54
|
+
# # It can be set to an array that will enable params authentication only for the
|
55
|
+
# # given strategies, for example, `config.params_authenticatable = [:database]` will
|
56
|
+
# # enable it only for database (email + password) authentication.
|
57
|
+
# # config.params_authenticatable = true
|
58
|
+
|
59
|
+
# # Tell if authentication through HTTP Auth is enabled. False by default.
|
60
|
+
# # It can be set to an array that will enable http authentication only for the
|
61
|
+
# # given strategies, for example, `config.http_authenticatable = [:database]` will
|
62
|
+
# # enable it only for database authentication. The supported strategies are:
|
63
|
+
# # :database = Support basic authentication with authentication key + password
|
64
|
+
# # config.http_authenticatable = false
|
65
|
+
|
66
|
+
# # If 401 status code should be returned for AJAX requests. True by default.
|
67
|
+
# # config.http_authenticatable_on_xhr = true
|
68
|
+
|
69
|
+
# # The realm used in Http Basic Authentication. 'Application' by default.
|
70
|
+
# # config.http_authentication_realm = 'Application'
|
71
|
+
|
72
|
+
# # It will change confirmation, password recovery and other workflows
|
73
|
+
# # to behave the same regardless if the e-mail provided was right or wrong.
|
74
|
+
# # Does not affect registerable.
|
75
|
+
# # config.paranoid = true
|
76
|
+
|
77
|
+
# # By default Devise will store the user in session. You can skip storage for
|
78
|
+
# # particular strategies by setting this option.
|
79
|
+
# # Notice that if you are skipping storage for all authentication paths, you
|
80
|
+
# # may want to disable generating routes to Devise's sessions controller by
|
81
|
+
# # passing skip: :sessions to `devise_for` in your config/routes.rb
|
82
|
+
# config.skip_session_storage = [:http_auth]
|
83
|
+
|
84
|
+
# # By default, Devise cleans up the CSRF token on authentication to
|
85
|
+
# # avoid CSRF token fixation attacks. This means that, when using AJAX
|
86
|
+
# # requests for sign in and sign up, you need to get a new CSRF token
|
87
|
+
# # from the server. You can disable this option at your own risk.
|
88
|
+
# # config.clean_up_csrf_token_on_authentication = true
|
89
|
+
|
90
|
+
# # ==> Configuration for :database_authenticatable
|
91
|
+
# # For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
92
|
+
# # using other encryptors, it sets how many times you want the password re-encrypted.
|
93
|
+
# #
|
94
|
+
# # Limiting the stretches to just one in testing will increase the performance of
|
95
|
+
# # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
96
|
+
# # a value less than 10 in other environments. Note that, for bcrypt (the default
|
97
|
+
# # encryptor), the cost increases exponentially with the number of stretches (e.g.
|
98
|
+
# # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
99
|
+
# config.stretches = Rails.env.test? ? 1 : 10
|
100
|
+
|
101
|
+
# # Setup a pepper to generate the encrypted password.
|
102
|
+
# # config.pepper = '9502969048e47cf3cdb19a2212410bc98dee1e534d2aa69b5082d4821d19088388027baa117f3f12bc97aecf5042a0cc92156f486ed25ce48d3e5042244d5c16'
|
103
|
+
|
104
|
+
# # Send a notification email when the user's password is changed
|
105
|
+
# # config.send_password_change_notification = false
|
106
|
+
|
107
|
+
# # ==> Configuration for :confirmable
|
108
|
+
# # A period that the user is allowed to access the website even without
|
109
|
+
# # confirming their account. For instance, if set to 2.days, the user will be
|
110
|
+
# # able to access the website for two days without confirming their account,
|
111
|
+
# # access will be blocked just in the third day. Default is 0.days, meaning
|
112
|
+
# # the user cannot access the website without confirming their account.
|
113
|
+
# # config.allow_unconfirmed_access_for = 2.days
|
114
|
+
|
115
|
+
# # A period that the user is allowed to confirm their account before their
|
116
|
+
# # token becomes invalid. For example, if set to 3.days, the user can confirm
|
117
|
+
# # their account within 3 days after the mail was sent, but on the fourth day
|
118
|
+
# # their account can't be confirmed with the token any more.
|
119
|
+
# # Default is nil, meaning there is no restriction on how long a user can take
|
120
|
+
# # before confirming their account.
|
121
|
+
# # config.confirm_within = 3.days
|
122
|
+
|
123
|
+
# # If true, requires any email changes to be confirmed (exactly the same way as
|
124
|
+
# # initial account confirmation) to be applied. Requires additional unconfirmed_email
|
125
|
+
# # db field (see migrations). Until confirmed, new email is stored in
|
126
|
+
# # unconfirmed_email column, and copied to email column on successful confirmation.
|
127
|
+
# config.reconfirmable = true
|
128
|
+
|
129
|
+
# # Defines which key will be used when confirming an account
|
130
|
+
# # config.confirmation_keys = [:email]
|
131
|
+
|
132
|
+
# # ==> Configuration for :rememberable
|
133
|
+
# # The time the user will be remembered without asking for credentials again.
|
134
|
+
# # config.remember_for = 2.weeks
|
135
|
+
|
136
|
+
# # Invalidates all the remember me tokens when the user signs out.
|
137
|
+
# config.expire_all_remember_me_on_sign_out = true
|
138
|
+
|
139
|
+
# # If true, extends the user's remember period when remembered via cookie.
|
140
|
+
# # config.extend_remember_period = false
|
141
|
+
|
142
|
+
# # Options to be passed to the created cookie. For instance, you can set
|
143
|
+
# # secure: true in order to force SSL only cookies.
|
144
|
+
# # config.rememberable_options = {}
|
145
|
+
|
146
|
+
# # ==> Configuration for :validatable
|
147
|
+
# # Range for password length.
|
148
|
+
# config.password_length = 8..72
|
149
|
+
|
150
|
+
# # Email regex used to validate email formats. It simply asserts that
|
151
|
+
# # one (and only one) @ exists in the given string. This is mainly
|
152
|
+
# # to give user feedback and not to assert the e-mail validity.
|
153
|
+
# # config.email_regexp = /\A[^@]+@[^@]+\z/
|
154
|
+
|
155
|
+
# # ==> Configuration for :timeoutable
|
156
|
+
# # The time you want to timeout the user session without activity. After this
|
157
|
+
# # time the user will be asked for credentials again. Default is 30 minutes.
|
158
|
+
# # config.timeout_in = 30.minutes
|
159
|
+
|
160
|
+
# # ==> Configuration for :lockable
|
161
|
+
# # Defines which strategy will be used to lock an account.
|
162
|
+
# # :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
163
|
+
# # :none = No lock strategy. You should handle locking by yourself.
|
164
|
+
# # config.lock_strategy = :failed_attempts
|
165
|
+
|
166
|
+
# # Defines which key will be used when locking and unlocking an account
|
167
|
+
# # config.unlock_keys = [:email]
|
168
|
+
|
169
|
+
# # Defines which strategy will be used to unlock an account.
|
170
|
+
# # :email = Sends an unlock link to the user email
|
171
|
+
# # :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
172
|
+
# # :both = Enables both strategies
|
173
|
+
# # :none = No unlock strategy. You should handle unlocking by yourself.
|
174
|
+
# # config.unlock_strategy = :both
|
175
|
+
|
176
|
+
# # Number of authentication tries before locking an account if lock_strategy
|
177
|
+
# # is failed attempts.
|
178
|
+
# # config.maximum_attempts = 20
|
179
|
+
|
180
|
+
# # Time interval to unlock the account if :time is enabled as unlock_strategy.
|
181
|
+
# # config.unlock_in = 1.hour
|
182
|
+
|
183
|
+
# # Warn on the last attempt before the account is locked.
|
184
|
+
# # config.last_attempt_warning = true
|
185
|
+
|
186
|
+
# # ==> Configuration for :recoverable
|
187
|
+
# #
|
188
|
+
# # Defines which key will be used when recovering the password for an account
|
189
|
+
# # config.reset_password_keys = [:email]
|
190
|
+
|
191
|
+
# # Time interval you can reset your password with a reset password key.
|
192
|
+
# # Don't put a too small interval or your users won't have the time to
|
193
|
+
# # change their passwords.
|
194
|
+
# config.reset_password_within = 6.hours
|
195
|
+
|
196
|
+
# # When set to false, does not sign a user in automatically after their password is
|
197
|
+
# # reset. Defaults to true, so a user is signed in automatically after a reset.
|
198
|
+
# # config.sign_in_after_reset_password = true
|
199
|
+
|
200
|
+
# # ==> Configuration for :encryptable
|
201
|
+
# # Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
202
|
+
# # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
203
|
+
# # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
204
|
+
# # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
205
|
+
# # REST_AUTH_SITE_KEY to pepper).
|
206
|
+
# #
|
207
|
+
# # Require the `devise-encryptable` gem when using anything other than bcrypt
|
208
|
+
# # config.encryptor = :sha512
|
209
|
+
|
210
|
+
# # ==> Scopes configuration
|
211
|
+
# # Turn scoped views on. Before rendering "sessions/new", it will first check for
|
212
|
+
# # "users/sessions/new". It's turned off by default because it's slower if you
|
213
|
+
# # are using only default views.
|
214
|
+
# config.scoped_views = true
|
215
|
+
|
216
|
+
# # Configure the default scope given to Warden. By default it's the first
|
217
|
+
# # devise role declared in your routes (usually :user).
|
218
|
+
# # config.default_scope = :user
|
219
|
+
|
220
|
+
# # Set this configuration to false if you want /users/sign_out to sign out
|
221
|
+
# # only the current scope. By default, Devise signs out all scopes.
|
222
|
+
# config.sign_out_all_scopes = false
|
223
|
+
|
224
|
+
# # ==> Navigation configuration
|
225
|
+
# # Lists the formats that should be treated as navigational. Formats like
|
226
|
+
# # :html, should redirect to the sign in page when the user does not have
|
227
|
+
# # access, but formats like :xml or :json, should return 401.
|
228
|
+
# #
|
229
|
+
# # If you have any extra navigational formats, like :iphone or :mobile, you
|
230
|
+
# # should add them to the navigational formats lists.
|
231
|
+
# #
|
232
|
+
# # The "*/*" below is required to match Internet Explorer requests.
|
233
|
+
# # config.navigational_formats = ['*/*', :html]
|
234
|
+
|
235
|
+
# # The default HTTP method used to sign out a resource. Default is :delete.
|
236
|
+
# config.sign_out_via = :delete
|
237
|
+
|
238
|
+
# # ==> OmniAuth
|
239
|
+
# # Add a new OmniAuth provider. Check the wiki for more information on setting
|
240
|
+
# # up on your models and hooks.
|
241
|
+
# # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
242
|
+
|
243
|
+
# # ==> Warden configuration
|
244
|
+
# # If you want to use other strategies, that are not supported by Devise, or
|
245
|
+
# # change the failure app, you can configure them inside the config.warden block.
|
246
|
+
# #
|
247
|
+
# # config.warden do |manager|
|
248
|
+
# # manager.intercept_401 = false
|
249
|
+
# # manager.default_strategies(scope: :user).unshift :some_external_strategy
|
250
|
+
# # end
|
251
|
+
|
252
|
+
# # ==> Mountable engine configurations
|
253
|
+
# # When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
254
|
+
# # is mountable, there are some extra configurations to be taken into account.
|
255
|
+
# # The following options are available, assuming the engine is mounted as:
|
256
|
+
# #
|
257
|
+
# # mount MyEngine, at: '/my_engine'
|
258
|
+
# #
|
259
|
+
# # The router that invoked `devise_for`, in the example above, would be:
|
260
|
+
# # config.router_name = :my_engine
|
261
|
+
# #
|
262
|
+
# # When using OmniAuth, Devise cannot automatically set OmniAuth path,
|
263
|
+
# # so you need to do it manually. For the users scope, it would be:
|
264
|
+
# # config.omniauth_path_prefix = '/my_engine/users/auth'
|
265
|
+
# end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require "net/http"
|
2
|
+
require "net/smtp"
|
3
|
+
|
4
|
+
# Example:
|
5
|
+
# begin
|
6
|
+
# some http call
|
7
|
+
# rescue *HTTP_ERRORS => error
|
8
|
+
# notify_hoptoad error
|
9
|
+
# end
|
10
|
+
|
11
|
+
HTTP_ERRORS = [
|
12
|
+
EOFError,
|
13
|
+
Errno::ECONNRESET,
|
14
|
+
Errno::EINVAL,
|
15
|
+
Net::HTTPBadResponse,
|
16
|
+
Net::HTTPHeaderSyntaxError,
|
17
|
+
Net::ProtocolError,
|
18
|
+
Timeout::Error
|
19
|
+
]
|
20
|
+
|
21
|
+
SMTP_SERVER_ERRORS = [
|
22
|
+
IOError,
|
23
|
+
Net::SMTPAuthenticationError,
|
24
|
+
Net::SMTPServerBusy,
|
25
|
+
Net::SMTPUnknownError,
|
26
|
+
TimeoutError
|
27
|
+
]
|
28
|
+
|
29
|
+
SMTP_CLIENT_ERRORS = [
|
30
|
+
Net::SMTPFatalError,
|
31
|
+
Net::SMTPSyntaxError
|
32
|
+
]
|
33
|
+
|
34
|
+
SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS
|
@@ -0,0 +1 @@
|
|
1
|
+
ActiveSupport::JSON::Encoding.time_precision = 0
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
2
|
+
|
3
|
+
en:
|
4
|
+
devise:
|
5
|
+
confirmations:
|
6
|
+
confirmed: "Your email address has been successfully confirmed."
|
7
|
+
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
|
8
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
|
9
|
+
failure:
|
10
|
+
already_authenticated: "You are already signed in."
|
11
|
+
inactive: "Your account is not activated yet."
|
12
|
+
invalid: "Invalid %{authentication_keys} or password."
|
13
|
+
locked: "Your account is locked."
|
14
|
+
last_attempt: "You have one more attempt before your account is locked."
|
15
|
+
not_found_in_database: "Invalid %{authentication_keys} or password."
|
16
|
+
timeout: "Your session expired. Please sign in again to continue."
|
17
|
+
unauthenticated: "You need to sign in or sign up before continuing."
|
18
|
+
unconfirmed: "You have to confirm your email address before continuing."
|
19
|
+
mailer:
|
20
|
+
confirmation_instructions:
|
21
|
+
subject: "Confirmation instructions"
|
22
|
+
reset_password_instructions:
|
23
|
+
subject: "Reset password instructions"
|
24
|
+
unlock_instructions:
|
25
|
+
subject: "Unlock instructions"
|
26
|
+
password_change:
|
27
|
+
subject: "Password Changed"
|
28
|
+
omniauth_callbacks:
|
29
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
30
|
+
success: "Successfully authenticated from %{kind} account."
|
31
|
+
passwords:
|
32
|
+
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
|
33
|
+
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
34
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
|
35
|
+
updated: "Your password has been changed successfully. You are now signed in."
|
36
|
+
updated_not_active: "Your password has been changed successfully."
|
37
|
+
registrations:
|
38
|
+
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
39
|
+
signed_up: "Welcome! You have signed up successfully."
|
40
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
41
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
42
|
+
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
|
43
|
+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
|
44
|
+
updated: "Your account has been updated successfully."
|
45
|
+
sessions:
|
46
|
+
signed_in: "Signed in successfully."
|
47
|
+
signed_out: "Signed out successfully."
|
48
|
+
already_signed_out: "Signed out successfully."
|
49
|
+
unlocks:
|
50
|
+
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
51
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
52
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
53
|
+
errors:
|
54
|
+
messages:
|
55
|
+
already_confirmed: "was already confirmed, please try signing in"
|
56
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
57
|
+
expired: "has expired, please request a new one"
|
58
|
+
not_found: "not found"
|
59
|
+
not_locked: "was not locked"
|
60
|
+
not_saved:
|
61
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
62
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|
@@ -1,19 +1,142 @@
|
|
1
1
|
development:
|
2
|
+
# Configure available database clients. (required)
|
2
3
|
clients:
|
4
|
+
# Defines the default client. (required)
|
3
5
|
default:
|
4
|
-
database
|
6
|
+
# Defines the name of the default database that Mongoid can connect to.
|
7
|
+
# (required).
|
8
|
+
database: rails_app_development
|
9
|
+
# Provides the hosts the default client can connect to. Must be an array
|
10
|
+
# of host:port pairs. (required)
|
5
11
|
hosts:
|
6
|
-
|
12
|
+
- localhost:27017
|
7
13
|
options:
|
8
|
-
|
9
|
-
|
14
|
+
# Change the default write concern. (default = { w: 1 })
|
15
|
+
# write:
|
16
|
+
# w: 1
|
10
17
|
|
18
|
+
# Change the default read preference. Valid options for mode are: :secondary,
|
19
|
+
# :secondary_preferred, :primary, :primary_preferred, :nearest
|
20
|
+
# (default: primary)
|
21
|
+
# read:
|
22
|
+
# mode: :secondary_preferred
|
23
|
+
# tag_sets:
|
24
|
+
# - use: web
|
25
|
+
|
26
|
+
# The name of the user for authentication.
|
27
|
+
# user: 'user'
|
28
|
+
|
29
|
+
# The password of the user for authentication.
|
30
|
+
# password: 'password'
|
31
|
+
|
32
|
+
# The user's database roles.
|
33
|
+
# roles:
|
34
|
+
# - 'dbOwner'
|
35
|
+
|
36
|
+
# Change the default authentication mechanism. Valid options are: :scram,
|
37
|
+
# :mongodb_cr, :mongodb_x509, and :plain. (default on 3.0 is :scram, default
|
38
|
+
# on 2.4 and 2.6 is :plain)
|
39
|
+
# auth_mech: :scram
|
40
|
+
|
41
|
+
# The database or source to authenticate the user against. (default: admin)
|
42
|
+
# auth_source: admin
|
43
|
+
|
44
|
+
# Force a the driver cluster to behave in a certain manner instead of auto-
|
45
|
+
# discovering. Can be one of: :direct, :replica_set, :sharded. Set to :direct
|
46
|
+
# when connecting to hidden members of a replica set.
|
47
|
+
# connect: :direct
|
48
|
+
|
49
|
+
# Changes the default time in seconds the server monitors refresh their status
|
50
|
+
# via ismaster commands. (default: 10)
|
51
|
+
# heartbeat_frequency: 10
|
52
|
+
|
53
|
+
# The time in seconds for selecting servers for a near read preference. (default: 5)
|
54
|
+
# local_threshold: 5
|
55
|
+
|
56
|
+
# The timeout in seconds for selecting a server for an operation. (default: 30)
|
57
|
+
# server_selection_timeout: 30
|
58
|
+
|
59
|
+
# The maximum number of connections in the connection pool. (default: 5)
|
60
|
+
# max_pool_size: 5
|
61
|
+
|
62
|
+
# The minimum number of connections in the connection pool. (default: 1)
|
63
|
+
# min_pool_size: 1
|
64
|
+
|
65
|
+
# The time to wait, in seconds, in the connection pool for a connection
|
66
|
+
# to be checked in before timing out. (default: 5)
|
67
|
+
# wait_queue_timeout: 5
|
68
|
+
|
69
|
+
# The time to wait to establish a connection before timing out, in seconds.
|
70
|
+
# (default: 5)
|
71
|
+
# connect_timeout: 5
|
72
|
+
|
73
|
+
# The timeout to wait to execute operations on a socket before raising an error.
|
74
|
+
# (default: 5)
|
75
|
+
# socket_timeout: 5
|
76
|
+
|
77
|
+
# The name of the replica set to connect to. Servers provided as seeds that do
|
78
|
+
# not belong to this replica set will be ignored.
|
79
|
+
# replica_set: name
|
80
|
+
|
81
|
+
# Whether to connect to the servers via ssl. (default: false)
|
82
|
+
# ssl: true
|
83
|
+
|
84
|
+
# The certificate file used to identify the connection against MongoDB.
|
85
|
+
# ssl_cert: /path/to/my.cert
|
86
|
+
|
87
|
+
# The private keyfile used to identify the connection against MongoDB.
|
88
|
+
# Note that even if the key is stored in the same file as the certificate,
|
89
|
+
# both need to be explicitly specified.
|
90
|
+
# ssl_key: /path/to/my.key
|
91
|
+
|
92
|
+
# A passphrase for the private key.
|
93
|
+
# ssl_key_pass_phrase: password
|
94
|
+
|
95
|
+
# Whether or not to do peer certification validation. (default: false)
|
96
|
+
# ssl_verify: true
|
97
|
+
|
98
|
+
# The file containing a set of concatenated certification authority certifications
|
99
|
+
# used to validate certs passed from the other end of the connection.
|
100
|
+
# ssl_ca_cert: /path/to/ca.cert
|
101
|
+
|
102
|
+
|
103
|
+
# Configure Mongoid specific options. (optional)
|
104
|
+
options:
|
105
|
+
# Includes the root model name in json serialization. (default: false)
|
106
|
+
# include_root_in_json: false
|
107
|
+
|
108
|
+
# Include the _type field in serialization. (default: false)
|
109
|
+
# include_type_for_serialization: false
|
110
|
+
|
111
|
+
# Preload all models in development, needed when models use
|
112
|
+
# inheritance. (default: false)
|
113
|
+
# preload_models: false
|
114
|
+
|
115
|
+
# Raise an error when performing a #find and the document is not found.
|
116
|
+
# (default: true)
|
117
|
+
# raise_not_found_error: true
|
118
|
+
|
119
|
+
# Raise an error when defining a scope with the same name as an
|
120
|
+
# existing method. (default: false)
|
121
|
+
# scope_overwrite_exception: false
|
122
|
+
|
123
|
+
# Use Active Support's time zone in conversions. (default: true)
|
124
|
+
# use_activesupport_time_zone: true
|
125
|
+
|
126
|
+
# Ensure all times are UTC in the app side. (default: false)
|
127
|
+
# use_utc: false
|
11
128
|
test:
|
12
129
|
clients:
|
13
130
|
default:
|
14
|
-
database:
|
131
|
+
database: rails_app_test
|
15
132
|
hosts:
|
16
|
-
|
133
|
+
- localhost:27017
|
17
134
|
options:
|
18
|
-
|
19
|
-
|
135
|
+
read:
|
136
|
+
mode: :primary
|
137
|
+
max_pool_size: 1
|
138
|
+
|
139
|
+
production:
|
140
|
+
clients:
|
141
|
+
default:
|
142
|
+
uri: <%= ENV['MONGODB_URI'] %>
|