Add possibility to supply COOKIES via ENV

This commit is contained in:
Sebastian Schulze 2022-03-17 09:42:48 +01:00
parent a6ff72fef1
commit c79d4db54a
Signed by: bascht
GPG Key ID: 5BCB1D3B4D38A35A
3 changed files with 14 additions and 1 deletions

View File

@ -12,7 +12,8 @@ RUN go build -o /usr/local/bin/presseclub
FROM capsulecode/singlefile
COPY --from=presseclub /usr/local/bin/presseclub /usr/local/bin/presseclub
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
EXPOSE 3000
ENTRYPOINT "presseclub"
ENTRYPOINT "entrypoint.sh"

10
entrypoint.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env sh
set -eo pipefail
if [ -n "${COOKIES_URL}" ]; then
wget -O /tmp/cookies.txt $COOKIES_URL
cat /tmp/cookies.txt
fi;
exec presseclub

View File

@ -29,6 +29,8 @@ func main() {
"/usr/bin/chromium-browser",
"--output-directory",
"./../../../out/",
"--browser-cookies-file",
"/tmp/cookies.txt",
"--browser-args", "[\"--no-sandbox\"]",
"--dump-content",
url,