2022-08-23 04:14:06 -05:00
|
|
|
#!/usr/bin/env bash
|
2021-04-04 15:09:16 -05:00
|
|
|
|
2022-09-10 17:06:55 -05:00
|
|
|
set -euo pipefail
|
|
|
|
IFS=$'\n\t'
|
|
|
|
|
2023-10-24 13:31:25 -05:00
|
|
|
cat << NETRC > ~/.netrc
|
|
|
|
machine $(echo $PUBLISH_HOSTPORT | cut -d ':' -f 1)
|
|
|
|
login $PUBLISH_USERNAME
|
|
|
|
password $PUBLISH_PASSWORD
|
|
|
|
NETRC
|
|
|
|
chmod 660 ~/.netrc
|
|
|
|
|
2023-08-21 16:24:22 -05:00
|
|
|
mountpoint=ftpmnt
|
|
|
|
mkdir $mountpoint
|
2023-10-24 13:31:25 -05:00
|
|
|
curlftpfs "$PUBLISH_HOSTPORT" $mountpoint -o ssl,ciphers='ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-GCM-SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:TLS_AES_128_CCM_8_SHA256:TLS_AES_128_CCM_SHA256'
|
2024-04-14 13:34:25 -05:00
|
|
|
if [[ -z ${PUBLISH_ACCESSCHECK-} ]]; then
|
|
|
|
cp $PUBLISH_FILENAME $mountpoint/${PUBLISH_DIRECTORY:-.}/
|
|
|
|
fi
|
2023-08-21 16:24:22 -05:00
|
|
|
fusermount -u $mountpoint
|
|
|
|
rmdir $mountpoint
|