add script to perform mas migration compatibility check
This commit is contained in:
39
abra.sh
39
abra.sh
@ -19,6 +19,45 @@ ensure_mas_database () {
|
||||
fi
|
||||
}
|
||||
|
||||
# Local helper: fetch homeserver.yaml from app, push to mas, then syn2mas check + dry-run.
|
||||
prepare_mas_migration () {
|
||||
local hs_local syn_cfg
|
||||
|
||||
syn_cfg=/tmp/homeserver.yaml
|
||||
|
||||
cleanup_prepare_mas_migration() {
|
||||
rm -f "homeserver.yaml"
|
||||
}
|
||||
trap cleanup_prepare_mas_migration EXIT
|
||||
|
||||
echo "Fetching /data/homeserver.yaml from app to homeserver.yaml (abra app run … cat)..."
|
||||
if ! abra app run -t "$DOMAIN" app cat /data/homeserver.yaml > "homeserver.yaml"
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
if [ ! -s "homeserver.yaml" ]; then
|
||||
echo "Error: fetched homeserver.yaml is empty." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "Copying into mas:/tmp"
|
||||
abra app cp -C "$DOMAIN" "homeserver.yaml" "mas:/tmp" || return 1
|
||||
|
||||
echo "Running mas-cli syn2mas check..."
|
||||
abra app run -t "$DOMAIN" mas -- mas-cli syn2mas check \
|
||||
--config /etc/mas/config.yaml \
|
||||
--synapse-config "$syn_cfg" || return 1
|
||||
|
||||
echo "Running mas-cli syn2mas migrate --dry-run..."
|
||||
abra app run -t "$DOMAIN" mas -- mas-cli syn2mas migrate \
|
||||
--config /etc/mas/config.yaml \
|
||||
--synapse-config "$syn_cfg" \
|
||||
--dry-run || return 1
|
||||
|
||||
# trap - EXIT
|
||||
# cleanup_prepare_mas_migration
|
||||
}
|
||||
|
||||
set_admin () {
|
||||
admin=akadmin
|
||||
if [ -n "$1" ]
|
||||
|
||||
Reference in New Issue
Block a user