This repository has been archived by the owner on Jul 8, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample-config.yaml
136 lines (125 loc) · 5.05 KB
/
example-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Homeserver details
homeserver:
# The address that this appservice can use to connect to the homeserver.
address: http://localhost:8008
# The address that Twilio can use to download media from the homeserver.
public_address: https://matrix.example.com
# The domain of the homeserver (for MXIDs, etc).
domain: example.com
# Whether or not to verify the SSL certificate of the homeserver.
# Only applies if address starts with https://
verify_ssl: true
# Application service host/registration related details
# Changing these values requires regeneration of the registration.
appservice:
# The address that the homeserver can use to connect to this appservice.
address: http://localhost:29322
# The hostname and port where this appservice should listen.
hostname: 0.0.0.0
port: 29322
# The maximum body size of appservice API requests (from the homeserver) in mebibytes
# Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
max_body_size: 1
# The full URI to the database. SQLite and Postgres are fully supported.
# Other DBMSes supported by SQLAlchemy may or may not work.
# Format examples:
# SQLite: sqlite:///filename.db
# Postgres: postgres://username:password@hostname/dbname
database: sqlite:///mautrix-twilio.db
# The unique ID of this appservice.
id: twilio
# Username of the appservice bot.
bot_username: twiliobot
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
# to leave display name/avatar as-is.
bot_displayname: Twilio bridge bot
bot_avatar: mxc://maunium.net/FYuKJHaCrSeSpvBJfHwgYylP
# Community ID for bridged users (changes registration file) and rooms.
# Must be created manually.
community_id: null
# 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"
# Bridge config
bridge:
# Localpart template of MXIDs for remote users.
# {userid} is replaced with the phone number of the user (plain/E.164 international format).
username_template: "twilio_whatsapp_{userid}"
# Displayname template for remote users.
# {displayname} is replaced with the phone number of the user (human-readable international format).
displayname_template: "{displayname} (WhatsApp)"
# The prefix for commands. Only required in non-management rooms.
command_prefix: "!tw"
# List of users to always invite to newly created portal rooms.
invite_users: []
# Template for text messages.
message_template: "$message<br/>- $displayname"
# Whether or not Matrix m.notice-type messages should be bridged.
bridge_notices: false
# Whether or not created rooms should have federation enabled.
# If false, created portal rooms will never be federated.
federate_rooms: true
# Initial room state for created rooms.
initial_state:
m.room.power_levels:
events_default: 0
users_default: 0
state_default: 50
events:
m.room.avatar: 0
m.room.name: 0
m.room.topic: 0
# Permissions for using the bridge.
# Permitted values:
# user - Use the bridge with puppeting.
# admin - Use and administrate the bridge.
# Permitted keys:
# * - All Matrix users
# domain - All users on that homeserver
# mxid - Specific user
permissions:
"example.com": "user"
"@admin:example.com": "admin"
# Twilio webhook settings.
twilio:
# Twilio account ID
account_id: AC1082dcd0e9ae51404f6cae3581edfbff
# Twilio phone number to send messages from.
sender_id: whatsapp:+1415550199
# Your Twilio auth token (get from Twilio dashboard front page)
secret: 2035141f21a001604e763c009aa3be4c
# Path prefix for webhook endpoints. Subpaths are /status and /receive.
# Note that the webhook must be put behind a reverse proxy with https.
webhook_path: /twilio
# Python logging configuration.
#
# See section 16.7.2 of the Python documentation for more info:
# https://docs.python.org/3.7/library/logging.config.html#configuration-dictionary-schema
logging:
version: 1
formatters:
colored:
(): mautrix_twilio.util.ColorFormatter
format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
normal:
format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
handlers:
file:
class: logging.handlers.RotatingFileHandler
formatter: normal
filename: ./mautrix-twilio.log
maxBytes: 10485760
backupCount: 10
console:
class: logging.StreamHandler
formatter: colored
loggers:
mau:
level: DEBUG
twilio:
level: DEBUG
aiohttp:
level: INFO
root:
level: DEBUG
handlers: [file, console]