diff --git a/.github/workflows/test-dns.yml b/.github/workflows/test-dns.yml index b471869529..e82d196405 100644 --- a/.github/workflows/test-dns.yml +++ b/.github/workflows/test-dns.yml @@ -92,7 +92,7 @@ jobs: INFINITO_DISTRO: ${{ matrix.distro }} run: | set -euo pipefail - make up + make compose-up - name: DNS test suite shell: bash diff --git a/AGENTS.md b/AGENTS.md index e36d315022..38aaa38fb3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -51,7 +51,7 @@ Agents MUST write all transient files (downloaded logs, intermediate output, scr ## Container-Owned Filesystem Entries 🐳 -Files produced by the containerized runner (e.g. `__pycache__/*.pyc` under `tests/`, build artefacts) are often owned by `nobody` or another in-container UID and cannot be removed from the host. When a host-level `rm`/`chmod`/edit fails with `Permission denied` on such paths, agents MUST run the cleanup via `make exec` (see [compose.yml](compose.yml); the repo is mounted at `/opt/src/infinito`) and MUST NOT ask the operator which path to take. +Files produced by the containerized runner (e.g. `__pycache__/*.pyc` under `tests/`, build artefacts) are often owned by `nobody` or another in-container UID and cannot be removed from the host. When a host-level `rm`/`chmod`/edit fails with `Permission denied` on such paths, agents MUST run the cleanup via `make compose-exec` (see [compose.yml](compose.yml); the repo is mounted at `/opt/src/infinito`) and MUST NOT ask the operator which path to take. ## Commit-Time Context Compaction 📦 diff --git a/CLAUDE.md b/CLAUDE.md index 804d1319c5..bbf7e8408e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -17,7 +17,7 @@ At the start of every new conversation (after reading `AGENTS.md`), you MUST rea - You MUST prefer `make` targets over raw `docker`/`docker compose`/`ansible-playbook`/`python`/shell invocations whenever an equivalent target exists in the [`Makefile`](Makefile). Inspect the `Makefile` first; fall back to the raw command only when no target covers the operation. The reason is operational consistency, not permissioning. Raw commands also auto-allow under the sandbox. - You SHOULD run sandbox-confined commands directly on the host. The sandbox bounds what they can read, write, and reach. See [sandbox.md](docs/contributing/tools/agents/claude/sandbox.md). -- For commands that legitimately cannot run inside the sandbox (e.g. operations needing access to `~/.ssh` or `~/.gnupg`), use `make up` to start the stack and `make exec` to drop into a container shell. The repository is mounted at `/opt/src/infinito` (see [compose.yml](compose.yml)), so code changes are immediately available there. +- For commands that legitimately cannot run inside the sandbox (e.g. operations needing access to `~/.ssh` or `~/.gnupg`), use `make compose-up` to start the stack and `make compose-exec` to drop into a container shell. The repository is mounted at `/opt/src/infinito` (see [compose.yml](compose.yml)), so code changes are immediately available there. - Commands listed under `permissions.ask` in [.claude/settings.json](.claude/settings.json) still pause for explicit operator confirmation regardless of sandbox state. - **Shell loops are FORBIDDEN. ⛔** You MUST NOT use `for`, `while`, `until`, or any other shell loop construct in any Bash tool call. Reason: shell control structures fall outside the sandbox auto-allow heuristic and trigger approval prompts even when every subcommand would individually auto-allow. - **Multi-statement chains in shell invocations are FORBIDDEN. ⛔** You MUST NOT chain independent statements inside a single Bash tool call with **any** statement separator (`;`, literal newline, `&&`, `||`, `&` background operator, or subshell/brace groups around the same). The ban covers causally-dependent chains (`cd X && cmd`) just as much as optional ones, and applies to trailing `&` used to background a command (use the Bash tool's `run_in_background: true` parameter instead). Reason: identical to the loop rule. Split the work across **separate Bash tool calls** or use a single-command equivalent (`xargs`, `grep` with multiple args, a make target). diff --git a/Makefile b/Makefile index e0e18b2825..a8905d3c07 100644 --- a/Makefile +++ b/Makefile @@ -13,24 +13,23 @@ else $(error Missing env file: $(ENV_SH)) endif -.PHONY: setup setup-clean install install-force install-ansible install-lint install-lint-force install-venv install-python install-python-dev install-system-python install-skills update-skills agent-install +.PHONY: setup setup-clean install install-force install-ansible install-lint install-lint-force install-venv install-python install-python-dev install-system-python install-skills update-skills install-agent .PHONY: test lint lint-action lint-ansible lint-python lint-shellcheck lint-markdown lint-makefile lint-javascript autoformat test-lint test-unit test-integration test-external test-signed -.PHONY: clean clean-pycache-only-dirs clean-sudo down cache-clean -.PHONY: system-purge system-disk-usage -.PHONY: list tree mig dockerignore chmod-scripts help +.PHONY: clean clean-cache clean-pycache-dirs clean-sudo compose-down +.PHONY: system-purge diagnose-disk-usage +.PHONY: meta-list meta-tree meta-mig fix-dockerignore fix-chmod help .PHONY: print-python -.PHONY: dns-setup dns-remove +.PHONY: network-dns-setup network-dns-remove .PHONY: environment-bootstrap environment-teardown .PHONY: wsl2-systemd-check wsl2-dns-setup wsl2-trust-windows -.PHONY: apparmor-teardown apparmor-restore -.PHONY: disable-ipv6 restore-ipv6 -.PHONY: trust-ca -.PHONY: restart refresh exec run up down stop console +.PHONY: security-apparmor-teardown security-apparmor-restore +.PHONY: network-ipv6-disable network-ipv6-restore +.PHONY: network-trust-ca +.PHONY: compose-restart network-refresh compose-exec compose-inner-run compose-up compose-down compose-stop console .PHONY: build build-missing build-no-cache build-no-cache-all build-cleanup build-dependency .PHONY: act-all act-app act-workflow -.PHONY: deploy container-refresh-inventory container-purge-entity container-purge-system +.PHONY: deploy diagnose-network container-refresh-inventory container-purge-entity container-purge-system .PHONY: bootstrap -.PHONY: debug-network # Run all act-based deploy checks. act-all: @@ -45,11 +44,11 @@ act-workflow: @bash scripts/tests/deploy/act/workflow.sh # Install OS-level sandbox dependencies (bubblewrap, socat) required by the Claude Code sandbox. -agent-install: +install-agent: @bash scripts/install/sandbox.sh # Restore AppArmor profiles. -apparmor-restore: +security-apparmor-restore: @echo "==> AppArmor: restore profiles" @if grep -q '^[Yy1]' /sys/module/apparmor/parameters/enabled 2>/dev/null; then \ sudo bash scripts/system/apparmor/restore.sh; \ @@ -58,7 +57,7 @@ apparmor-restore: fi # Tear down AppArmor for local development. -apparmor-teardown: +security-apparmor-teardown: @echo "==> AppArmor: full teardown (local dev)" @if grep -q '^[Yy1]' /sys/module/apparmor/parameters/enabled 2>/dev/null; then \ sudo bash scripts/system/apparmor/teardown.sh; \ @@ -74,7 +73,7 @@ autoformat: install-lint bootstrap: install setup # Build the local image. -build: dockerignore +build: fix-dockerignore @IMAGE_TAG="$$(bash scripts/meta/resolve/image/local.sh)" \ bash scripts/image/build.sh @@ -104,12 +103,12 @@ build-no-cache-all: INFINITO_DISTRO="$$d" "$(MAKE)" build-no-cache; \ done -# Wipe on-disk caches under /var/cache/infinito/core/cache/ (stops cache containers first; re-run `make up` to recreate). -cache-clean: +# Wipe on-disk caches under /var/cache/infinito/core/cache/ (stops cache containers first; re-run `make compose-up` to recreate). +clean-cache: @bash scripts/system/cache/clean.sh # Mark all shell scripts under scripts/ as executable. -chmod-scripts: +fix-chmod: @find scripts/ -name "*.sh" -exec chmod +x {} \; # Remove ignored files from the working tree; falls back to sudo for container-owned __pycache__/*.pyc, warns and continues if both fail. @@ -129,7 +128,7 @@ clean: fi # Remove tracked directories whose only child is a __pycache__ folder (orphans left after moving / deleting source files). -clean-pycache-only-dirs: +clean-pycache-dirs: @"$${PYTHON}" -m utils.cleanup.pycache_only_dirs # Remove ignored files from the working tree with sudo. @@ -155,10 +154,6 @@ container-purge-system: container-purge-entity container-refresh-inventory: @bash scripts/tests/deploy/local/reset/inventory.sh -# Run the network-diagnose script inside the infinito container (DNS/TCP/TLS/PMTU v4+v6). -debug-network: - @$(MAKE) exec INFINITO_CMD="python3 -m cli.contributing.network.diagnose" - # Run the local deploy router. Args: mode=initialize|reinstall|update (default initialize), apps=, purge=true|false (default false), type=server|workstation|universal (default from default.env), bundles=, disabled=, full_cycle=true|false. Example: `make deploy mode=reinstall apps=web-app-matomo full_cycle=true`. See scripts/tests/deploy/local/deploy/main.sh for the full table. deploy: @$(if $(apps),INFINITO_APPS="$(apps)") \ @@ -170,22 +165,26 @@ deploy: $(if $(full_cycle),INFINITO_FULL_CYCLE="$(full_cycle)") \ bash scripts/tests/deploy/local/deploy/main.sh +# Run the network-diagnose script inside the infinito container (DNS/TCP/TLS/PMTU v4+v6). +diagnose-network: + @$(MAKE) compose-exec INFINITO_CMD="python3 -m cli.contributing.network.diagnose" + # Disable IPv6 for local development. -disable-ipv6: +network-ipv6-disable: @sudo bash scripts/system/network/ipv6/disable.sh - @"$(MAKE)" refresh + @"$(MAKE)" network-refresh # Remove the DNS configuration. -dns-remove: +network-dns-remove: @bash scripts/system/network/dns/remove.sh # Configure DNS on Linux. -dns-setup: wsl2-dns-setup +network-dns-setup: wsl2-dns-setup @bash scripts/system/network/dns/setup/linux.sh # Regenerate .dockerignore from .gitignore (which carries the .git entry Docker needs). Race-safe under parallel make setup invocations. -dockerignore: - @echo "Create dockerignore" +fix-dockerignore: + @echo "Create .dockerignore" cat .gitignore > .dockerignore # Regenerate .env (SPOT) from default.env + runtime context (distro, cache sizes, secrets, ...). @@ -198,17 +197,17 @@ dotenv-force: @env -i HOME="$${HOME}" PATH="$${PATH}" python3 -m cli.meta.env # Stop the development stack. -down: +compose-down: @"$${PYTHON}" -m cli.administration.deploy.development down # Bootstrap the local development environment. -environment-bootstrap: wsl2-systemd-check install-python-dev install-lint apparmor-teardown dns-setup disable-ipv6 +environment-bootstrap: wsl2-systemd-check install-python-dev install-lint security-apparmor-teardown network-dns-setup network-ipv6-disable # Tear down the local development environment. -environment-teardown: apparmor-restore dns-remove restore-ipv6 +environment-teardown: security-apparmor-restore network-dns-remove network-ipv6-restore -# Run a shell (`make exec`) or command (`make exec INFINITO_CMD="..."`) in the running container. -exec: +# Run a shell (`make compose-exec`) or command (`make compose-exec INFINITO_CMD="..."`) in the running container. +compose-exec: @bash scripts/tests/deploy/local/exec/container.sh # Print every Make target with the description from its preceding comment line. @@ -296,33 +295,33 @@ lint-shellcheck: install-lint @bash scripts/lint/wrapper.sh shellcheck # Print the repository role list. -list: +meta-list: @echo "Generating the roles list" @"$${PYTHON}" -m cli.build.list # Build the meta graph inputs. -mig: list tree +meta-mig: meta-list meta-tree @echo "Creating meta data for meta infinity graph" # Refresh the running development stack only when it already exists. -refresh: +network-refresh: @bash scripts/system/network/docker/stack_refresh.sh # Restart the development stack. -restart: +compose-restart: @"$${PYTHON}" -m cli.administration.deploy.development restart # Restore IPv6 settings. -restore-ipv6: +network-ipv6-restore: @sudo bash scripts/system/network/ipv6/restore.sh - @"$(MAKE)" refresh + @"$(MAKE)" network-refresh # Run a one-off `docker run` inside the running container. -run: +compose-inner-run: @bash scripts/tests/deploy/local/exec/run.sh # Run the setup step after generating .dockerignore. -setup: dockerignore dotenv +setup: fix-dockerignore dotenv @bash scripts/setup.sh # Run setup after cleaning ignored files. @@ -330,11 +329,11 @@ setup-clean: clean setup @echo "Full build with cleanup before was executed." # Stop the development stack without removing volumes. -stop: +compose-stop: @"$${PYTHON}" -m cli.administration.deploy.development stop # Show disk and Docker resource usage to identify what to clean up. -system-disk-usage: +diagnose-disk-usage: @bash scripts/system/meta/disk-usage.sh # Run the broad low-hardware cleanup routine. @@ -384,17 +383,17 @@ test-unit: install bash scripts/tests/code/wrapper.sh # Print the repository tree. -tree: +meta-tree: @echo "Generating Tree" @"$${PYTHON}" -m cli.build.tree -D 2 # Trust the local CA on Linux and WSL2. -trust-ca: +network-trust-ca: @bash scripts/system/tls/trust/linux.sh @bash scripts/system/tls/trust/wsl2.sh # Start the development stack. -up: install +compose-up: install @"$${PYTHON}" -m cli.administration.deploy.development up # Update all agent skills to latest versions and refresh skills-lock.json. diff --git a/cli/contributing/network/README.md b/cli/contributing/network/README.md index 996dd46a94..aae887512d 100644 --- a/cli/contributing/network/README.md +++ b/cli/contributing/network/README.md @@ -6,7 +6,7 @@ Contributor-side network tooling: probe the live container network stack, sugges | Path | Purpose | |---|---| -| [diagnose/](diagnose/) | Run `python -m cli.contributing.network.diagnose` to print a structured DNS / TCP / TLS / PMTU report (IPv4 + IPv6) plus interface MTU, `/etc/resolv.conf`, `/etc/hosts`, proxy env vars, and CA bundle summaries from inside the running infinito container. Exposed as `make debug-network`. | +| [diagnose/](diagnose/) | Run `python -m cli.contributing.network.diagnose` to print a structured DNS / TCP / TLS / PMTU report (IPv4 + IPv6) plus interface MTU, `/etc/resolv.conf`, `/etc/hosts`, proxy env vars, and CA bundle summaries from inside the running infinito container. Exposed as `make diagnose-network`. | | [address/](address/) | `cli contributing network address suggest`: propose the next free per-role IPv4 subnet(s) gap-first within the established umbrella blocks. | | [ports/](ports/) | `cli contributing network ports suggest`: propose free host-bound ports inside `PORT_BANDS..`. | diff --git a/compose/cache.override.yml b/compose/cache.override.yml index a87cd279fc..4dc1ee81e0 100644 --- a/compose/cache.override.yml +++ b/compose/cache.override.yml @@ -127,13 +127,13 @@ services: read_only: true bind: create_host_path: true - - ${INFINITO_CACHE_REGISTRY_PROXY_CONF:?Set by 'cli deploy development up' / 'make up' (driver-injected, not produced by 'make + - ${INFINITO_CACHE_REGISTRY_PROXY_CONF:?Set by 'cli deploy development up' / 'make compose-up' (driver-injected, not produced by 'make dotenv')}:/etc/systemd/system/docker.service.d/registry-cache-proxy.conf:ro - ./scripts/docker/cache/registry-ca.sh:/usr/local/bin/registry-cache-ca.sh:ro - - ${INFINITO_CACHE_PACKAGE_PIP_CONF:?Set by 'cli deploy development up' / 'make up' (driver-injected, not produced by 'make dotenv')}:/etc/pip.conf:ro - - ${INFINITO_CACHE_PACKAGE_NPMRC:?Set by 'cli deploy development up' / 'make up' (driver-injected, not produced by 'make dotenv')}:/root/.npmrc:ro - - ${INFINITO_CACHE_PACKAGE_APT_LIST:?Set by 'cli deploy development up' / 'make up' (driver-injected, not produced by 'make + - ${INFINITO_CACHE_PACKAGE_PIP_CONF:?Set by 'cli deploy development up' / 'make compose-up' (driver-injected, not produced by 'make dotenv')}:/etc/pip.conf:ro + - ${INFINITO_CACHE_PACKAGE_NPMRC:?Set by 'cli deploy development up' / 'make compose-up' (driver-injected, not produced by 'make dotenv')}:/root/.npmrc:ro + - ${INFINITO_CACHE_PACKAGE_APT_LIST:?Set by 'cli deploy development up' / 'make compose-up' (driver-injected, not produced by 'make dotenv')}:/etc/apt/sources.list.d/package-cache.list:ro - - ${INFINITO_CACHE_PACKAGE_FRONTEND_CA_FILE:?Set by 'cli deploy development up' / 'make up' (driver-injected, not produced by 'make + - ${INFINITO_CACHE_PACKAGE_FRONTEND_CA_FILE:?Set by 'cli deploy development up' / 'make compose-up' (driver-injected, not produced by 'make dotenv')}:/opt/package-frontend-ca.crt:ro - ./scripts/docker/cache/package-frontend-ca.sh:/usr/local/bin/package-frontend-ca.sh:ro diff --git a/docs/agents/action/iteration/playwright.md b/docs/agents/action/iteration/playwright.md index 4873571e85..a5a87bed03 100644 --- a/docs/agents/action/iteration/playwright.md +++ b/docs/agents/action/iteration/playwright.md @@ -46,7 +46,7 @@ You MUST load the following pages before editing any file, in this order: ## Debugging in the nested docker daemon -To validate a hypothesis without redeploying — e.g. rerun the Playwright image with a patched env or grep — use `make run IMAGE= [INFINITO_CMD=...] [INFINITO_RUN_FLAGS=...]`. You MAY hand-edit `/tmp/test-e2e-playwright//.env` for the diagnosis run only, but you MUST mirror any fix back into `roles//templates/playwright.env.j2` before the next deploy. +To validate a hypothesis without redeploying — e.g. rerun the Playwright image with a patched env or grep — use `make compose-inner-run IMAGE= [INFINITO_CMD=...] [INFINITO_RUN_FLAGS=...]`. You MAY hand-edit `/tmp/test-e2e-playwright//.env` for the diagnosis run only, but you MUST mirror any fix back into `roles//templates/playwright.env.j2` before the next deploy. ## Exit diff --git a/docs/agents/action/iteration/role.md b/docs/agents/action/iteration/role.md index d12c61b83a..afaf63cbcd 100644 --- a/docs/agents/action/iteration/role.md +++ b/docs/agents/action/iteration/role.md @@ -43,14 +43,14 @@ For the matrix-variant mechanism (folder layout, round semantics, `--variant` / ## Certificate Authority -- If the website uses locally deployed certificates, you MUST run `make trust-ca` before you inspect it in a browser. Otherwise the browser will warn about the local CA and the inspection will not be reliable. -- After `make trust-ca`, you MUST restart the browser so it picks up the updated trust store. -- If `make trust-ca` fails due to missing root permissions, you MUST use the alternative syntax `curl -k` (or `wget --no-check-certificate`) to skip certificate validation when checking URLs from the command line instead of fixing the trust store. +- If the website uses locally deployed certificates, you MUST run `make network-trust-ca` before you inspect it in a browser. Otherwise the browser will warn about the local CA and the inspection will not be reliable. +- After `make network-trust-ca`, you MUST restart the browser so it picks up the updated trust store. +- If `make network-trust-ca` fails due to missing root permissions, you MUST use the alternative syntax `curl -k` (or `wget --no-check-certificate`) to skip certificate validation when checking URLs from the command line instead of fixing the trust store. ## Inspect - Before you redeploy, you MUST complete all available inspections first. Check the live local output, local logs, and current browser state so the original state stays visible. -- To inspect files or run commands inside a running container, use `make exec`. -- To run a one-off sidecar image against the same docker daemon (e.g. a Playwright runner with a patched `.env`), use `make run IMAGE= [INFINITO_CMD=...] [INFINITO_RUN_FLAGS=...]`. -- When a local deploy fails, you SHOULD first inspect and, where practical, validate a fix inside the running container with `make exec` / `make run` before starting another deploy. Use that live investigation to identify the concrete root cause and save iteration time. +- To inspect files or run commands inside a running container, use `make compose-exec`. +- To run a one-off sidecar image against the same docker daemon (e.g. a Playwright runner with a patched `.env`), use `make compose-inner-run IMAGE= [INFINITO_CMD=...] [INFINITO_RUN_FLAGS=...]`. +- When a local deploy fails, you SHOULD first inspect and, where practical, validate a fix inside the running container with `make compose-exec` / `make compose-inner-run` before starting another deploy. Use that live investigation to identify the concrete root cause and save iteration time. - Once the root cause is understood, you MUST apply the real fix in the repository files and then continue the redeploy loop with the usual commands from this page. In-container fixes are only for diagnosis or short validation and MUST NOT replace the repo change. diff --git a/docs/contributing/actions/debugging/network.md b/docs/contributing/actions/debugging/network.md index 37915d541c..e59559d56f 100644 --- a/docs/contributing/actions/debugging/network.md +++ b/docs/contributing/actions/debugging/network.md @@ -5,10 +5,10 @@ When compose pulls hang, image builds fail to resolve registry manifests, `make ## Diagnose tool 🕵️ ```bash -make debug-network +make diagnose-network ``` -Runs [__main__.py](../../../../cli/contributing/network/diagnose/__main__.py) inside the running `infinito` container and produces a structured DNS / TCP / TLS / PMTU report against the standard infrastructure hosts (`github.com`, `ghcr.io`, `registry-1.docker.io`, `auth.docker.io`, `pypi.org`, `files.pythonhosted.org`, `registry.npmjs.org`, `objects.githubusercontent.com`, `raw.githubusercontent.com`), separately for IPv4 and IPv6 when available. Extra hosts can be appended via `INFINITO_NET_DEBUG_HOSTS="example.com api.example.org" make debug-network`. +Runs [__main__.py](../../../../cli/contributing/network/diagnose/__main__.py) inside the running `infinito` container and produces a structured DNS / TCP / TLS / PMTU report against the standard infrastructure hosts (`github.com`, `ghcr.io`, `registry-1.docker.io`, `auth.docker.io`, `pypi.org`, `files.pythonhosted.org`, `registry.npmjs.org`, `objects.githubusercontent.com`, `raw.githubusercontent.com`), separately for IPv4 and IPv6 when available. Extra hosts can be appended via `INFINITO_NET_DEBUG_HOSTS="example.com api.example.org" make diagnose-network`. On first run it self-installs `iputils-ping` + `iproute2` via the container's package manager (Debian / Ubuntu apt, Arch pacman, Fedora / CentOS / RHEL dnf). The installer waits up to two minutes for an apt-lock if a parallel deploy is running. IPv6 probes are auto-skipped when the bridge has no usable IPv6 default route. @@ -54,10 +54,10 @@ For a one-off local override of the compose bridge, regenerate `.env` with the d ```bash INFINITO_OUTER_NETWORK_MTU=1400 make dotenv -make down && make up +make compose-down && make compose-up ``` -A clean `down && up` is required after the change: `make up` alone recreates the bridge but compose then re-attaches existing containers with dynamic IPs instead of the static `default.env` ones, which breaks CoreDNS. +A clean `down && up` is required after the change: `make compose-up` alone recreates the bridge but compose then re-attaches existing containers with dynamic IPs instead of the static `default.env` ones, which breaks CoreDNS. ## IPv6 🔢 @@ -71,23 +71,23 @@ curl -6 https://registry-1.docker.io/v2/ The recommended way to disable IPv6 for local development is via Make: ```bash -make disable-ipv6 +make network-ipv6-disable ``` -This also restarts `docker.service` and then calls `make refresh`, so the running Infinito development stack is recreated when one is active and the new setting reaches fresh container network namespaces. +This also restarts `docker.service` and then calls `make network-refresh`, so the running Infinito development stack is recreated when one is active and the new setting reaches fresh container network namespaces. To restore the original IPv6 settings afterwards: ```bash -make restore-ipv6 +make network-ipv6-restore ``` -This restore path also restarts `docker.service` and then calls `make refresh`, so the running Infinito development stack is recreated when one is active and the restored setting reaches fresh container network namespaces. +This restore path also restarts `docker.service` and then calls `make network-refresh`, so the running Infinito development stack is recreated when one is active and the restored setting reaches fresh container network namespaces. You can also refresh the running local stack directly after host-level changes: ```bash -make refresh +make network-refresh ``` Alternatively, disable IPv6 only in Docker via `/etc/docker/daemon.json`: @@ -103,4 +103,4 @@ ping -c 3 registry-1.docker.io curl -v https://registry-1.docker.io/v2/ ``` -Check firewall rules, proxy settings, and DNS configuration. The `proxy env vars` and `CA bundle summary` sections of `make debug-network` surface the same information from inside the container. +Check firewall rules, proxy settings, and DNS configuration. The `proxy env vars` and `CA bundle summary` sections of `make diagnose-network` surface the same information from inside the container. diff --git a/docs/contributing/actions/deploy.md b/docs/contributing/actions/deploy.md index a117c1374f..840eb91bf3 100644 --- a/docs/contributing/actions/deploy.md +++ b/docs/contributing/actions/deploy.md @@ -75,15 +75,15 @@ infinito administration deploy development deploy --inventory-dir "${INFINITO_IN ## Inspect Live State 🔍 -Use [`make exec`](../../../Makefile) to drop into the running container shell. The repo is mounted at `/opt/src/infinito`, so code changes are visible immediately. Inspect logs and current state BEFORE redeploying so the failing snapshot stays available. +Use [`make compose-exec`](../../../Makefile) to drop into the running container shell. The repo is mounted at `/opt/src/infinito`, so code changes are visible immediately. Inspect logs and current state BEFORE redeploying so the failing snapshot stays available. -For TLS-enabled local sites, run [`make trust-ca`](../../../Makefile) once after the first deploy and restart the browser; alternatively use `curl -k` on the command line. +For TLS-enabled local sites, run [`make network-trust-ca`](../../../Makefile) once after the first deploy and restart the browser; alternatively use `curl -k` on the command line. ## Reference Files 📌 | File | Purpose | |---|---| -| [Makefile](../../../Makefile) | The `deploy` router target and `make exec` / `make trust-ca` helpers. | +| [Makefile](../../../Makefile) | The `deploy` router target and `make compose-exec` / `make network-trust-ca` helpers. | | [dev CLI tree](../../../cli/administration/deploy/development/) | Python CLI for init, deploy, up, down, exec, etc. | | [`make dotenv`](../../../Makefile) | Resolves `INFINITO_INVENTORY_DIR`, `INFINITO_INVENTORY_FILE`, and `INFINITO_INVENTORY_VARS_FILE` into `.env` for the dev CLI (see [variables.md](../environment/variables.md)). | | [local deploy scripts](../../../scripts/tests/deploy/local/) | Bash glue behind the make targets (fresh / reuse / purge variants). | diff --git a/docs/contributing/actions/testing.md b/docs/contributing/actions/testing.md index f882d1a1d7..29686eda66 100644 --- a/docs/contributing/actions/testing.md +++ b/docs/contributing/actions/testing.md @@ -53,7 +53,7 @@ Important: - Some local deploy commands are destructive. - Read [reset/README.md](../../../scripts/tests/deploy/local/reset/README.md), [purge/README.md](../../../scripts/tests/deploy/local/purge/README.md), or [exec/README.md](../../../scripts/tests/deploy/local/exec/README.md) before using the matching helper. - For act-based workflow checks, see [Act Workflow Checks](../tools/act.md). -- After a successful local deploy, run `make trust-ca` and restart your browser. +- After a successful local deploy, run `make network-trust-ca` and restart your browser. ## Suite Selection 🎯 diff --git a/docs/contributing/artefact/files/compose.yml.md b/docs/contributing/artefact/files/compose.yml.md index 535705fb41..c9acb48b5e 100644 --- a/docs/contributing/artefact/files/compose.yml.md +++ b/docs/contributing/artefact/files/compose.yml.md @@ -75,7 +75,7 @@ The env-var contracts each service expects strictly via `${VAR:?…}` (consumed | `INFINITO_CACHE_PACKAGE_MAX_AGE_MIN` | Cache freshness window in minutes, applied to every Nexus proxy repo (`contentMaxAge`/`metadataMaxAge`/negative-cache TTL). Stays strictly below the 7-day `Valid-Until` window Debian / Ubuntu generate in their apt `Release` files, so `apt-get update` never aborts with "Release file ... is expired". | | `INFINITO_CACHE_PACKAGE_ADMIN_PASSWORD` | Target value for the rotated Nexus admin password. Default is a stable per-host hash. | | `INFINITO_CACHE_PACKAGE_PORT` | Host-side port mapped to Nexus REST/UI. Bound to `${INFINITO_BIND_IP}` only. | -| `INFINITO_CACHE_PACKAGE_PIP_CONF` | Bind source for `/etc/pip.conf`. Driver-injected by `make up` under the `cache` profile. | +| `INFINITO_CACHE_PACKAGE_PIP_CONF` | Bind source for `/etc/pip.conf`. Driver-injected by `make compose-up` under the `cache` profile. | | `INFINITO_CACHE_PACKAGE_NPMRC` | Bind source for `/root/.npmrc`. Driver-injected. | | `INFINITO_CACHE_PACKAGE_APT_LIST` | Bind source for `/etc/apt/sources.list.d/package-cache.list`. Driver-injected. | | `INFINITO_CACHE_PACKAGE_FRONTEND_CA_DIR` | Host directory for the frontend CA. | diff --git a/docs/contributing/artefact/files/github/workflow.md b/docs/contributing/artefact/files/github/workflow.md index 9485c50415..c78809279b 100644 --- a/docs/contributing/artefact/files/github/workflow.md +++ b/docs/contributing/artefact/files/github/workflow.md @@ -88,7 +88,7 @@ Ordering: - Swap step MUST run **after** `actions/checkout` because the script lives inside the repo. - Swap step SHOULD run **after** `jlumbroso/free-disk-space` so the reclaimed disk on `/` is also a candidate target when `/mnt` is crowded. -- Swap step MUST run **before** any `make up` / container build step so the expanded swap is active when heavy-allocation work begins. +- Swap step MUST run **before** any `make compose-up` / container build step so the expanded swap is active when heavy-allocation work begins. Swap is a host-kernel resource; see [svc-opt-swapfile](../../../../../roles/svc-opt-swapfile/) for why the in-stack swap role is intentionally skipped inside containers. diff --git a/docs/contributing/environment/cache.md b/docs/contributing/environment/cache.md index a570ae3113..1d7186eb0b 100644 --- a/docs/contributing/environment/cache.md +++ b/docs/contributing/environment/cache.md @@ -96,9 +96,9 @@ Per-variable defaults and purposes are in [compose.yml.md](../artefact/files/com | Action | Command | |---|---| -| Start the stack with caches | `make up` | -| Stop the stack | `make down` | -| Wipe local cache state | `make cache-clean` | +| Start the stack with caches | `make compose-up` | +| Stop the stack | `make compose-down` | +| Wipe local cache state | `make clean-cache` | | Manually re-bootstrap Nexus repos | `bash scripts/docker/cache/package.sh` (after `make dotenv` or sourcing `scripts/meta/env/load.sh`) | | Manually regenerate frontend certs | `bash scripts/docker/cache/package-frontend-certs.sh` | | Reload nginx in the frontend | `docker exec infinito-package-cache-frontend nginx -s reload` | diff --git a/docs/contributing/environment/hardware.md b/docs/contributing/environment/hardware.md index 1c69c45cbd..e0f8fc05d0 100644 --- a/docs/contributing/environment/hardware.md +++ b/docs/contributing/environment/hardware.md @@ -89,7 +89,7 @@ You SHOULD use `make deploy` (full discovery) only when you need broad coverage You SHOULD check what is actually consuming space before cleaning up: ```bash -make system-disk-usage +make diagnose-disk-usage ``` That makes it easier to see whether the real issue is Docker, journald, a package cache, or project state. diff --git a/docs/contributing/environment/setup.md b/docs/contributing/environment/setup.md index 3ef33d0f85..76a3993e99 100644 --- a/docs/contributing/environment/setup.md +++ b/docs/contributing/environment/setup.md @@ -26,8 +26,8 @@ Run these commands from the repository root: ```bash make bootstrap make environment-bootstrap -make up -make trust-ca +make compose-up +make network-trust-ca ``` #### Bootstrap Commands 📋 @@ -36,8 +36,8 @@ make trust-ca |---|---|---| | Initial setup | `make bootstrap` | Installs project dependencies and runs the first repository setup. | | Host preparation | `make environment-bootstrap` | Prepares the local development machine for the project workflow. | -| Start stack | `make up` | Starts the local development stack. | -| Browser trust | `make trust-ca` | Trusts the generated local [CA](https://en.wikipedia.org/wiki/Certificate_authority) so `*.infinito.example` works correctly in your browser. | +| Start stack | `make compose-up` | Starts the local development stack. | +| Browser trust | `make network-trust-ca` | Trusts the generated local [CA](https://en.wikipedia.org/wiki/Certificate_authority) so `*.infinito.example` works correctly in your browser. | The `pre-commit` hooks are installed automatically by `make environment-bootstrap`. Per-machine overrides go into the process environment before invoking `make` (e.g. `export INFINITO_FOO=…`); `make dotenv` honors caller-set values via setdefault semantics. @@ -47,7 +47,7 @@ Per-machine overrides go into the process environment before invoking `make` (e. When you are done, use these commands to stop the stack and clean up the local environment: ```bash -make down +make compose-down make environment-teardown ``` @@ -55,7 +55,7 @@ make environment-teardown | Phase | Command | What it does | |---|---|---| -| Stop stack | `make down` | Stops the local development stack. | +| Stop stack | `make compose-down` | Stops the local development stack. | | Host cleanup | `make environment-teardown` | Reverts local development environment changes where supported. | ### Full Development Flow 🔁 @@ -68,11 +68,11 @@ The repository already contains a modular environment test suite at [scripts/tes |---|---|---| | 1 | `make install` | Installs the dependencies needed before running the local development flow. | | 2 | `make environment-bootstrap` | Prepares the host machine for local development. | -| 3 | `make up` | Starts the development stack. | +| 3 | `make compose-up` | Starts the development stack. | | 4 | `make test` | Runs the main combined validation flow. | | 5 | `make deploy mode=reinstall apps=web-app-matomo` | Runs the baseline validation path for one concrete app. For the retry-loop policy, see [Role Loop](../../agents/action/iteration/role.md). | -| 6 | `make trust-ca` | Makes the generated local certificates trusted by the host browser. | -| 7 | `make down` | Stops the running development stack. | +| 6 | `make network-trust-ca` | Makes the generated local certificates trusted by the host browser. | +| 7 | `make compose-down` | Stops the running development stack. | | 8 | `make environment-teardown` | Cleans up host-side development environment changes. | Use this as a practical reference when you want to understand how local development is expected to work. diff --git a/docs/contributing/environment/variables.md b/docs/contributing/environment/variables.md index 93e2fc6aed..23f81f6f42 100644 --- a/docs/contributing/environment/variables.md +++ b/docs/contributing/environment/variables.md @@ -32,7 +32,7 @@ Already-set env vars take precedence over `default.env` defaults. A handful of variables are documented next to their consumer because they cannot have a static default: -- **Driver-injected** by `make up` and the dev CLI (cache override paths like `INFINITO_CACHE_REGISTRY_PROXY_CONF`, the package-cache config paths, the frontend CA file). +- **Driver-injected** by `make compose-up` and the dev CLI (cache override paths like `INFINITO_CACHE_REGISTRY_PROXY_CONF`, the package-cache config paths, the frontend CA file). See [common.py](../../../cli/administration/deploy/development/common.py) and [compose.yml.md](../artefact/files/compose.yml.md). - **Computed at container start** for `INFINITO_PATH`, set by [entry.sh](../../../scripts/docker/entry.sh). - **Persisted on the deploy target** for `INFINITO_VERSION`, written by the [sys-version](../../../roles/sys-version/) role. diff --git a/docs/contributing/tools/agents/cheatsheet.md b/docs/contributing/tools/agents/cheatsheet.md index 9c4bea7d26..19a00ee480 100644 --- a/docs/contributing/tools/agents/cheatsheet.md +++ b/docs/contributing/tools/agents/cheatsheet.md @@ -39,7 +39,7 @@ SPOT: [develop.md](../../../agents/action/develop.md) For any change with a documented acceptance scope, [Requirement Implementation](#requirement-implementation-) is the preferred entry point; use this prompt only when no requirement file exists or applies. ``` -Follow the instructions from AGENTS.md, iterate on web app role by following the procedure in docs/agents/action/iteration/role.md. Begin by clarifying every open requirement through active listening, then act autonomously through to completion with as few follow-up questions as possible. For every failing Playwright test, follow the inner-loop procedure in docs/agents/action/iteration/role.md together with the procedure in docs/agents/action/iteration/playwright.md. Before every redeploy you MUST run `make exec` and `make run` against the live stack and fully fix and inspect every failure in the container. A new deploy iteration MUST NOT start until every error is resolved and the fix has been empirically verified in-container. You MUST NOT use any commit command, push command, or any command that would require an `ask`-mode approval. You MUST NOT stop the iteration early under any circumstance. Premature termination is explicitly forbidden. The iteration is finished only when every role is green end-to-end. +Follow the instructions from AGENTS.md, iterate on web app role by following the procedure in docs/agents/action/iteration/role.md. Begin by clarifying every open requirement through active listening, then act autonomously through to completion with as few follow-up questions as possible. For every failing Playwright test, follow the inner-loop procedure in docs/agents/action/iteration/role.md together with the procedure in docs/agents/action/iteration/playwright.md. Before every redeploy you MUST run `make compose-exec` and `make compose-inner-run` against the live stack and fully fix and inspect every failure in the container. A new deploy iteration MUST NOT start until every error is resolved and the fix has been empirically verified in-container. You MUST NOT use any commit command, push command, or any command that would require an `ask`-mode approval. You MUST NOT stop the iteration early under any circumstance. Premature termination is explicitly forbidden. The iteration is finished only when every role is green end-to-end. ``` SPOT: [Role Loop](../../../agents/action/iteration/role.md) diff --git a/docs/contributing/tools/agents/claude/sandbox.md b/docs/contributing/tools/agents/claude/sandbox.md index 8d00859873..5dd55e7c89 100644 --- a/docs/contributing/tools/agents/claude/sandbox.md +++ b/docs/contributing/tools/agents/claude/sandbox.md @@ -32,7 +32,7 @@ On Linux, the sandbox backend requires `bubblewrap` (provides the `bwrap` binary Invoke it via the dedicated Make target (preferred, matches the agent permission model in [`.claude/settings.json`](../../../../../.claude/settings.json)): ```bash -make agent-install +make install-agent ``` Equivalent direct invocation: @@ -80,6 +80,6 @@ The `sandbox.network` block governs outbound and local connectivity from inside |---|---|---| | `allowedDomains` | List of domain patterns the agent or its tooling needs to reach. Apex domains are listed bare (`pypi.org`, `github.com`, `ghcr.io`, `letsencrypt.org`, `monogramm.io`, `cybermaster.space`, `infinito.nexus`, `infinito.example`); subdomain families use the `*.parent.tld` form (`*.pythonhosted.org`, `*.ansible.com`, `*.amazonaws.com`, `*.github.com`, `*.githubusercontent.com`, `*.npmjs.org`, `*.docker.com`, `*.gitea.com`, `*.hcaptcha.com`, `*.gstatic.com`, `*.taiga.io`, `*.infinito.nexus`). | Subdomain wildcards (`*.example.com`) are honored, but a bare `*` is not; sandboxed network access is enforced per pattern, and any unmatched host triggers an interactive `SandboxNetworkAccess` prompt. Add a new pattern here when introducing tooling that fetches from a new origin; egress is still bounded by any host-level firewall on top. | | `allowAllUnixSockets` | `true` | The sandbox can connect to any Unix-domain socket on the host. Required so commands like `docker`, `systemctl`, and language servers continue to work; these all communicate over Unix sockets (e.g. `/var/run/docker.sock`). | -| `allowLocalBinding` | `true` | The agent MAY bind listening sockets on `localhost` (e.g. `make up`, `python -m http.server`, dev servers). Required for any local end-to-end testing. | +| `allowLocalBinding` | `true` | The agent MAY bind listening sockets on `localhost` (e.g. `make compose-up`, `python -m http.server`, dev servers). Required for any local end-to-end testing. | If a contributor needs to tighten network policy locally (e.g. running on an untrusted network), they SHOULD do so via `.claude/settings.local.json` rather than weakening the project-level defaults that other contributors depend on. diff --git a/docs/contributing/tools/make.md b/docs/contributing/tools/make.md index a1fea98322..110856665d 100644 --- a/docs/contributing/tools/make.md +++ b/docs/contributing/tools/make.md @@ -14,7 +14,7 @@ For rules on how to write and structure the `Makefile` itself, see [makefile.md] These pages drill into a single workflow rather than enumerate every target. `make help` is the authoritative list of available targets: -- [Network debugging](../actions/debugging/network.md): `make debug-network` (DNS / TCP / TLS / PMTU diagnostics inside the dev container) plus MTU / IPv6 / connectivity troubleshooting. +- [Network debugging](../actions/debugging/network.md): `make diagnose-network` (DNS / TCP / TLS / PMTU diagnostics inside the dev container) plus MTU / IPv6 / connectivity troubleshooting. - For app-level local deploy flows and end-to-end checks, see [Development & Testing](../actions/testing.md). ## Git 🔐 diff --git a/roles/web-app-hugo/Administration.md b/roles/web-app-hugo/Administration.md index 4d0214de42..37736e987f 100644 --- a/roles/web-app-hugo/Administration.md +++ b/roles/web-app-hugo/Administration.md @@ -8,7 +8,7 @@ The Hugo site is built into the custom Docker image at `compose build` time. The - **A force rebuild** without a source-version change can be triggered by clearing the role's image cache: ```bash - make exec INFINITO_CMD="docker compose -f /opt/docker/web-app-hugo/docker-compose.yml build --no-cache" + make compose-exec INFINITO_CMD="docker compose -f /opt/docker/web-app-hugo/docker-compose.yml build --no-cache" ``` The next `make deploy mode=update apps=web-app-hugo` will pull the image, restart nginx, and serve the freshly rendered output. @@ -36,7 +36,7 @@ The Hugo site is built into the custom Docker image at `compose build` time. The The Hugo build runs inside `docker compose build`. If `hugo` exits non-zero, the play fails and the previous image keeps serving. To inspect the failure log: ```bash -make exec INFINITO_CMD="docker compose -f /opt/docker/web-app-hugo/docker-compose.yml build --progress=plain --no-cache web-app-hugo 2>&1 | tail -200" +make compose-exec INFINITO_CMD="docker compose -f /opt/docker/web-app-hugo/docker-compose.yml build --progress=plain --no-cache web-app-hugo 2>&1 | tail -200" ``` Common causes: diff --git a/roles/web-app-odoo/README.md b/roles/web-app-odoo/README.md index 7779cc50d5..9ff3638fb9 100644 --- a/roles/web-app-odoo/README.md +++ b/roles/web-app-odoo/README.md @@ -96,7 +96,7 @@ The role includes a custom `auth_oauth_https` addon that fixes OAuth redirect UR ### Inspecting the Container ```bash -make exec +make compose-exec # Then inside the container: odoo shell -d ``` diff --git a/roles/web-app-opencloud/docs/IAM.md b/roles/web-app-opencloud/docs/IAM.md index eddd1a8798..8ad5a872e0 100644 --- a/roles/web-app-opencloud/docs/IAM.md +++ b/roles/web-app-opencloud/docs/IAM.md @@ -14,7 +14,7 @@ OpenCloud delegates authentication to the central Keycloak realm and consumes us ### Verify OIDC discovery 🩺 ```bash -make exec INFINITO_CMD="container exec opencloud sh -c 'curl -fsS {{ OIDC.CLIENT.DISCOVERY_DOCUMENT }} | head -c 200'" +make compose-exec INFINITO_CMD="container exec opencloud sh -c 'curl -fsS {{ OIDC.CLIENT.DISCOVERY_DOCUMENT }} | head -c 200'" ``` ## LDAP 📒 @@ -33,7 +33,7 @@ Members of the `application_administrators` group (per requirement 004) gain Ope ### Verify LDAP wiring 🩺 ```bash -make exec INFINITO_CMD="container exec opencloud opencloud config get ldap" +make compose-exec INFINITO_CMD="container exec opencloud opencloud config get ldap" ``` ## Federation 🔗 diff --git a/roles/web-app-opencloud/docs/LDAP.md b/roles/web-app-opencloud/docs/LDAP.md index ff70ff928a..f91a520dfb 100644 --- a/roles/web-app-opencloud/docs/LDAP.md +++ b/roles/web-app-opencloud/docs/LDAP.md @@ -22,5 +22,5 @@ OpenCloud uses the central `svc-db-openldap` instance for user and group lookups ## Inspect LDAP Entries 🩺 ```bash -make exec INFINITO_CMD="container exec opencloud opencloud users list" +make compose-exec INFINITO_CMD="container exec opencloud opencloud users list" ``` diff --git a/roles/web-app-opentalk/docs/IAM.md b/roles/web-app-opentalk/docs/IAM.md index c782eae57f..6a5c2d45d8 100644 --- a/roles/web-app-opentalk/docs/IAM.md +++ b/roles/web-app-opentalk/docs/IAM.md @@ -32,11 +32,11 @@ Members of the `application_administrators` LDAP group (per requirement 004) rec ## Verify OIDC Discovery 🩺 ```bash -make exec INFINITO_CMD="container exec opentalk-controller sh -c 'curl -fsS {{ OIDC.CLIENT.DISCOVERY_DOCUMENT }} | head -c 200'" +make compose-exec INFINITO_CMD="container exec opentalk-controller sh -c 'curl -fsS {{ OIDC.CLIENT.DISCOVERY_DOCUMENT }} | head -c 200'" ``` ## Verify Keycloak Admin API Access 🩺 ```bash -make exec INFINITO_CMD="container exec opentalk-controller sh -c 'curl -fsS -H \"Authorization: Bearer \" {{ OPENTALK_KEYCLOAK_BASE_URL }}/admin/realms/{{ OIDC.CLIENT.REALM }}/users?search=alice'" +make compose-exec INFINITO_CMD="container exec opentalk-controller sh -c 'curl -fsS -H \"Authorization: Bearer \" {{ OPENTALK_KEYCLOAK_BASE_URL }}/admin/realms/{{ OIDC.CLIENT.REALM }}/users?search=alice'" ``` diff --git a/roles/web-app-opentalk/docs/LDAP.md b/roles/web-app-opentalk/docs/LDAP.md index 8fb230333e..bfc82226df 100644 --- a/roles/web-app-opentalk/docs/LDAP.md +++ b/roles/web-app-opentalk/docs/LDAP.md @@ -15,11 +15,11 @@ Upstream OpenTalk supports two `[user_search].backend` values: `keycloak_webapi` ## Inspect The Keycloak ↔ LDAP Federation 🩺 ```bash -make exec INFINITO_CMD="container exec keycloak /opt/keycloak/bin/kcadm.sh get components -r {{ OIDC.CLIENT.REALM }} --query type=org.keycloak.storage.UserStorageProvider" +make compose-exec INFINITO_CMD="container exec keycloak /opt/keycloak/bin/kcadm.sh get components -r {{ OIDC.CLIENT.REALM }} --query type=org.keycloak.storage.UserStorageProvider" ``` If users created in OpenLDAP do not appear in OpenTalk, force a Keycloak full sync (component IDs vary per environment): ```bash -make exec INFINITO_CMD="container exec keycloak /opt/keycloak/bin/kcadm.sh create user-storage//sync?action=triggerFullSync -r {{ OIDC.CLIENT.REALM }}" +make compose-exec INFINITO_CMD="container exec keycloak /opt/keycloak/bin/kcadm.sh create user-storage//sync?action=triggerFullSync -r {{ OIDC.CLIENT.REALM }}" ``` diff --git a/scripts/docker/cache/package.sh b/scripts/docker/cache/package.sh index 30333c6cf7..198a3f64ab 100755 --- a/scripts/docker/cache/package.sh +++ b/scripts/docker/cache/package.sh @@ -54,7 +54,7 @@ rotate_admin_password() { log "Default rotation rejected but configured password authenticates; assuming previous bootstrap, marking done" else log "Cannot authenticate with default '${NEXUS_DEFAULT_PASSWORD}' nor with configured INFINITO_CACHE_PACKAGE_ADMIN_PASSWORD." - log "Wipe ${INFINITO_CACHE_PACKAGE_HOST_PATH} (e.g. via 'make cache-clean') and retry." + log "Wipe ${INFINITO_CACHE_PACKAGE_HOST_PATH} (e.g. via 'make clean-cache') and retry." return 1 fi fi diff --git a/scripts/github/runner/dump_state.sh b/scripts/github/runner/dump_state.sh index b72898c02b..5f4c2ffb28 100755 --- a/scripts/github/runner/dump_state.sh +++ b/scripts/github/runner/dump_state.sh @@ -74,7 +74,7 @@ if [ -n "${INFINITO_CONTAINER}" ]; then journalctl -u 'hlth-disc-space*' -n 80 --no-pager 2>&1 || echo "journal for hlth-disc-space not accessible" else - echo "no infinito container running (expected before 'make up')" + echo "no infinito container running (expected before 'make compose-up')" fi echo "::endgroup::" diff --git a/scripts/install/README.md b/scripts/install/README.md index 9e3c343e4c..f2c14bf0e5 100644 --- a/scripts/install/README.md +++ b/scripts/install/README.md @@ -5,7 +5,7 @@ This directory contains scripts that install and bootstrap host-side tooling use - 📦 Install Python, Ansible, and lint dependencies for supported environments - 🐧 Install ad-hoc APT packages for CI and workflow jobs via `apt.sh` - 📦 Build and install distro package metadata via `package.sh` (Arch/Debian/Ubuntu/Fedora) -- 🏖️ Install OS-level Claude Code sandbox dependencies (`bubblewrap`, `socat`) via `sandbox.sh`, covering Debian, Ubuntu, Fedora, CentOS/RHEL/Rocky/Alma, and Arch; also exposed as `make agent-install` +- 🏖️ Install OS-level Claude Code sandbox dependencies (`bubblewrap`, `socat`) via `sandbox.sh`, covering Debian, Ubuntu, Fedora, CentOS/RHEL/Rocky/Alma, and Arch; also exposed as `make install-agent` - 🐍 Bootstrap virtual environments and editable project dependencies - 🛠️ Keep host preparation separate from lint, build, and test execution diff --git a/scripts/install/wrapper.sh b/scripts/install/wrapper.sh index 4fe690afe5..22434f3ffe 100755 --- a/scripts/install/wrapper.sh +++ b/scripts/install/wrapper.sh @@ -4,7 +4,7 @@ # Dispatcher for `python -m utils.install.lint` based on INFINITO_LINT_RUNNER: # host -- install lint tools into the host venv. # docker -- install lint tools inside the running infinito -# compose container (requires `make up`; auto-brings +# compose container (requires `make compose-up`; auto-brings # the stack up). # # The per-environment stamp (build/install-lint-.stamp; is @@ -31,8 +31,8 @@ host) ;; docker) if ! docker compose ps -q infinito 2>/dev/null | grep -q .; then - echo ">>> 'infinito' container not running; starting the stack via 'make up'..." - "${MAKE:-make}" up + echo ">>> 'infinito' container not running; starting the stack via 'make compose-up'..." + "${MAKE:-make}" compose-up fi INFINITO_DISTRO="${INFINITO_DISTRO}" \ diff --git a/scripts/lint/wrapper.sh b/scripts/lint/wrapper.sh index 94fc52b477..fb4c12c44c 100755 --- a/scripts/lint/wrapper.sh +++ b/scripts/lint/wrapper.sh @@ -2,7 +2,7 @@ # Dispatcher for scripts/lint/.sh based on INFINITO_LINT_RUNNER: # host -- directly on the host shell (tools resolved via PATH). # docker -- inside the running infinito compose container -# (requires `make up`; auto-brings the stack up). +# (requires `make compose-up`; auto-brings the stack up). # # Argv: [extra args forwarded to the lint script] # TYPE is the basename (without `.sh`) of a sibling script next to this @@ -43,8 +43,8 @@ docker) echo "============================================================" if ! docker compose ps -q infinito 2>/dev/null | grep -q .; then - echo ">>> 'infinito' container not running; starting the stack via 'make up'..." - "${MAKE:-make}" up + echo ">>> 'infinito' container not running; starting the stack via 'make compose-up'..." + "${MAKE:-make}" compose-up fi # Pass BASH_ENV so `bash --login` auto-sources load.sh inside the diff --git a/scripts/meta/resolve/diff/affected_roles.sh b/scripts/meta/resolve/diff/affected_roles.sh index 736384129d..db6eb1af5c 100755 --- a/scripts/meta/resolve/diff/affected_roles.sh +++ b/scripts/meta/resolve/diff/affected_roles.sh @@ -24,7 +24,7 @@ # [ ...] restricted deploy set (whitelist). # # Pre-conditions: -# - The container started by `make up` is running (the Python resolver +# - The container started by `make compose-up` is running (the Python resolver # is invoked via `docker compose ... exec infinito`, identical to the # pattern used in scripts/meta/resolve/apps.sh). # - `git fetch origin main` is reachable (caller already did checkout). diff --git a/scripts/system/cache/clean.sh b/scripts/system/cache/clean.sh index 10fae65623..4f4ef5d5a8 100755 --- a/scripts/system/cache/clean.sh +++ b/scripts/system/cache/clean.sh @@ -13,7 +13,7 @@ # the Nexus side, the next bootstrap rotates a fresh admin password # and re-creates blobstore + proxy repos. # -# Use `make cache-clean` rather than calling this script directly. +# Use `make clean-cache` rather than calling this script directly. set -euo pipefail @@ -31,7 +31,7 @@ source "scripts/meta/env/load.sh" # whole stack would also kill the runner, which is too destructive; # scope to the two cache services explicitly. if docker ps --format '{{.Names}}' | grep -qE '^infinito-(registry|package)-cache$'; then - echo "[cache-clean] stopping infinito-registry-cache + infinito-package-cache" + echo "[clean-cache] stopping infinito-registry-cache + infinito-package-cache" docker stop infinito-registry-cache infinito-package-cache 2>/dev/null || true docker rm infinito-registry-cache infinito-package-cache 2>/dev/null || true fi @@ -51,14 +51,14 @@ remove_path() { local p="$1" [[ -z "${p}" ]] && return 0 if [[ ! -e "${p}" ]]; then - echo "[cache-clean] not present, skipping: ${p}" + echo "[clean-cache] not present, skipping: ${p}" return 0 fi if [[ -w "${p}" ]] || [[ -O "${p}" ]]; then - echo "[cache-clean] removing: ${p}" + echo "[clean-cache] removing: ${p}" rm -rf -- "${p}" else - echo "[cache-clean] removing (sudo): ${p}" + echo "[clean-cache] removing (sudo): ${p}" sudo rm -rf -- "${p}" fi } @@ -67,4 +67,4 @@ remove_path "${PATHS[0]}" remove_path "${PATHS[1]}" remove_path "${PATHS[2]}" -echo "[cache-clean] done. Re-run 'make up' to recreate empty caches." +echo "[clean-cache] done. Re-run 'make compose-up' to recreate empty caches." diff --git a/scripts/system/network/ipv6/README.md b/scripts/system/network/ipv6/README.md index c6e11bc46f..4e2060de19 100644 --- a/scripts/system/network/ipv6/README.md +++ b/scripts/system/network/ipv6/README.md @@ -2,7 +2,7 @@ This directory holds IPv6 enable and restore helpers for local development. For the canonical Make target index that invokes these helpers, see [make.md](../../../../docs/contributing/tools/make.md). -For the generic stack refresh helper used by `make refresh`, see [../docker/README.md](../docker/README.md). +For the generic stack refresh helper used by `make network-refresh`, see [../docker/README.md](../docker/README.md). ## Entry Points diff --git a/scripts/system/network/ipv6/disable.sh b/scripts/system/network/ipv6/disable.sh index 57b183b7b7..062cb428c9 100755 --- a/scripts/system/network/ipv6/disable.sh +++ b/scripts/system/network/ipv6/disable.sh @@ -4,7 +4,7 @@ set -euo pipefail STATE_FILE="/tmp/infinito-dev-environment-ipv6.state" if [[ "${EUID:-$(id -u)}" -ne 0 ]]; then - echo "[ipv6] error: disable.sh must be run as root (for example via 'sudo' or 'make disable-ipv6')" >&2 + echo "[ipv6] error: disable.sh must be run as root (for example via 'sudo' or 'make network-ipv6-disable')" >&2 exit 1 fi @@ -108,4 +108,4 @@ disable_existing_interfaces restart_docker_service echo "[ipv6] disabled for all, default, and currently existing interfaces" -echo "[ipv6] note: make disable-ipv6 calls make refresh after the docker.service restart" +echo "[ipv6] note: make network-ipv6-disable calls make network-refresh after the docker.service restart" diff --git a/scripts/system/network/ipv6/restore.sh b/scripts/system/network/ipv6/restore.sh index d0424655e7..e91c120477 100755 --- a/scripts/system/network/ipv6/restore.sh +++ b/scripts/system/network/ipv6/restore.sh @@ -4,7 +4,7 @@ set -euo pipefail STATE_FILE="/tmp/infinito-dev-environment-ipv6.state" if [[ "${EUID:-$(id -u)}" -ne 0 ]]; then - echo "[ipv6] error: restore.sh must be run as root (for example via 'sudo' or 'make restore-ipv6')" >&2 + echo "[ipv6] error: restore.sh must be run as root (for example via 'sudo' or 'make network-ipv6-restore')" >&2 exit 1 fi @@ -94,4 +94,4 @@ restart_docker_service rm -f "${STATE_FILE}" echo "[ipv6] restored for all, default, and currently existing interfaces" -echo "[ipv6] note: make restore-ipv6 calls make refresh after the docker.service restart" +echo "[ipv6] note: make network-ipv6-restore calls make network-refresh after the docker.service restart" diff --git a/scripts/system/tls/trust/linux.sh b/scripts/system/tls/trust/linux.sh index 173104b3ec..831f125b14 100755 --- a/scripts/system/tls/trust/linux.sh +++ b/scripts/system/tls/trust/linux.sh @@ -19,12 +19,12 @@ CA_TRUST_NAME="infinito-root-ca" WITH_CA_TRUST_SCRIPT="${SCRIPT_DIR}/../../../../roles/sys-ca-selfsigned/files/with-ca-trust.sh" log() { - echo "[trust-ca] $*" >&2 + echo "[network-trust-ca] $*" >&2 } require() { if ! command -v "$1" >/dev/null 2>&1; then - echo "[trust-ca] ERROR: required command not found: $1" >&2 + echo "[network-trust-ca] ERROR: required command not found: $1" >&2 exit 1 fi } @@ -35,12 +35,12 @@ require docker require sudo if [ -z "$CONTAINER_NAME" ]; then - echo "[trust-ca] ERROR: INFINITO_CONTAINER is not set" >&2 + echo "[network-trust-ca] ERROR: INFINITO_CONTAINER is not set" >&2 exit 2 fi if [ ! -f "$WITH_CA_TRUST_SCRIPT" ]; then - echo "[trust-ca] ERROR: with-ca-trust.sh not found at $WITH_CA_TRUST_SCRIPT" >&2 + echo "[network-trust-ca] ERROR: with-ca-trust.sh not found at $WITH_CA_TRUST_SCRIPT" >&2 exit 3 fi diff --git a/scripts/tests/code/wrapper.sh b/scripts/tests/code/wrapper.sh index 0efcf14f47..5ff0e61e1e 100755 --- a/scripts/tests/code/wrapper.sh +++ b/scripts/tests/code/wrapper.sh @@ -2,7 +2,7 @@ # Chooses where to execute scripts/tests/code/run.sh based on # INFINITO_TEST_RUNNER: # docker (default) -- inside the already-running infinito compose -# container (requires `make up`). +# container (requires `make compose-up`). # host -- directly against the host shell/Python. set -euo pipefail @@ -32,10 +32,10 @@ docker) echo "============================================================" # Auto-bring-up: if the `infinito` container is not running, kick off - # `make up` first so test-* doesn't fail with "service not running". + # `make compose-up` first so test-* doesn't fail with "service not running". if ! docker compose ps -q infinito 2>/dev/null | grep -q .; then - echo ">>> 'infinito' container not running; starting the stack via 'make up'..." - "${MAKE:-make}" up + echo ">>> 'infinito' container not running; starting the stack via 'make compose-up'..." + "${MAKE:-make}" compose-up fi # Compose auto-loads `.env` (the SPOT generated from default.env), diff --git a/scripts/tests/deploy/local/deploy/apps/reinstall/selection.sh b/scripts/tests/deploy/local/deploy/apps/reinstall/selection.sh index 5e86b44feb..7be144eb8e 100755 --- a/scripts/tests/deploy/local/deploy/apps/reinstall/selection.sh +++ b/scripts/tests/deploy/local/deploy/apps/reinstall/selection.sh @@ -46,7 +46,7 @@ echo "limit_host=${INFINITO_LIMIT_HOST}" echo "inventory_dir=${INFINITO_INVENTORY_DIR}" echo -echo ">>> Bringing stack down (replaces former 'make down' prerequisite)" +echo ">>> Bringing stack down (replaces former 'make compose-down' prerequisite)" "${PYTHON}" -m cli.administration.deploy.development down echo ">>> Ensuring stack is up for distro ${INFINITO_DISTRO}" diff --git a/scripts/tests/deploy/local/exec/run.sh b/scripts/tests/deploy/local/exec/run.sh index 08c132a508..5aac8aa449 100755 --- a/scripts/tests/deploy/local/exec/run.sh +++ b/scripts/tests/deploy/local/exec/run.sh @@ -21,13 +21,13 @@ set -euo pipefail # INFINITO_CONTAINER Optional explicit override of the host container name. # # Examples: -# IMAGE=alpine make run -# IMAGE=alpine INFINITO_CMD='env | grep PATH' make run +# IMAGE=alpine make compose-inner-run +# IMAGE=alpine INFINITO_CMD='env | grep PATH' make compose-inner-run # IMAGE=mcr.microsoft.com/playwright:v1.59.1-noble \ # INFINITO_RUN_FLAGS='--env-file /tmp/test-e2e-playwright/web-app-friendica/.env \ # -v /tmp/test-e2e-playwright/web-app-friendica:/e2e -w /e2e' \ # INFINITO_CMD='npx playwright test --grep dashboard' \ -# make run +# make compose-inner-run SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../../../" && pwd)" diff --git a/scripts/tests/environment/02_system.sh b/scripts/tests/environment/02_system.sh index 868bb7d44a..10d2aed0d3 100755 --- a/scripts/tests/environment/02_system.sh +++ b/scripts/tests/environment/02_system.sh @@ -3,7 +3,7 @@ set -euo pipefail echo "Showing current disk and Docker resource usage before purging." -make system-disk-usage +make diagnose-disk-usage echo "Freeing disk and memory on minimal-hardware systems before the build." make system-purge diff --git a/scripts/tests/environment/04_bootstrap.sh b/scripts/tests/environment/04_bootstrap.sh index 1e575564e3..c019073d5a 100755 --- a/scripts/tests/environment/04_bootstrap.sh +++ b/scripts/tests/environment/04_bootstrap.sh @@ -12,4 +12,4 @@ echo "Bootstrapping the development environment: DNS, AppArmor, IPv6, and lint t make environment-bootstrap echo "Starting the local compose stack (builds the image if missing)." -make up +make compose-up diff --git a/scripts/tests/environment/07_deploy_minimal.sh b/scripts/tests/environment/07_deploy_minimal.sh index 6564fd24e3..2e6da96905 100755 --- a/scripts/tests/environment/07_deploy_minimal.sh +++ b/scripts/tests/environment/07_deploy_minimal.sh @@ -26,7 +26,7 @@ CACHE_AFTER="$(cache_snapshot)" assert_caches_used "${CACHE_BEFORE}" "${CACHE_AFTER}" echo "Trusting the local CA certificate so HTTPS endpoints are reachable from the host." -make trust-ca +make network-trust-ca echo "Verifying the dashboard is reachable (matomo was disabled, not the dashboard itself)." assert_http_status 200 "${DASHBOARD_URL}" diff --git a/scripts/tests/environment/08_deploy_performance.sh b/scripts/tests/environment/08_deploy_performance.sh index d743dd304e..4fa494ea67 100755 --- a/scripts/tests/environment/08_deploy_performance.sh +++ b/scripts/tests/environment/08_deploy_performance.sh @@ -11,7 +11,7 @@ make deploy mode=reinstall apps="${MATOMO_APP}" INFINITO_FULL_CYCLE=true inspect echo "Re-trusting the CA after the fresh deploy rebuilt the certificates." -make trust-ca +make network-trust-ca echo "Verifying matomo is now reachable after its dedicated deploy." assert_http_status 200 "${MATOMO_URL}" diff --git a/scripts/tests/environment/10_teardown.sh b/scripts/tests/environment/10_teardown.sh index a351b2a252..99211de6f4 100755 --- a/scripts/tests/environment/10_teardown.sh +++ b/scripts/tests/environment/10_teardown.sh @@ -3,7 +3,7 @@ set -euo pipefail echo "Stopping the compose stack and removing all volumes for a clean teardown." -make down +make compose-down echo "Reversing the environment bootstrap (DNS, AppArmor, IPv6 settings)." make environment-teardown diff --git a/scripts/tests/environment/utils/common.sh b/scripts/tests/environment/utils/common.sh index 04b7d23245..010419a783 100755 --- a/scripts/tests/environment/utils/common.sh +++ b/scripts/tests/environment/utils/common.sh @@ -69,7 +69,7 @@ ensure_git_safe_directory # — keep the inner shell strictly POSIX (no bash arrays, no `shopt`, no `(( ))`). inspect_glob_print() { local glob_pattern="$1" fallback="$2" - make exec INFINITO_CMD="set -eu; \ + make compose-exec INFINITO_CMD="set -eu; \ any=; \ for f in ${glob_pattern}; do \ [ -f \"\$f\" ] || continue; \ diff --git a/utils/cleanup/pycache_only_dirs.py b/utils/cleanup/pycache_only_dirs.py index bebdd2def5..4f8b5eec8d 100644 --- a/utils/cleanup/pycache_only_dirs.py +++ b/utils/cleanup/pycache_only_dirs.py @@ -5,7 +5,7 @@ deleted: the ``__pycache__`` cache remains and the now-orphan parent directory holds nothing else. ``git clean -fdX`` does not touch the parent because the parent itself is tracked, so they stick around forever. -Run via ``python -m utils.cleanup.pycache_only_dirs`` (or ``make clean-pycache-only-dirs``). +Run via ``python -m utils.cleanup.pycache_only_dirs`` (or ``make clean-pycache-dirs``). """ from __future__ import annotations