<commit_before>#!/bin/sh

set -e

domain="$1"

cd /var/lib/letsencrypt

[ -s account.key ] || openssl genrsa 4096 > account.key
[ -s ${domain}.key ] || openssl genrsa 4096 > ${domain}.key
[ -s ${domain}.csr ] || openssl req -new -sha256 -key ${domain}.key -subj "/CN=${domain}" > ${domain}.csr

if ! [ -s ${domain}.crt ] || ! openssl x509 -checkend 2592000 -noout -in ${domain}.crt; then
  if [ -s ${domain.crt} ]; then
    echo "Renewing certificate for ${domain}"
  else
    echo "Creating certificate for ${domain}"
  fi

  python /usr/local/letsencrypt/acme_tiny.py --account-key account.key --csr ${domain}.csr --acme-dir /srv/.well-known/acme-challenge/ >${domain}.crt
else
  echo "We already have a certificate for ${domain} which is still valid for at least 30 days."
fi

echo "Configuring certificate for requests to https://${domain}/"
/usr/local/letsencrypt/insert-certificate.sh -h $domain -c ${domain}.crt -k ${domain}.key<commit_msg>Fix incorrect substitution.<commit_after>#!/bin/sh

set -e

domain="$1"

cd /var/lib/letsencrypt

[ -s account.key ] || openssl genrsa 4096 > account.key
[ -s ${domain}.key ] || openssl genrsa 4096 > ${domain}.key
[ -s ${domain}.csr ] || openssl req -new -sha256 -key ${domain}.key -subj "/CN=${domain}" > ${domain}.csr

if ! [ -s ${domain}.crt ] || ! openssl x509 -checkend 2592000 -noout -in ${domain}.crt; then
  if [ -s ${domain}.crt ]; then
    echo "Renewing certificate for ${domain}"
  else
    echo "Creating certificate for ${domain}"
  fi

  python /usr/local/letsencrypt/acme_tiny.py --account-key account.key --csr ${domain}.csr --acme-dir /srv/.well-known/acme-challenge/ >${domain}.crt
else
  echo "We already have a certificate for ${domain} which is still valid for at least 30 days."
fi

echo "Configuring certificate for requests to https://${domain}/"
/usr/local/letsencrypt/insert-certificate.sh -h $domain -c ${domain}.crt -k ${domain}.key
{'fraction_non_alphanumeric': 0.17452830188679244, 'fraction_numerical': 0.025157232704402517, 'mean_word_length': 3.545238095238095, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '730026', 'n_tokens_mistral': 707, 'n_tokens_neox': 659, 'n_words': 197}