chore: Update tools.sh script to create allowed_signers file

This commit is contained in:
Bill Church 2024-07-19 10:46:47 +00:00
parent afe462b180
commit beee8e63e8
No known key found for this signature in database

View file

@ -13,6 +13,31 @@ sudo chown -R vscode:vscode ~/.ssh
# Install Node.js 6.9.1
asdf install nodejs 6.9.1
asdf local nodejs 6.9.1
asdf global nodejs 6.9.1
git config --global --add safe.directory /workspaces/webssh2
git config --global --add safe.directory ${PWD}
# Get the signing key from git config
signing_key=$(git config --get user.signingkey)
if [ -z "$signing_key" ]; then
echo "No signing key found in git config."
exit 1
fi
# Get the user email from git config
user_email=$(git config --get user.email)
if [ -z "$user_email" ]; then
echo "No user email found in git config."
exit 1
fi
# Create the ~/.ssh directory if it doesn't exist
mkdir -p ~/.ssh
# Write the signing key and email to the allowed_signers file
echo "$user_email $signing_key" > ~/.ssh/allowed_signers
# Set the correct permissions for the allowed_signers file
chmod 644 ~/.ssh/allowed_signers
echo "allowed_signers file created successfully."