Compare commits

..

No commits in common. '25b39cf525c7caae9c2421365d1edca0c9520389' and 'b23d15e4063b625022b2deeceeb92d69d92a1719' have entirely different histories.

  1. 2
      docker-compose.yml
  2. 4
      ldap.env
  3. 13
      redmine/999_config-ldap.rb
  4. 2
      redmine/Dockerfile
  5. 2
      redmine/redmine_ldap_passwd/app/models/auth_source_ldap_passwd.rb

@ -14,7 +14,6 @@ services:
REDMINE_SECRET_KEY_BASE: supersecretkey REDMINE_SECRET_KEY_BASE: supersecretkey
REDMINE_PLUGINS_MIGRATE: "true" REDMINE_PLUGINS_MIGRATE: "true"
REDMINE_LDAP: ldap REDMINE_LDAP: ldap
LDAP_BASE_DN: "dc=example,dc=org"
env_file: env_file:
- ldap.env - ldap.env
volumes: volumes:
@ -31,7 +30,6 @@ services:
restart: always restart: always
environment: environment:
MYSQL_DATABASE: redmine MYSQL_DATABASE: redmine
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
#env_file: #env_file:
# - db.env # - db.env
volumes: volumes:

@ -1,2 +1,2 @@
#LDAP_BASE_DN="o=example,c=org" LDAP_BASE_DN: "DC=example,DC=org"
LDAP_ADMIN_PASSWORD=admin LDAP_ADMIN_PASSWORD: "admin"

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

@ -1,3 +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/ ADD --chown=999:999 ./999_config-ldap.rb /usr/src/redmine/db/migrate/

@ -40,7 +40,7 @@ class AuthSourceLdapPasswd < AuthSourceLdap
def self.change_password_allowed?(user) def self.change_password_allowed?(user)
return false if user.nil? return false if user.nil?
AuthSourceLdapPasswd.name.eql?( user.auth_source .nil? ? "" : user.auth_source.type) AuthSourceLdapPasswd.name.eql?(user.auth_source.type)
end end
def self.is_password_valid(password) def self.is_password_valid(password)

Loading…
Cancel
Save