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.
 
 

397 lines
20 KiB

  1. # Matrix Appservice IRC is a Matrix <-> IRC bridge
  2. # See: https://github.com/matrix-org/matrix-appservice-irc
  3. matrix_appservice_irc_enabled: true
  4. matrix_appservice_irc_docker_image: "docker.io/matrixdotorg/matrix-appservice-irc:release-0.17.1"
  5. matrix_appservice_irc_docker_image_force_pull: "{{ matrix_appservice_irc_docker_image.endswith(':latest') }}"
  6. matrix_appservice_irc_base_path: "{{ matrix_base_data_path }}/appservice-irc"
  7. matrix_appservice_irc_config_path: "{{ matrix_appservice_irc_base_path }}/config"
  8. matrix_appservice_irc_data_path: "{{ matrix_appservice_irc_base_path }}/data"
  9. matrix_appservice_irc_homeserver_url: 'http://matrix-synapse:8008'
  10. matrix_appservice_irc_homeserver_media_url: 'https://{{ matrix_server_fqn_matrix }}'
  11. matrix_appservice_irc_homeserver_domain: '{{ matrix_domain }}'
  12. matrix_appservice_irc_homeserver_enablePresence: true
  13. matrix_appservice_irc_appservice_address: 'http://matrix-appservice-irc:9999'
  14. matrix_appservice_irc_database_engine: nedb
  15. matrix_appservice_irc_database_username: matrix_appservice_irc
  16. matrix_appservice_irc_database_password: ~
  17. matrix_appservice_irc_database_hostname: 'matrix-postgres'
  18. matrix_appservice_irc_database_port: 5432
  19. matrix_appservice_irc_database_name: matrix_appservice_irc
  20. # This is just the Postgres connection string, if Postgres is used.
  21. # Naming clashes with `matrix_appservice_irc_database_connectionString` somewhat.
  22. matrix_appservice_irc_database_connection_string: 'postgresql://{{ matrix_appservice_irc_database_username }}:{{ matrix_appservice_irc_database_password }}@{{ matrix_appservice_irc_database_hostname }}:{{ matrix_appservice_irc_database_port }}/{{ matrix_appservice_irc_database_name }}?sslmode=disable'
  23. # This is what actually goes into `database.connectionString` for the bridge.
  24. matrix_appservice_irc_database_connectionString: "{{
  25. {
  26. 'nedb': 'nedb:///data',
  27. 'postgres': matrix_appservice_irc_database_connection_string,
  28. }[matrix_appservice_irc_database_engine]
  29. }}"
  30. matrix_appservice_irc_ircService_servers: []
  31. # Example of `matrix_appservice_irc_ircService_servers` with one server (and all its options):
  32. #
  33. # matrix_appservice_irc_ircService_servers:
  34. # # The address of the server to connect to.
  35. # irc.example.com:
  36. # # A human-readable short name. This is used to label IRC status rooms
  37. # # where matrix users control their connections.
  38. # # E.g. 'ExampleNet IRC Bridge status'.
  39. # # It is also used in the Third Party Lookup API as the instance `desc`
  40. # # property, where each server is an instance.
  41. # name: "ExampleNet"
  42. # additionalAddresses: [ "irc2.example.com" ]
  43. # #
  44. # # [DEPRECATED] Use `name`, above, instead.
  45. # # A human-readable description string
  46. # # description: "Example.com IRC network"
  47. # # An ID for uniquely identifying this server amongst other servers being bridged.
  48. # # networkId: "example"
  49. # # URL to an icon used as the network icon whenever this network appear in
  50. # # a network list. (Like in the riot room directory, for instance.)
  51. # # icon: https://example.com/images/hash.png
  52. # # The port to connect to. Optional.
  53. # port: 6697
  54. # # Whether to use SSL or not. Default: false.
  55. # ssl: true
  56. # # Whether or not IRC server is using a self-signed cert or not providing CA Chain
  57. # sslselfsign: false
  58. # # Should the connection attempt to identify via SASL (if a server or user password is given)
  59. # # If false, this will use PASS instead. If SASL fails, we do not fallback to PASS.
  60. # sasl: false
  61. # # Whether to allow expired certs when connecting to the IRC server.
  62. # # Usually this should be off. Default: false.
  63. # allowExpiredCerts: false
  64. # # A specific CA to trust instead of the default CAs. Optional.
  65. # #ca: |
  66. # # -----BEGIN CERTIFICATE-----
  67. # # ...
  68. # # -----END CERTIFICATE-----
  69. # #
  70. # # The connection password to send for all clients as a PASS (or SASL, if enabled above) command. Optional.
  71. # # password: 'pa$$w0rd'
  72. # #
  73. # # Whether or not to send connection/error notices to real Matrix users. Default: true.
  74. # sendConnectionMessages: true
  75. # quitDebounce:
  76. # # Whether parts due to net-splits are debounced for delayMs, to allow
  77. # # time for the netsplit to resolve itself. A netsplit is detected as being
  78. # # a QUIT rate higher than quitsPerSecond. Default: false.
  79. # enabled: false
  80. # # The maximum number of quits per second acceptable above which a netsplit is
  81. # # considered ongoing. Default: 5.
  82. # quitsPerSecond: 5
  83. # # The time window in which to wait before bridging a QUIT to Matrix that occurred during
  84. # # a netsplit. Debouncing is jittered randomly between delayMinMs and delayMaxMs so that the HS
  85. # # is not sent many requests to leave rooms all at once if a netsplit occurs and many
  86. # # people to not rejoin.
  87. # # If the user with the same IRC nick as the one who sent the quit rejoins a channel
  88. # # they are considered back online and the quit is not bridged, so long as the rejoin
  89. # # occurs before the randomly-jittered timeout is not reached.
  90. # # Default: 3600000, = 1h
  91. # delayMinMs: 3600000 # 1h
  92. # # Default: 7200000, = 2h
  93. # delayMaxMs: 7200000 # 2h
  94. # # A map for conversion of IRC user modes to Matrix power levels. This enables bridging
  95. # # of IRC ops to Matrix power levels only, it does not enable the reverse. If a user has
  96. # # been given multiple modes, the one that maps to the highest power level will be used.
  97. # modePowerMap:
  98. # o: 50
  99. # botConfig:
  100. # # Enable the presence of the bot in IRC channels. The bot serves as the entity
  101. # # which maps from IRC -> Matrix. You can disable the bot entirely which
  102. # # means IRC -> Matrix chat will be shared by active "M-Nick" connections
  103. # # in the room. If there are no users in the room (or if there are users
  104. # # but their connections are not on IRC) then nothing will be bridged to
  105. # # Matrix. If you're concerned about the bot being treated as a "logger"
  106. # # entity, then you may want to disable the bot. If you want IRC->Matrix
  107. # # but don't want to have TCP connections to IRC unless a Matrix user speaks
  108. # # (because your client connection limit is low), then you may want to keep
  109. # # the bot enabled. Default: true.
  110. # # NB: If the bot is disabled, you SHOULD have matrix-to-IRC syncing turned
  111. # # on, else there will be no users and no bot in a channel (meaning no
  112. # # messages to Matrix!) until a Matrix user speaks which makes a client
  113. # # join the target IRC channel.
  114. # # NBB: The bridge bot IRC client will still join the target IRC network so
  115. # # it can service bridge-specific queries from the IRC-side e.g. so
  116. # # real IRC clients have a way to change their Matrix display name.
  117. # # See https://github.com/matrix-org/matrix-appservice-irc/issues/55
  118. # enabled: true
  119. # # The nickname to give the AS bot.
  120. # nick: "MatrixBot"
  121. # # The password to give to NickServ or IRC Server for this nick. Optional.
  122. # # password: "helloworld"
  123. # #
  124. # # Join channels even if there are no Matrix users on the other side of
  125. # # the bridge. Set to false to prevent the bot from joining channels which have no
  126. # # real matrix users in them, even if there is a mapping for the channel.
  127. # # Default: true
  128. # joinChannelsIfNoUsers: true
  129. # # Configuration for PMs / private 1:1 communications between users.
  130. # privateMessages:
  131. # # Enable the ability for PMs to be sent to/from IRC/Matrix.
  132. # # Default: true.
  133. # enabled: true
  134. # # Prevent Matrix users from sending PMs to the following IRC nicks.
  135. # # Optional. Default: [].
  136. # # exclude: ["Alice", "Bob"] # NOT YET IMPLEMENTED
  137. # # Should created Matrix PM rooms be federated? If false, only users on the
  138. # # HS attached to this AS will be able to interact with this room.
  139. # # Optional. Default: true.
  140. # federate: true
  141. # # Configuration for mappings not explicitly listed in the 'mappings'
  142. # # section.
  143. # dynamicChannels:
  144. # # Enable the ability for Matrix users to join *any* channel on this IRC
  145. # # network.
  146. # # Default: false.
  147. # enabled: true
  148. # # Should the AS create a room alias for the new Matrix room? The form of
  149. # # the alias can be modified via 'aliasTemplate'. Default: true.
  150. # createAlias: true
  151. # # Should the AS publish the new Matrix room to the public room list so
  152. # # anyone can see it? Default: true.
  153. # published: true
  154. # # What should the join_rule be for the new Matrix room? If 'public',
  155. # # anyone can join the room. If 'invite', only users with an invite can
  156. # # join the room. Note that if an IRC channel has +k or +i set on it,
  157. # # join_rules will be set to 'invite' until these modes are removed.
  158. # # Default: "public".
  159. # joinRule: public
  160. # # This will set the m.room.related_groups state event in newly created rooms
  161. # # with the given groupId. This means flares will show up on IRC users in those rooms.
  162. # # This should be set to the same thing as namespaces.users.group_id in irc_registration.
  163. # # This does not alter existing rooms.
  164. # # Leaving this option empty will not set the event.
  165. # groupId: +myircnetwork:localhost
  166. # # Should created Matrix rooms be federated? If false, only users on the
  167. # # HS attached to this AS will be able to interact with this room.
  168. # # Default: true.
  169. # federate: true
  170. # # The room alias template to apply when creating new aliases. This only
  171. # # applies if createAlias is 'true'. The following variables are exposed:
  172. # # $SERVER => The IRC server address (e.g. "irc.example.com")
  173. # # $CHANNEL => The IRC channel (e.g. "#python")
  174. # # This MUST have $CHANNEL somewhere in it.
  175. # # Default: '#irc_$SERVER_$CHANNEL'
  176. # aliasTemplate: "#irc_$CHANNEL"
  177. # # A list of user IDs which the AS bot will send invites to in response
  178. # # to a !join. Only applies if joinRule is 'invite'. Default: []
  179. # # whitelist:
  180. # # - "@foo:example.com"
  181. # # - "@bar:example.com"
  182. # #
  183. # # Prevent the given list of channels from being mapped under any
  184. # # circumstances.
  185. # # exclude: ["#foo", "#bar"]
  186. # # Configuration for controlling how Matrix and IRC membership lists are
  187. # # synced.
  188. # membershipLists:
  189. # # Enable the syncing of membership lists between IRC and Matrix. This
  190. # # can have a significant effect on performance on startup as the lists are
  191. # # synced. This must be enabled for anything else in this section to take
  192. # # effect. Default: false.
  193. # enabled: false
  194. # # Syncing membership lists at startup can result in hundreds of members to
  195. # # process all at once. This timer drip feeds membership entries at the
  196. # # specified rate. Default: 10000. (10s)
  197. # floodDelayMs: 10000
  198. # global:
  199. # ircToMatrix:
  200. # # Get a snapshot of all real IRC users on a channel (via NAMES) and
  201. # # join their virtual matrix clients to the room.
  202. # initial: false
  203. # # Make virtual matrix clients join and leave rooms as their real IRC
  204. # # counterparts join/part channels. Default: false.
  205. # incremental: false
  206. # matrixToIrc:
  207. # # Get a snapshot of all real Matrix users in the room and join all of
  208. # # them to the mapped IRC channel on startup. Default: false.
  209. # initial: false
  210. # # Make virtual IRC clients join and leave channels as their real Matrix
  211. # # counterparts join/leave rooms. Make sure your 'maxClients' value is
  212. # # high enough! Default: false.
  213. # incremental: false
  214. # # Apply specific rules to Matrix rooms. Only matrix-to-IRC takes effect.
  215. # rooms:
  216. # - room: "!fuasirouddJoxtwfge:localhost"
  217. # matrixToIrc:
  218. # initial: false
  219. # incremental: false
  220. # # Apply specific rules to IRC channels. Only IRC-to-matrix takes effect.
  221. # channels:
  222. # - channel: "#foo"
  223. # ircToMatrix:
  224. # initial: false
  225. # incremental: false
  226. # mappings:
  227. # # 1:many mappings from IRC channels to room IDs on this IRC server.
  228. # # The matrix room must already exist. Your matrix client should expose
  229. # # the room ID in a "settings" page for the room.
  230. # "#thepub":
  231. # roomIds: ["!kieouiJuedJoxtVdaG:localhost"]
  232. # # Channel key/password to use. Optional. If provided, matrix users do
  233. # # not need to know the channel key in order to join the channel.
  234. # # key: "secret"
  235. # # Configuration for virtual matrix users. The following variables are
  236. # # exposed:
  237. # # $NICK => The IRC nick
  238. # # $SERVER => The IRC server address (e.g. "irc.example.com")
  239. # matrixClients:
  240. # # The user ID template to use when creating virtual matrix users. This
  241. # # MUST have $NICK somewhere in it.
  242. # # Optional. Default: "@$SERVER_$NICK".
  243. # # Example: "@irc.example.com_Alice:example.com"
  244. # userTemplate: "@irc_$NICK"
  245. # # The display name to use for created matrix clients. This should have
  246. # # $NICK somewhere in it if it is specified. Can also use $SERVER to
  247. # # insert the IRC domain.
  248. # # Optional. Default: "$NICK (IRC)". Example: "Alice (IRC)"
  249. # displayName: "$NICK (IRC)"
  250. # # Number of tries a client can attempt to join a room before the request
  251. # # is discarded. You can also use -1 to never retry or 0 to never give up.
  252. # # Optional. Default: -1
  253. # joinAttempts: -1
  254. # # Configuration for virtual IRC users. The following variables are exposed:
  255. # # $LOCALPART => The user ID localpart ("alice" in @alice:localhost)
  256. # # $USERID => The user ID
  257. # # $DISPLAY => The display name of this user, with excluded characters
  258. # # (e.g. space) removed. If the user has no display name, this
  259. # # falls back to $LOCALPART.
  260. # ircClients:
  261. # # The template to apply to every IRC client nick. This MUST have either
  262. # # $DISPLAY or $USERID or $LOCALPART somewhere in it.
  263. # # Optional. Default: "M-$DISPLAY". Example: "M-Alice".
  264. # nickTemplate: "$DISPLAY[m]"
  265. # # True to allow virtual IRC clients to change their nick on this server
  266. # # by issuing !nick <server> <nick> commands to the IRC AS bot.
  267. # # This is completely freeform: it will NOT follow the nickTemplate.
  268. # allowNickChanges: true
  269. # # The max number of IRC clients that will connect. If the limit is
  270. # # reached, the client that spoke the longest time ago will be
  271. # # disconnected and replaced.
  272. # # Optional. Default: 30.
  273. # maxClients: 30
  274. # # IPv6 configuration.
  275. # ipv6:
  276. # # Optional. Set to true to force IPv6 for outgoing connections.
  277. # only: false
  278. # # Optional. The IPv6 prefix to use for generating unique addresses for each
  279. # # connected user. If not specified, all users will connect from the same
  280. # # (default) address. This may require additional OS-specific work to allow
  281. # # for the node process to bind to multiple different source addresses
  282. # # e.g IP_FREEBIND on Linux, which requires an LD_PRELOAD with the library
  283. # # https://github.com/matrix-org/freebindfree as Node does not expose setsockopt.
  284. # # prefix: "2001:0db8:85a3::" # modify appropriately
  285. # #
  286. # # The maximum amount of time in seconds that the client can exist
  287. # # without sending another message before being disconnected. Use 0 to
  288. # # not apply an idle timeout. This value is ignored if this IRC server is
  289. # # mirroring matrix membership lists to IRC. Default: 172800 (48 hours)
  290. # idleTimeout: 10800
  291. # # The number of millseconds to wait between consecutive reconnections if a
  292. # # client gets disconnected. Setting to 0 will cause the scheduling to be
  293. # # disabled, i.e. it will be scheduled immediately (with jitter.
  294. # # Otherwise, the scheduling interval will be used such that one client
  295. # # reconnect for this server will be handled every reconnectIntervalMs ms using
  296. # # a FIFO queue.
  297. # # Default: 5000 (5 seconds)
  298. # reconnectIntervalMs: 5000
  299. # # The number of concurrent reconnects if a user has been disconnected unexpectedly
  300. # # (e.g. a netsplit). You should set this to a reasonably high number so that
  301. # # bridges are not waiting an eternity to reconnect all its clients if
  302. # # we see a massive number of disconnect. This is unrelated to the reconnectIntervalMs
  303. # # setting above which is for connecting on restart of the bridge. Set to 0 to
  304. # # immediately try to reconnect all users.
  305. # # Default: 50
  306. # concurrentReconnectLimit: 50
  307. # # The number of lines to allow being sent by the IRC client that has received
  308. # # a large block of text to send from matrix. If the number of lines that would
  309. # # be sent is > lineLimit, the text will instead be uploaded to matrix and the
  310. # # resulting URI is treated as a file. As such, a link will be sent to the IRC
  311. # # side instead of potentially spamming IRC and getting the IRC client kicked.
  312. # # Default: 3.
  313. # lineLimit: 3
  314. # # A list of user modes to set on every IRC client. For example, "RiG" would set
  315. # # +R, +i and +G on every IRC connection when they have successfully connected.
  316. # # User modes vary wildly depending on the IRC network you're connecting to,
  317. # # so check before setting this value. Some modes may not work as intended
  318. # # through the bridge e.g. caller ID as there is no way to /ACCEPT.
  319. # # Default: "" (no user modes)
  320. # # userModes: "R"
  321. # Controls whether the matrix-appservice-discord container exposes its HTTP port (tcp/9999 in the container).
  322. #
  323. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9999"), or empty string to not expose.
  324. matrix_appservice_irc_container_http_host_bind_port: ''
  325. # A list of extra arguments to pass to the container
  326. matrix_appservice_irc_container_extra_arguments: []
  327. # List of systemd services that matrix-appservice-irc.service depends on.
  328. matrix_appservice_irc_systemd_required_services_list: ['docker.service']
  329. # List of systemd services that matrix-appservice-irc.service wants
  330. matrix_appservice_irc_systemd_wanted_services_list: []
  331. matrix_appservice_irc_appservice_token: ''
  332. matrix_appservice_irc_homeserver_token: ''
  333. matrix_appservice_irc_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  334. matrix_appservice_irc_configuration_extension_yaml: |
  335. # Your custom YAML configuration for Appservice IRC servers goes here.
  336. # This configuration extends the default starting configuration (`matrix_appservice_irc_configuration_yaml`).
  337. #
  338. # You can override individual variables from the default configuration, or introduce new ones.
  339. #
  340. # If you need something more special, you can take full control by
  341. # completely redefining `matrix_appservice_irc_configuration_yaml`.
  342. matrix_appservice_irc_configuration_extension: "{{ matrix_appservice_irc_configuration_extension_yaml|from_yaml if matrix_appservice_irc_configuration_extension_yaml|from_yaml is mapping else {} }}"
  343. matrix_appservice_irc_configuration: "{{ matrix_appservice_irc_configuration_yaml|from_yaml|combine(matrix_appservice_irc_configuration_extension, recursive=True) }}"
  344. # The original registration.yaml file generated by AppService IRC is merged with this config override,
  345. # to produce the final registration.yaml file ultimately used by both the bridge and the homeserver.
  346. #
  347. # We do this to ensure consistency:
  348. # - always having an up-to-date registration.yaml file (synced with the configuration file)
  349. # - always having the same AS/HS token and appservice id in the registration.yaml file
  350. #
  351. # Learn more about this in `setup_install.yml`
  352. matrix_appservice_irc_registration_override_yaml: |
  353. id: appservice-irc
  354. as_token: "{{ matrix_appservice_irc_appservice_token }}"
  355. hs_token: "{{ matrix_appservice_irc_homeserver_token }}"
  356. matrix_appservice_irc_registration_override: "{{ matrix_appservice_irc_registration_override_yaml|from_yaml }}"