forked from mtusi2026/mtusi2026lab5
Bring the application, own tests, Dockerfile, toolchain, compose stack, HAProxy, k6 and RustFS configuration, migrations, hooks, evidence and scenario scripts and the CI job from the lab 4 solution commit d2744bc, merge the lab 4 Makefile targets into the lab 5 skeleton Makefile without touching its targets, and append the lab 4 solution variables to the skeleton .env.example. The package and the application follow the contract version 1.5.0, and the image and the throwaway test containers are tagged lab5 so they do not collide with a lab 4 stand on the same host. This is the starting point of the lab 5 cycle: lint, own tests and the offline skeleton check pass before any lab 5 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"; }
|