feat(configs): create iso file instead of json

This commit is contained in:
Adrien Langou 2023-07-24 17:55:22 +02:00 committed by Pierre-Olivier Mercier
parent a431b75e69
commit a5699b6cce

View File

@ -10,13 +10,13 @@ escape_newline () {
export VAULT_ADDR="${VAULT_ADDR:-"https://vault.srs.epita.fr:443"}"
SSH_PATH="${SSH_PATH:-/tmp/fic_ssh}"
DHPARAM_PATH="${DHPARAM_PATH:-/tmp/dhparam.pem}"
OUTPUT_PATH="${OUTPUT_PATH:-/tmp/metadata.json}"
OUTPUT_PATH="${OUTPUT_PATH:-"$(mktemp -d)"}"
vault login -method=oidc -no-print 2> /dev/null
export DM_CRYPT="$(tr -d -c "a-zA-Z0-9" < /dev/urandom | fold -w512 | head -n 1)"
export CERT_PEM="$(vault kv get --field=cert.pem fic/cert/fic.srs.epita.fr | escape_newline)"
export CHAIN_PEM="$(vault kv get --field=chain.pem fic/cert/fic.srs.epita.fr | espace_newline)"
export CHAIN_PEM="$(vault kv get --field=chain.pem fic/cert/fic.srs.epita.fr | escape_newline)"
export FULLCHAIN_PEM="$(vault kv get --field=fullchain.pem fic/cert/fic.srs.epita.fr | escape_newline)"
export PRIVKEY_PEM="$(vault kv get --field=privkey.pem fic/cert/fic.srs.epita.fr | escape_newline)"
@ -87,6 +87,8 @@ TEMPLATE='
}
}'
echo "$TEMPLATE" | envsubst > "$OUTPUT_PATH"
echo "$TEMPLATE" | envsubst > "$OUTPUT_PATH"/user-data
echo "Result in $OUTPUT_PATH"
echo -e "Result in $OUTPUT_PATH\nGenerating iso"
mkisofs -joliet-long -V CIDATA -o fickit-metadata.iso "${OUTPUT_PATH}"