|
|
|
@ -6,7 +6,7 @@ class Setup < ActiveRecord::Migration[4.2] |
|
|
|
|
# or auth_source_ldap.rb |
|
|
|
|
# in path /usr/src/redmine/app/models |
|
|
|
|
|
|
|
|
|
class AuthSource < ActiveRecord::Base |
|
|
|
|
class AuthSourceLdap < ActiveRecord::Base |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def self.up |
|
|
|
@ -44,19 +44,20 @@ class Setup < ActiveRecord::Migration[4.2] |
|
|
|
|
# 'timeout') |
|
|
|
|
|
|
|
|
|
# create default administrator account |
|
|
|
|
auth = AuthSource.new |
|
|
|
|
auth = AuthSourceLdap.create |
|
|
|
|
|
|
|
|
|
auth.type = "AuthSourceLdap" |
|
|
|
|
auth.name = "ldap" |
|
|
|
|
auth.host = ENV["REDMINE_LDAP"] |
|
|
|
|
auth.port = 389 |
|
|
|
|
auth.account = "admin" |
|
|
|
|
auth.account = "cn=admin,dc=example,dc=org" |
|
|
|
|
auth.account_password = ENV["LDAP_ADMIN_PASSWORD"] |
|
|
|
|
auth.base_dn = ENV["LDAP_BASE_DN"] |
|
|
|
|
auth.attr_login = "uid" |
|
|
|
|
auth.attr_firstname = "givenName" |
|
|
|
|
auth.attr_lastname = "sn" |
|
|
|
|
auth.attr_mail = "mail" |
|
|
|
|
auth.onthefly_register = true |
|
|
|
|
auth.onthefly_register = 1 |
|
|
|
|
|
|
|
|
|
auth.save |
|
|
|
|
|
|
|
|
|