lab7: безопасность, mTLS, OpenBao и PKI lifecycle

This commit is contained in:
Vladislav Kunetskiy
2026-11-10 10:58:07 +03:00
parent 3d216fbd50
commit 3441f2269a
183 changed files with 216667 additions and 3165 deletions
+7 -4
View File
@@ -1,5 +1,7 @@
#!/bin/sh
set -eu
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
cd "$ROOT_DIR"
# Fault-injection hook: stop exactly ONE api replica of the lab5 stand.
#
# TARGET_INSTANCE_ID=<hostname|container name|short id> scripts/stop-one.sh
@@ -15,18 +17,19 @@ set -eu
PROJECT=${COMPOSE_PROJECT_NAME:-mtusi-messenger-lab6}
candidates=$(docker ps -q \
--filter "label=com.docker.compose.project=${PROJECT}" \
--filter "label=com.docker.compose.service=api")
candidates=$(python3 student-tests/tests_helpers.py compose ps -q api)
if [ -z "$candidates" ]; then
printf 'stop-one.sh: no api containers of project %s are running\n' "$PROJECT" >&2
exit 1
fi
set -- $candidates
PROJECT=$(docker inspect --format '{{index .Config.Labels "com.docker.compose.project"}}' "$1")
# Matches the requested alias against every reasonable identifier of a replica:
# container hostname (= X-Instance-Id), full/short container id, full container
# name (mtusi-messenger-lab4-api-1) and the service-local suffix (api-1).
# name (project-api-1) and the service-local suffix (api-1).
match_replica() {
target=$1
full_id=$2