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

truncate -s 0 /var/mail/app

AS_USER="sudo -u ${VAGRANT_USER}"
HOME_DIR=$(getent passwd ${VAGRANT_USER} | cut -d ':' -f6)
$AS_USER mkdir -p "${HOME_DIR}/.ssh"
$AS_USER touch "${HOME_DIR}/.ssh/authorized_keys"
chmod 700 "${HOME_DIR}/.ssh"
chmod 600 "${HOME_DIR}/.ssh/authorized_keys"

if ssh-add -L >/dev/null 2>/dev/null; then
    ssh-add -L >> ${HOME_DIR}/.ssh/authorized_keys;
fi

cat << EOF >> ${HOME_DIR}/.ssh/authorized_keys
EOF

rm -f "/var/lib/varnish/`hostname`"
ln -s /var/lib/varnish/xxxxx-dummytag-vagrant.nodes.hypernode.io/ "/var/lib/varnish/`hostname`"

rm -rf /etc/cron.d/hypernode-fpm-monitor

# Copy default nginx configs to synced nginx directory if the files don't exist
if [ -d /etc/hypernode/defaults/nginx/ ]; then
    su ${VAGRANT_USER} -c 'find /etc/hypernode/defaults/nginx -type f | xargs -I {} cp -n {} /data/web/nginx/'
fi

# Update magerun to the latest version
/usr/local/bin/n98-magerun -q self-update || true
/usr/local/bin/n98-magerun2 -q self-update || true

# Remove mysql user from cgroup limitation, as hardcoded ones during deployment of hypernode box swap all stuff out
tee /etc/cgrules.conf <<"CONFIG"
solr            memory          limited
CONFIG<commit_msg>Add app user to admin group<commit_after>#!/bin/bash
set -e

truncate -s 0 /var/mail/app

AS_USER="sudo -u ${VAGRANT_USER}"
HOME_DIR=$(getent passwd ${VAGRANT_USER} | cut -d ':' -f6)
$AS_USER mkdir -p "${HOME_DIR}/.ssh"
$AS_USER touch "${HOME_DIR}/.ssh/authorized_keys"
chmod 700 "${HOME_DIR}/.ssh"
chmod 600 "${HOME_DIR}/.ssh/authorized_keys"

if ssh-add -L >/dev/null 2>/dev/null; then
    ssh-add -L >> ${HOME_DIR}/.ssh/authorized_keys;
fi

cat << EOF >> ${HOME_DIR}/.ssh/authorized_keys
EOF

rm -f "/var/lib/varnish/`hostname`"
ln -s /var/lib/varnish/xxxxx-dummytag-vagrant.nodes.hypernode.io/ "/var/lib/varnish/`hostname`"

rm -rf /etc/cron.d/hypernode-fpm-monitor

# Copy default nginx configs to synced nginx directory if the files don't exist
if [ -d /etc/hypernode/defaults/nginx/ ]; then
    su ${VAGRANT_USER} -c 'find /etc/hypernode/defaults/nginx -type f | xargs -I {} cp -n {} /data/web/nginx/'
fi

# Update magerun to the latest version
/usr/local/bin/n98-magerun -q self-update || true
/usr/local/bin/n98-magerun2 -q self-update || true

usermod -a -G admin app

# Remove mysql user from cgroup limitation, as hardcoded ones during deployment of hypernode box swap all stuff out
tee /etc/cgrules.conf <<"CONFIG"
solr            memory          limited
CONFIG
{'fraction_non_alphanumeric': 0.15304902351534475, 'fraction_numerical': 0.011159824631327222, 'mean_word_length': 3.5306859205776173, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '2627685', 'n_tokens_mistral': 1007, 'n_tokens_neox': 956, 'n_words': 253}