parent
0cab2eebd8
commit
b23d15e406
@ -0,0 +1,2 @@ |
|||||||
|
LDAP_BASE_DN: "DC=example,DC=org" |
||||||
|
LDAP_ADMIN_PASSWORD: "admin" |
@ -0,0 +1,65 @@ |
|||||||
|
# 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 AuthSource < 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 = AuthSource.new |
||||||
|
|
||||||
|
auth.name = "ldap" |
||||||
|
auth.host = ENV["REDMINE_LDAP"] |
||||||
|
auth.port = 389 |
||||||
|
auth.account = "admin" |
||||||
|
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.save |
||||||
|
|
||||||
|
end |
||||||
|
|
||||||
|
end |
@ -1,2 +1,3 @@ |
|||||||
FROM redmine:latest |
FROM redmine:latest |
||||||
ADD --chown=999:999 ./redmine_ldap_passwd/ /usr/src/redmine/plugins/redmine_ldap_passwd/ |
ADD --chown=999:999 ./redmine_ldap_passwd/ /usr/src/redmine/plugins/redmine_ldap_passwd/ |
||||||
|
ADD --chown=999:999 ./999_config-ldap.rb /usr/src/redmine/db/migrate/ |
Loading…
Reference in new issue