Skip to content

Commit f0ff319

Browse files
authored
Backport use TLS 1.2 to upload files to CDN using FTP (#7307)
1 parent 7768ad7 commit f0ff319

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- Fix "rescript format" with many files. https://github.com/rescript-lang/rescript-compiler/pull/7081
2525
- Fix exponential notation syntax. https://github.com/rescript-lang/rescript/pull/7174
2626
- Fix formatter handling of wildcard in pattern matching records with no fields specified. https://github.com/rescript-lang/rescript/pull/7224
27+
- Fix files that were being truncated when sent to the CDN over FTP. https://github.com/rescript-lang/rescript/pull/7307
2728

2829
#### :house: Internal
2930

playground/upload_bundle.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fi
3232
PACKAGES=("compiler-builtins" "@rescript/react" "@rescript/core")
3333

3434
echo "Uploading compiler.js file..."
35-
curl --ftp-create-dirs -T "${SCRIPT_DIR}/compiler.js" --ssl --netrc-file $NETRC_FILE ftp://${KEYCDN_SRV}/v${VERSION}/compiler.js
35+
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
3636

3737
echo "---"
3838
echo "Uploading packages cmij files..."
@@ -43,7 +43,7 @@ do
4343

4444
echo "Uploading '$SOURCE/cmij.js' to '$TARGET/cmij.js'..."
4545

46-
curl --ftp-create-dirs -T "${SOURCE}/cmij.js" --ssl --netrc-file $NETRC_FILE "${TARGET}/cmij.js"
46+
curl --ftp-create-dirs -T "${SOURCE}/cmij.js" --ssl --tls-max 1.2 --netrc-file $NETRC_FILE "${TARGET}/cmij.js"
4747
done
4848

4949
# we now upload the bundled stdlib runtime files
@@ -54,4 +54,6 @@ TARGET="ftp://${KEYCDN_SRV}/v${VERSION}/${DIR}"
5454

5555
echo "Uploading '$SOURCE/*.js' to '$TARGET/*.js'..."
5656

57-
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" \;
57+
# we use TLS 1.2 because 1.3 sometimes causes data losses (files capped at 16384B)
58+
# https://github.com/curl/curl/issues/6149#issuecomment-1618591420
59+
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" \;

0 commit comments

Comments
 (0)