forked from mtusi2026/mtusi2026lab7
Добавить стенд лабораторной 7 с mTLS, OpenBao и least privilege worker.
Закрывает обязательный минимум и трек 1: ротация leaf и секрета, sealed OpenBao и сохранность queued-задачи.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# Map the public random alias to the compose service and stop only that replica.
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
|
||||
found=""
|
||||
for dir in run/instances/*; do
|
||||
[ -f "$dir/id" ] || continue
|
||||
current=$(tr -d '\r\n' < "$dir/id")
|
||||
if [ "$current" = "$TARGET_INSTANCE_ID" ]; then
|
||||
found=$(basename "$dir")
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -z "$found" ]; then
|
||||
echo "unknown instance alias" >&2
|
||||
exit 1
|
||||
fi
|
||||
case "$found" in
|
||||
api-1|api-2) ;;
|
||||
*) echo "alias does not belong to an API replica" >&2; exit 1 ;;
|
||||
esac
|
||||
docker compose --env-file .env stop -t 2 "$found"
|
||||
Reference in New Issue
Block a user