<commit_before>#!/bin/bash
set -e

USER=${ARANGODB_USERNAME:-root}
PASS=${ARANGODB_PASSWORD:-$(pwgen -s -1 16)}
DB=${ARANGODB_DBNAME:-}

# setup user and database
echo "creating initial user, please wait ..."

(
  if [ "$USER" == "root" ];  then
    echo "require(\"org/arangodb/users\").replace(\"root\", \"$PASS\");"
  else
    echo "require(\"org/arangodb/users\").save(\"$USER\", \"$PASS\");"
    echo "require(\"org/arangodb/users\").replace(\"root\", \"$PASS\", false);"
  fi

  if [ ! -z "$DB" ]; then
    echo "db._createDatabase(\"$DB\"); db._useDatabase(\"$DB\");"

    if [ "$USER" == "root" ];  then
      echo "require(\"org/arangodb/users\").replace(\"root\", \"$PASS\");"
    else
      echo "require(\"org/arangodb/users\").save(\"$USER\", \"$PASS\");"
      echo "require(\"org/arangodb/users\").replace(\"root\", \"$PASS\", false);"
    fi
  fi
) | /usr/sbin/arangod --configuration /etc/arangodb/arangod.conf --console --log.file /tmp/arangodb.log --log.tty "" > /dev/null

echo "========================================================================"
echo "ArangoDB User: \"$USER\""
echo "ArangoDB Password: \"$<PASSWORD>\""
if [ ! -z "$DB" ]; then
    echo "ArangoDB Database: \"$DB\""
fi
echo "========================================================================"

# check for foxxes
if test -f "/foxxes/mounts.json";  then
  echo "checking for foxxes, please wait ..."

  /usr/sbin/arangod --configuration /etc/arangodb/arangod.conf --log.level error --javascript.script /scripts/install-foxxes.js
fi

touch /data/.initialized<commit_msg>more info output<commit_after>#!/bin/bash
set -e

USER=${ARANGODB_USERNAME:-root}
PASS=${ARANGODB_PASSWORD:-$(pwgen -s -1 16)}
DB=${ARANGODB_DBNAME:-}

# setup user and database
echo "creating initial user, please wait ..."

(
  if [ "$USER" == "root" ];  then
    echo "require(\"org/arangodb/users\").replace(\"root\", \"$PASS\");"
  else
    echo "require(\"org/arangodb/users\").save(\"$USER\", \"$PASS\");"
    echo "require(\"org/arangodb/users\").replace(\"root\", \"$PASS\", false);"
  fi

  if [ ! -z "$DB" ]; then
    echo "db._createDatabase(\"$DB\"); db._useDatabase(\"$DB\");"

    if [ "$USER" == "root" ];  then
      echo "require(\"org/arangodb/users\").replace(\"root\", \"$PASS\");"
    else
      echo "require(\"org/arangodb/users\").save(\"$USER\", \"$PASS\");"
      echo "require(\"org/arangodb/users\").replace(\"root\", \"$PASS\", false);"
    fi
  fi
) | /usr/sbin/arangod --configuration /etc/arangodb/arangod.conf --console --log.file /tmp/arangodb.log --log.tty "" > /dev/null

echo "========================================================================"
echo "ArangoDB User: \"$USER\""
echo "ArangoDB Password: \"$<PASSWORD>\""
if [ ! -z "$DB" ]; then
    echo "ArangoDB Database: \"$DB\""
fi
echo "========================================================================"

# check for foxxes
if test -f "/foxxes/mounts.json";  then
  echo "checking for foxxes, please wait ..."

  /usr/sbin/arangod --configuration /etc/arangodb/arangod.conf --log.level error --javascript.script /scripts/install-foxxes.js

  echo "installation has finished"
fi

touch /data/.initialized
{'fraction_non_alphanumeric': 0.30318310746927196, 'fraction_numerical': 0.0018909549322407816, 'mean_word_length': 3.626822157434402, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7621802', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1091, 'n_words': 225}