<commit_before>#!/bin/bash

/etc/init.d/cron start
# Make sure time for /import/ to be mounted
sleep 3
CONF_FILE="/import/conf.yaml"
# Add the user

if [ ! -e "${CONF_FILE}" ];
then
    echo "Cannot have a missing conf file";
    exit 1;
fi
USERNAME=$(grep 'notebook_username' ${CONF_FILE} | sed 's/notebook_username: //g')
PASSWORD=$(grep '<PASSWORD>' ${CONF_FILE} | sed 's/notebook_password: //g')
DOCKER_PORT=$(grep 'docker_port' ${CONF_FILE} | sed 's/docker_port: //g')
# Req latest conf.yaml spec
CORS_ORIGIN=$(grep 'cors_origin' ${CONF_FILE} | sed 's/cors_origin: //g')

sed -i "s/ '\*'; # IE_CORS_ORIGIN/ '${CORS_ORIGIN}';/" /proxy.conf;
sed -i "s/ 80; # IE_DOCKER_PORT/ ${DOCKER_PORT};/" /proxy.conf;
cp /proxy.conf /etc/nginx/sites-enabled/default
# Create user
useradd -p `openssl passwd -1 $PASSWORD` $USERNAME -d /import/
# Chown import as that user so they can write there
chown $USERNAME:$USERNAME /import/ -R
# Start the servers
service rstudio-server start
service nginx restart
sleep 1
curl localhost:8787/auth-public-key > /import/rserver_pub_key
chmod 777 /import/ -R<commit_msg>Substitution was failing due to slashes in URL from cors_origin<commit_after>#!/bin/bash

/etc/init.d/cron start
# Make sure time for /import/ to be mounted
sleep 3
CONF_FILE="/import/conf.yaml"
# Add the user

if [ ! -e "${CONF_FILE}" ];
then
    echo "Cannot have a missing conf file";
    exit 1;
fi
USERNAME=$(grep 'notebook_username' ${CONF_FILE} | sed 's/notebook_username: //g')
PASSWORD=$(grep '<PASSWORD>' ${CONF_FILE} | sed 's/notebook_password: //g')
DOCKER_PORT=$(grep 'docker_port' ${CONF_FILE} | sed 's/docker_port: //g')
# Req latest conf.yaml spec
CORS_ORIGIN=$(grep 'cors_origin' ${CONF_FILE} | sed 's/cors_origin: //g')

sed -i "s| '\*'; # IE_CORS_ORIGIN| '${CORS_ORIGIN}';|" /proxy.conf;
sed -i "s/ 80; # IE_DOCKER_PORT/ ${DOCKER_PORT};/" /proxy.conf;
cp /proxy.conf /etc/nginx/sites-enabled/default
# Create user
useradd -p `openssl passwd -1 $PASSWORD` $USERNAME -d /import/
# Chown import as that user so they can write there
chown $USERNAME:$USERNAME /import/ -R
# Start the servers
service rstudio-server start
service nginx restart
sleep 1
curl localhost:8787/auth-public-key > /import/rserver_pub_key
chmod 777 /import/ -R
{'fraction_non_alphanumeric': 0.1558325912733749, 'fraction_numerical': 0.01157613535173642, 'mean_word_length': 4.33729216152019, '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': '1110135', 'n_tokens_mistral': 881, 'n_tokens_neox': 839, 'n_words': 246}