<commit_before>#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WEB_DIR=$SCRIPT_DIR/..
GIT_DIR=$WEB_DIR/../..
LOG_DIR=/var/log/bitquant
cd $SCRIPT_DIR

mkdir -p $LOG_DIR
chmod a+w $LOG_DIR

if [ -e /usr/share/bitquant/bitquant.sh ] ; then
   source /usr/share/bitquant/bitquant.sh
   echo "Bitstation - build $build_date $commit_id"
fi
echo "Start redis"
sudo -u redis /usr/bin/redis-server /etc/redis.conf &
echo "Start mongo"
chown -R mongod:mongod /var/lib/mongodb
sudo -u mongod /usr/bin/mongod --quiet -f /etc/mongod.conf &
echo "Starting httpd"
if [ -z "${AUTH_NAME}" ] ; then
    if [ ! -z "${INSTANCE_NAME}" ] ; then
       export AUTH_NAME=${INSTANCE_NAME}
    else
       export AUTH_NAME="PAM Authentication"
    fi
fi

if [ ! -z "${INSTANCE_NAME}" ] ; then
    export PS1="${INSTANCE_NAME}\\$ "
fi

/usr/sbin/httpd -DFOREGROUND &
if [ -f /etc/webmin/start ] ; then
    echo "Start webmin"
    /etc/webmin/start
elif [ -f /usr/share/webmin/postinstall.sh ] ; then
    echo "Installing webmin"
    /usr/share/webmin/postinstall.sh
    sed -i -e 's!ssl=1!ssl=0!' /etc/webmin/miniserv.conf
    cat <<EOF > /etc/webmin/miniserv.users
user:x:0
EOF
    cat <<EOF >> /etc/webmin/config
webprefix=/webmin<commit_msg>mkdir log for dokuwiki<commit_after>#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WEB_DIR=$SCRIPT_DIR/..
GIT_DIR=$WEB_DIR/../..
LOG_DIR=/var/log/bitquant
cd $SCRIPT_DIR

mkdir -p $LOG_DIR
chmod a+w $LOG_DIR

if [ -e /usr/share/bitquant/bitquant.sh ] ; then
   source /usr/share/bitquant/bitquant.sh
   echo "Bitstation - build $build_date $commit_id"
fi
echo "Start redis"
sudo -u redis /usr/bin/redis-server /etc/redis.conf &
echo "Start mongo"
chown -R mongod:mongod /var/lib/mongodb
sudo -u mongod /usr/bin/mongod --quiet -f /etc/mongod.conf &
echo "Starting httpd"
if [ -z "${AUTH_NAME}" ] ; then
    if [ ! -z "${INSTANCE_NAME}" ] ; then
       export AUTH_NAME=${INSTANCE_NAME}
    else
       export AUTH_NAME="PAM Authentication"
    fi
fi

if [ ! -z "${INSTANCE_NAME}" ] ; then
    export PS1="${INSTANCE_NAME}\\$ "
fi

if [ ! -d /var/lib/dokuwiki/log ] ; then
    mkdir -p /var/lib/dokuwiki/log
    chown apache:apache /var/lib/dokuwiki/log
fi

/usr/sbin/httpd -DFOREGROUND &
if [ -f /etc/webmin/start ] ; then
    echo "Start webmin"
    /etc/webmin/start
elif [ -f /usr/share/webmin/postinstall.sh ] ; then
    echo "Installing webmin"
    /usr/share/webmin/postinstall.sh
    sed -i -e 's!ssl=1!ssl=0!' /etc/webmin/miniserv.conf
    cat <<EOF > /etc/webmin/miniserv.users
user:x:0
EOF
    cat <<EOF >> /etc/webmin/config
webprefix=/webmin
{'fraction_non_alphanumeric': 0.1657142857142857, 'fraction_numerical': 0.0038095238095238095, 'mean_word_length': 3.1289308176100628, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2255191', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1049, 'n_words': 231}