Fix: Ensure registration.yaml sender_localpart is always whatsappbot and update Makefile for build service
This commit is contained in:
4
start.sh
4
start.sh
@@ -58,6 +58,7 @@ if [ ! -f "$CONFIG_PATH" ]; then
|
||||
yq -i -y '.appservice.public_address = "https://'"$CLOUDRON_APP_DOMAIN"'"' "$CONFIG_PATH" || echo "=> ERROR: Could not configure appservice public_address"
|
||||
yq -i -y '.appservice.hostname = "0.0.0.0"' "$CONFIG_PATH" || echo "=> ERROR: Could not configure appservice hostname"
|
||||
yq -i -y '.appservice.port = 29318' "$CONFIG_PATH" || echo "=> ERROR: Could not configure appservice port"
|
||||
yq -i -y '.appservice.bot_username = "whatsappbot"' "$CONFIG_PATH" || echo "=> ERROR: Could not configure appservice bot_username"
|
||||
|
||||
# Configure permissions for base domain users
|
||||
yq -i -y '.bridge.permissions."'"$BASE_DOMAIN"'" = "user"' "$CONFIG_PATH" || echo "=> ERROR: Could not configure permissions"
|
||||
@@ -105,6 +106,7 @@ if [ ! -f "$CONFIG_PATH" ]; then
|
||||
# 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[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"
|
||||
fi
|
||||
|
||||
chown cloudron:cloudron "$CONFIG_PATH" "$REGISTRATION_PATH" 2>/dev/null || true
|
||||
@@ -154,6 +156,7 @@ else
|
||||
yq -i -y '.appservice.public_address = "https://'"$CLOUDRON_APP_DOMAIN"'"' "$CONFIG_PATH" || echo "=> ERROR: Could not update appservice public_address"
|
||||
yq -i -y '.appservice.hostname = "0.0.0.0"' "$CONFIG_PATH" || echo "=> ERROR: Could not update appservice hostname"
|
||||
yq -i -y '.appservice.port = 29318' "$CONFIG_PATH" || echo "=> ERROR: Could not update appservice port"
|
||||
yq -i -y '.appservice.bot_username = "whatsappbot"' "$CONFIG_PATH" || echo "=> ERROR: Could not update appservice bot_username"
|
||||
|
||||
# Configure permissions for base domain users
|
||||
yq -i -y '.bridge.permissions."'"$BASE_DOMAIN"'" = "user"' "$CONFIG_PATH" || echo "=> ERROR: Could not update permissions"
|
||||
@@ -226,6 +229,7 @@ else
|
||||
# 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[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"
|
||||
fi
|
||||
|
||||
# Let the bridge handle token generation automatically - remove any placeholder tokens
|
||||
|
Reference in New Issue
Block a user