example-config.yaml 10 KB

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