example-config.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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. instagram:
  63. # Seed for generating devices. This is secret because the seed is used to generate
  64. # device IDs, which can apparently be used to bypass two-factor authentication after
  65. # logging out, because Instagram is insecure.
  66. device_seed: generate
  67. # Bridge config
  68. bridge:
  69. # Localpart template of MXIDs for Instagram users.
  70. # {userid} is replaced with the user ID of the Instagram user.
  71. username_template: "instagram_{userid}"
  72. # Displayname template for Instagram users.
  73. # {displayname} is replaced with the display name of the Instagram user.
  74. # {username} is replaced with the username of the Instagram user.
  75. displayname_template: "{displayname} (Instagram)"
  76. # Displayname template for 1:1 chat portals. Same variables as displayname_template.
  77. private_chat_name_template: "{displayname}"
  78. # Displayname template for group chat portals. Only {name} is available.
  79. group_chat_name_template: "{name}"
  80. # Maximum length of displayname
  81. displayname_max_length: 100
  82. # Maximum number of seconds since the last activity in a chat to automatically create portals.
  83. portal_create_max_age: 86400
  84. # Maximum number of chats to fetch for startup sync
  85. chat_sync_limit: 100
  86. # Whether or not to use /sync to get read receipts and typing notifications
  87. # when double puppeting is enabled
  88. sync_with_custom_puppets: true
  89. # Whether or not to update the m.direct account data event when double puppeting is enabled.
  90. # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
  91. # and is therefore prone to race conditions.
  92. sync_direct_chat_list: false
  93. # Allow using double puppeting from any server with a valid client .well-known file.
  94. double_puppet_allow_discovery: false
  95. # Servers to allow double puppeting from, even if double_puppet_allow_discovery is false.
  96. double_puppet_server_map:
  97. example.com: https://example.com
  98. # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
  99. #
  100. # If set, custom puppets will be enabled automatically for local users
  101. # instead of users having to find an access token and run `login-matrix`
  102. # manually.
  103. # If using this for other servers than the bridge's server,
  104. # you must also set the URL in the double_puppet_server_map.
  105. login_shared_secret_map:
  106. example.com: foo
  107. # Whether or not created rooms should have federation enabled.
  108. # If false, created portal rooms will never be federated.
  109. federate_rooms: true
  110. # Settings for backfilling messages from Instagram.
  111. backfill:
  112. # Whether or not the Instagram users of logged in Matrix users should be
  113. # invited to private chats when backfilling history from Instagram. This is
  114. # usually needed to prevent rate limits and to allow timestamp massaging.
  115. invite_own_puppet: true
  116. # Maximum number of messages to backfill initially.
  117. # Set to 0 to disable backfilling when creating portal.
  118. initial_limit: 0
  119. # Maximum number of messages to backfill if messages were missed while
  120. # the bridge was disconnected.
  121. # Set to 0 to disable backfilling missed messages.
  122. missed_limit: 1000
  123. # If using double puppeting, should notifications be disabled
  124. # while the initial backfill is in progress?
  125. disable_notifications: false
  126. periodic_reconnect:
  127. # Interval in seconds in which to automatically reconnect all users.
  128. # This can be used to automatically mitigate the bug where Instagram stops sending messages.
  129. # Set to -1 to disable periodic reconnections entirely.
  130. interval: -1
  131. # Whether or not the bridge should backfill chats when reconnecting.
  132. resync: true
  133. # Should even disconnected users be reconnected?
  134. always: false
  135. # End-to-bridge encryption support options. You must install the e2be optional dependency for
  136. # this to work. See https://github.com/tulir/mautrix-telegram/wiki/End‐to‐bridge-encryption
  137. encryption:
  138. # Allow encryption, work in group chat rooms with e2ee enabled
  139. allow: false
  140. # Default to encryption, force-enable encryption in all portals the bridge creates
  141. # This will cause the bridge bot to be in private chats for the encryption to work properly.
  142. default: false
  143. # Options for automatic key sharing.
  144. key_sharing:
  145. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
  146. # You must use a client that supports requesting keys from other users to use this feature.
  147. allow: false
  148. # Require the requesting device to have a valid cross-signing signature?
  149. # This doesn't require that the bridge has verified the device, only that the user has verified it.
  150. # Not yet implemented.
  151. require_cross_signing: false
  152. # Require devices to be verified by the bridge?
  153. # Verification by the bridge is not yet implemented.
  154. require_verification: true
  155. # Whether or not to explicitly set the avatar and room name for private
  156. # chat portal rooms. This will be implicitly enabled if encryption.default is true.
  157. private_chat_portal_meta: false
  158. # Whether or not the bridge should send a read receipt from the bridge bot when a message has
  159. # been sent to Instagram.
  160. delivery_receipts: false
  161. # Whether or not delivery errors should be reported as messages in the Matrix room.
  162. delivery_error_reports: false
  163. # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
  164. # This field will automatically be changed back to false after it,
  165. # except if the config file is not writable.
  166. resend_bridge_info: false
  167. # Whether or not unimportant bridge notices should be sent to the user.
  168. # (e.g. connected, disconnected but will retry)
  169. unimportant_bridge_notices: true
  170. # Disable bridge notices entirely
  171. disable_bridge_notices: false
  172. # Provisioning API part of the web server for automated portal creation and fetching information.
  173. # Used by things like mautrix-manager (https://github.com/tulir/mautrix-manager).
  174. provisioning:
  175. # Whether or not the provisioning API should be enabled.
  176. enabled: true
  177. # The prefix to use in the provisioning API endpoints.
  178. prefix: /_matrix/provision/v1
  179. # The shared secret to authorize users of the API.
  180. # Set to "generate" to generate and save a new token.
  181. shared_secret: generate
  182. # The prefix for commands. Only required in non-management rooms.
  183. command_prefix: "!ig"
  184. # Permissions for using the bridge.
  185. # Permitted values:
  186. # user - Use the bridge with puppeting.
  187. # admin - Use and administrate the bridge.
  188. # Permitted keys:
  189. # * - All Matrix users
  190. # domain - All users on that homeserver
  191. # mxid - Specific user
  192. permissions:
  193. "example.com": "user"
  194. "@admin:example.com": "admin"
  195. # Python logging configuration.
  196. #
  197. # See section 16.7.2 of the Python documentation for more info:
  198. # https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
  199. logging:
  200. version: 1
  201. formatters:
  202. colored:
  203. (): mautrix_instagram.util.ColorFormatter
  204. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  205. normal:
  206. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  207. handlers:
  208. file:
  209. class: logging.handlers.RotatingFileHandler
  210. formatter: normal
  211. filename: ./mautrix-instagram.log
  212. maxBytes: 10485760
  213. backupCount: 10
  214. console:
  215. class: logging.StreamHandler
  216. formatter: colored
  217. loggers:
  218. mau:
  219. level: DEBUG
  220. mauigpapi:
  221. level: DEBUG
  222. aiohttp:
  223. level: INFO
  224. paho.mqtt:
  225. level: INFO
  226. root:
  227. level: DEBUG
  228. handlers: [file, console]