Matrix bridge for Hostex property management system
971
A Matrix bridge for the Hostex property management system using mautrix-go bridgev2 framework. This bridge allows you to receive and send messages from your Hostex conversations directly in Matrix with full double puppeting support - your host messages appear as sent by you, not the bridge bot.
!hostex refreshMatrix Room ā mautrix-hostex ā Hostex API
pkg/hostexapi/): HTTP client for Hostex API v3.0.0pkg/connector/): mautrix bridgev2 implementationpkg/webhook/): Webhook endpoint implementation (untested)cmd/mautrix-hostex/): Entry point and bridge initializationdocker-compose.yml:version: '3.8'
services:
mautrix-hostex:
build: .
container_name: mautrix-hostex
volumes:
- ./data:/data
ports:
- "29337:29337"
restart: unless-stopped
docker-compose up -d
data/config.yaml with your Matrix homeserver and Hostex API detailsInstall libolm on macOS:
brew install libolm
Install libolm on Ubuntu/Debian:
sudo apt install libolm-dev
git clone https://github.com/keithah/matrix-hostex-bridge.git
cd matrix-hostex-bridge
# Build with proper CGO flags for libolm
CGO_CFLAGS="-I$(brew --prefix)/include" CGO_LDFLAGS="-L$(brew --prefix)/lib" go build -o mautrix-hostex ./cmd/mautrix-hostex
# Use bbctl to generate proper bridgev2 config with double puppeting
bbctl config --type bridgev2 sh-generic -o config.yaml
# Or generate basic config for standalone usage
./mautrix-hostex -g -c config.yaml -r registration.yaml
config.yaml with your settings and start:./mautrix-hostex -c config.yaml
Note: When using with Beeper, the bbctl-generated config includes proper double puppeting configuration and should be preferred over the basic generated config.
When using with Beeper, the bridge uses a bridgev2 configuration that includes:
as_tokensh-hostex prefix for Beeper compatibilityExample network section to add to your bbctl-generated config:
network:
hostex_api_url: https://api.hostex.io/v3
admin_user: "@yourusername:beeper.com"
For standalone usage:
The bridge uses the official Hostex logo as its avatar. To set this up:
./mautrix-hostex./upload-avatar.shconfig.yaml with the returned mxc:// URI./mautrix-hostex
@sh-hostexbot:beeper.local)login command and provide your Hostex API tokenlogin - Authenticate with your Hostex API tokenlogout - Sign out from Hostexlist-logins - Show your current login statusrefresh - Manually refresh conversation cache and check for new messageshelp - Show available commandsThis bridge is fully compatible with Beeper and includes proper double puppeting support:
bbctl loginbbctl config --type bridgev2 sh-generic -o config.yamlusername_template to sh-hostex_{{.}}username to sh-hostexbotnetwork section with your Hostex API settingsWhen properly configured with the bridgev2 config:
as_token for automatic double puppetingbbctl register sh-hostexhostex-matrix-bridge/
āāā cmd/mautrix-hostex/main.go # Application entry point
āāā pkg/
ā āāā connector/
ā ā āāā connector.go # Main bridge implementation with double puppeting
ā ā āāā minimal.go # Minimal test connector
ā āāā hostexapi/client.go # Hostex API client
ā āāā webhook/handler.go # Webhook handler (untested)
āāā config.yaml # Bridgev2 configuration (generated by bbctl)
āāā config.example.yaml # Example standalone configuration
āāā registration.yaml # Bridge registration for Matrix homeserver
āāā go.mod # Go dependencies
āāā Dockerfile # Container build
āāā docker-run.sh # Container runtime
# Development build
go run . -g -c config.yaml -r registration.yaml
# Production build with version info
TAG=v0.1.0 COMMIT=$(git rev-parse HEAD) BUILD_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
go build -ldflags "-X 'hostex-matrix-bridge/cmd/mautrix-hostex.Tag=${TAG}' -X 'hostex-matrix-bridge/cmd/mautrix-hostex.Commit=${COMMIT}' -X 'hostex-matrix-bridge/cmd/mautrix-hostex.BuildTime=${BUILD_TIME}'"
# Run tests
go test ./...
# Test Hostex API connection
curl -H "Hostex-Access-Token: your-token" https://api.hostex.io/v1/properties
This project is licensed under the Mozilla Public License 2.0 (MPL-2.0) - see the LICENSE file for details.
This license choice matches the core mautrix framework dependency and allows commercial use while ensuring improvements to the bridge remain open source.
Content type
Image
Digest
sha256:bb8e97d80ā¦
Size
64.4 MB
Last updated
about 1 year ago
docker pull keithah/mautrix-hostex