Skip to content

Commit 80086d5

Browse files
committed
fix: add error handling and mitigate SSH key exposure risk
1 parent 79af1ea commit 80086d5

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

apps/web/next.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const nextConfig = {
1919
experimental: {
2020
optimizePackageImports: ['lucide-react', '@heroicons/react'],
2121
},
22-
swcMinify: true,
2322
};
2423

2524
module.exports = nextConfig;

apps/web/scripts/init-submodules.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/bin/bash
22
# initialize git submodules during vercel build
33

4+
set -e # Exit immediately on any error
5+
46
# setup ssh for private submodule
57
if [ -n "$GIT_SSH_KEY" ]; then
6-
mkdir -p ~/.ssh
7-
echo "$GIT_SSH_KEY" > ~/.ssh/id_ed25519
8-
chmod 600 ~/.ssh/id_ed25519
9-
ssh-keyscan github.com >> ~/.ssh/known_hosts
8+
mkdir -p ~/.ssh || { echo "Failed to create ~/.ssh directory" >&2; exit 1; }
9+
printf '%s' "$GIT_SSH_KEY" > ~/.ssh/id_ed25519 || { echo "Failed to write SSH key" >&2; exit 1; }
10+
chmod 600 ~/.ssh/id_ed25519 || { echo "Failed to set SSH key permissions" >&2; exit 1; }
11+
ssh-keyscan -t ed25519 github.com >> ~/.ssh/known_hosts 2>/dev/null || true
1012
fi
1113

1214
# initialize and update submodules

0 commit comments

Comments
 (0)