example-config.yaml 10 KB

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