<commit_before>#!/bin/sh

#Add Mongo password
echo "db = db.getSiblingDB('uptime');db.addUser('root','${1}')" > init-mongo.js
mongo ${MONGODB_PORT_28017_TCP_ADDR} init-mongo.js

sed "s/MONGO_SERVER/${MONGODB_PORT_27017_TCP_ADDR}/g" config/config_template.yaml | sed "s/MONGO_PASSWORD/${1}/g" > config/default.yaml
nodejs app<commit_msg>Adding support for custom config and custom init script<commit_after>#!/bin/sh

# Copy custom config
if [ -d /tmp/uptime/config ];
then
	echo "Copying custom config"
	rm -rf /opt/uptime/config
	cp /tmp/uptime/config /opt/uptime/config	
fi

# Add Mongo password
echo "db = db.getSiblingDB('uptime');db.addUser('root','${1}')" > init-mongo.js
mongo ${MONGODB_PORT_28017_TCP_ADDR} init-mongo.js

sed "s/MONGO_SERVER/${MONGODB_PORT_27017_TCP_ADDR}/g" config/config_template.yaml | sed "s/MONGO_PASSWORD/${1}/g" > config/default.yaml


# Run custom initilization script if it exists
if [ -f /tmp/uptime/init-uptime.sh ];
then
   echo "Running /tmp/uptime/init-uptime.sh"
   chmod +x /tmp/uptime/init-uptime.sh
   /tmp/uptime/init-uptime.sh
fi

nodejs app
{'fraction_non_alphanumeric': 0.15115207373271888, 'fraction_numerical': 0.022119815668202765, 'mean_word_length': 4.746031746031746, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4762272', 'n_tokens_mistral': 450, 'n_tokens_neox': 432, 'n_words': 82}