diff --git a/.devcontainer/scripts/tools.sh b/.devcontainer/scripts/tools.sh index a75a4d3..26e1900 100644 --- a/.devcontainer/scripts/tools.sh +++ b/.devcontainer/scripts/tools.sh @@ -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 \ No newline at end of file +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." \ No newline at end of file