example-config.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. # Homeserver details
  2. homeserver:
  3. # The address that this appservice can use to connect to the homeserver.
  4. address: https://example.com
  5. # The domain of the homeserver (for MXIDs, etc).
  6. domain: example.com
  7. # Whether or not to verify the SSL certificate of the homeserver.
  8. # Only applies if address starts with https://
  9. verify_ssl: true
  10. asmux: false
  11. # Number of retries for all HTTP requests if the homeserver isn't reachable.
  12. http_retry_count: 4
  13. # The URL to push real-time bridge status to.
  14. # If set, the bridge will make POST requests to this URL whenever a user's Facebook MQTT connection state changes.
  15. # The bridge will use the appservice as_token to authorize requests.
  16. status_endpoint: null
  17. # Application service host/registration related details
  18. # Changing these values requires regeneration of the registration.
  19. appservice:
  20. # The address that the homeserver can use to connect to this appservice.
  21. address: http://localhost:29330
  22. # When using https:// the TLS certificate and key files for the address.
  23. tls_cert: false
  24. tls_key: false
  25. # The hostname and port where this appservice should listen.
  26. hostname: 0.0.0.0
  27. port: 29330
  28. # The maximum body size of appservice API requests (from the homeserver) in mebibytes
  29. # Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
  30. max_body_size: 1
  31. # The full URI to the database. Only Postgres is currently supported.
  32. database: postgres://username:password@hostname/db
  33. # Additional arguments for asyncpg.create_pool()
  34. # https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool
  35. database_opts:
  36. min_size: 5
  37. max_size: 10
  38. # The unique ID of this appservice.
  39. id: instagram
  40. # Username of the appservice bot.
  41. bot_username: instagrambot
  42. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  43. # to leave display name/avatar as-is.
  44. bot_displayname: Instagram bridge bot
  45. bot_avatar: mxc://maunium.net/JxjlbZUlCPULEeHZSwleUXQv
  46. # Community ID for bridged users (changes registration file) and rooms.
  47. # Must be created manually.
  48. #
  49. # Example: "+instagram:example.com". Set to false to disable.
  50. community_id: false
  51. # Whether or not to receive ephemeral events via appservice transactions.
  52. # Requires MSC2409 support (i.e. Synapse 1.22+).
  53. # You should disable bridge -> sync_with_custom_puppets when this is enabled.
  54. ephemeral_events: false
  55. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
  56. as_token: "This value is generated when generating the registration"
  57. hs_token: "This value is generated when generating the registration"
  58. # Prometheus telemetry config. Requires prometheus-client to be installed.
  59. metrics:
  60. enabled: false
  61. listen_port: 8000
  62. # Manhole config.
  63. manhole:
  64. # Whether or not opening the manhole is allowed.
  65. enabled: false
  66. # The path for the unix socket.
  67. path: /var/tmp/mautrix-instagram.manhole
  68. # The list of UIDs who can be added to the whitelist.
  69. # If empty, any UIDs can be specified in the open-manhole command.
  70. whitelist:
  71. - 0
  72. instagram:
  73. # Seed for generating devices. This is secret because the seed is used to generate
  74. # device IDs, which can apparently be used to bypass two-factor authentication after
  75. # logging out, because Instagram is insecure.
  76. device_seed: generate
  77. # Bridge config
  78. bridge:
  79. # Localpart template of MXIDs for Instagram users.
  80. # {userid} is replaced with the user ID of the Instagram user.
  81. username_template: "instagram_{userid}"
  82. # Displayname template for Instagram users.
  83. # {displayname} is replaced with the display name of the Instagram user.
  84. # {username} is replaced with the username of the Instagram user.
  85. displayname_template: "{displayname} (Instagram)"
  86. # Displayname template for 1:1 chat portals. Same variables as displayname_template.
  87. private_chat_name_template: "{displayname}"
  88. # Displayname template for group chat portals. Only {name} is available.
  89. group_chat_name_template: "{name}"
  90. # Maximum length of displayname
  91. displayname_max_length: 100
  92. # Maximum number of seconds since the last activity in a chat to automatically create portals.
  93. portal_create_max_age: 86400
  94. # Maximum number of chats to fetch for startup sync
  95. chat_sync_limit: 100
  96. # Whether or not to use /sync to get read receipts and typing notifications
  97. # when double puppeting is enabled
  98. sync_with_custom_puppets: true
  99. # Whether or not to update the m.direct account data event when double puppeting is enabled.
  100. # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
  101. # and is therefore prone to race conditions.
  102. sync_direct_chat_list: false
  103. # Allow using double puppeting from any server with a valid client .well-known file.
  104. double_puppet_allow_discovery: false
  105. # Servers to allow double puppeting from, even if double_puppet_allow_discovery is false.
  106. double_puppet_server_map:
  107. example.com: https://example.com
  108. # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
  109. #
  110. # If set, custom puppets will be enabled automatically for local users
  111. # instead of users having to find an access token and run `login-matrix`
  112. # manually.
  113. # If using this for other servers than the bridge's server,
  114. # you must also set the URL in the double_puppet_server_map.
  115. login_shared_secret_map:
  116. example.com: foo
  117. # Whether or not created rooms should have federation enabled.
  118. # If false, created portal rooms will never be federated.
  119. federate_rooms: true
  120. # Settings for backfilling messages from Instagram.
  121. backfill:
  122. # Whether or not the Instagram users of logged in Matrix users should be
  123. # invited to private chats when backfilling history from Instagram. This is
  124. # usually needed to prevent rate limits and to allow timestamp massaging.
  125. invite_own_puppet: true
  126. # Maximum number of messages to backfill initially.
  127. # Set to 0 to disable backfilling when creating portal.
  128. initial_limit: 0
  129. # Maximum number of messages to backfill if messages were missed while
  130. # the bridge was disconnected.
  131. # Set to 0 to disable backfilling missed messages.
  132. missed_limit: 1000
  133. # If using double puppeting, should notifications be disabled
  134. # while the initial backfill is in progress?
  135. disable_notifications: false
  136. periodic_reconnect:
  137. # Interval in seconds in which to automatically reconnect all users.
  138. # This can be used to automatically mitigate the bug where Instagram stops sending messages.
  139. # Set to -1 to disable periodic reconnections entirely.
  140. interval: -1
  141. # Whether or not the bridge should backfill chats when reconnecting.
  142. resync: true
  143. # Should even disconnected users be reconnected?
  144. always: false
  145. # End-to-bridge encryption support options. You must install the e2be optional dependency for
  146. # this to work. See https://github.com/tulir/mautrix-telegram/wiki/End‐to‐bridge-encryption
  147. encryption:
  148. # Allow encryption, work in group chat rooms with e2ee enabled
  149. allow: false
  150. # Default to encryption, force-enable encryption in all portals the bridge creates
  151. # This will cause the bridge bot to be in private chats for the encryption to work properly.
  152. default: false
  153. # Options for automatic key sharing.
  154. key_sharing:
  155. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
  156. # You must use a client that supports requesting keys from other users to use this feature.
  157. allow: false
  158. # Require the requesting device to have a valid cross-signing signature?
  159. # This doesn't require that the bridge has verified the device, only that the user has verified it.
  160. # Not yet implemented.
  161. require_cross_signing: false
  162. # Require devices to be verified by the bridge?
  163. # Verification by the bridge is not yet implemented.
  164. require_verification: true
  165. # Whether or not to explicitly set the avatar and room name for private
  166. # chat portal rooms. This will be implicitly enabled if encryption.default is true.
  167. private_chat_portal_meta: false
  168. # Whether or not the bridge should send a read receipt from the bridge bot when a message has
  169. # been sent to Instagram.
  170. delivery_receipts: false
  171. # Whether or not delivery errors should be reported as messages in the Matrix room.
  172. delivery_error_reports: false
  173. # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
  174. # This field will automatically be changed back to false after it,
  175. # except if the config file is not writable.
  176. resend_bridge_info: false
  177. # Whether or not unimportant bridge notices should be sent to the user.
  178. # (e.g. connected, disconnected but will retry)
  179. unimportant_bridge_notices: true
  180. # Disable bridge notices entirely
  181. disable_bridge_notices: false
  182. # Provisioning API part of the web server for automated portal creation and fetching information.
  183. # Used by things like mautrix-manager (https://github.com/tulir/mautrix-manager).
  184. provisioning:
  185. # Whether or not the provisioning API should be enabled.
  186. enabled: true
  187. # The prefix to use in the provisioning API endpoints.
  188. prefix: /_matrix/provision/v1
  189. # The shared secret to authorize users of the API.
  190. # Set to "generate" to generate and save a new token.
  191. shared_secret: generate
  192. # The prefix for commands. Only required in non-management rooms.
  193. command_prefix: "!ig"
  194. # Permissions for using the bridge.
  195. # Permitted values:
  196. # user - Use the bridge with puppeting.
  197. # admin - Use and administrate the bridge.
  198. # Permitted keys:
  199. # * - All Matrix users
  200. # domain - All users on that homeserver
  201. # mxid - Specific user
  202. permissions:
  203. "example.com": "user"
  204. "@admin:example.com": "admin"
  205. # Python logging configuration.
  206. #
  207. # See section 16.7.2 of the Python documentation for more info:
  208. # https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
  209. logging:
  210. version: 1
  211. formatters:
  212. colored:
  213. (): mautrix_instagram.util.ColorFormatter
  214. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  215. normal:
  216. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  217. handlers:
  218. file:
  219. class: logging.handlers.RotatingFileHandler
  220. formatter: normal
  221. filename: ./mautrix-instagram.log
  222. maxBytes: 10485760
  223. backupCount: 10
  224. console:
  225. class: logging.StreamHandler
  226. formatter: colored
  227. loggers:
  228. mau:
  229. level: DEBUG
  230. mauigpapi:
  231. level: DEBUG
  232. aiohttp:
  233. level: INFO
  234. paho.mqtt:
  235. level: INFO
  236. root:
  237. level: DEBUG
  238. handlers: [file, console]