fix minor bugs with mas integration

This commit is contained in:
Simon
2026-05-12 21:46:13 +02:00
parent d82d539424
commit cff6cfb001
5 changed files with 35 additions and 11 deletions

28
abra.sh
View File

@ -8,7 +8,7 @@ export TELEGRAM_BRIDGE_YAML_VERSION=v6
export NGINX_CONFIG_VERSION=v13
export WK_SERVER_VERSION=v1
export WK_CLIENT_VERSION=v2
export MAS_CONFIG_VERSION=v1
export MAS_CONFIG_VERSION=v2
export PG_BACKUP_VERSION=v2
export ADMIN_CONFIG_VERSION=v1
@ -19,9 +19,33 @@ ensure_mas_database () {
fi
}
# Generate a PEM RSA private key and insert it as the MAS signing secret.
# `abra app secret generate` can only produce random hex/charset strings, so this
# secret is marked `generate=false` in .env.sample and handled here instead.
generate_mas_signing_rsa() {
if ! command -v openssl &> /dev/null; then
echo "openssl is required on your local machine to generate the MAS signing key."
echo "It could not be found in your PATH, please install openssl to proceed."
exit 1
fi
KEY=$(openssl genrsa 2048 2>/dev/null)
if [ -z "$KEY" ]; then
echo "Failed to generate RSA private key with openssl."
exit 1
fi
if printf '%s\n' "$KEY" | abra app secret insert -C "$APP_NAME" mas_signing_rsa v1; then
echo "MAS signing RSA key generated and inserted as v1."
else
echo "Failed to insert MAS signing RSA key."
exit 1
fi
}
# Local helper: fetch homeserver.yaml from app, push to mas, then syn2mas check + dry-run.
prepare_mas_migration () {
local hs_local syn_cfg
local syn_cfg
syn_cfg=/tmp/homeserver.yaml