<commit_before>#!/bin/bash

if [ ! -e /var/lib/ldap/.bootstrapped ]; then

    cat <<EOF

Setting SlapD Config:

ROOTPASS=${<PASSWORD>}
DOMAIN=${DOMAIN}
ORG=${ORG}

EOF

ulimit -n 1024

    cat <<EOF | debconf-set-selections
slapd slapd/internal/generated_adminpw password ${ROOTPASS}
slapd slapd/internal/adminpw password ${ROOTPASS}
slapd slapd/password2 password ${ROOT<PASSWORD>}
slapd slapd/password1 password ${ROOTPASS}
slapd slapd/domain string ${DOMAIN}
slapd shared/organization string ${ORG}
slapd slapd/dump_database_destdir string /var/backups/slapd-VERSION
slapd slapd/backend string HDB
slapd slapd/purge_database boolean true
slapd slapd/move_old_database boolean true
slapd slapd/allow_ldap_v2 boolean false
slapd slapd/no_configuration boolean false
slapd slapd/dump_database select when needed
EOF

    dpkg-reconfigure -f noninteractive slapd

    if [ -e /etc/ldap/ssl/ldap.crt ] && \
       [ -e /etc/ldap/ssl/ldap.key ] && \
       [ -e /etc/ldap/ssl/ca.crt ]; then
    
      echo "SSL Certificates Found"
    
      echo <<EOF >> /etc/ldap/slapd.conf
TLSCACertificateFile    /etc/ldap/ssl/ca.crt
TLSCertificateKeyFile   /etc/ldap/ssl/ldap.key
TLSCertificateFile      /etc/ldap/ssl/ldap.crt
EOF<commit_msg>fix formatting and add update debconf keys<commit_after>#!/bin/bash

if [ ! -e /var/lib/ldap/.bootstrapped ]; then

    cat <<- EOF

    Setting SlapD Config:
    
    ROOTPASS=${ROOT<PASSWORD>}
    DOMAIN=${DOMAIN}
    ORG=${ORG}

    EOF

    ulimit -n 1024

    cat <<- EOF | debconf-set-selections
    slapd   slapd/internal/generated_adminpw password ${ROOT<PASSWORD>}
    slapd   slapd/internal/adminpw passwod ${ROOT<PASSWORD>}
    slapd   slapd/password1 password ${<PASSWORD>}
    slapd   slapd/password2 password ${ROOT<PASSWORD>}
    slapd   slapd/domain    string  ${DOMAIN}
    slapd   shared/organization string ${ORG}
    slapd   slapd/unsafe_selfwrite_acl  note    
    slapd   slapd/invalid_config    boolean true
    slapd   slapd/no_configuration  boolean false
    slapd   slapd/purge_database    boolean true
    slapd   slapd/allow_ldap_v2 boolean false
    slapd   slapd/upgrade_slapcat_failure   error   
    slapd   slapd/password_mismatch note    
    slapd   slapd/backend   select  HDB
    slapd   slapd/dump_database select  when needed
    slapd   slapd/dump_database_destdir string  /var/backups/slapd-VERSION
    slapd   slapd/move_old_database boolean true
    EOF

    dpkg-reconfigure -f noninteractive slapd

    if [ -e /etc/ldap/ssl/ldap.crt ] && \
       [ -e /etc/ldap/ssl/ldap.key ] && \
       [ -e /etc/ldap/ssl/ca.crt ]; then
    
        echo "SSL Certificates Found"
    
        echo <<- EOF >> /etc/ldap/slapd.conf
        TLSCACertificateFile    /etc/ldap/ssl/ca.crt
        TLSCertificateKeyFile   /etc/ldap/ssl/ldap.key
        TLSCertificateFile      /etc/ldap/ssl/ldap.crt
        EOF
{'fraction_non_alphanumeric': 0.10010463899546565, 'fraction_numerical': 0.004883153121730032, 'mean_word_length': 2.8652291105121295, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3410182', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1063, 'n_words': 218}