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

# Set environment variables
SSH_HOST_KEY_FILE=${SSH_HOST_KEY_FILE:-/etc/ssh/ssh_host_rsa_key}

# Generate an SSH key if none is present
if ! [ -f "${SSH_HOST_KEY_FILE}" ]; then
  ssh-keygen -t rsa -b 4096 -f "${SSH_HOST_KEY_FILE}" -N '' -C ''
fi

command="/usr/sbin/sshd -D"
if [ "${SSH_DEBUG_LEVEL}" = "1" ]; then
  command="$command -d -e"
fi
if [ "${SSH_DEBUG_LEVEL}" = "2" ]; then
  command="$command -d -d -e"
fi
if [ "${SSH_DEBUG_LEVEL}" = "3" ]; then
  command="$command -d -d -d -e"
fi
command="$command -h ${SSH_HOST_KEY_FILE}"

$command
<commit_msg>Added configurable ssh authorized key file<commit_after>#! /bin/bash
set -e

# Set environment variables
SSH_HOST_KEY_FILE=${SSH_HOST_KEY_FILE:-/etc/ssh/ssh_host_rsa_key}
SSH_AUTHORIZED_KEYS_FILE=${SSH_AUTHORIZED_KEYS_FILE:-/root/.ssh/authorized_keys}

# Generate an SSH key if none is present
if ! [ -f "${SSH_HOST_KEY_FILE}" ]; then
  ssh-keygen -t rsa -b 4096 -f "${SSH_HOST_KEY_FILE}" -N '' -C ''
fi

# Create a symlink to the authorized keys file if not the DEFAULT_SSH_PORT
if [ -f "${SSH_AUTHORIZED_KEYS_FILE}" ] && [ "${SSH_AUTHORIZED_KEYS_FILE}" != "/root/.ssh/authorized_keys" ]; then
  rm -f "/root/.ssh/authorized_keys"
  ln -fs "${SSH_AUTHORIZED_KEYS_FILE}" "/root/.ssh/authorized_keys"
fi

command="/usr/sbin/sshd -D"
if [ "${SSH_DEBUG_LEVEL}" = "1" ]; then
  command="$command -d -e"
fi
if [ "${SSH_DEBUG_LEVEL}" = "2" ]; then
  command="$command -d -d -e"
fi
if [ "${SSH_DEBUG_LEVEL}" = "3" ]; then
  command="$command -d -d -d -e"
fi
command="$command -h ${SSH_HOST_KEY_FILE}"

$command

{'fraction_non_alphanumeric': 0.17761100687929957, 'fraction_numerical': 0.008755472170106316, 'mean_word_length': 4.2805280528052805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7420715', 'n_tokens_mistral': 676, 'n_tokens_neox': 652, 'n_words': 158}