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.
 
 

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