<commit_before>#!/bin/bash
set -e

# config
SYNAPSE_BRANCH=develop
INSTALLATION_NAME=consent
SERVER_DIR=installations/$INSTALLATION_NAME
CONFIG_TEMPLATE=consent
PORT=5005
# set current directory to script directory
BASE_DIR=$(cd $(dirname $0) && pwd)

if [ -d $BASE_DIR/$SERVER_DIR ]; then
    echo "synapse is already installed"
    exit
fi

cd $BASE_DIR

mkdir -p installations/
curl https://codeload.github.com/matrix-org/synapse/zip/$SYNAPSE_BRANCH --output synapse.zip
unzip -q synapse.zip
mv synapse-$SYNAPSE_BRANCH $SERVER_DIR
cd $SERVER_DIR
virtualenv -p python3 env
source env/bin/activate

# Having been bitten by pip SSL fail too many times, I don't trust the existing pip
# to be able to --upgrade itself, so grab a new one fresh from source.
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

pip install --upgrade setuptools
pip install matrix-synapse[all]
python -m synapse.app.homeserver \
    --server-name localhost \
    --config-path homeserver.yaml \
    --generate-config \
    --report-stats=no
# apply configuration
cp -r $BASE_DIR/config-templates/$CONFIG_TEMPLATE/. ./
<commit_msg>Only install the minimum deps to pass<commit_after>#!/bin/bash
set -e

# config
SYNAPSE_BRANCH=develop
INSTALLATION_NAME=consent
SERVER_DIR=installations/$INSTALLATION_NAME
CONFIG_TEMPLATE=consent
PORT=5005
# set current directory to script directory
BASE_DIR=$(cd $(dirname $0) && pwd)

if [ -d $BASE_DIR/$SERVER_DIR ]; then
    echo "synapse is already installed"
    exit
fi

cd $BASE_DIR

mkdir -p installations/
curl https://codeload.github.com/matrix-org/synapse/zip/$SYNAPSE_BRANCH --output synapse.zip
unzip -q synapse.zip
mv synapse-$SYNAPSE_BRANCH $SERVER_DIR
cd $SERVER_DIR
virtualenv -p python3 env
source env/bin/activate

# Having been bitten by pip SSL fail too many times, I don't trust the existing pip
# to be able to --upgrade itself, so grab a new one fresh from source.
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

pip install --upgrade setuptools
pip install matrix-synapse[resources.consent]
python -m synapse.app.homeserver \
    --server-name localhost \
    --config-path homeserver.yaml \
    --generate-config \
    --report-stats=no
# apply configuration
cp -r $BASE_DIR/config-templates/$CONFIG_TEMPLATE/. ./

{'fraction_non_alphanumeric': 0.10478260869565217, 'fraction_numerical': 0.0052173913043478265, 'mean_word_length': 4.024017467248909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '465858', 'n_tokens_mistral': 811, 'n_tokens_neox': 762, 'n_words': 226}