From 3445b70342c9724cc65cb5653806be6f8deb8cac Mon Sep 17 00:00:00 2001 From: Karmanyaah Malhotra Date: Tue, 2 Mar 2021 20:54:30 -0500 Subject: [PATCH] config --- example-config.yaml | 57 ++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/example-config.yaml b/example-config.yaml index 9b6d5b2..276db87 100644 --- a/example-config.yaml +++ b/example-config.yaml @@ -17,16 +17,17 @@ appservice: # Database config. database: - # The database type. "sqlite3" and "postgres" are supported. - type: sqlite3 + # The database type. only "postgres" is supported for now. sqlite is TODO + type: postgres # The database URI. # SQLite: File name is enough. https://github.com/mattn/go-sqlite3#connection-string # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable - uri: mautrix-whatsapp.db + uri: postgres://user:password@host/database?sslmode=disable # Maximum number of connections. Mostly relevant for Postgres. max_open_conns: 20 max_idle_conns: 2 + # NOT TESTED YET # Settings for provisioning API provisioning: # Prefix for the provisioning API paths. @@ -35,47 +36,37 @@ appservice: shared_secret: disable # The unique ID of this appservice. - id: whatsapp + id: groupme # Appservice bot details. bot: # Username of the appservice bot. - username: whatsappbot + username: groupmebot # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty # to leave display name/avatar as-is. - displayname: WhatsApp bridge bot - avatar: mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr + displayname: GroupMe bridge bot + avatar: mxc://malhotra.cc/YTWNAdhgJhYOPsKIxyfFZsrA # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. as_token: "This value is generated when generating the registration" hs_token: "This value is generated when generating the registration" +# Metrics not yet tested! metrics: # Whether or not to enable prometheus metrics enabled: false # IP and port where the metrics listener should be. The path is always /metrics listen: 127.0.0.1:8001 -whatsapp: - # Device name that's shown in the "WhatsApp Web" section in the mobile app. - os_name: Mautrix-WhatsApp bridge - # Browser name that determines the logo shown in the mobile app. If the name is unrecognized, a generic icon is shown. - # Use the name of an actual browser (Chrome, Firefox, Safari, IE, Edge, Opera) if you want a specific icon. - browser_name: mx-wa - # Bridge config bridge: # Localpart template of MXIDs for WhatsApp users. # {{.}} is replaced with the phone number of the WhatsApp user. - username_template: whatsapp_{{.}} - # Displayname template for WhatsApp users. - # {{.Notify}} - nickname set by the WhatsApp user - # {{.Jid}} - phone number (international format) - # The following variables are also available, but will cause problems on multi-user instances: - # {{.Name}} - display name from contact list - # {{.Short}} - short display name from contact list - # To use multiple if's, you need to use: {{else if .Name}}, for example: - # "{{if .Notify}}{{.Notify}}{{else if .Name}}{{.Name}}{{else}}{{.Jid}}{{end}} (WA)" - displayname_template: "{{if .Nickname}}{{.Nickname}}{{else}}{{call .UserID.String}}{{end}} (WA)" + username_template: groupme_{{.}} + # Displayname template for GroupMe users. + # {{call .UserID.String}} - the number GroupMe assigns to the user + # {{.Nickname}} - the nickname in that room + # {{.ImageURL}} - User's avatar URL is available but irrelevant here + displayname_template: "{{if .Nickname}}{{.Nickname}}{{else}}{{call .UserID.String}}{{end}} (GM)" # Localpart template for per-user room grouping community IDs. # On startup, the bridge will try to create these communities, add all of the specific user's # portals to the community, and invite the Matrix user to it. @@ -83,11 +74,12 @@ bridge: # communities.) # {{.Localpart}} is the MXID localpart and {{.Server}} is the MXID server part of the user. # whatsapp_{{.Localpart}}={{.Server}} is a good value that should work for any user. + # communities are NOT YET TESTED in the GroupMe bridge community_template: null - # WhatsApp connection timeout in seconds. + # GroupMe connection timeout in seconds. connection_timeout: 20 - # If WhatsApp doesn't respond within connection_timeout, should the bridge try to fetch the message + # If groupme doesn't respond within connection_timeout, should the bridge try to fetch the message # to see if it was actually bridged? Use this if you have problems with sends timing out but actually # succeeding. fetch_message_on_timeout: false @@ -95,9 +87,7 @@ bridge: # sent to WhatsApp. If fetch_message_on_timeout is enabled, a successful post-timeout fetch will # trigger a read receipt too. delivery_receipts: false - # Number of times to regenerate QR code when logging in. - # The regenerated QR code is sent as an edit and essentially multiplies the login timeout (20 seconds) - login_qr_regen_count: 2 + # Maximum number of times to retry connecting on connection error. max_connection_attempts: 3 # Number of seconds to wait between connection attempts. @@ -116,14 +106,15 @@ bridge: portal_message_buffer: 128 # Whether or not to send call start/end notices to Matrix. + # N/A GroupMe call_notices: start: true end: true # Number of chats to sync for new users. - initial_chat_sync_count: 10 + initial_chat_sync_count: 5 # Number of old messages to fill when creating new portal rooms. - initial_history_fill_count: 20 + initial_history_fill_count: 100 # Whether or not notifications should be turned off while filling initial history. # Only applicable when using double puppeting. initial_history_disable_notifications: false @@ -180,8 +171,9 @@ bridge: allow_user_invite: false # The prefix for commands. Only required in non-management rooms. - command_prefix: "!wa" + command_prefix: "!gm" + # NOT TESTED in GroupMe # End-to-bridge encryption support options. This requires login_shared_secret to be configured # in order to get a device for the bridge bot. # @@ -221,6 +213,7 @@ bridge: "example.com": user "@admin:example.com": admin + # GroupMe not tested relaybot: # Whether or not relaybot support is enabled. enabled: false