How do I configure Subversion Edge to use LDAP Groups for authentication?

Solution 1:

Download https://bitbucket.org/whitlockjc/jw-tools.

Create an executable script like the following (substitute in your directories and LDAP configuration):

#!/bin/bash

CSVN_DIR=/home/csvn
JW_TOOLS_DIR=/home/csvn/jw-tools

# truncate the access file after the generated-content tag
perl -0777 -pe 's/\n\n\n### Start generated content.*//s' \
    < $CSVN_DIR/data/conf/svn_access_file \
    > $CSVN_DIR/data/conf/svn_access_file.tmp

# append the latest LDAP group configuration
$JW_TOOLS_DIR/sync_ldap_groups_to_svn_authz/sync_ldap_groups_to_svn_authz.py \
    --url="..." \
    --bind-dn="..." --bind-password="..." \
    --base-dn="..." \
    --group-query="objectClass=posixGroup" \
    --group-member-attribute="memberUid" \
    --user-query="objectClass=posixAccount" \
    --userid_attribute="uid" \
    --quiet \
    | grep -v '^\[groups\]' \
    >> $CSVN_DIR/data/conf/svn_access_file.tmp

mv -f $CSVN_DIR/data/conf/svn_access_file.tmp $CSVN_DIR/data/conf/svn_access_file

Run the script periodically from cron:

0 * * * * ~/update-ldap-groups