<commit_before>#!/bin/bash

REMOTE_SERVER="10.32.213.65"
REMOTE_LOCATION="/home/ankurjain.v/visual-tail"
LOCAL_LOCATION="/Users/ankurjain.v/Downloads"
RELEASE_FILE="release_1.0.0.tar.gz"
DGREP_API="http://10.47.5.141/query"

ssh -t $REMOTE_SERVER "sudo apt-get install nginx; rm -rf ${REMOTE_LOCATION}; mkdir ${REMOTE_LOCATION}"
scp "${LOCAL_LOCATION}/${RELEASE_FILE}" $REMOTE_SERVER:$REMOTE_LOCATION
ssh -t $REMOTE_SERVER "cd ${REMOTE_LOCATION}; tar -xvzf ${RELEASE_FILE}; rm -rf ${RELEASE_FILE}"

cat > ${LOCAL_LOCATION}/config.js <<EOL
var config = {
  logsApi: "/dgrep"
}
EOL

scp "${LOCAL_LOCATION}/config.js" $REMOTE_SERVER:$REMOTE_LOCATION/dist/js

cat > ${LOCAL_LOCATION}/vt.conf <<EOL
server {
  server_name localhost;
  listen 80;
  root ${REMOTE_LOCATION};
  location /dgrep {
    proxy_pass ${DGREP_API};
    proxy_pass_request_headers on;
  }<commit_msg>removed nginx proxy to dgrep since it supports cors now<commit_after>#!/bin/bash

REMOTE_SERVER="10.32.213.65"
REMOTE_LOCATION="/home/ankurjain.v/visual-tail"
LOCAL_LOCATION="/Users/ankurjain.v/Downloads"
RELEASE_FILE="release_1.0.0.tar.gz"
DGREP_API="http://10.47.5.141/query"

ssh -t $REMOTE_SERVER "sudo apt-get install nginx; rm -rf ${REMOTE_LOCATION}; mkdir ${REMOTE_LOCATION}"
scp "${LOCAL_LOCATION}/${RELEASE_FILE}" $REMOTE_SERVER:$REMOTE_LOCATION
ssh -t $REMOTE_SERVER "cd ${REMOTE_LOCATION}; tar -xvzf ${RELEASE_FILE}; rm -rf ${RELEASE_FILE}"

cat > ${LOCAL_LOCATION}/config.js <<EOL
var config = {
  logsApi: "${DGREP_API}"
}
EOL

scp "${LOCAL_LOCATION}/config.js" $REMOTE_SERVER:$REMOTE_LOCATION/dist/js

cat > ${LOCAL_LOCATION}/vt.conf <<EOL
server {
  server_name localhost;
  listen 80;
  root ${REMOTE_LOCATION};
{'fraction_non_alphanumeric': 0.15938606847697756, 'fraction_numerical': 0.025974025974025976, 'mean_word_length': 5.726190476190476, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7414999', 'n_tokens_mistral': 769, 'n_tokens_neox': 663, 'n_words': 121}