Реализация на 5

This commit is contained in:
Grbisba
2026-11-13 11:05:05 +03:00
parent ec540a1a72
commit d862103650
148 changed files with 11225 additions and 55 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
umask 077
mkdir -p secrets/lab4
if [ ! -f .env.lab4 ]; then
{ printf 'POSTGRES_PASSWORD='; openssl rand -hex 24
printf 'REDIS_PASSWORD='; openssl rand -hex 24
printf 'HOST_PORT=18081\nAPI_REPLICAS=2\n'
} > .env.lab4
fi
if [ ! -f secrets/lab4/private_key.pem ]; then
openssl genrsa -out secrets/lab4/private_key.pem 2048 2>/dev/null
fi
if [ ! -f secrets/lab4/public_key.pem ]; then
openssl rsa -in secrets/lab4/private_key.pem -pubout -out secrets/lab4/public_key.pem 2>/dev/null
fi
# Only synthetic stand keys, readable by the non-root application inside containers.
chmod 755 secrets secrets/lab4
chmod 444 secrets/lab4/*.pem
printf '%s\n' 'Local lab4 settings and synthetic keys ready; existing files preserved.'
python3 scripts/bootstrap-storage.py