From 198bf8c4407566137b55cf84255989bc75191606 Mon Sep 17 00:00:00 2001 From: kannibalox Date: Sat, 18 Mar 2023 11:28:59 -0400 Subject: [PATCH] Add small utility for archiver.py --- Dockerfile | 3 ++- resources/archiver.sh | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 resources/archiver.sh diff --git a/Dockerfile b/Dockerfile index 906e8d1..17a712d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,7 @@ FROM base as final ENV PATH="/venv/bin:${PATH}" ENV VIRTUAL_ENV="/venv" -RUN bash -c 'echo -e "[Main]\nbaseURL=https://passthepopcorn.me/" > ~/.ptpapi.conf' +RUN bash -c 'echo -e "[Main]\nbaseURL=https://passthepopcorn.me/\ndownloadDirectory=/data/" > ~/.ptpapi.conf' +COPY ./resources/archiver.sh /usr/local/bin/ COPY --from=builder /venv /venv diff --git a/resources/archiver.sh b/resources/archiver.sh new file mode 100755 index 0000000..fe12b57 --- /dev/null +++ b/resources/archiver.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -eu +install_file="/data/archiver.py" +if [[ ! -d "/data/" ]]; then + mkdir /data/ +fi +if [[ ! -e "$install_file" ]]; then + curl -v -H "ApiUser: ${PTPAPI_APIUSER}" -H "ApiKey: ${PTPAPI_APIKEY}" "https://passthepopcorn.me/archive.php?action=script" \ + > "$install_file" +fi +/venv/bin/python ${install_file} "$@" --config /data/config.ptp