<commit_before>#!/bin/bash
USER=`/bin/mongo -quiet skyring --eval 'db.getUser("admin")["user"]'`
if [ $? -ne 0 ] || [ "${USER}" != 'admin' ]; then
    /bin/systemctl status mongod > /dev/null 2>&1
    if [ $? -eq 0 ]; then
	pwd=`python -c 'import json;print json.loads(open("/etc/skyring/skyring.conf").read())["dbconfig"]["password"]'`
	cmd="/bin/mongo skyring --eval 'db.createUser( { \"user\" : \"admin\", \"pwd\": \"$<PASSWORD>\", \"roles\" : [\"readWrite\", \"dbAdmin\", \"userAdmin\"] })'"
	eval $cmd
    fi
fi<commit_msg>skyring: Set auth = true post installation for mongodb<commit_after>#!/bin/bash
USER=`/bin/mongo -quiet skyring --eval 'db.getUser("admin")["user"]'`
if [ $? -ne 0 ] || [ "${USER}" != 'admin' ]; then
    /bin/systemctl status mongod > /dev/null 2>&1
    if [ $? -eq 0 ]; then
	pwd=`python -c 'import json;print json.loads(open("/etc/skyring/skyring.conf").read())["dbconfig"]["password"]'`
	cmd="/bin/mongo skyring --eval 'db.createUser( { \"user\" : \"admin\", \"pwd\": \"$<PASSWORD>\", \"roles\" : [\"readWrite\", \"dbAdmin\", \"userAdmin\"] })'"
	eval $cmd
    fi
fi
sed -i -e 's/#auth = true/auth = true/g' /etc/mongodb.conf
{'fraction_non_alphanumeric': 0.2655709342560554, 'fraction_numerical': 0.006920415224913495, 'mean_word_length': 3.5912698412698414, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 9, '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': '7436476', 'n_tokens_mistral': 448, 'n_tokens_neox': 435, 'n_words': 97}