Skip to content

Commit

Permalink
Add small utility for archiver.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kannibalox committed Mar 18, 2023
1 parent 434fb52 commit 198bf8c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions resources/archiver.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 198bf8c

Please sign in to comment.