<commit_before>#!/usr/bin/env bash

set -e

if [ ! -e /root/.config/quasar/quasar-config.json ]; then

    echo >&2 'info: create quasar-config.json'

    PORT="${PORT-8080}"
    CONNECTION_NAME="${CONNECTION_NAME-MongoDB}"
    CONNECTION_URI="${CONNECTION_URI-mongodb://mongodb:27017}"

    echo "
    {
      \"server\": {
        \"port\": $PORT
      },
      \"mountings\": {
        \"/$CONNECTION_NAME/\": {
          \"mongodb\": {
            \"connectionUri\": \"$CONNECTION_URI\"
          }
        }
      }
    }
    " >> /root/.config/quasar/quasar-config.json
fi

java -jar /slamdata/quasar.jar --content-path /slamdata/public<commit_msg>Allow JAVA_OPTIONS and SD_OPTIONS to be picked up from environment variables<commit_after>#!/usr/bin/env bash

set -e

if [ ! -e /root/.config/quasar/quasar-config.json ]; then

    echo >&2 'info: create quasar-config.json'

    PORT="${PORT-8080}"
    CONNECTION_NAME="${CONNECTION_NAME-MongoDB}"
    CONNECTION_URI="${CONNECTION_URI-mongodb://mongodb:27017}"

    echo "
    {
      \"server\": {
        \"port\": $PORT
      },
      \"mountings\": {
        \"/$CONNECTION_NAME/\": {
          \"mongodb\": {
            \"connectionUri\": \"$CONNECTION_URI\"
          }
        }
      }
    }
    " >> /root/.config/quasar/quasar-config.json
fi



export _JAVA_OPTIONS="${JAVA_OPTIONS:="-Xms1G -Xmx4G"} $SD_OPTS"

java -jar /slamdata/quasar.jar --content-path /slamdata/public
{'fraction_non_alphanumeric': 0.17998610145934676, 'fraction_numerical': 0.015288394718554551, 'mean_word_length': 2.185840707964602, 'pattern_counts': {'":': 12, '<': 3, '<?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': '5148073', 'n_tokens_mistral': 546, 'n_tokens_neox': 506, 'n_words': 77}