example-config.yaml 9.9 KB

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