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.

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