From d86660fe7e45835a0ec7b7aeb768d271fb421ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Tue, 14 Jan 2025 19:48:27 +0100 Subject: [PATCH 1/3] Update `foundryup` The newest `foundryup` now defaults to installing stable Foundry, see https://github.com/foundry-rs/foundry/pull/9585 and https://github.com/foundry-rs/foundry/releases/tag/stable Closes #92 --- entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index f3d6e65..b543c34 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -152,10 +152,10 @@ install_node() install_foundry() { if [[ -d "$TARGET" ]] && [[ -f "$TARGET/foundry.toml" ]]; then - echo "[-] Foundry target detected, installing foundry nightly" + echo "[-] Foundry target detected, installing foundry stable" - wget -q -O foundryup https://raw.githubusercontent.com/foundry-rs/foundry/7b452656f722fc560f0414db3ce24a1f2972a8b7/foundryup/foundryup - if [ ! "e7628766329e2873484d5d633c750b5019eec77ae506c11a0ef13b440cc3e7c2 foundryup" = "$(sha256sum foundryup)" ]; then + wget -q -O foundryup https://raw.githubusercontent.com/foundry-rs/foundry/41c6653e2adee0354ba6cdf7233c58294bcea3bf/foundryup/foundryup + if [ ! "a717b894d8c4d1f375f31e63c9f7835883d065c2de107c20e055caaa7ca04c60 foundryup" = "$(sha256sum foundryup)" ]; then echo "Foundry installer does not match expected checksum! exiting" exit 1 fi From c05bd1e9da00812c2c0ef479aa5fe5468c50666e Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 20 Mar 2025 10:15:11 +0100 Subject: [PATCH 2/3] move checksum to a dedicated file --- checksum | 2 ++ entrypoint.sh | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 checksum diff --git a/checksum b/checksum new file mode 100644 index 0000000..cf4f3df --- /dev/null +++ b/checksum @@ -0,0 +1,2 @@ +fabc489b39a5e9c999c7cab4d281cdbbcbad10ec2f8b9a7f7144ad701b6bfdc7 nvm-install.sh +980a7a4a7f6a453346191bbe5c03bb378a91c92b10573a86fd29ee6f4b7f5d35 foundryup diff --git a/entrypoint.sh b/entrypoint.sh index f3d6e65..6499556 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -135,7 +135,8 @@ install_node() fi wget -q -O nvm-install.sh https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh - if [ ! "fabc489b39a5e9c999c7cab4d281cdbbcbad10ec2f8b9a7f7144ad701b6bfdc7 nvm-install.sh" = "$(sha256sum nvm-install.sh)" ]; then + sha256sum -c checksum --status --strict --ignore-missing + if [[ $? -ne 0 ]]; then echo "NVM installer does not match expected checksum! exiting" exit 1 fi @@ -154,8 +155,9 @@ install_foundry() if [[ -d "$TARGET" ]] && [[ -f "$TARGET/foundry.toml" ]]; then echo "[-] Foundry target detected, installing foundry nightly" - wget -q -O foundryup https://raw.githubusercontent.com/foundry-rs/foundry/7b452656f722fc560f0414db3ce24a1f2972a8b7/foundryup/foundryup - if [ ! "e7628766329e2873484d5d633c750b5019eec77ae506c11a0ef13b440cc3e7c2 foundryup" = "$(sha256sum foundryup)" ]; then + wget -q -O foundryup https://raw.githubusercontent.com/foundry-rs/foundry/stable/foundryup/foundryup + sha256sum -c checksum --status --strict --ignore-missing + if [[ $? -ne 0 ]]; then echo "Foundry installer does not match expected checksum! exiting" exit 1 fi From 2957438dfadaaa8e42b9db5e5328ba50b421f346 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 26 Mar 2025 11:41:50 +0100 Subject: [PATCH 3/3] Refactor --- entrypoint.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2329b17..1b5df73 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -135,11 +135,11 @@ install_node() fi wget -q -O nvm-install.sh https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh - sha256sum -c checksum --status --strict --ignore-missing - if [[ $? -ne 0 ]]; then + if ! grep nvm-install.sh checksum | sha256sum --check --status --strict; then echo "NVM installer does not match expected checksum! exiting" exit 1 fi + bash nvm-install.sh rm nvm-install.sh @@ -155,9 +155,8 @@ install_foundry() if [[ -d "$TARGET" ]] && [[ -f "$TARGET/foundry.toml" ]]; then echo "[-] Foundry target detected, installing foundry stable" - wget -q -O foundryup https://raw.githubusercontent.com/foundry-rs/foundry/stable/foundryup/foundryup - sha256sum -c checksum --status --strict --ignore-missing - if [[ $? -ne 0 ]]; then + wget -q -O foundryup https://raw.githubusercontent.com/foundry-rs/foundry/871eaaa6d621c4fae67380bc8306d049ad5168b7/foundryup/foundryup + if ! grep foundryup checksum | sha256sum --check --status --strict; then echo "Foundry installer does not match expected checksum! exiting" exit 1 fi