Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

210 lines
9.4 KiB

  1. # mautrix-facebook is a Matrix <-> Facebook bridge
  2. # See: https://github.com/tulir/mautrix-facebook
  3. matrix_mautrix_facebook_enabled: true
  4. # See: https://mau.dev/tulir/mautrix-facebook/container_registry
  5. matrix_mautrix_facebook_docker_image: "dock.mau.dev/tulir/mautrix-facebook:latest"
  6. matrix_mautrix_facebook_docker_image_force_pull: "{{ matrix_mautrix_facebook_docker_image.endswith(':latest') }}"
  7. matrix_mautrix_facebook_base_path: "{{ matrix_base_data_path }}/mautrix-facebook"
  8. matrix_mautrix_facebook_config_path: "{{ matrix_mautrix_facebook_base_path }}/config"
  9. matrix_mautrix_facebook_data_path: "{{ matrix_mautrix_facebook_base_path }}/data"
  10. matrix_mautrix_facebook_homeserver_address: 'http://matrix-synapse:8008'
  11. matrix_mautrix_facebook_homeserver_domain: '{{ matrix_domain }}'
  12. matrix_mautrix_facebook_appservice_address: 'http://matrix-mautrix-facebook:29319'
  13. # A list of extra arguments to pass to the container
  14. matrix_mautrix_facebook_container_extra_arguments: []
  15. # List of systemd services that matrix-mautrix-facebook.service depends on.
  16. matrix_mautrix_facebook_systemd_required_services_list: ['docker.service']
  17. # List of systemd services that matrix-mautrix-facebook.service wants
  18. matrix_mautrix_facebook_systemd_wanted_services_list: []
  19. matrix_mautrix_facebook_appservice_token: ''
  20. matrix_mautrix_facebook_homeserver_token: ''
  21. # Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth).
  22. matrix_mautrix_facebook_login_shared_secret: ''
  23. # Default configuration template which covers the generic use case.
  24. # You can customize it by controlling the various variables inside it.
  25. #
  26. # For a more advanced customization, you can extend the default (see `matrix_mautrix_facebook_configuration_extension_yaml`)
  27. # or completely replace this variable with your own template.
  28. matrix_mautrix_facebook_configuration_yaml: |
  29. #jinja2: lstrip_blocks: "True"
  30. # Homeserver details
  31. homeserver:
  32. # The address that this appservice can use to connect to the homeserver.
  33. address: {{ matrix_mautrix_facebook_homeserver_address }}
  34. # The domain of the homeserver (for MXIDs, etc).
  35. domain: {{ matrix_mautrix_facebook_homeserver_domain }}
  36. # Whether or not to verify the SSL certificate of the homeserver.
  37. # Only applies if address starts with https://
  38. verify_ssl: true
  39. # Application service host/registration related details
  40. # Changing these values requires regeneration of the registration.
  41. appservice:
  42. # The address that the homeserver can use to connect to this appservice.
  43. address: {{ matrix_mautrix_facebook_appservice_address }}
  44. # The hostname and port where this appservice should listen.
  45. hostname: 0.0.0.0
  46. port: 29319
  47. # The maximum body size of appservice API requests (from the homeserver) in mebibytes
  48. # Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
  49. max_body_size: 1
  50. # The full URI to the database. SQLite and Postgres are fully supported.
  51. # Other DBMSes supported by SQLAlchemy may or may not work.
  52. # Format examples:
  53. # SQLite: sqlite:///filename.db
  54. # Postgres: postgres://username:password@hostname/dbname
  55. database: sqlite:////data/mautrix-facebook.db
  56. # Public part of web server for out-of-Matrix interaction with the bridge.
  57. public:
  58. # Whether or not the public-facing endpoints should be enabled.
  59. enabled: false
  60. # The prefix to use in the public-facing endpoints.
  61. prefix: /public
  62. # The base URL where the public-facing endpoints are available. The prefix is not added
  63. # implicitly.
  64. external: https://example.com/public
  65. # The unique ID of this appservice.
  66. id: facebook
  67. # Username of the appservice bot.
  68. bot_username: facebookbot
  69. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  70. # to leave display name/avatar as-is.
  71. bot_displayname: Facebook bridge bot
  72. bot_avatar: mxc://maunium.net/ddtNPZSKMNqaUzqrHuWvUADv
  73. # Authentication tokens for AS <-> HS communication.
  74. as_token: "{{ matrix_mautrix_facebook_appservice_token }}"
  75. hs_token: "{{ matrix_mautrix_facebook_homeserver_token }}"
  76. # Bridge config
  77. bridge:
  78. # Localpart template of MXIDs for Facebook users.
  79. # {userid} is replaced with the user ID of the Facebook user.
  80. username_template: "facebook_{userid}"
  81. # Localpart template for per-user room grouping community IDs.
  82. # The bridge will create these communities and add all of the specific user's portals to the community.
  83. # {localpart} is the MXID localpart and {server} is the MXID server part of the user.
  84. #
  85. # `facebook_{localpart}={server}` is a good value.
  86. community_template: null
  87. # Displayname template for Facebook users.
  88. # {displayname} is replaced with the display name of the Facebook user
  89. # as defined below in displayname_preference.
  90. # Keys available for displayname_preference are also available here.
  91. displayname_template: '{displayname} (FB)'
  92. # Available keys:
  93. # "name" (full name)
  94. # "first_name"
  95. # "last_name"
  96. # "nickname"
  97. # "own_nickname" (user-specific!)
  98. displayname_preference:
  99. - name
  100. # The prefix for commands. Only required in non-management rooms.
  101. command_prefix: "!fb"
  102. # Number of chats to sync (and create portals for) on startup/login.
  103. # Maximum 20, set 0 to disable automatic syncing.
  104. initial_chat_sync: 10
  105. # Whether or not the Facebook users of logged in Matrix users should be
  106. # invited to private chats when the user sends a message from another client.
  107. invite_own_puppet_to_pm: false
  108. # Whether or not to use /sync to get presence, read receipts and typing notifications when using
  109. # your own Matrix account as the Matrix puppet for your Facebook account.
  110. sync_with_custom_puppets: true
  111. # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
  112. #
  113. # If set, custom puppets will be enabled automatically for local users
  114. # instead of users having to find an access token and run `login-matrix`
  115. # manually.
  116. login_shared_secret: {{ matrix_mautrix_facebook_login_shared_secret|to_json }}
  117. # Whether or not to bridge presence in both directions. Facebook allows users not to broadcast
  118. # presence, but then it won't send other users' presence to the client.
  119. presence: true
  120. # Whether or not to update avatars when syncing all contacts at startup.
  121. update_avatar_initial_sync: true
  122. # Permissions for using the bridge.
  123. # Permitted values:
  124. # user - Use the bridge with puppeting.
  125. # admin - Use and administrate the bridge.
  126. # Permitted keys:
  127. # * - All Matrix users
  128. # domain - All users on that homeserver
  129. # mxid - Specific user
  130. permissions:
  131. '{{ matrix_mautrix_facebook_homeserver_domain }}': user
  132. # Python logging configuration.
  133. #
  134. # See section 16.7.2 of the Python documentation for more info:
  135. # https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
  136. logging:
  137. version: 1
  138. formatters:
  139. colored:
  140. (): mautrix_facebook.util.ColorFormatter
  141. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  142. normal:
  143. format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
  144. handlers:
  145. console:
  146. class: logging.StreamHandler
  147. formatter: colored
  148. loggers:
  149. mau:
  150. level: DEBUG
  151. fbchat:
  152. level: DEBUG
  153. hbmqtt:
  154. level: INFO
  155. aiohttp:
  156. level: INFO
  157. root:
  158. level: DEBUG
  159. handlers: [console]
  160. matrix_mautrix_facebook_configuration_extension_yaml: |
  161. # Your custom YAML configuration goes here.
  162. # This configuration extends the default starting configuration (`matrix_mautrix_facebook_configuration_yaml`).
  163. #
  164. # You can override individual variables from the default configuration, or introduce new ones.
  165. #
  166. # If you need something more special, you can take full control by
  167. # completely redefining `matrix_mautrix_facebook_configuration_yaml`.
  168. matrix_mautrix_facebook_configuration_extension: "{{ matrix_mautrix_facebook_configuration_extension_yaml|from_yaml if matrix_mautrix_facebook_configuration_extension_yaml|from_yaml is mapping else {} }}"
  169. # Holds the final configuration (a combination of the default and its extension).
  170. # You most likely don't need to touch this variable. Instead, see `matrix_mautrix_facebook_configuration_yaml`.
  171. matrix_mautrix_facebook_configuration: "{{ matrix_mautrix_facebook_configuration_yaml|from_yaml|combine(matrix_mautrix_facebook_configuration_extension, recursive=True) }}"
  172. matrix_mautrix_facebook_registration_yaml: |
  173. id: facebook
  174. as_token: "{{ matrix_mautrix_facebook_appservice_token }}"
  175. hs_token: "{{ matrix_mautrix_facebook_homeserver_token }}"
  176. namespaces:
  177. users:
  178. - exclusive: true
  179. regex: '^@facebook_.+:{{ matrix_mautrix_facebook_homeserver_domain|regex_escape }}$'
  180. url: {{ matrix_mautrix_facebook_appservice_address }}
  181. sender_localpart: facebookbot
  182. rate_limited: false
  183. matrix_mautrix_facebook_registration: "{{ matrix_mautrix_facebook_registration_yaml|from_yaml }}"