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.
 
 

411 lines
21 KiB

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