chore: Update tools.sh script to create allowed_signers file
This commit is contained in:
parent
afe462b180
commit
beee8e63e8
1 changed files with 27 additions and 2 deletions
|
@ -13,6 +13,31 @@ sudo chown -R vscode:vscode ~/.ssh
|
||||||
|
|
||||||
# Install Node.js 6.9.1
|
# Install Node.js 6.9.1
|
||||||
asdf install nodejs 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."
|
Loading…
Reference in a new issue