|
|
|
@@ -81,7 +81,7 @@ if [ ! -f "$CONFIG_PATH" ]; then
|
|
|
|
yq -i -y '.encryption.allow = true' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption allow"
|
|
|
|
yq -i -y '.encryption.allow = true' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption allow"
|
|
|
|
yq -i -y '.encryption.default = false' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption default"
|
|
|
|
yq -i -y '.encryption.default = false' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption default"
|
|
|
|
yq -i -y '.encryption.require = false' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption require"
|
|
|
|
yq -i -y '.encryption.require = false' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption require"
|
|
|
|
yq -i -y '.encryption.appservice = false' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption appservice"
|
|
|
|
yq -i -y '.encryption.appservice = true' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption appservice"
|
|
|
|
yq -i -y '.encryption.plaintext_mentions = false' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption plaintext_mentions"
|
|
|
|
yq -i -y '.encryption.plaintext_mentions = false' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption plaintext_mentions"
|
|
|
|
yq -i -y '.encryption.delete_keys.delete_outbound_on_ack = true' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption delete_outbound_on_ack"
|
|
|
|
yq -i -y '.encryption.delete_keys.delete_outbound_on_ack = true' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption delete_outbound_on_ack"
|
|
|
|
yq -i -y '.encryption.delete_keys.dont_store_outbound = true' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption dont_store_outbound"
|
|
|
|
yq -i -y '.encryption.delete_keys.dont_store_outbound = true' "$CONFIG_PATH" || echo "=> ERROR: Could not configure encryption dont_store_outbound"
|
|
|
|
@@ -105,7 +105,7 @@ if [ ! -f "$CONFIG_PATH" ]; then
|
|
|
|
echo "=> Fixing registration file regex patterns for domain: $BASE_DOMAIN"
|
|
|
|
echo "=> Fixing registration file regex patterns for domain: $BASE_DOMAIN"
|
|
|
|
# Fix user regex patterns to use base domain instead of matrix subdomain
|
|
|
|
# Fix user regex patterns to use base domain instead of matrix subdomain
|
|
|
|
yq -i -y '.namespaces.users[0].regex = "^@whatsappbot:'"$BASE_DOMAIN"'$"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix whatsappbot regex"
|
|
|
|
yq -i -y '.namespaces.users[0].regex = "^@whatsappbot:'"$BASE_DOMAIN"'$"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix whatsappbot regex"
|
|
|
|
yq -i -y '.namespaces.users[1].regex = "^@whatsapp_.*:'"$BASE_DOMAIN"'$"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix whatsapp_.* regex"
|
|
|
|
yq -i -y '.namespaces.users[1].regex = "^@whatsapp_.+:'"$BASE_DOMAIN"'$"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix whatsapp_.+ regex"
|
|
|
|
yq -i -y '.sender_localpart = "whatsappbot"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix sender_localpart"
|
|
|
|
yq -i -y '.sender_localpart = "whatsappbot"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix sender_localpart"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
@@ -179,7 +179,7 @@ else
|
|
|
|
yq -i -y '.encryption.allow = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption allow"
|
|
|
|
yq -i -y '.encryption.allow = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption allow"
|
|
|
|
yq -i -y '.encryption.default = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption default"
|
|
|
|
yq -i -y '.encryption.default = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption default"
|
|
|
|
yq -i -y '.encryption.require = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption require"
|
|
|
|
yq -i -y '.encryption.require = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption require"
|
|
|
|
yq -i -y '.encryption.appservice = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption appservice"
|
|
|
|
yq -i -y '.encryption.appservice = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption appservice"
|
|
|
|
yq -i -y '.encryption.plaintext_mentions = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption plaintext_mentions"
|
|
|
|
yq -i -y '.encryption.plaintext_mentions = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption plaintext_mentions"
|
|
|
|
yq -i -y '.encryption.delete_keys.delete_outbound_on_ack = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption delete_outbound_on_ack"
|
|
|
|
yq -i -y '.encryption.delete_keys.delete_outbound_on_ack = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption delete_outbound_on_ack"
|
|
|
|
yq -i -y '.encryption.delete_keys.dont_store_outbound = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption dont_store_outbound"
|
|
|
|
yq -i -y '.encryption.delete_keys.dont_store_outbound = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption dont_store_outbound"
|
|
|
|
@@ -209,7 +209,7 @@ else
|
|
|
|
yq -i -y '.encryption.allow = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption allow"
|
|
|
|
yq -i -y '.encryption.allow = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption allow"
|
|
|
|
yq -i -y '.encryption.default = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption default"
|
|
|
|
yq -i -y '.encryption.default = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption default"
|
|
|
|
yq -i -y '.encryption.require = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption require"
|
|
|
|
yq -i -y '.encryption.require = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption require"
|
|
|
|
yq -i -y '.encryption.appservice = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption appservice"
|
|
|
|
yq -i -y '.encryption.appservice = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption appservice"
|
|
|
|
yq -i -y '.encryption.plaintext_mentions = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption plaintext_mentions"
|
|
|
|
yq -i -y '.encryption.plaintext_mentions = false' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption plaintext_mentions"
|
|
|
|
yq -i -y '.encryption.delete_keys.delete_outbound_on_ack = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption delete_outbound_on_ack"
|
|
|
|
yq -i -y '.encryption.delete_keys.delete_outbound_on_ack = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption delete_outbound_on_ack"
|
|
|
|
yq -i -y '.encryption.delete_keys.dont_store_outbound = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption dont_store_outbound"
|
|
|
|
yq -i -y '.encryption.delete_keys.dont_store_outbound = true' "$CONFIG_PATH" || echo "=> ERROR: Could not update encryption dont_store_outbound"
|
|
|
|
@@ -228,7 +228,7 @@ else
|
|
|
|
yq -i -y '.url = "https://'"$CLOUDRON_APP_DOMAIN"'"' "$REGISTRATION_PATH" 2>/dev/null || true
|
|
|
|
yq -i -y '.url = "https://'"$CLOUDRON_APP_DOMAIN"'"' "$REGISTRATION_PATH" 2>/dev/null || true
|
|
|
|
# Fix user regex patterns to use base domain instead of matrix subdomain
|
|
|
|
# Fix user regex patterns to use base domain instead of matrix subdomain
|
|
|
|
yq -i -y '.namespaces.users[0].regex = "^@whatsappbot:'"$BASE_DOMAIN"'$"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix whatsappbot regex"
|
|
|
|
yq -i -y '.namespaces.users[0].regex = "^@whatsappbot:'"$BASE_DOMAIN"'$"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix whatsappbot regex"
|
|
|
|
yq -i -y '.namespaces.users[1].regex = "^@whatsapp_.*:'"$BASE_DOMAIN"'$"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix whatsapp_.* regex"
|
|
|
|
yq -i -y '.namespaces.users[1].regex = "^@whatsapp_.+:'"$BASE_DOMAIN"'$"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix whatsapp_.+ regex"
|
|
|
|
yq -i -y '.sender_localpart = "whatsappbot"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix sender_localpart"
|
|
|
|
yq -i -y '.sender_localpart = "whatsappbot"' "$REGISTRATION_PATH" || echo "=> ERROR: Could not fix sender_localpart"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|