<commit_before>package create

const (
	decryptTLSAssetsScriptTemplate = `#!/bin/bash -e

rkt run \
	--volume=ssl,kind=host,source=/etc/kubernetes/ssl,readOnly=false \
	--mount=volume=ssl,target=/etc/kubernetes/ssl \
	--uuid-file-save=/var/run/coreos/decrypt-tls-assets.uuid \
	--volume=dns,kind=host,source=/etc/resolv.conf,readOnly=true --mount volume=dns,target=/etc/resolv.conf \
	--net=host \
	--trust-keys-from-https \
	quay.io/coreos/awscli:025a357f05242fdad6a81e8a6b520098aa65a600 --exec=/bin/bash -- \
		-ec \
		'echo decrypting tls assets
		shopt -s nullglob
		for encKey in $(find /etc/kubernetes/ssl -name "*.pem.enc"); do
			echo decrypting $encKey
			f=$(mktemp $encKey.XXXXXXXX)
			/usr/bin/aws \
				--region {{.AWS.Region}} kms decrypt \
				--ciphertext-blob fileb://$encKey \
				--output text \
				--query Plaintext \
			| base64 -d > $f
			mv -f $f ${encKey%.enc}
		done;
		echo done.'

rkt rm --uuid-file=/var/run/coreos/decrypt-tls-assets.uuid || :`

	decryptTLSAssetsServiceTemplate = `
[Unit]
Description=Decrypt TLS certificates

[Service]
Type=oneshot
ExecStart=/opt/bin/decrypt-tls-assets

[Install]
WantedBy=multi-user.target`

	userDataScriptTemplate = `#!/bin/bash

# user-data in EC2 instances has a 16KB limit.
# To circumvent this limit, we:
#
# 1. Upload the final cloudconfig to s3
# 2. Generate a "small cloudconfig" whose only task is fetching the
#    final cloudconfig from s3
# 3. Configure the instance to be able to access the s3 URI where the<commit_msg>templates: Chown /etc/kubernetes/ssl/etcd for etcd:etcd<commit_after>package create

const (
	decryptTLSAssetsScriptTemplate = `#!/bin/bash -e

rkt run \
	--volume=ssl,kind=host,source=/etc/kubernetes/ssl,readOnly=false \
	--mount=volume=ssl,target=/etc/kubernetes/ssl \
	--uuid-file-save=/var/run/coreos/decrypt-tls-assets.uuid \
	--volume=dns,kind=host,source=/etc/resolv.conf,readOnly=true --mount volume=dns,target=/etc/resolv.conf \
	--net=host \
	--trust-keys-from-https \
	quay.io/coreos/awscli:025a357f05242fdad6a81e8a6b520098aa65a600 --exec=/bin/bash -- \
		-ec \
		'echo decrypting tls assets
		shopt -s nullglob
		for encKey in $(find /etc/kubernetes/ssl -name "*.pem.enc"); do
			echo decrypting $encKey
			f=$(mktemp $encKey.XXXXXXXX)
			/usr/bin/aws \
				--region {{.AWS.Region}} kms decrypt \
				--ciphertext-blob fileb://$encKey \
				--output text \
				--query Plaintext \
			| base64 -d > $f
			mv -f $f ${encKey%.enc}
		done;
		echo done.'

rkt rm --uuid-file=/var/run/coreos/decrypt-tls-assets.uuid || :

chown -R etcd:etcd /etc/kubernetes/ssl/etcd`

	decryptTLSAssetsServiceTemplate = `
[Unit]
Description=Decrypt TLS certificates

[Service]
Type=oneshot
ExecStart=/opt/bin/decrypt-tls-assets

[Install]
WantedBy=multi-user.target`

	userDataScriptTemplate = `#!/bin/bash

# user-data in EC2 instances has a 16KB limit.
# To circumvent this limit, we:
#
# 1. Upload the final cloudconfig to s3
# 2. Generate a "small cloudconfig" whose only task is fetching the
#    final cloudconfig from s3
# 3. Configure the instance to be able to access the s3 URI where the
{'fraction_non_alphanumeric': 0.1419773095623987, 'fraction_numerical': 0.024635332252836303, 'mean_word_length': 3.478955007256894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '7528848', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1144, 'n_words': 255}