<commit_before>#!/bin/bash

set -ex

npx sequelize-cli db:migrate \
    --url="${DB_DIALECT:-mysql}://${DB_USERNAME:-fedlearner}:${DB_PASSWORD:-<PASSWORD>}@${DB_HOST:-127.0.0.1}:${DB_PORT:-3306}/${DB_DATABASE:-fedlearner}"

node bootstrap.js &

while true; do sleep 1000; done<commit_msg>Escape DB password for webconsole V1 (#807)<commit_after>#!/bin/bash

set -ex

urlencode() {
    # urlencode <string>

    old_lc_collate=$LC_COLLATE
    LC_COLLATE=C

    local length="${#1}"
    for (( i = 0; i < length; i++ )); do
        local c="${1:$i:1}"
        case $c in
            [a-zA-Z0-9.~_-]) printf '%s' "$c" ;;
            *) printf '%%%02X' "'$c" ;;
        esac
    done

    LC_COLLATE=$old_lc_collate
}

ENCODE_DB_PASSWORD=`urlencode ${DB_PASSWORD:-<PASSWORD>}`

npx sequelize-cli db:migrate \
    --url="${DB_DIALECT:-mysql}://${DB_USERNAME:-fedlearner}:${ENCODE_DB_PASSWORD}@${DB_HOST:-127.0.0.1}:${DB_PORT:-3306}/${DB_DATABASE:-fedlearner}"

node bootstrap.js &

while true; do sleep 1000; done
{'fraction_non_alphanumeric': 0.2013888888888889, 'fraction_numerical': 0.03968253968253968, 'mean_word_length': 3.545045045045045, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4702707', 'n_tokens_mistral': 443, 'n_tokens_neox': 406, 'n_words': 66}