Files
computer-playbook/scripts/docker/entry.sh
T
kevinveenbirkenbachandClaude Opus 4.7 a77a570409 refactor(env): consolidate INFINITO_* namespace and centralize path/image SPOTs
Closes a stack of env-pipeline regressions left over from the recent
INFINITO_* namespace refactor by:

* DOMAIN_PRIMARY now reads INFINITO_DOMAIN strictly (was: legacy DOMAIN
  env var → defaulted to infinito.localhost, which never resolved
  because CoreDNS serves the INFINITO_DOMAIN value, infinito.example).
* group_vars/all/08_networks.yml IPs (ip4/ip6/dns) now read
  INFINITO_IP4 / INFINITO_IP6 / INFINITO_DNS_IP.
* PLAYWRIGHT_KEEP_ALL renamed to INFINITO_PLAYWRIGHT_KEEP end-to-end
  (env-builder, role default, run_one.yml docker exec, playwright.config.js,
  lint allowlist, docs anchor, CI workflow vars).
* PKGMGR_IMAGE renamed to INFINITO_PARENT_IMAGE; Dockerfile ARG drops
  the inline default so env/default.env is the only SPOT.
* INFINITO_SRC_DIR centralized: Dockerfile ARG (no default) + ENV;
  compose forwards it as build-arg, volume mount path, and container env;
  every Python CLI + shell helper + CI workflow now reads it strictly
  (os.environ[...] / "${INFINITO_SRC_DIR:?...}") instead of the literal
  /opt/src/infinito.
* New entries in env/default.env: INFINITO_IP6=::1, INFINITO_PARENT_IMAGE,
  INFINITO_PLAYWRIGHT_KEEP=false. All three propagated through
  utils/env/handlers/passthrough.STATIC_KEYS and (where consumed in the
  container) through compose.yml's environment block.

Validated end-to-end with `make test` (2360 tests across lint, lint-*,
test-lint, test-external, test-unit, test-integration).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 02:30:34 +02:00

69 lines
2.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
echo "[docker-infinito] Starting infinito container"
if [[ "${1:-}" == "/sbin/init" ]]; then
echo "[docker-infinito] Starting systemd as PID 1..."
exec /sbin/init
fi
# Compute dynamically if not provided from outside
echo "[docker-infinito] before pkgmgr path"
INFINITO_PATH="$(pkgmgr path infinito)"
echo "[docker-infinito] after pkgmgr path: ${INFINITO_PATH}" # nocheck: container-bootstrap
# INFINITO_SRC_DIR is provided by compose / Dockerfile ENV. Assert strictly.
: "${INFINITO_SRC_DIR:?INFINITO_SRC_DIR must be set by the container environment}"
export INFINITO_PATH
export INFINITO_SRC_DIR
run_local_build() {
echo "[docker-infinito] Build enabled (--compile)"
echo "[docker-infinito] Using ${INFINITO_PATH} as working directory" # nocheck: container-bootstrap
mkdir -p "${INFINITO_PATH}" # nocheck: container-bootstrap
cd "${INFINITO_PATH}" # nocheck: container-bootstrap
echo "[docker-infinito] Copy ${INFINITO_SRC_DIR} to ${INFINITO_PATH}..." # nocheck: container-bootstrap
rsync -a --delete --chown=root:root --exclude='.git' "${INFINITO_SRC_DIR}/" "${INFINITO_PATH}/" # nocheck: container-bootstrap
echo "[docker-infinito] Reinstall via 'make install'..."
make install
echo "[docker-infinito] Installed:"
pkgmgr version infinito
}
# Parse bootstrap flags. Each flag triggers its action directly; `--`
# terminates flag parsing so the rest of argv is the exec target.
while [[ $# -gt 0 ]]; do
case "$1" in
--compile)
shift
run_local_build
;;
--compile-silent)
shift
run_local_build >/dev/null 2>&1
;;
--)
shift
break
;;
*)
break
;;
esac
done
# ---------------------------------------------------------------------------
# Hand off to infinito or arbitrary command
# ---------------------------------------------------------------------------
if [[ $# -eq 0 ]]; then
echo "[docker-infinito] No arguments provided. Showing infinito help..."
exec infinito --help
else
cd "${INFINITO_PATH}" # nocheck: container-bootstrap
exec "$@"
fi