Skip to content

Commit fd1e7b8

Browse files
authored
use TLS 1.2 to upload files to CDN using FTP (#7306)
1 parent 5437d14 commit fd1e7b8

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
@@ -34,6 +34,7 @@
3434
- Fix dot completion issue with React primitives. https://github.com/rescript-lang/rescript/pull/7292
3535
- Stdlib namespace for Core modules (fixes name clashes with user modules). https://github.com/rescript-lang/rescript/pull/7285
3636
- Fix runtime type check for Object in untagged variants when one variant case is `null`. https://github.com/rescript-lang/rescript/pull/7303
37+
- Fix files that were being truncated when sent to the CDN over FTP. https://github.com/rescript-lang/rescript/pull/7306
3738

3839
#### :house: Internal
3940

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")
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)