activeadmin-ajax_filter 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yaml +1 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +65 -59
- data/README.md +10 -13
- data/activeadmin-ajax_filter.gemspec +2 -2
- data/lib/active_admin/ajax_filter/version.rb +1 -1
- data/test_app/blog/.gitattributes +7 -0
- data/test_app/blog/.gitignore +35 -0
- data/test_app/blog/.ruby-version +1 -0
- data/test_app/blog/Gemfile +83 -0
- data/test_app/blog/Gemfile.lock +345 -0
- data/test_app/blog/README.md +24 -0
- data/test_app/blog/Rakefile +6 -0
- data/test_app/blog/app/admin/admin_users.rb +28 -0
- data/test_app/blog/app/admin/categories.rb +7 -0
- data/test_app/blog/app/admin/dashboard.rb +32 -0
- data/test_app/blog/app/admin/items.rb +38 -0
- data/test_app/blog/app/admin/subcategories.rb +8 -0
- data/test_app/blog/app/admin/tags.rb +22 -0
- data/test_app/blog/app/assets/config/manifest.js +2 -0
- data/test_app/blog/app/assets/images/.keep +0 -0
- data/test_app/blog/app/assets/javascripts/active_admin.js +4 -0
- data/test_app/blog/app/assets/stylesheets/active_admin.scss +21 -0
- data/test_app/blog/app/assets/stylesheets/application.css +15 -0
- data/test_app/blog/app/channels/application_cable/channel.rb +4 -0
- data/test_app/blog/app/channels/application_cable/connection.rb +4 -0
- data/test_app/blog/app/controllers/application_controller.rb +2 -0
- data/test_app/blog/app/controllers/concerns/.keep +0 -0
- data/test_app/blog/app/decorators/subcategory_decorator.rb +5 -0
- data/test_app/blog/app/helpers/application_helper.rb +2 -0
- data/test_app/blog/app/jobs/application_job.rb +7 -0
- data/test_app/blog/app/mailers/application_mailer.rb +4 -0
- data/test_app/blog/app/models/admin_user.rb +6 -0
- data/test_app/blog/app/models/application_record.rb +3 -0
- data/test_app/blog/app/models/category.rb +6 -0
- data/test_app/blog/app/models/concerns/.keep +0 -0
- data/test_app/blog/app/models/item.rb +6 -0
- data/test_app/blog/app/models/subcategory.rb +8 -0
- data/test_app/blog/app/models/tag.rb +6 -0
- data/test_app/blog/app/views/layouts/application.html.erb +15 -0
- data/test_app/blog/app/views/layouts/mailer.html.erb +13 -0
- data/test_app/blog/app/views/layouts/mailer.text.erb +1 -0
- data/test_app/blog/bin/bundle +114 -0
- data/test_app/blog/bin/rails +4 -0
- data/test_app/blog/bin/rake +4 -0
- data/test_app/blog/bin/setup +33 -0
- data/test_app/blog/config/application.rb +22 -0
- data/test_app/blog/config/boot.rb +4 -0
- data/test_app/blog/config/cable.yml +10 -0
- data/test_app/blog/config/credentials.yml.enc +1 -0
- data/test_app/blog/config/database.yml +25 -0
- data/test_app/blog/config/environment.rb +5 -0
- data/test_app/blog/config/environments/development.rb +70 -0
- data/test_app/blog/config/environments/production.rb +93 -0
- data/test_app/blog/config/environments/test.rb +60 -0
- data/test_app/blog/config/initializers/active_admin.rb +335 -0
- data/test_app/blog/config/initializers/assets.rb +12 -0
- data/test_app/blog/config/initializers/content_security_policy.rb +25 -0
- data/test_app/blog/config/initializers/devise.rb +313 -0
- data/test_app/blog/config/initializers/filter_parameter_logging.rb +8 -0
- data/test_app/blog/config/initializers/inflections.rb +16 -0
- data/test_app/blog/config/initializers/permissions_policy.rb +11 -0
- data/test_app/blog/config/locales/devise.en.yml +65 -0
- data/test_app/blog/config/locales/en.yml +33 -0
- data/test_app/blog/config/puma.rb +43 -0
- data/test_app/blog/config/routes.rb +8 -0
- data/test_app/blog/config/storage.yml +34 -0
- data/test_app/blog/config.ru +6 -0
- data/test_app/blog/db/migrate/20230425060437_devise_create_admin_users.rb +44 -0
- data/test_app/blog/db/migrate/20230425060439_create_active_admin_comments.rb +16 -0
- data/test_app/blog/db/migrate/20230425060707_initial_schema.rb +17 -0
- data/test_app/blog/db/migrate/20230425060708_create_tags.rb +13 -0
- data/test_app/blog/db/schema.rb +69 -0
- data/test_app/blog/db/seeds.rb +33 -0
- data/test_app/blog/lib/assets/.keep +0 -0
- data/test_app/blog/lib/tasks/.keep +0 -0
- data/test_app/blog/log/.keep +0 -0
- data/test_app/blog/public/404.html +67 -0
- data/test_app/blog/public/422.html +67 -0
- data/test_app/blog/public/500.html +66 -0
- data/test_app/blog/public/apple-touch-icon-precomposed.png +0 -0
- data/test_app/blog/public/apple-touch-icon.png +0 -0
- data/test_app/blog/public/favicon.ico +0 -0
- data/test_app/blog/public/robots.txt +1 -0
- data/test_app/blog/storage/.keep +0 -0
- data/test_app/blog/test/application_system_test_case.rb +5 -0
- data/test_app/blog/test/channels/application_cable/connection_test.rb +11 -0
- data/test_app/blog/test/controllers/.keep +0 -0
- data/test_app/blog/test/fixtures/admin_users.yml +11 -0
- data/test_app/blog/test/fixtures/files/.keep +0 -0
- data/test_app/blog/test/helpers/.keep +0 -0
- data/test_app/blog/test/integration/.keep +0 -0
- data/test_app/blog/test/mailers/.keep +0 -0
- data/test_app/blog/test/models/.keep +0 -0
- data/test_app/blog/test/models/admin_user_test.rb +7 -0
- data/test_app/blog/test/system/.keep +0 -0
- data/test_app/blog/test/test_helper.rb +13 -0
- data/test_app/blog/tmp/.keep +0 -0
- data/test_app/blog/tmp/pids/.keep +0 -0
- data/test_app/blog/tmp/storage/.keep +0 -0
- data/test_app/blog/vendor/.keep +0 -0
- metadata +101 -21
- data/.travis.yml +0 -26
@@ -0,0 +1,335 @@
|
|
1
|
+
ActiveAdmin.setup do |config|
|
2
|
+
# == Site Title
|
3
|
+
#
|
4
|
+
# Set the title that is displayed on the main layout
|
5
|
+
# for each of the active admin pages.
|
6
|
+
#
|
7
|
+
config.site_title = "Blog"
|
8
|
+
|
9
|
+
# Set the link url for the title. For example, to take
|
10
|
+
# users to your main site. Defaults to no link.
|
11
|
+
#
|
12
|
+
# config.site_title_link = "/"
|
13
|
+
|
14
|
+
# Set an optional image to be displayed for the header
|
15
|
+
# instead of a string (overrides :site_title)
|
16
|
+
#
|
17
|
+
# Note: Aim for an image that's 21px high so it fits in the header.
|
18
|
+
#
|
19
|
+
# config.site_title_image = "logo.png"
|
20
|
+
|
21
|
+
# == Default Namespace
|
22
|
+
#
|
23
|
+
# Set the default namespace each administration resource
|
24
|
+
# will be added to.
|
25
|
+
#
|
26
|
+
# eg:
|
27
|
+
# config.default_namespace = :hello_world
|
28
|
+
#
|
29
|
+
# This will create resources in the HelloWorld module and
|
30
|
+
# will namespace routes to /hello_world/*
|
31
|
+
#
|
32
|
+
# To set no namespace by default, use:
|
33
|
+
# config.default_namespace = false
|
34
|
+
#
|
35
|
+
# Default:
|
36
|
+
# config.default_namespace = :admin
|
37
|
+
#
|
38
|
+
# You can customize the settings for each namespace by using
|
39
|
+
# a namespace block. For example, to change the site title
|
40
|
+
# within a namespace:
|
41
|
+
#
|
42
|
+
# config.namespace :admin do |admin|
|
43
|
+
# admin.site_title = "Custom Admin Title"
|
44
|
+
# end
|
45
|
+
#
|
46
|
+
# This will ONLY change the title for the admin section. Other
|
47
|
+
# namespaces will continue to use the main "site_title" configuration.
|
48
|
+
|
49
|
+
# == User Authentication
|
50
|
+
#
|
51
|
+
# Active Admin will automatically call an authentication
|
52
|
+
# method in a before filter of all controller actions to
|
53
|
+
# ensure that there is a currently logged in admin user.
|
54
|
+
#
|
55
|
+
# This setting changes the method which Active Admin calls
|
56
|
+
# within the application controller.
|
57
|
+
config.authentication_method = :authenticate_admin_user!
|
58
|
+
|
59
|
+
# == User Authorization
|
60
|
+
#
|
61
|
+
# Active Admin will automatically call an authorization
|
62
|
+
# method in a before filter of all controller actions to
|
63
|
+
# ensure that there is a user with proper rights. You can use
|
64
|
+
# CanCanAdapter or make your own. Please refer to documentation.
|
65
|
+
# config.authorization_adapter = ActiveAdmin::CanCanAdapter
|
66
|
+
|
67
|
+
# In case you prefer Pundit over other solutions you can here pass
|
68
|
+
# the name of default policy class. This policy will be used in every
|
69
|
+
# case when Pundit is unable to find suitable policy.
|
70
|
+
# config.pundit_default_policy = "MyDefaultPunditPolicy"
|
71
|
+
|
72
|
+
# If you wish to maintain a separate set of Pundit policies for admin
|
73
|
+
# resources, you may set a namespace here that Pundit will search
|
74
|
+
# within when looking for a resource's policy.
|
75
|
+
# config.pundit_policy_namespace = :admin
|
76
|
+
|
77
|
+
# You can customize your CanCan Ability class name here.
|
78
|
+
# config.cancan_ability_class = "Ability"
|
79
|
+
|
80
|
+
# You can specify a method to be called on unauthorized access.
|
81
|
+
# This is necessary in order to prevent a redirect loop which happens
|
82
|
+
# because, by default, user gets redirected to Dashboard. If user
|
83
|
+
# doesn't have access to Dashboard, he'll end up in a redirect loop.
|
84
|
+
# Method provided here should be defined in application_controller.rb.
|
85
|
+
# config.on_unauthorized_access = :access_denied
|
86
|
+
|
87
|
+
# == Current User
|
88
|
+
#
|
89
|
+
# Active Admin will associate actions with the current
|
90
|
+
# user performing them.
|
91
|
+
#
|
92
|
+
# This setting changes the method which Active Admin calls
|
93
|
+
# (within the application controller) to return the currently logged in user.
|
94
|
+
config.current_user_method = :current_admin_user
|
95
|
+
|
96
|
+
# == Logging Out
|
97
|
+
#
|
98
|
+
# Active Admin displays a logout link on each screen. These
|
99
|
+
# settings configure the location and method used for the link.
|
100
|
+
#
|
101
|
+
# This setting changes the path where the link points to. If it's
|
102
|
+
# a string, the strings is used as the path. If it's a Symbol, we
|
103
|
+
# will call the method to return the path.
|
104
|
+
#
|
105
|
+
# Default:
|
106
|
+
config.logout_link_path = :destroy_admin_user_session_path
|
107
|
+
|
108
|
+
# This setting changes the http method used when rendering the
|
109
|
+
# link. For example :get, :delete, :put, etc..
|
110
|
+
#
|
111
|
+
# Default:
|
112
|
+
# config.logout_link_method = :get
|
113
|
+
|
114
|
+
# == Root
|
115
|
+
#
|
116
|
+
# Set the action to call for the root path. You can set different
|
117
|
+
# roots for each namespace.
|
118
|
+
#
|
119
|
+
# Default:
|
120
|
+
# config.root_to = 'dashboard#index'
|
121
|
+
|
122
|
+
# == Admin Comments
|
123
|
+
#
|
124
|
+
# This allows your users to comment on any resource registered with Active Admin.
|
125
|
+
#
|
126
|
+
# You can completely disable comments:
|
127
|
+
# config.comments = false
|
128
|
+
#
|
129
|
+
# You can change the name under which comments are registered:
|
130
|
+
# config.comments_registration_name = 'AdminComment'
|
131
|
+
#
|
132
|
+
# You can change the order for the comments and you can change the column
|
133
|
+
# to be used for ordering:
|
134
|
+
# config.comments_order = 'created_at ASC'
|
135
|
+
#
|
136
|
+
# You can disable the menu item for the comments index page:
|
137
|
+
# config.comments_menu = false
|
138
|
+
#
|
139
|
+
# You can customize the comment menu:
|
140
|
+
# config.comments_menu = { parent: 'Admin', priority: 1 }
|
141
|
+
|
142
|
+
# == Batch Actions
|
143
|
+
#
|
144
|
+
# Enable and disable Batch Actions
|
145
|
+
#
|
146
|
+
config.batch_actions = true
|
147
|
+
|
148
|
+
# == Controller Filters
|
149
|
+
#
|
150
|
+
# You can add before, after and around filters to all of your
|
151
|
+
# Active Admin resources and pages from here.
|
152
|
+
#
|
153
|
+
# config.before_action :do_something_awesome
|
154
|
+
|
155
|
+
# == Attribute Filters
|
156
|
+
#
|
157
|
+
# You can exclude possibly sensitive model attributes from being displayed,
|
158
|
+
# added to forms, or exported by default by ActiveAdmin
|
159
|
+
#
|
160
|
+
config.filter_attributes = [:encrypted_password, :password, :password_confirmation]
|
161
|
+
|
162
|
+
# == Localize Date/Time Format
|
163
|
+
#
|
164
|
+
# Set the localize format to display dates and times.
|
165
|
+
# To understand how to localize your app with I18n, read more at
|
166
|
+
# https://guides.rubyonrails.org/i18n.html
|
167
|
+
#
|
168
|
+
# You can run `bin/rails runner 'puts I18n.t("date.formats")'` to see the
|
169
|
+
# available formats in your application.
|
170
|
+
#
|
171
|
+
config.localize_format = :long
|
172
|
+
|
173
|
+
# == Setting a Favicon
|
174
|
+
#
|
175
|
+
# config.favicon = 'favicon.ico'
|
176
|
+
|
177
|
+
# == Meta Tags
|
178
|
+
#
|
179
|
+
# Add additional meta tags to the head element of active admin pages.
|
180
|
+
#
|
181
|
+
# Add tags to all pages logged in users see:
|
182
|
+
# config.meta_tags = { author: 'My Company' }
|
183
|
+
|
184
|
+
# By default, sign up/sign in/recover password pages are excluded
|
185
|
+
# from showing up in search engine results by adding a robots meta
|
186
|
+
# tag. You can reset the hash of meta tags included in logged out
|
187
|
+
# pages:
|
188
|
+
# config.meta_tags_for_logged_out_pages = {}
|
189
|
+
|
190
|
+
# == Removing Breadcrumbs
|
191
|
+
#
|
192
|
+
# Breadcrumbs are enabled by default. You can customize them for individual
|
193
|
+
# resources or you can disable them globally from here.
|
194
|
+
#
|
195
|
+
# config.breadcrumb = false
|
196
|
+
|
197
|
+
# == Create Another Checkbox
|
198
|
+
#
|
199
|
+
# Create another checkbox is disabled by default. You can customize it for individual
|
200
|
+
# resources or you can enable them globally from here.
|
201
|
+
#
|
202
|
+
# config.create_another = true
|
203
|
+
|
204
|
+
# == Register Stylesheets & Javascripts
|
205
|
+
#
|
206
|
+
# We recommend using the built in Active Admin layout and loading
|
207
|
+
# up your own stylesheets / javascripts to customize the look
|
208
|
+
# and feel.
|
209
|
+
#
|
210
|
+
# To load a stylesheet:
|
211
|
+
# config.register_stylesheet 'my_stylesheet.css'
|
212
|
+
#
|
213
|
+
# You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
|
214
|
+
# config.register_stylesheet 'my_print_stylesheet.css', media: :print
|
215
|
+
#
|
216
|
+
# To load a javascript file:
|
217
|
+
# config.register_javascript 'my_javascript.js'
|
218
|
+
|
219
|
+
# == CSV options
|
220
|
+
#
|
221
|
+
# Set the CSV builder separator
|
222
|
+
# config.csv_options = { col_sep: ';' }
|
223
|
+
#
|
224
|
+
# Force the use of quotes
|
225
|
+
# config.csv_options = { force_quotes: true }
|
226
|
+
|
227
|
+
# == Menu System
|
228
|
+
#
|
229
|
+
# You can add a navigation menu to be used in your application, or configure a provided menu
|
230
|
+
#
|
231
|
+
# To change the default utility navigation to show a link to your website & a logout btn
|
232
|
+
#
|
233
|
+
# config.namespace :admin do |admin|
|
234
|
+
# admin.build_menu :utility_navigation do |menu|
|
235
|
+
# menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
|
236
|
+
# admin.add_logout_button_to_menu menu
|
237
|
+
# end
|
238
|
+
# end
|
239
|
+
#
|
240
|
+
# If you wanted to add a static menu item to the default menu provided:
|
241
|
+
#
|
242
|
+
# config.namespace :admin do |admin|
|
243
|
+
# admin.build_menu :default do |menu|
|
244
|
+
# menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
|
245
|
+
# end
|
246
|
+
# end
|
247
|
+
|
248
|
+
# == Download Links
|
249
|
+
#
|
250
|
+
# You can disable download links on resource listing pages,
|
251
|
+
# or customize the formats shown per namespace/globally
|
252
|
+
#
|
253
|
+
# To disable/customize for the :admin namespace:
|
254
|
+
#
|
255
|
+
# config.namespace :admin do |admin|
|
256
|
+
#
|
257
|
+
# # Disable the links entirely
|
258
|
+
# admin.download_links = false
|
259
|
+
#
|
260
|
+
# # Only show XML & PDF options
|
261
|
+
# admin.download_links = [:xml, :pdf]
|
262
|
+
#
|
263
|
+
# # Enable/disable the links based on block
|
264
|
+
# # (for example, with cancan)
|
265
|
+
# admin.download_links = proc { can?(:view_download_links) }
|
266
|
+
#
|
267
|
+
# end
|
268
|
+
|
269
|
+
# == Pagination
|
270
|
+
#
|
271
|
+
# Pagination is enabled by default for all resources.
|
272
|
+
# You can control the default per page count for all resources here.
|
273
|
+
#
|
274
|
+
# config.default_per_page = 30
|
275
|
+
#
|
276
|
+
# You can control the max per page count too.
|
277
|
+
#
|
278
|
+
# config.max_per_page = 10_000
|
279
|
+
|
280
|
+
# == Filters
|
281
|
+
#
|
282
|
+
# By default the index screen includes a "Filters" sidebar on the right
|
283
|
+
# hand side with a filter for each attribute of the registered model.
|
284
|
+
# You can enable or disable them for all resources here.
|
285
|
+
#
|
286
|
+
# config.filters = true
|
287
|
+
#
|
288
|
+
# By default the filters include associations in a select, which means
|
289
|
+
# that every record will be loaded for each association (up
|
290
|
+
# to the value of config.maximum_association_filter_arity).
|
291
|
+
# You can enabled or disable the inclusion
|
292
|
+
# of those filters by default here.
|
293
|
+
#
|
294
|
+
# config.include_default_association_filters = true
|
295
|
+
|
296
|
+
# config.maximum_association_filter_arity = 256 # default value of :unlimited will change to 256 in a future version
|
297
|
+
# config.filter_columns_for_large_association = [
|
298
|
+
# :display_name,
|
299
|
+
# :full_name,
|
300
|
+
# :name,
|
301
|
+
# :username,
|
302
|
+
# :login,
|
303
|
+
# :title,
|
304
|
+
# :email,
|
305
|
+
# ]
|
306
|
+
# config.filter_method_for_large_association = '_starts_with'
|
307
|
+
|
308
|
+
# == Head
|
309
|
+
#
|
310
|
+
# You can add your own content to the site head like analytics. Make sure
|
311
|
+
# you only pass content you trust.
|
312
|
+
#
|
313
|
+
# config.head = ''.html_safe
|
314
|
+
|
315
|
+
# == Footer
|
316
|
+
#
|
317
|
+
# By default, the footer shows the current Active Admin version. You can
|
318
|
+
# override the content of the footer here.
|
319
|
+
#
|
320
|
+
# config.footer = 'my custom footer text'
|
321
|
+
|
322
|
+
# == Sorting
|
323
|
+
#
|
324
|
+
# By default ActiveAdmin::OrderClause is used for sorting logic
|
325
|
+
# You can inherit it with own class and inject it for all resources
|
326
|
+
#
|
327
|
+
# config.order_clause = MyOrderClause
|
328
|
+
|
329
|
+
# == Webpacker
|
330
|
+
#
|
331
|
+
# By default, Active Admin uses Sprocket's asset pipeline.
|
332
|
+
# You can switch to using Webpacker here.
|
333
|
+
#
|
334
|
+
# config.use_webpacker = true
|
335
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Version of your assets, change this if you want to expire all your assets.
|
4
|
+
Rails.application.config.assets.version = "1.0"
|
5
|
+
|
6
|
+
# Add additional assets to the asset load path.
|
7
|
+
# Rails.application.config.assets.paths << Emoji.images_path
|
8
|
+
|
9
|
+
# Precompile additional assets.
|
10
|
+
# application.js, application.css, and all non-JS/CSS in the app/assets
|
11
|
+
# folder are already added.
|
12
|
+
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Define an application-wide content security policy.
|
4
|
+
# See the Securing Rails Applications Guide for more information:
|
5
|
+
# https://guides.rubyonrails.org/security.html#content-security-policy-header
|
6
|
+
|
7
|
+
# Rails.application.configure do
|
8
|
+
# config.content_security_policy do |policy|
|
9
|
+
# policy.default_src :self, :https
|
10
|
+
# policy.font_src :self, :https, :data
|
11
|
+
# policy.img_src :self, :https, :data
|
12
|
+
# policy.object_src :none
|
13
|
+
# policy.script_src :self, :https
|
14
|
+
# policy.style_src :self, :https
|
15
|
+
# # Specify URI for violation reports
|
16
|
+
# # policy.report_uri "/csp-violation-report-endpoint"
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# # Generate session nonces for permitted importmap and inline scripts
|
20
|
+
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
21
|
+
# config.content_security_policy_nonce_directives = %w(script-src)
|
22
|
+
#
|
23
|
+
# # Report violations without enforcing the policy.
|
24
|
+
# # config.content_security_policy_report_only = true
|
25
|
+
# end
|
@@ -0,0 +1,313 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Assuming you have not yet modified this file, each configuration option below
|
4
|
+
# is set to its default value. Note that some are commented out while others
|
5
|
+
# are not: uncommented lines are intended to protect your configuration from
|
6
|
+
# breaking changes in upgrades (i.e., in the event that future versions of
|
7
|
+
# Devise change the default values for those options).
|
8
|
+
#
|
9
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
10
|
+
# Many of these configuration options can be set straight in your model.
|
11
|
+
Devise.setup do |config|
|
12
|
+
# The secret key used by Devise. Devise uses this key to generate
|
13
|
+
# random tokens. Changing this key will render invalid all existing
|
14
|
+
# confirmation, reset password and unlock tokens in the database.
|
15
|
+
# Devise will use the `secret_key_base` as its `secret_key`
|
16
|
+
# by default. You can change it below and use your own secret key.
|
17
|
+
# config.secret_key = '63bcbe7e44dca3732cdf03044e5ca304d8a1bd6615a892f964d79de0de48d7daeb12ce1478a42dffb97bd32752c2cb8c64a7ca9f434fb863f08f6d0a11a78125'
|
18
|
+
|
19
|
+
# ==> Controller configuration
|
20
|
+
# Configure the parent class to the devise controllers.
|
21
|
+
# config.parent_controller = 'DeviseController'
|
22
|
+
|
23
|
+
# ==> Mailer Configuration
|
24
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
25
|
+
# note that it will be overwritten if you use your own mailer class
|
26
|
+
# with default "from" parameter.
|
27
|
+
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
28
|
+
|
29
|
+
# Configure the class responsible to send e-mails.
|
30
|
+
# config.mailer = 'Devise::Mailer'
|
31
|
+
|
32
|
+
# Configure the parent class responsible to send e-mails.
|
33
|
+
# config.parent_mailer = 'ActionMailer::Base'
|
34
|
+
|
35
|
+
# ==> ORM configuration
|
36
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
37
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
38
|
+
# available as additional gems.
|
39
|
+
require 'devise/orm/active_record'
|
40
|
+
|
41
|
+
# ==> Configuration for any authentication mechanism
|
42
|
+
# Configure which keys are used when authenticating a user. The default is
|
43
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
44
|
+
# authenticating a user, both parameters are required. Remember that those
|
45
|
+
# parameters are used only when authenticating and not when retrieving from
|
46
|
+
# session. If you need permissions, you should implement that in a before filter.
|
47
|
+
# You can also supply a hash where the value is a boolean determining whether
|
48
|
+
# or not authentication should be aborted when the value is not present.
|
49
|
+
# config.authentication_keys = [:email]
|
50
|
+
|
51
|
+
# Configure parameters from the request object used for authentication. Each entry
|
52
|
+
# given should be a request method and it will automatically be passed to the
|
53
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
54
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
55
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
56
|
+
# config.request_keys = []
|
57
|
+
|
58
|
+
# Configure which authentication keys should be case-insensitive.
|
59
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
60
|
+
# to authenticate or find a user. Default is :email.
|
61
|
+
config.case_insensitive_keys = [:email]
|
62
|
+
|
63
|
+
# Configure which authentication keys should have whitespace stripped.
|
64
|
+
# These keys will have whitespace before and after removed upon creating or
|
65
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
66
|
+
config.strip_whitespace_keys = [:email]
|
67
|
+
|
68
|
+
# Tell if authentication through request.params is enabled. True by default.
|
69
|
+
# It can be set to an array that will enable params authentication only for the
|
70
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
71
|
+
# enable it only for database (email + password) authentication.
|
72
|
+
# config.params_authenticatable = true
|
73
|
+
|
74
|
+
# Tell if authentication through HTTP Auth is enabled. False by default.
|
75
|
+
# It can be set to an array that will enable http authentication only for the
|
76
|
+
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
77
|
+
# enable it only for database authentication.
|
78
|
+
# For API-only applications to support authentication "out-of-the-box", you will likely want to
|
79
|
+
# enable this with :database unless you are using a custom strategy.
|
80
|
+
# The supported strategies are:
|
81
|
+
# :database = Support basic authentication with authentication key + password
|
82
|
+
# config.http_authenticatable = false
|
83
|
+
|
84
|
+
# If 401 status code should be returned for AJAX requests. True by default.
|
85
|
+
# config.http_authenticatable_on_xhr = true
|
86
|
+
|
87
|
+
# The realm used in Http Basic Authentication. 'Application' by default.
|
88
|
+
# config.http_authentication_realm = 'Application'
|
89
|
+
|
90
|
+
# It will change confirmation, password recovery and other workflows
|
91
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
92
|
+
# Does not affect registerable.
|
93
|
+
# config.paranoid = true
|
94
|
+
|
95
|
+
# By default Devise will store the user in session. You can skip storage for
|
96
|
+
# particular strategies by setting this option.
|
97
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
98
|
+
# may want to disable generating routes to Devise's sessions controller by
|
99
|
+
# passing skip: :sessions to `devise_for` in your config/routes.rb
|
100
|
+
config.skip_session_storage = [:http_auth]
|
101
|
+
|
102
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
103
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
104
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
105
|
+
# from the server. You can disable this option at your own risk.
|
106
|
+
# config.clean_up_csrf_token_on_authentication = true
|
107
|
+
|
108
|
+
# When false, Devise will not attempt to reload routes on eager load.
|
109
|
+
# This can reduce the time taken to boot the app but if your application
|
110
|
+
# requires the Devise mappings to be loaded during boot time the application
|
111
|
+
# won't boot properly.
|
112
|
+
# config.reload_routes = true
|
113
|
+
|
114
|
+
# ==> Configuration for :database_authenticatable
|
115
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 12. If
|
116
|
+
# using other algorithms, it sets how many times you want the password to be hashed.
|
117
|
+
# The number of stretches used for generating the hashed password are stored
|
118
|
+
# with the hashed password. This allows you to change the stretches without
|
119
|
+
# invalidating existing passwords.
|
120
|
+
#
|
121
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
122
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
123
|
+
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
124
|
+
# algorithm), the cost increases exponentially with the number of stretches (e.g.
|
125
|
+
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
126
|
+
config.stretches = Rails.env.test? ? 1 : 12
|
127
|
+
|
128
|
+
# Set up a pepper to generate the hashed password.
|
129
|
+
# config.pepper = 'bee4454e247381a02dd19731d7d7e11d33f1d0bdeaaa933c3fa125df42dbdb3742dd46972b0b921ece8142fa608b0d0be0e08b72ef45d514528e73a0f2f6787a'
|
130
|
+
|
131
|
+
# Send a notification to the original email when the user's email is changed.
|
132
|
+
# config.send_email_changed_notification = false
|
133
|
+
|
134
|
+
# Send a notification email when the user's password is changed.
|
135
|
+
# config.send_password_change_notification = false
|
136
|
+
|
137
|
+
# ==> Configuration for :confirmable
|
138
|
+
# A period that the user is allowed to access the website even without
|
139
|
+
# confirming their account. For instance, if set to 2.days, the user will be
|
140
|
+
# able to access the website for two days without confirming their account,
|
141
|
+
# access will be blocked just in the third day.
|
142
|
+
# You can also set it to nil, which will allow the user to access the website
|
143
|
+
# without confirming their account.
|
144
|
+
# Default is 0.days, meaning the user cannot access the website without
|
145
|
+
# confirming their account.
|
146
|
+
# config.allow_unconfirmed_access_for = 2.days
|
147
|
+
|
148
|
+
# A period that the user is allowed to confirm their account before their
|
149
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
150
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
151
|
+
# their account can't be confirmed with the token any more.
|
152
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
153
|
+
# before confirming their account.
|
154
|
+
# config.confirm_within = 3.days
|
155
|
+
|
156
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
157
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
158
|
+
# db field (see migrations). Until confirmed, new email is stored in
|
159
|
+
# unconfirmed_email column, and copied to email column on successful confirmation.
|
160
|
+
config.reconfirmable = true
|
161
|
+
|
162
|
+
# Defines which key will be used when confirming an account
|
163
|
+
# config.confirmation_keys = [:email]
|
164
|
+
|
165
|
+
# ==> Configuration for :rememberable
|
166
|
+
# The time the user will be remembered without asking for credentials again.
|
167
|
+
# config.remember_for = 2.weeks
|
168
|
+
|
169
|
+
# Invalidates all the remember me tokens when the user signs out.
|
170
|
+
config.expire_all_remember_me_on_sign_out = true
|
171
|
+
|
172
|
+
# If true, extends the user's remember period when remembered via cookie.
|
173
|
+
# config.extend_remember_period = false
|
174
|
+
|
175
|
+
# Options to be passed to the created cookie. For instance, you can set
|
176
|
+
# secure: true in order to force SSL only cookies.
|
177
|
+
# config.rememberable_options = {}
|
178
|
+
|
179
|
+
# ==> Configuration for :validatable
|
180
|
+
# Range for password length.
|
181
|
+
config.password_length = 6..128
|
182
|
+
|
183
|
+
# Email regex used to validate email formats. It simply asserts that
|
184
|
+
# one (and only one) @ exists in the given string. This is mainly
|
185
|
+
# to give user feedback and not to assert the e-mail validity.
|
186
|
+
config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
|
187
|
+
|
188
|
+
# ==> Configuration for :timeoutable
|
189
|
+
# The time you want to timeout the user session without activity. After this
|
190
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
191
|
+
# config.timeout_in = 30.minutes
|
192
|
+
|
193
|
+
# ==> Configuration for :lockable
|
194
|
+
# Defines which strategy will be used to lock an account.
|
195
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
196
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
197
|
+
# config.lock_strategy = :failed_attempts
|
198
|
+
|
199
|
+
# Defines which key will be used when locking and unlocking an account
|
200
|
+
# config.unlock_keys = [:email]
|
201
|
+
|
202
|
+
# Defines which strategy will be used to unlock an account.
|
203
|
+
# :email = Sends an unlock link to the user email
|
204
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
205
|
+
# :both = Enables both strategies
|
206
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
207
|
+
# config.unlock_strategy = :both
|
208
|
+
|
209
|
+
# Number of authentication tries before locking an account if lock_strategy
|
210
|
+
# is failed attempts.
|
211
|
+
# config.maximum_attempts = 20
|
212
|
+
|
213
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
214
|
+
# config.unlock_in = 1.hour
|
215
|
+
|
216
|
+
# Warn on the last attempt before the account is locked.
|
217
|
+
# config.last_attempt_warning = true
|
218
|
+
|
219
|
+
# ==> Configuration for :recoverable
|
220
|
+
#
|
221
|
+
# Defines which key will be used when recovering the password for an account
|
222
|
+
# config.reset_password_keys = [:email]
|
223
|
+
|
224
|
+
# Time interval you can reset your password with a reset password key.
|
225
|
+
# Don't put a too small interval or your users won't have the time to
|
226
|
+
# change their passwords.
|
227
|
+
config.reset_password_within = 6.hours
|
228
|
+
|
229
|
+
# When set to false, does not sign a user in automatically after their password is
|
230
|
+
# reset. Defaults to true, so a user is signed in automatically after a reset.
|
231
|
+
# config.sign_in_after_reset_password = true
|
232
|
+
|
233
|
+
# ==> Configuration for :encryptable
|
234
|
+
# Allow you to use another hashing or encryption algorithm besides bcrypt (default).
|
235
|
+
# You can use :sha1, :sha512 or algorithms from others authentication tools as
|
236
|
+
# :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
|
237
|
+
# for default behavior) and :restful_authentication_sha1 (then you should set
|
238
|
+
# stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
|
239
|
+
#
|
240
|
+
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
241
|
+
# config.encryptor = :sha512
|
242
|
+
|
243
|
+
# ==> Scopes configuration
|
244
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
245
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
246
|
+
# are using only default views.
|
247
|
+
# config.scoped_views = false
|
248
|
+
|
249
|
+
# Configure the default scope given to Warden. By default it's the first
|
250
|
+
# devise role declared in your routes (usually :user).
|
251
|
+
# config.default_scope = :user
|
252
|
+
|
253
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
254
|
+
# only the current scope. By default, Devise signs out all scopes.
|
255
|
+
# config.sign_out_all_scopes = true
|
256
|
+
|
257
|
+
# ==> Navigation configuration
|
258
|
+
# Lists the formats that should be treated as navigational. Formats like
|
259
|
+
# :html should redirect to the sign in page when the user does not have
|
260
|
+
# access, but formats like :xml or :json, should return 401.
|
261
|
+
#
|
262
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
263
|
+
# should add them to the navigational formats lists.
|
264
|
+
#
|
265
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
266
|
+
# config.navigational_formats = ['*/*', :html, :turbo_stream]
|
267
|
+
|
268
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
269
|
+
config.sign_out_via = :delete
|
270
|
+
|
271
|
+
# ==> OmniAuth
|
272
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
273
|
+
# up on your models and hooks.
|
274
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
275
|
+
|
276
|
+
# ==> Warden configuration
|
277
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
278
|
+
# change the failure app, you can configure them inside the config.warden block.
|
279
|
+
#
|
280
|
+
# config.warden do |manager|
|
281
|
+
# manager.intercept_401 = false
|
282
|
+
# manager.default_strategies(scope: :user).unshift :some_external_strategy
|
283
|
+
# end
|
284
|
+
|
285
|
+
# ==> Mountable engine configurations
|
286
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
287
|
+
# is mountable, there are some extra configurations to be taken into account.
|
288
|
+
# The following options are available, assuming the engine is mounted as:
|
289
|
+
#
|
290
|
+
# mount MyEngine, at: '/my_engine'
|
291
|
+
#
|
292
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
293
|
+
# config.router_name = :my_engine
|
294
|
+
#
|
295
|
+
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
|
296
|
+
# so you need to do it manually. For the users scope, it would be:
|
297
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
298
|
+
|
299
|
+
# ==> Hotwire/Turbo configuration
|
300
|
+
# When using Devise with Hotwire/Turbo, the http status for error responses
|
301
|
+
# and some redirects must match the following. The default in Devise for existing
|
302
|
+
# apps is `200 OK` and `302 Found respectively`, but new apps are generated with
|
303
|
+
# these new defaults that match Hotwire/Turbo behavior.
|
304
|
+
# Note: These might become the new default in future versions of Devise.
|
305
|
+
config.responder.error_status = :unprocessable_entity
|
306
|
+
config.responder.redirect_status = :see_other
|
307
|
+
|
308
|
+
# ==> Configuration for :registerable
|
309
|
+
|
310
|
+
# When set to false, does not sign a user in automatically after their password is
|
311
|
+
# changed. Defaults to true, so a user is signed in automatically after changing a password.
|
312
|
+
# config.sign_in_after_change_password = true
|
313
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Configure parameters to be filtered from the log file. Use this to limit dissemination of
|
4
|
+
# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
|
5
|
+
# notations and behaviors.
|
6
|
+
Rails.application.config.filter_parameters += [
|
7
|
+
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
8
|
+
]
|