forked from southbridgeio/redmine_2fa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.rb
31 lines (27 loc) · 1 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FileUtils.mkdir_p(Rails.root.join('log/redmine_2fa')) unless Dir.exist?(Rails.root.join('log/redmine_2fa'))
require 'redmine_2fa'
ActionDispatch::Callbacks.to_prepare do
%w( /app/models/redmine_2fa/*.rb
/lib/redmine_2fa/patches/account_controller_patch/*.rb
/lib/redmine_2fa/*.rb
/lib/redmine_2fa/code_sender/*.rb
/lib/redmine_2fa/{patches/*_patch,hooks/*_hook,*}.rb).each do |paths|
Dir.glob(File.dirname(__FILE__) + paths).each do |file|
require_dependency file
end
end
end
Redmine::Plugin.register :redmine_2fa do
name 'Redmine 2FA'
version '1.4.1'
url 'https://github.com/centosadmin/redmine_2fa'
description 'Two-factor authorization for Redmine'
author 'Centos-admin.ru'
author_url 'https://centos-admin.ru'
requires_redmine version_or_higher: '3.0'
settings(default: { 'bot_token' => '',
'required' => false,
'active_protocols' => Redmine2FA::AVAILABLE_PROTOCOLS
},
partial: 'settings/redmine_2fa')
end