Bring the application, own tests, Dockerfile, toolchain, compose stack,
HAProxy, k6, RustFS and RabbitMQ configuration, migrations, hooks,
scenario scripts and the CI job from the lab 5 solution commit 64d5c67,
keep the lab 5 Makefile targets on top of the unchanged skeleton
targets, and append the lab 5 solution variables to the skeleton
.env.example. The package and the application follow the contract
version 1.6.0, and the image, the throwaway test containers and the
broker vhost description are tagged lab6 so they do not collide with a
lab 5 stand on the same host.
This is the starting point of the lab 6 cycle: lint, own tests and the
offline skeleton check pass before any lab 6 change.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
25 lines
865 B
Bash
Executable File
25 lines
865 B
Bash
Executable File
#!/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"
|
|
put s3_root_user "root$(random | cut -c1-16)"
|
|
put s3_root_password "$(random)"
|
|
put s3_access_key_id "api$(random | cut -c1-16)"
|
|
put s3_secret_access_key "$(random)"
|
|
[ -f .env ] || { cp .env.example .env; echo "создан .env из .env.example"; }
|