#!/bin/sh # Rebuild from a verified immutable upstream checkout and the local runtime lock. set -eu UPSTREAM_REVISION=f94c81babf4bfd44cdd4bd46e1f2e1fb1d91c753 BUILD_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) UPSTREAM_DIR=${1:-/tmp/umt-camofox-1.18.0-source} if [ ! -d "$UPSTREAM_DIR/.git" ]; then git clone --depth 1 --branch v1.18.0 https://github.com/jo-inc/camofox-browser.git "$UPSTREAM_DIR" fi test "$(git -C "$UPSTREAM_DIR" rev-parse HEAD)" = "$UPSTREAM_REVISION" test -z "$(git -C "$UPSTREAM_DIR" status --porcelain)" set -- docker build --network=host \ --build-arg "APT_MIRROR=${APT_MIRROR:-}" \ --build-context "upstream=$UPSTREAM_DIR" \ -t "${CAMOFOX_BUILD_TAG:-camofox-browser:1.18.0}" if [ -n "${CAMOUFOX_ASSET_DIR:-}" ]; then test -f "$CAMOUFOX_ASSET_DIR/camoufox.zip" set -- "$@" --build-arg CAMOUFOX_ASSET_STAGE=provided-browser \ --build-context "browser-asset=$CAMOUFOX_ASSET_DIR" fi exec "$@" "$BUILD_DIR"