<commit_before># Implement ManagementAPI
set -e

export MANAGEMENT_API_DIR=$EASY_MAIL_DIR/ManagementAPI

mkdir $MANAGEMENT_API_DIR && cd $MANAGEMENT_API_DIR

apt-get install wget -y

wget https://github.com/runeasymail/ManagementAPI/releases/download/v0.9/ManagementAPI
chmod +x ManagementAPI

echo "
[app]
port=7080
hostname=__EASYMAIL_HOSTNAME__

[mysql]
dsn=$MYSQL_USERNAME:$MYSQL_PASSWORD@tcp($MYSQL_HOSTNAME:3306)/$MYSQL_DATABASE

[auth]
secretKey:$MANAGEMENT_API_SECRETKEY
username:$MANAGEMENT_API_USERNAME
password:$<PASSWORD>
" > config.ini


cp $CURRENT_DIR/ManagementAPI/ManagementAPI-nginx.conf $MANAGEMENT_API_DIR/ManagementAPI-nginx.conf
cp $CURRENT_DIR/ManagementAPI/renew_letsencrypt_certificate.sh $MANAGEMENT_API_DIR/renew_letsencrypt_certificate.sh

sed -i "s|# __EASY_MAIL_INCLUDE__|include $MANAGEMENT_API_DIR/ManagementAPI-nginx.conf;|g" /etc/nginx/sites-enabled/roundcube

crontab <<EOF
0 0 1 * * sh $MANAGEMENT_API_DIR/renew_letsencrypt_certificate.sh
EOF

service cron start

./ManagementAPI &
service nginx reload
 
<commit_msg>Fix Management API configs separation<commit_after># Implement ManagementAPI
set -e

export MANAGEMENT_API_DIR=$EASY_MAIL_DIR/ManagementAPI

mkdir $MANAGEMENT_API_DIR && cd $MANAGEMENT_API_DIR

apt-get install wget -y

wget https://github.com/runeasymail/ManagementAPI/releases/download/v0.9/ManagementAPI
chmod +x ManagementAPI

echo "
[app]
port=7080
hostname=__EASYMAIL_HOSTNAME__

[mysql]
dsn=$MYSQL_USERNAME:$MYSQL_PASSWORD@tcp($MYSQL_HOSTNAME:3306)/$MYSQL_DATABASE

[auth]
secretKey=$MANAGEMENT_API_SECRETKEY
username=$MANAGEMENT_API_USERNAME
password=$<PASSWORD>
" > config.ini


cp $CURRENT_DIR/ManagementAPI/ManagementAPI-nginx.conf $MANAGEMENT_API_DIR/ManagementAPI-nginx.conf
cp $CURRENT_DIR/ManagementAPI/renew_letsencrypt_certificate.sh $MANAGEMENT_API_DIR/renew_letsencrypt_certificate.sh

sed -i "s|# __EASY_MAIL_INCLUDE__|include $MANAGEMENT_API_DIR/ManagementAPI-nginx.conf;|g" /etc/nginx/sites-enabled/roundcube

crontab <<EOF
0 0 1 * * sh $MANAGEMENT_API_DIR/renew_letsencrypt_certificate.sh
EOF

service cron start

./ManagementAPI &
service nginx reload
 

{'fraction_non_alphanumeric': 0.09389671361502347, 'fraction_numerical': 0.012206572769953052, 'mean_word_length': 7.627530364372469, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '5361113', 'n_tokens_mistral': 835, 'n_tokens_neox': 820, 'n_words': 120}