<commit_before>#!/bin/sh

set -e

if [ ! -f ~/ca-bundle.crt.original ]; then
    cp /etc/pki/tls/certs/ca-bundle.crt ~/ca-bundle.crt.original
fi

cp ~/ca-bundle.crt.original /etc/pki/tls/certs/ca-bundle.crt

if [ "$(ls -A /harbor_cust_cert)" ]; then
    if grep -q "Photon" /etc/lsb-release; then
        echo "Appending trust CA to ca-bundle ..."
        for z in /harbor_cust_cert/*; do
            case ${z} in
                *.crt | *.ca | *.ca-bundle | *.pem)
                    if [ -d "$z" ]; then
                        echo "$z is dirictory, skip it ..."
                    else
                        cat $z >> /etc/pki/tls/certs/ca-bundle.crt
                        echo " $z Appended ..."
                    fi
                    ;;
                *) echo "$z is Not ca file ..." ;;
            esac
        done
        echo "CA appending is Done."
    else
        echo "Current OS is not Photon, skip appending ca bundle"
    fi
fi<commit_msg>feat(certs): install internal tls ca from /etc/harbor/ssl dir<commit_after>#!/bin/sh

set -e

if ! grep -q "Photon" /etc/lsb-release; then
    echo "Current OS is not Photon, skip appending ca bundle"
    exit 0
fi

if [ ! -f ~/ca-bundle.crt.original ]; then
    cp /etc/pki/tls/certs/ca-bundle.crt ~/ca-bundle.crt.original
fi

cp ~/ca-bundle.crt.original /etc/pki/tls/certs/ca-bundle.crt

# Install /etc/harbor/ssl/{component}/ca.crt to trust CA.
echo "Appending internal tls trust CA to ca-bundle ..."
for caFile in `find /etc/harbor/ssl -maxdepth 2 -name ca.crt`; do
    cat $caFile >> /etc/pki/tls/certs/ca-bundle.crt
    echo "Internal tls trust CA $caFile appended ..."
done
echo "Internal tls trust CA appending is Done."

if [[ -d /harbor_cust_cert && -n "$(ls -A /harbor_cust_cert)" ]]; then
    echo "Appending trust CA to ca-bundle ..."
    for z in /harbor_cust_cert/*; do
        case ${z} in
            *.crt | *.ca | *.ca-bundle | *.pem)
                if [ -d "$z" ]; then
                    echo "$z is dirictory, skip it ..."
                else
                    cat $z >> /etc/pki/tls/certs/ca-bundle.crt
                    echo " $z Appended ..."
                fi
                ;;
            *) echo "$z is Not ca file ..." ;;
        esac
    done
    echo "CA appending is Done."
fi
{'fraction_non_alphanumeric': 0.14185639229422067, 'fraction_numerical': 0.0008756567425569177, 'mean_word_length': 1.5165198237885462, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3499072', 'n_tokens_mistral': 821, 'n_tokens_neox': 770, 'n_words': 226}