Carry over the lab 3 solution

Bring the application, own tests, Dockerfile, toolchain, compose stack,
HAProxy and k6 configuration, migrations, hooks, evidence and level 4
scripts and the CI job from the lab 3 solution commit 61c0c28, merge
the lab 3 Makefile targets into the lab 4 skeleton Makefile without
touching its targets, and append the lab 3 solution variables to the
skeleton .env.example. The package and the application follow the
contract version 1.4.0, and the image and the throwaway test containers
are tagged lab4 so they do not collide with a lab 3 stand on the same
host.

This is the starting point of the lab 4 cycle: lint, own tests and the
offline skeleton check pass before any lab 4 change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Artyom
2026-10-28 20:17:51 +03:00
co-authored by Claude Opus 5.5
parent b0f463ac5c
commit bf8e4e3cd1
129 changed files with 8698 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
umask 077
mkdir -p secrets
random() { od -An -N32 -tx1 /dev/urandom | tr -d ' \n'; }
put() {
if [ ! -s "secrets/$1" ]; then
printf '%s' "$2" > "secrets/$1"
chmod 644 "secrets/$1"
echo "создан secrets/$1"
fi
}
put postgres_password "$(random)"
put database_url "postgresql://messenger:$(cat secrets/postgres_password)@postgres:5432/messenger"
put cursor_secret "$(random)"
put valkey_password "$(random)"
put valkey.conf "requirepass $(cat secrets/valkey_password)"
put cache_url "redis://:$(cat secrets/valkey_password)@valkey:6379/0"
[ -f .env ] || { cp .env.example .env; echo "создан .env из .env.example"; }