|
|
|
@ -1,12 +1,12 @@ |
|
|
|
|
# Add default ldap auth source |
|
|
|
|
|
|
|
|
|
class Setup < ActiveRecord::Migration[4.2] |
|
|
|
|
class ConfigLdap < ActiveRecord::Migration[4.2] |
|
|
|
|
|
|
|
|
|
# look at auth_source.rb |
|
|
|
|
# or auth_source_ldap.rb |
|
|
|
|
# in path /usr/src/redmine/app/models |
|
|
|
|
|
|
|
|
|
class AuthSource < ActiveRecord::Base |
|
|
|
|
class AuthSources < ActiveRecord::Base |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def self.up |
|
|
|
@ -44,19 +44,22 @@ class Setup < ActiveRecord::Migration[4.2] |
|
|
|
|
# 'timeout') |
|
|
|
|
|
|
|
|
|
# create default administrator account |
|
|
|
|
auth = AuthSource.new |
|
|
|
|
auth = AuthSources.new |
|
|
|
|
|
|
|
|
|
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.verify_peer = 0 |
|
|
|
|
auth.tls = 0 |
|
|
|
|
|
|
|
|
|
auth.save |
|
|
|
|
|