Repository navigation
Configuration
The bridge is configured in two places: config.yaml (a standard mautrix bridgev2 config) and environment variables for the relay connection.
| Variable | Meaning |
|---|---|
MACOUN_NAC_RELAY_URL |
Base URL of the relay, for example https://<mac-ip>:5001
|
MACOUN_NAC_RELAY_TOKEN |
The relay's bearer token |
MACOUN_NAC_RELAY_CERT_FP |
SHA-256 of the relay's DER certificate, hex. When set, the certificate is pinned; when unset, it must chain to a public CA |
MACOUN_ANISETTE_PROVIDER_URL, _TOKEN, _CERT_FP
|
Optional: a separate provider for anisette. Unset means anisette comes from the relay above |
MACOUN_ANISETTE_URL |
Last resort: an anisette v3 server, https only. Public v3 servers do not work with a Mac identity |
MACOUN_OUTBOUND_LIMIT |
off disables the outbound send limiter. Not recommended |
XDG_DATA_HOME |
Parent of the state directory. State lives in $XDG_DATA_HOME/corten-matrix/ (the upstream name is kept so existing data works) |
RUST_LOG |
Log filter for the Rust side. Suggested: warn,rustpush=warn,rustpush::ids::identity_manager=info,rustpushgo=info
|
The relay URL, token and fingerprint can also be embedded in the hardware key by extract-key; the environment wins when both are present.
Keep the token and the hardware key in a secret store or a root-only environment file.
./macoun-matrix -e -c config.yaml writes an example. The homeserver, appservice, database, permissions and encryption sections are the same as in any mautrix bridge; the mautrix bridge docs explain them.
iMessage options that are most often changed (full table in bridge-guide.md, reference in example-config.yaml):
| Option | Default | Meaning |
|---|---|---|
cloudkit_backfill |
false |
Backfill history from iCloud. Needs the device PIN at login |
preferred_handle |
from login | The identity you send from, tel:+15551234567 or mailto:user@example.com
|
read_receipts, typing_notifications
|
true |
Whether your read state and typing are sent to iMessage contacts |
disable_facetime |
false |
Turn off FaceTime call notices |
disable_icloud_contacts |
false |
Skip iCloud contacts and the periodic refresh of shared profiles |
carddav.* |
unset | An external CardDAV server for contact names |
heic_conversion, video_transcoding
|
false |
Convert HEIC to JPEG (needs libheif) and remux video to MP4 (needs ffmpeg) |
max_attachment_size_mb |
100 |
Attachments above this are skipped |
bridge_status_notices |
bridgev2 default | Set to errors to get a notice in the management room when the relay is unreachable and when it recovers |
Sends from Matrix pass through a limiter before they reach Apple:
- at most 10 new chats (chats with no history) per rolling 24 hours and 64 per rolling 7 days,
- 30 sends per chat per minute,
- 300 sends per login per hour.
A refused send fails visibly with a notice in the room. Ordinary conversation does not come near these numbers; they exist to stop a runaway client or bot from producing traffic that looks like spam from your account. The new-chat state is stored encrypted in the bridge database (macoun_outbound_limiter, key in macoun-limiter.key).
Besides the usual bridge database and the corten-matrix/ state directory (session.json, keystore.plist), macoun adds the tables macoun_outbound_limiter, macoun_attachment_index* and macoun_recycle_bin_*, and the key files macoun-limiter.key and macoun-attachment-index.key. All are created on first use. Back up the state directory together with the database.