From 2cd1e031f706b9aecb23934863818391123e1a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Tsnobiladz=C3=A9?= Date: Wed, 19 Feb 2025 10:14:19 +0100 Subject: [PATCH 1/2] use TLS 1.2 to upload files to CDN using FTP --- playground/upload_bundle.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/playground/upload_bundle.sh b/playground/upload_bundle.sh index 78ef8652c7..a468ff6781 100755 --- a/playground/upload_bundle.sh +++ b/playground/upload_bundle.sh @@ -32,7 +32,7 @@ fi PACKAGES=("compiler-builtins" "@rescript/react" "@rescript/core") echo "Uploading compiler.js file..." -curl --ftp-create-dirs -T "${SCRIPT_DIR}/compiler.js" --ssl --netrc-file $NETRC_FILE ftp://${KEYCDN_SRV}/v${VERSION}/compiler.js +curl --ftp-create-dirs -T "${SCRIPT_DIR}/compiler.js" --ssl --tls-max 1.2 --netrc-file $NETRC_FILE ftp://${KEYCDN_SRV}/v${VERSION}/compiler.js echo "---" echo "Uploading packages cmij files..." @@ -43,7 +43,7 @@ do echo "Uploading '$SOURCE/cmij.js' to '$TARGET/cmij.js'..." - curl --ftp-create-dirs -T "${SOURCE}/cmij.js" --ssl --netrc-file $NETRC_FILE "${TARGET}/cmij.js" + curl --ftp-create-dirs -T "${SOURCE}/cmij.js" --ssl --tls-max 1.2 --netrc-file $NETRC_FILE "${TARGET}/cmij.js" done # we now upload the bundled stdlib runtime files @@ -54,4 +54,6 @@ TARGET="ftp://${KEYCDN_SRV}/v${VERSION}/${DIR}" echo "Uploading '$SOURCE/*.js' to '$TARGET/*.js'..." -find "${SOURCE}" -type f -name "*.js" -exec sh -c 'curl --ftp-create-dirs --ssl --netrc-file "$0" -T "$1" "${2}/$(basename "$1")"' "$NETRC_FILE" {} "$TARGET" \; +# we use TLS 1.2 because 1.3 sometimes causes data losses (files capped at 16384B) +# https://github.com/curl/curl/issues/6149#issuecomment-1618591420 +find "${SOURCE}" -type f -name "*.js" -exec sh -c 'curl --ftp-create-dirs --ssl --tls-max 1.2 --netrc-file "$0" -T "$1" "${2}/$(basename "$1")"' "$NETRC_FILE" {} "$TARGET" \; From 28bb6149717102e35daada2e3a1d0173d15b4e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Tsnobiladz=C3=A9?= Date: Wed, 19 Feb 2025 10:21:04 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0cf85961f..6d695beeef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - Fix "rescript format" with many files. https://github.com/rescript-lang/rescript-compiler/pull/7081 - Fix exponential notation syntax. https://github.com/rescript-lang/rescript/pull/7174 - Fix formatter handling of wildcard in pattern matching records with no fields specified. https://github.com/rescript-lang/rescript/pull/7224 +- Fix files that were being truncated when sent to the CDN over FTP. https://github.com/rescript-lang/rescript/pull/7307 #### :house: Internal