<commit_before>#!/bin/sh -e

# Initialise all STUNNEL_ environment variables to good defaults. STUNNEL_LOG
# can also be given, in which case it should point to the path of a log file.
# The default is to keep it empty to rely on Docker logging and keep the
# container volume to grow on disk.
export STUNNEL_CONF="/etc/stunnel/stunnel.conf"
export STUNNEL_DEBUG="${STUNNEL_DEBUG:-7}"
export STUNNEL_CLIENT="${STUNNEL_CLIENT:-no}"
export STUNNEL_CAFILE="${STUNNEL_CAFILE:-/etc/ssl/certs/ca-certificates.crt}"
export STUNNEL_KEY="${STUNNEL_KEY:-/etc/stunnel/stunnel.key}"
export STUNNEL_CRT="${STUNNEL_CRT:-/etc/stunnel/stunnel.pem}"
export STUNNEL_PSK="${STUNNEL_PSK:-}"
#export STUNNEL_LOG

if [[ -z "${STUNNEL_SERVICE}" ]] || [[ -z "${STUNNEL_ACCEPT}" ]] || [[ -z "${STUNNEL_CONNECT}" ]]; then
    echo >&2 "one or more STUNNEL_SERVICE* values missing: "
    echo >&2 "  STUNNEL_SERVICE=${STUNNEL_SERVICE}"
    echo >&2 "  STUNNEL_ACCEPT=${STUNNEL_ACCEPT}"
    echo >&2 "  STUNNEL_CONNECT=${STUNNEL_CONNECT}"
    exit 1
fi

env

if [[ ! -z "${STUNNEL_PSK}" ]] && [[ -f ${STUNNEL_PSK} ]]; then
    if [[ ! -s ${STUNNEL_CONF} ]]; then<commit_msg>Removing env spying, remain of a debugging session<commit_after>#!/bin/sh -e

# Initialise all STUNNEL_ environment variables to good defaults. STUNNEL_LOG
# can also be given, in which case it should point to the path of a log file.
# The default is to keep it empty to rely on Docker logging and keep the
# container volume to grow on disk.
export STUNNEL_CONF="/etc/stunnel/stunnel.conf"
export STUNNEL_DEBUG="${STUNNEL_DEBUG:-7}"
export STUNNEL_CLIENT="${STUNNEL_CLIENT:-no}"
export STUNNEL_CAFILE="${STUNNEL_CAFILE:-/etc/ssl/certs/ca-certificates.crt}"
export STUNNEL_KEY="${STUNNEL_KEY:-/etc/stunnel/stunnel.key}"
export STUNNEL_CRT="${STUNNEL_CRT:-/etc/stunnel/stunnel.pem}"
export STUNNEL_PSK="${STUNNEL_PSK:-}"
#export STUNNEL_LOG

if [[ -z "${STUNNEL_SERVICE}" ]] || [[ -z "${STUNNEL_ACCEPT}" ]] || [[ -z "${STUNNEL_CONNECT}" ]]; then
    echo >&2 "one or more STUNNEL_SERVICE* values missing: "
    echo >&2 "  STUNNEL_SERVICE=${STUNNEL_SERVICE}"
    echo >&2 "  STUNNEL_ACCEPT=${STUNNEL_ACCEPT}"
    echo >&2 "  STUNNEL_CONNECT=${STUNNEL_CONNECT}"
    exit 1
fi

if [[ ! -z "${STUNNEL_PSK}" ]] && [[ -f ${STUNNEL_PSK} ]]; then
    if [[ ! -s ${STUNNEL_CONF} ]]; then
{'fraction_non_alphanumeric': 0.1579173838209983, 'fraction_numerical': 0.0051635111876075735, 'mean_word_length': 4.871212121212121, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '307112', 'n_tokens_mistral': 867, 'n_tokens_neox': 930, 'n_words': 213}