diff --git a/Dockerfile b/Dockerfile index a41440dd..fd017714 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ MAINTAINER Avi Deitcher RUN apk add --update 'mariadb-client>10.3.15' mariadb-connector-c bash python3 samba-client shadow && \ rm -rf /var/cache/apk/* && \ touch /etc/samba/smb.conf && \ - pip3 install awscli + pip3 install s3cmd # set us up to run as non-root user RUN groupadd -g 1005 appuser && \ diff --git a/entrypoint b/entrypoint index 55000640..b4a95191 100755 --- a/entrypoint +++ b/entrypoint @@ -109,8 +109,8 @@ if [[ -n "$DB_RESTORE_TARGET" ]]; then if [[ "${uri[schema]}" == "file" ]]; then cp $DB_RESTORE_TARGET $TMPRESTORE 2>/dev/null elif [[ "${uri[schema]}" == "s3" ]]; then - [[ -n "$AWS_ENDPOINT_URL" ]] && AWS_ENDPOINT_OPT="--endpoint-url $AWS_ENDPOINT_URL" - aws ${AWS_ENDPOINT_OPT} s3 cp "${DB_RESTORE_TARGET}" $TMPRESTORE + [[ -n "$AWS_ENDPOINT_URL" ]] && AWS_ENDPOINT_OPT="$AWS_ENDPOINT_OPT --host=$AWS_ENDPOINT_URL" + s3cmd ${AWS_ENDPOINT_OPT} --access_key=${AWS_ACCESS_KEY_ID} --secret_key=${AWS_SECRET_ACCESS_KEY} put "${DB_RESTORE_TARGET}" $TMPRESTORE elif [[ "${uri[schema]}" == "smb" ]]; then if [[ -n "$SMB_USER" ]]; then UPASSARG="-U" diff --git a/functions.sh b/functions.sh index 36c5db5b..dc3d356f 100644 --- a/functions.sh +++ b/functions.sh @@ -194,8 +194,8 @@ function backup_target() { ;; "s3") # allow for endpoint url override - [[ -n "$AWS_ENDPOINT_URL" ]] && AWS_ENDPOINT_OPT="--endpoint-url $AWS_ENDPOINT_URL" - aws ${AWS_ENDPOINT_OPT} s3 cp ${TMPDIR}/${SOURCE} "${DB_DUMP_TARGET}/${TARGET}" + [[ -n "$AWS_ENDPOINT_URL" ]] && AWS_ENDPOINT_OPT="$AWS_ENDPOINT_OPT --host=$AWS_ENDPOINT_URL" + s3cmd ${AWS_ENDPOINT_OPT} --access_key=${AWS_ACCESS_KEY_ID} --secret_key=${AWS_SECRET_ACCESS_KEY} put ${TMPDIR}/${SOURCE} "${DB_DUMP_TARGET}/${TARGET}" ;; "smb") if [[ -n "$SMB_USER" ]]; then