tainewoo / redmine_ldap_sync

A redmine plugin to synchronize both users and groups with an ldap server, forked from thorin which is unmaintained.
http://www.redmine.org/plugins/redmine_ldap_sync
GNU General Public License v3.0
17 stars 13 forks source link

Redmine LDAP Sync --- forked from https://github.com/thorin/redmine_ldap_sync, which is unmaintained. This maintained version is tested working fine with Redmine4.x/Ruby2.6.x/Rails5.2.x Issues and PRs are welcome. Redmine site: http://www.redmine.org/plugins/redmine_ldap_sync

Original readme:

This redmine plugin extends the ldap authentication with user/group synchronization.

Features:

Remarks:

Installation & Upgrade

Install/Upgrade

  1. install. - Copy your plugin directory into #{RAILS_ROOT}/plugins. If you are downloading the plugin directly from GitHub, you can do so by changing into the #{RAILS_ROOT}/plugins directory and issuing the command:

    git clone git://github.com/tainewoo/redmine_ldap_sync.git

    upgrade - Backup and replace the old plugin directory with the new plugin files. If you are downloading the plugin directly from GitHub, you can do so by changing into the plugin directory and issuing the command git pull.

  2. Update the ruby gems by changing into the redmine's directory and run the following command.

    bundle install
  3. upgrade - Still on the redmine's directory, run the following command to upgrade your database (make a db backup before).

    rake redmine:plugins:migrate RAILS_ENV=production
  4. Change into redmine's directory #{RAILS_ROOT} and run the following command.

    rake -T redmine:plugins:ldap_sync RAILS_ENV=production

    If the installation/upgrade was successful you should now see the list of Rake Tasks.

  5. Restart Redmine.

You should now be able to see Redmine LDAP Sync listed among the plugins in Administration -> Plugins.

Uninstall

  1. Change into redmine's directory #{RAILS_ROOT} and run the following command to downgrade the database (make a db backup before):

    rake redmine:plugins:migrate NAME=redmine_ldap_sync VERSION=0 RAILS_ENV=production
  2. Remove the plugin from the plugins folder: #{RAILS_ROOT}/plugins

  3. Restart Redmine.

Usage

Configuration

Open Administration > Ldap Synchronization to access the plugin configuration:

LDAP settings:

LDAP attributes:

Synchronization actions:

Rake tasks

The following tasks are available:

# rake -T redmine:plugins:ldap_sync
rake redmine:plugins:ldap_sync:sync_all     # Synchronize both redmine's users and groups with LDAP
rake redmine:plugins:ldap_sync:sync_groups  # Synchronize redmine's groups fields with those on LDAP
rake redmine:plugins:ldap_sync:sync_users   # Synchronize redmine's users fields and groups with those on LDAP

This tasks can be used to do periodic synchronization. For example:

# Synchronize users with ldap @ every 60 minutes
35 * * * *   www-data /usr/bin/rake -f /opt/redmine/Rakefile --silent redmine:plugins:ldap_sync:sync_users RAILS_ENV=production 2>&- 1>&-

The tasks recognize three environment variables:

Base settings

All the base settings are loaded from the plain YAML file config/base_settings.yml. Please be aware that those settings weren't tested and may not work. Saying so, I'll need your help to make these settings more accurate.

License

This plugin is released under the GPL v3 license. See LICENSE for more information.

Unmaintained

I created this plugin to solve a need we had on my previous job. Things changed and now I no longer have the time or the need necessary to maintain it. Sorry for this. Please consider forking or using one of the existing forks. In a best scenario, an official fork might already exist.


  1. For details about dynamic groups see OpenLDAP Overlays - Dynamic Lists or slapo-dynlist(5) - Linux man page.
  2. Searching for an user's dynamic groups is an costly task. To easy it up, a cache is used to store the relationship between dynamic groups and users. When running the rake task this cache will be refreshed.