mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 03:38:23 +00:00
Apply a consistent naming convention to the Make target inventory so
every target is grouped by its domain:
- compose-* (compose-up/down/restart/stop/exec/inner-run)
- network-* (network-dns-setup/remove, network-ipv6-disable/restore,
network-refresh, network-trust-ca)
- security-* (security-apparmor-restore/teardown)
- diagnose-* (diagnose-network, diagnose-disk-usage)
- fix-* (fix-chmod, fix-dockerignore)
- clean-* (clean-cache, clean-pycache-dirs)
- install-* (install-agent)
- meta-* (meta-list, meta-tree, meta-mig)
Drop the stale debug-network target and reintroduce its functionality
as diagnose-network. Cascade renames through:
- Makefile (.PHONY entries, prereqs, recursive $(MAKE) calls)
- contributor docs, agent-iteration docs, role-level docs
- bundle README, environment scripts, install/lint/test wrappers
- AGENTS.md, CLAUDE.md, compose/cache.override.yml, .github/workflows
Historical entries under docs/requirements/ and changelog/ stay
untouched as audit logs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
77 lines
2.0 KiB
Bash
Executable File
77 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
set -euo pipefail
|
||
|
||
# -----------------------------------------------------------------------------
|
||
# Trust Infinito Root CA from running container on the host system
|
||
# -----------------------------------------------------------------------------
|
||
|
||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||
|
||
# shellcheck source=scripts/meta/env/load.sh
|
||
source "${SCRIPT_DIR}/../../../meta/env/load.sh"
|
||
|
||
CONTAINER_NAME="${INFINITO_CONTAINER}"
|
||
CA_SRC_PATH="/etc/infinito.nexus/ca/root-ca.crt"
|
||
CA_DST_DIR="/etc/infinito.nexus/ca"
|
||
CA_DST_PATH="${CA_DST_DIR}/root-ca.crt"
|
||
CA_TRUST_NAME="infinito-root-ca"
|
||
|
||
WITH_CA_TRUST_SCRIPT="${SCRIPT_DIR}/../../../../roles/sys-ca-selfsigned/files/with-ca-trust.sh"
|
||
|
||
log() {
|
||
echo "[network-trust-ca] $*" >&2
|
||
}
|
||
|
||
require() {
|
||
if ! command -v "$1" >/dev/null 2>&1; then
|
||
echo "[network-trust-ca] ERROR: required command not found: $1" >&2
|
||
exit 1
|
||
fi
|
||
}
|
||
|
||
# --- checks ------------------------------------------------------------------
|
||
|
||
require docker
|
||
require sudo
|
||
|
||
if [ -z "$CONTAINER_NAME" ]; then
|
||
echo "[network-trust-ca] ERROR: INFINITO_CONTAINER is not set" >&2
|
||
exit 2
|
||
fi
|
||
|
||
if [ ! -f "$WITH_CA_TRUST_SCRIPT" ]; then
|
||
echo "[network-trust-ca] ERROR: with-ca-trust.sh not found at $WITH_CA_TRUST_SCRIPT" >&2
|
||
exit 3
|
||
fi
|
||
|
||
log "Using container: $CONTAINER_NAME"
|
||
log "CA source path (container): $CA_SRC_PATH"
|
||
log "CA destination path (host): $CA_DST_PATH"
|
||
|
||
# --- extract CA ---------------------------------------------------------------
|
||
|
||
log "Extracting Root CA from container"
|
||
sudo mkdir -p "$CA_DST_DIR"
|
||
|
||
sudo docker cp \
|
||
"${CONTAINER_NAME}:${CA_SRC_PATH}" \
|
||
"$CA_DST_PATH"
|
||
|
||
sudo chmod 0644 "$CA_DST_PATH"
|
||
|
||
# --- trust CA -----------------------------------------------------------------
|
||
|
||
log "Installing CA into host trust store"
|
||
|
||
sudo \
|
||
CA_TRUST_CERT="$CA_DST_PATH" \
|
||
CA_TRUST_NAME="$CA_TRUST_NAME" \
|
||
VERBOSE=1 \
|
||
bash "$WITH_CA_TRUST_SCRIPT"
|
||
|
||
log "CA trust installation completed successfully"
|
||
|
||
echo
|
||
echo "✅ Root CA trusted on host system"
|
||
echo "ℹ️ Restart browsers (Chrome / Firefox) if already running"
|