Merge pull request #4 from servusoft/master

add verify SSL option
This commit is contained in:
Christoph Schlosser 2018-02-13 06:47:17 +01:00 committed by GitHub
commit 9bc82515ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -44,7 +44,8 @@ pipeline:
image: cschlosser/drone-ftps image: cschlosser/drone-ftps
hostname: example.com:21 hostname: example.com:21
secrets: [ ftp_username, ftp_password ] secrets: [ ftp_username, ftp_password ]
secure: true secure: true (default) | false # true = use FTP(S), false = FTP without SSL
verify: true (default) | false # true = strong SSL verification, false = supress SSL verification error
dest_dir: /var/www/mysite dest_dir: /var/www/mysite
src_dir: /mysite/static src_dir: /mysite/static
exclude: exclude:

View File

@ -14,6 +14,10 @@ if [ -z "$PLUGIN_SECURE" ]; then
PLUGIN_SECURE="true" PLUGIN_SECURE="true"
fi fi
if [ -z "$PLUGIN_VERIFY" ]; then
PLUGIN_VERIFY="true"
fi
if [ -z "$PLUGIN_DEST_DIR" ]; then if [ -z "$PLUGIN_DEST_DIR" ]; then
PLUGIN_DEST_DIR="/" PLUGIN_DEST_DIR="/"
fi fi
@ -34,4 +38,11 @@ for i in "${in_arr[@]}"; do
PLUGIN_INCLUDE_STR="$PLUGIN_INCLUDE_STR -x $i" PLUGIN_INCLUDE_STR="$PLUGIN_INCLUDE_STR -x $i"
done done
lftp -e "set xfer:log 1; set ftp:ssl-force $PLUGIN_SECURE; set ftp:ssl-protect-data $PLUGIN_SECURE; set ftp:ssl-allow $PLUGIN_SECURE; mirror -R $PLUGIN_INCLUDE_STR $PLUGIN_EXCLUDE_STR $(pwd)$PLUGIN_SRC_DIR $PLUGIN_DEST_DIR" -u $FTP_USERNAME,$FTP_PASSWORD $PLUGIN_HOSTNAME lftp -e "set xfer:log 1; \
set ftp:ssl-allow $PLUGIN_SECURE; \
set ftp:ssl-force $PLUGIN_SECURE; \
set ftp:ssl-protect-data $PLUGIN_SECURE; \
set ssl:verify-certificate $PLUGIN_VERIFY; \
set ssl:check-hostname $PLUGIN_VERIFY; \
mirror --verbose -R $PLUGIN_INCLUDE_STR $PLUGIN_EXCLUDE_STR $(pwd)$PLUGIN_SRC_DIR $PLUGIN_DEST_DIR" \
-u $FTP_USERNAME,$FTP_PASSWORD $PLUGIN_HOSTNAME