2025-02-20 09:14:32 -08:00
|
|
|
ARG BROWSER_VERSION=1.77.52
|
2023-10-02 14:30:44 -07:00
|
|
|
ARG BROWSER_IMAGE_BASE=webrecorder/browsertrix-browser-base:brave-${BROWSER_VERSION}
|
2020-10-31 13:16:37 -07:00
|
|
|
|
2023-01-30 19:00:33 -08:00
|
|
|
FROM ${BROWSER_IMAGE_BASE}
|
2022-10-25 10:53:32 -04:00
|
|
|
|
2021-06-24 15:39:17 -07:00
|
|
|
# needed to add args to main build stage
|
2021-02-03 22:24:38 -08:00
|
|
|
ARG BROWSER_VERSION
|
|
|
|
|
2024-06-25 13:53:43 -07:00
|
|
|
ENV GEOMETRY=1360x1020x16 \
|
2021-06-24 15:39:17 -07:00
|
|
|
BROWSER_VERSION=${BROWSER_VERSION} \
|
2022-07-08 17:17:46 -07:00
|
|
|
BROWSER_BIN=google-chrome \
|
2023-01-09 23:56:53 -08:00
|
|
|
OPENSSL_CONF=/app/openssl.conf \
|
2024-03-21 08:16:59 -07:00
|
|
|
VNC_PASS=vncpassw0rd! \
|
|
|
|
DETACHED_CHILD_PROC=1
|
2020-10-31 13:16:37 -07:00
|
|
|
|
2024-06-14 15:19:35 -07:00
|
|
|
EXPOSE 9222 9223 6080
|
|
|
|
|
2020-10-31 13:16:37 -07:00
|
|
|
WORKDIR /app
|
|
|
|
|
2024-06-20 18:54:05 -07:00
|
|
|
ADD package.json yarn.lock /app/
|
2020-10-31 13:16:37 -07:00
|
|
|
|
2021-03-13 16:48:31 -08:00
|
|
|
# to allow forcing rebuilds from this stage
|
|
|
|
ARG REBUILD
|
|
|
|
|
2022-10-25 10:53:32 -04:00
|
|
|
# Download and format ad host blocklist as JSON
|
|
|
|
RUN mkdir -p /tmp/ads && cd /tmp/ads && \
|
|
|
|
curl -vs -o ad-hosts.txt https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts && \
|
|
|
|
cat ad-hosts.txt | grep '^0.0.0.0 '| awk '{ print $2; }' | grep -v '0.0.0.0' | jq --raw-input --slurp 'split("\n")' > /app/ad-hosts.json && \
|
|
|
|
rm /tmp/ads/ad-hosts.txt
|
|
|
|
|
2023-04-03 12:18:42 -07:00
|
|
|
RUN yarn install --network-timeout 1000000
|
2020-10-31 13:16:37 -07:00
|
|
|
|
2023-11-09 11:27:11 -08:00
|
|
|
ADD tsconfig.json /app/
|
|
|
|
ADD src /app/src
|
|
|
|
|
|
|
|
RUN yarn run tsc
|
2022-07-08 17:17:46 -07:00
|
|
|
|
|
|
|
ADD config/ /app/
|
|
|
|
|
2022-02-23 12:09:48 -08:00
|
|
|
ADD html/ /app/html/
|
2020-11-01 19:22:53 -08:00
|
|
|
|
Autoclick Support (#729)
Adds support for autoclick behavior:
- Adds new `autoclick` behavior option to `--behaviors`, but not
enabling by default
- Adds support for new exposed function `__bx_addSet` which allows
autoclick behavior to persist state about links that have already been
clicked to avoid duplicates, only used if link has an href
- Adds a new pageFinished flag on the worker state.
- Adds a on('dialog') handler to reject onbeforeunload page navigations,
when in behavior (page not finished), but accept when page is finished -
to allow navigation away only when behaviors are done
- Update to browsertrix-behaviors 0.7.0, which supports autoclick
- Add --clickSelector option to customize elements that will be clicked,
defaulting to `a`.
- Add --linkSelector as alias for --selectLinks for consistency
- Unknown options for --behaviors printed as warnings, instead of hard
exit, for forward compatibility for new behavior types in the future
Fixes #728, also #216, #665, #31
2025-01-16 09:38:11 -08:00
|
|
|
ARG RWP_VERSION=2.2.5
|
2024-03-22 17:32:42 -07:00
|
|
|
ADD https://cdn.jsdelivr.net/npm/replaywebpage@${RWP_VERSION}/ui.js /app/html/rwp/
|
|
|
|
ADD https://cdn.jsdelivr.net/npm/replaywebpage@${RWP_VERSION}/sw.js /app/html/rwp/
|
2024-04-12 09:47:32 -07:00
|
|
|
ADD https://cdn.jsdelivr.net/npm/replaywebpage@${RWP_VERSION}/adblock/adblock.gz /app/html/rwp/adblock.gz
|
2023-11-09 11:27:11 -08:00
|
|
|
|
2024-03-22 17:32:42 -07:00
|
|
|
RUN chmod a+x /app/dist/main.js /app/dist/create-login-profile.js && chmod a+r /app/html/rwp/*
|
|
|
|
|
|
|
|
RUN ln -s /app/dist/main.js /usr/bin/crawl; \
|
|
|
|
ln -s /app/dist/main.js /usr/bin/qa; \
|
|
|
|
ln -s /app/dist/create-login-profile.js /usr/bin/create-login-profile
|
2020-11-01 21:35:00 -08:00
|
|
|
|
2024-11-04 23:30:53 -05:00
|
|
|
RUN mkdir -p /app/behaviors
|
|
|
|
|
2020-11-02 15:28:19 +00:00
|
|
|
WORKDIR /crawls
|
2020-10-31 13:16:37 -07:00
|
|
|
|
2023-09-14 19:48:41 -07:00
|
|
|
# enable to test custom behaviors build (from browsertrix-behaviors)
|
|
|
|
# COPY behaviors.js /app/node_modules/browsertrix-behaviors/dist/behaviors.js
|
|
|
|
|
2024-06-05 21:46:49 +02:00
|
|
|
# add brave/chromium group policies
|
|
|
|
RUN mkdir -p /etc/brave/policies/managed/
|
|
|
|
ADD config/policies /etc/brave/policies/managed/
|
|
|
|
|
2022-09-28 15:49:52 -04:00
|
|
|
ADD docker-entrypoint.sh /docker-entrypoint.sh
|
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
|
|
|
2020-11-01 21:35:00 -08:00
|
|
|
CMD ["crawl"]
|