mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-23 15:26:42 +02:00
feat(infra): smart build memory check and baseline monitoring script
build-app.sh now checks available RAM before builds and only stops monitoring containers when free memory is below 3 GB threshold. New memory-baseline.sh script measures per-container and per-category RAM usage for capacity planning. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2b448419ba
commit
f5cd77b2b0
10 changed files with 550 additions and 14 deletions
54
docker/matrix/config/appservices/generate-as.sh
Normal file
54
docker/matrix/config/appservices/generate-as.sh
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Generate random token
|
||||
gen_token() {
|
||||
openssl rand -hex 32
|
||||
}
|
||||
|
||||
# Bot configurations: name, sender_localpart
|
||||
declare -a BOTS=(
|
||||
"mana:mana-bot"
|
||||
"ollama:ollama-bot"
|
||||
"stats:stats-bot"
|
||||
"projectdoc:projectdoc-bot"
|
||||
"todo:todo-bot"
|
||||
"calendar:calendar-bot"
|
||||
"nutriphi:nutriphi-bot"
|
||||
"zitare:zitare-bot"
|
||||
"clock:clock-bot"
|
||||
"tts:tts-bot"
|
||||
)
|
||||
|
||||
echo "# Generated AS tokens for .env file:" > as-tokens.env
|
||||
echo "" >> as-tokens.env
|
||||
|
||||
for bot_config in "${BOTS[@]}"; do
|
||||
IFS=":" read -r name sender <<< "$bot_config"
|
||||
|
||||
as_token=$(gen_token)
|
||||
hs_token=$(gen_token)
|
||||
|
||||
cat > "${name}-bot.yaml" << EOF
|
||||
id: ${name}-bot
|
||||
hs_token: ${hs_token}
|
||||
as_token: ${as_token}
|
||||
url: null
|
||||
sender_localpart: ${sender}
|
||||
namespaces:
|
||||
users:
|
||||
- exclusive: true
|
||||
regex: '@${sender}:mana\.how'
|
||||
rooms: []
|
||||
aliases: []
|
||||
rate_limited: false
|
||||
EOF
|
||||
|
||||
# Convert name to uppercase for env var
|
||||
env_name=$(echo "${name}" | tr '[:lower:]' '[:upper:]' | tr '-' '_')
|
||||
echo "MATRIX_${env_name}_BOT_AS_TOKEN=${as_token}" >> as-tokens.env
|
||||
|
||||
echo "Created ${name}-bot.yaml with AS token"
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Done! Add the tokens from as-tokens.env to your .env file"
|
||||
Loading…
Add table
Add a link
Reference in a new issue