Redmine + MySQL + LDAP + SVN + GIT deploy automation with docker-compose
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
redmine-integration/redmine/999_config_ldap.rb

66 lines
1.8 KiB

# Add default ldap auth source
class Setup < ActiveRecord::Migration[4.2]
# look at auth_source.rb
# or auth_source_ldap.rb
# in path /usr/src/redmine/app/models
class AuthSourceLdap < ActiveRecord::Base
end
def self.up
# create_table "auth_sources", :force => true do |t|
# t.column "type", :string, :limit => 30, :default => "", :null => false
# t.column "name", :string, :limit => 60, :default => "", :null => false
# t.column "host", :string, :limit => 60
# t.column "port", :integer
# t.column "account", :string, :limit => 60
# t.column "account_password", :string, :limit => 60
# t.column "base_dn", :string, :limit => 255
# t.column "attr_login", :string, :limit => 30
# t.column "attr_firstname", :string, :limit => 30
# t.column "attr_lastname", :string, :limit => 30
# t.column "attr_mail", :string, :limit => 30
# t.column "onthefly_register", :boolean, :default => false, :null => false
# end
# safe_attributes(
# 'name',
# 'host',
# 'port',
# 'account',
# 'account_password',
# 'base_dn',
# 'attr_login',
# 'attr_firstname',
# 'attr_lastname',
# 'attr_mail',
# 'onthefly_register',
# 'tls',
# 'verify_peer',
# 'filter',
# 'timeout')
# create default administrator account
auth = AuthSourceLdap.create
auth.type = "AuthSourceLdap"
auth.name = "ldap"
auth.host = ENV["REDMINE_LDAP"]
auth.port = 389
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 = 1
auth.save
end
end