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.
 
 

437 lines
22 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: "tedomum/matrix-appservice-irc:latest"
  5. matrix_appservice_irc_base_path: "{{ matrix_base_data_path }}/appservice-irc"
  6. # Controls whether the Appservice IRC container exposes the Client/Server API port (tcp/9999).
  7. matrix_appservice_irc_container_expose_client_server_api_port: false
  8. # A list of extra arguments to pass to the container
  9. matrix_appservice_irc_container_extra_arguments: []
  10. # List of systemd services that matrix-appservice-irc.service depends on.
  11. matrix_appservice_irc_systemd_required_services_list: ['docker.service']
  12. # List of systemd services that matrix-appservice-irc.service wants
  13. matrix_appservice_irc_systemd_wanted_services_list: []
  14. matrix_appservice_irc_configuration_yaml: |
  15. #jinja2: lstrip_blocks: True
  16. homeserver:
  17. url: "https://{{ matrix_server_fqn_matrix }}"
  18. domain: "{{ matrix_domain }}"
  19. enablePresence: true
  20. matrix_appservice_irc_configuration_extension_yaml: |
  21. # Your custom YAML configuration for Appservice IRC servers goes here.
  22. # This configuration extends the default starting configuration (`matrix_appservice_irc_configuration_yaml`).
  23. #
  24. # You can override individual variables from the default configuration, or introduce new ones.
  25. #
  26. # If you need something more special, you can take full control by
  27. # completely redefining `matrix_appservice_irc_configuration_yaml`.
  28. #
  29. # Example configuration extension follows:
  30. #
  31. # ircService:
  32. # databaseUri: "nedb:///data" # does not typically need modification
  33. # passwordEncryptionKeyPath: "/data/passkey.pem" # does not typically need modification
  34. # matrixHandler:
  35. # eventCacheSize: 4096
  36. # servers:
  37. # # The address of the server to connect to.
  38. # irc.example.com:
  39. # # A human-readable short name. This is used to label IRC status rooms
  40. # # where matrix users control their connections.
  41. # # E.g. 'ExampleNet IRC Bridge status'.
  42. # # It is also used in the Third Party Lookup API as the instance `desc`
  43. # # property, where each server is an instance.
  44. # name: "ExampleNet"
  45. #
  46. # additionalAddresses: [ "irc2.example.com" ]
  47. # #
  48. # # [DEPRECATED] Use `name`, above, instead.
  49. # # A human-readable description string
  50. # # description: "Example.com IRC network"
  51. #
  52. # # An ID for uniquely identifying this server amongst other servers being bridged.
  53. # # networkId: "example"
  54. #
  55. # # URL to an icon used as the network icon whenever this network appear in
  56. # # a network list. (Like in the riot room directory, for instance.)
  57. # # icon: https://example.com/images/hash.png
  58. #
  59. # # The port to connect to. Optional.
  60. # port: 6697
  61. # # Whether to use SSL or not. Default: false.
  62. # ssl: true
  63. # # Whether or not IRC server is using a self-signed cert or not providing CA Chain
  64. # sslselfsign: false
  65. # # Should the connection attempt to identify via SASL (if a server or user password is given)
  66. # # If false, this will use PASS instead. If SASL fails, we do not fallback to PASS.
  67. # sasl: false
  68. # # Whether to allow expired certs when connecting to the IRC server.
  69. # # Usually this should be off. Default: false.
  70. # allowExpiredCerts: false
  71. # # A specific CA to trust instead of the default CAs. Optional.
  72. # #ca: |
  73. # # -----BEGIN CERTIFICATE-----
  74. # # ...
  75. # # -----END CERTIFICATE-----
  76. #
  77. # #
  78. # # The connection password to send for all clients as a PASS (or SASL, if enabled above) command. Optional.
  79. # # password: 'pa$$w0rd'
  80. # #
  81. # # Whether or not to send connection/error notices to real Matrix users. Default: true.
  82. # sendConnectionMessages: true
  83. #
  84. # quitDebounce:
  85. # # Whether parts due to net-splits are debounced for delayMs, to allow
  86. # # time for the netsplit to resolve itself. A netsplit is detected as being
  87. # # a QUIT rate higher than quitsPerSecond. Default: false.
  88. # enabled: false
  89. # # The maximum number of quits per second acceptable above which a netsplit is
  90. # # considered ongoing. Default: 5.
  91. # quitsPerSecond: 5
  92. # # The time window in which to wait before bridging a QUIT to Matrix that occurred during
  93. # # a netsplit. Debouncing is jittered randomly between delayMinMs and delayMaxMs so that the HS
  94. # # is not sent many requests to leave rooms all at once if a netsplit occurs and many
  95. # # people to not rejoin.
  96. # # If the user with the same IRC nick as the one who sent the quit rejoins a channel
  97. # # they are considered back online and the quit is not bridged, so long as the rejoin
  98. # # occurs before the randomly-jittered timeout is not reached.
  99. # # Default: 3600000, = 1h
  100. # delayMinMs: 3600000 # 1h
  101. # # Default: 7200000, = 2h
  102. # delayMaxMs: 7200000 # 2h
  103. #
  104. # # A map for conversion of IRC user modes to Matrix power levels. This enables bridging
  105. # # of IRC ops to Matrix power levels only, it does not enable the reverse. If a user has
  106. # # been given multiple modes, the one that maps to the highest power level will be used.
  107. # modePowerMap:
  108. # o: 50
  109. #
  110. # botConfig:
  111. # # Enable the presence of the bot in IRC channels. The bot serves as the entity
  112. # # which maps from IRC -> Matrix. You can disable the bot entirely which
  113. # # means IRC -> Matrix chat will be shared by active "M-Nick" connections
  114. # # in the room. If there are no users in the room (or if there are users
  115. # # but their connections are not on IRC) then nothing will be bridged to
  116. # # Matrix. If you're concerned about the bot being treated as a "logger"
  117. # # entity, then you may want to disable the bot. If you want IRC->Matrix
  118. # # but don't want to have TCP connections to IRC unless a Matrix user speaks
  119. # # (because your client connection limit is low), then you may want to keep
  120. # # the bot enabled. Default: true.
  121. # # NB: If the bot is disabled, you SHOULD have matrix-to-IRC syncing turned
  122. # # on, else there will be no users and no bot in a channel (meaning no
  123. # # messages to Matrix!) until a Matrix user speaks which makes a client
  124. # # join the target IRC channel.
  125. # # NBB: The bridge bot IRC client will still join the target IRC network so
  126. # # it can service bridge-specific queries from the IRC-side e.g. so
  127. # # real IRC clients have a way to change their Matrix display name.
  128. # # See https://github.com/matrix-org/matrix-appservice-irc/issues/55
  129. # enabled: true
  130. # # The nickname to give the AS bot.
  131. # nick: "MatrixBot"
  132. # # The password to give to NickServ or IRC Server for this nick. Optional.
  133. # # password: "helloworld"
  134. # #
  135. # # Join channels even if there are no Matrix users on the other side of
  136. # # the bridge. Set to false to prevent the bot from joining channels which have no
  137. # # real matrix users in them, even if there is a mapping for the channel.
  138. # # Default: true
  139. # joinChannelsIfNoUsers: true
  140. #
  141. # # Configuration for PMs / private 1:1 communications between users.
  142. # privateMessages:
  143. # # Enable the ability for PMs to be sent to/from IRC/Matrix.
  144. # # Default: true.
  145. # enabled: true
  146. # # Prevent Matrix users from sending PMs to the following IRC nicks.
  147. # # Optional. Default: [].
  148. # # exclude: ["Alice", "Bob"] # NOT YET IMPLEMENTED
  149. #
  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. #
  155. # # Configuration for mappings not explicitly listed in the 'mappings'
  156. # # section.
  157. # dynamicChannels:
  158. # # Enable the ability for Matrix users to join *any* channel on this IRC
  159. # # network.
  160. # # Default: false.
  161. # enabled: true
  162. # # Should the AS create a room alias for the new Matrix room? The form of
  163. # # the alias can be modified via 'aliasTemplate'. Default: true.
  164. # createAlias: true
  165. # # Should the AS publish the new Matrix room to the public room list so
  166. # # anyone can see it? Default: true.
  167. # published: true
  168. # # What should the join_rule be for the new Matrix room? If 'public',
  169. # # anyone can join the room. If 'invite', only users with an invite can
  170. # # join the room. Note that if an IRC channel has +k or +i set on it,
  171. # # join_rules will be set to 'invite' until these modes are removed.
  172. # # Default: "public".
  173. # joinRule: public
  174. # # This will set the m.room.related_groups state event in newly created rooms
  175. # # with the given groupId. This means flares will show up on IRC users in those rooms.
  176. # # This should be set to the same thing as namespaces.users.group_id in irc_registration.
  177. # # This does not alter existing rooms.
  178. # # Leaving this option empty will not set the event.
  179. # groupId: +myircnetwork:localhost
  180. # # Should created Matrix rooms be federated? If false, only users on the
  181. # # HS attached to this AS will be able to interact with this room.
  182. # # Default: true.
  183. # federate: true
  184. # # The room alias template to apply when creating new aliases. This only
  185. # # applies if createAlias is 'true'. The following variables are exposed:
  186. # # $SERVER => The IRC server address (e.g. "irc.example.com")
  187. # # $CHANNEL => The IRC channel (e.g. "#python")
  188. # # This MUST have $CHANNEL somewhere in it.
  189. # # Default: '#irc_$SERVER_$CHANNEL'
  190. # aliasTemplate: "#irc_$CHANNEL"
  191. # # A list of user IDs which the AS bot will send invites to in response
  192. # # to a !join. Only applies if joinRule is 'invite'. Default: []
  193. # # whitelist:
  194. # # - "@foo:example.com"
  195. # # - "@bar:example.com"
  196. # #
  197. # # Prevent the given list of channels from being mapped under any
  198. # # circumstances.
  199. # # exclude: ["#foo", "#bar"]
  200. #
  201. # # Configuration for controlling how Matrix and IRC membership lists are
  202. # # synced.
  203. # membershipLists:
  204. # # Enable the syncing of membership lists between IRC and Matrix. This
  205. # # can have a significant effect on performance on startup as the lists are
  206. # # synced. This must be enabled for anything else in this section to take
  207. # # effect. Default: false.
  208. # enabled: false
  209. #
  210. # # Syncing membership lists at startup can result in hundreds of members to
  211. # # process all at once. This timer drip feeds membership entries at the
  212. # # specified rate. Default: 10000. (10s)
  213. # floodDelayMs: 10000
  214. #
  215. # global:
  216. # ircToMatrix:
  217. # # Get a snapshot of all real IRC users on a channel (via NAMES) and
  218. # # join their virtual matrix clients to the room.
  219. # initial: false
  220. # # Make virtual matrix clients join and leave rooms as their real IRC
  221. # # counterparts join/part channels. Default: false.
  222. # incremental: false
  223. #
  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. #
  233. # # Apply specific rules to Matrix rooms. Only matrix-to-IRC takes effect.
  234. # rooms:
  235. # - room: "!fuasirouddJoxtwfge:localhost"
  236. # matrixToIrc:
  237. # initial: false
  238. # incremental: false
  239. #
  240. # # Apply specific rules to IRC channels. Only IRC-to-matrix takes effect.
  241. # channels:
  242. # - channel: "#foo"
  243. # ircToMatrix:
  244. # initial: false
  245. # incremental: false
  246. #
  247. # mappings:
  248. # # 1:many mappings from IRC channels to room IDs on this IRC server.
  249. # # The matrix room must already exist. Your matrix client should expose
  250. # # the room ID in a "settings" page for the room.
  251. # "#thepub": ["!kieouiJuedJoxtVdaG:localhost"]
  252. #
  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. #
  273. # # Configuration for virtual IRC users. The following variables are exposed:
  274. # # $LOCALPART => The user ID localpart ("alice" in @alice:localhost)
  275. # # $USERID => The user ID
  276. # # $DISPLAY => The display name of this user, with excluded characters
  277. # # (e.g. space) removed. If the user has no display name, this
  278. # # falls back to $LOCALPART.
  279. # ircClients:
  280. # # The template to apply to every IRC client nick. This MUST have either
  281. # # $DISPLAY or $USERID or $LOCALPART somewhere in it.
  282. # # Optional. Default: "M-$DISPLAY". Example: "M-Alice".
  283. # nickTemplate: "$DISPLAY[m]"
  284. # # True to allow virtual IRC clients to change their nick on this server
  285. # # by issuing !nick <server> <nick> commands to the IRC AS bot.
  286. # # This is completely freeform: it will NOT follow the nickTemplate.
  287. # allowNickChanges: true
  288. # # The max number of IRC clients that will connect. If the limit is
  289. # # reached, the client that spoke the longest time ago will be
  290. # # disconnected and replaced.
  291. # # Optional. Default: 30.
  292. # maxClients: 30
  293. # # IPv6 configuration.
  294. # ipv6:
  295. # # Optional. Set to true to force IPv6 for outgoing connections.
  296. # only: false
  297. # # Optional. The IPv6 prefix to use for generating unique addresses for each
  298. # # connected user. If not specified, all users will connect from the same
  299. # # (default) address. This may require additional OS-specific work to allow
  300. # # for the node process to bind to multiple different source addresses
  301. # # e.g IP_FREEBIND on Linux, which requires an LD_PRELOAD with the library
  302. # # https://github.com/matrix-org/freebindfree as Node does not expose setsockopt.
  303. # # prefix: "2001:0db8:85a3::" # modify appropriately
  304. # #
  305. # # The maximum amount of time in seconds that the client can exist
  306. # # without sending another message before being disconnected. Use 0 to
  307. # # not apply an idle timeout. This value is ignored if this IRC server is
  308. # # mirroring matrix membership lists to IRC. Default: 172800 (48 hours)
  309. # idleTimeout: 10800
  310. # # The number of millseconds to wait between consecutive reconnections if a
  311. # # client gets disconnected. Setting to 0 will cause the scheduling to be
  312. # # disabled, i.e. it will be scheduled immediately (with jitter.
  313. # # Otherwise, the scheduling interval will be used such that one client
  314. # # reconnect for this server will be handled every reconnectIntervalMs ms using
  315. # # a FIFO queue.
  316. # # Default: 5000 (5 seconds)
  317. # reconnectIntervalMs: 5000
  318. # # The number of concurrent reconnects if a user has been disconnected unexpectedly
  319. # # (e.g. a netsplit). You should set this to a reasonably high number so that
  320. # # bridges are not waiting an eternity to reconnect all its clients if
  321. # # we see a massive number of disconnect. This is unrelated to the reconnectIntervalMs
  322. # # setting above which is for connecting on restart of the bridge. Set to 0 to
  323. # # immediately try to reconnect all users.
  324. # # Default: 50
  325. # concurrentReconnectLimit: 50
  326. # # The number of lines to allow being sent by the IRC client that has received
  327. # # a large block of text to send from matrix. If the number of lines that would
  328. # # be sent is > lineLimit, the text will instead be uploaded to matrix and the
  329. # # resulting URI is treated as a file. As such, a link will be sent to the IRC
  330. # # side instead of potentially spamming IRC and getting the IRC client kicked.
  331. # # Default: 3.
  332. # lineLimit: 3
  333. # # A list of user modes to set on every IRC client. For example, "RiG" would set
  334. # # +R, +i and +G on every IRC connection when they have successfully connected.
  335. # # User modes vary wildly depending on the IRC network you're connecting to,
  336. # # so check before setting this value. Some modes may not work as intended
  337. # # through the bridge e.g. caller ID as there is no way to /ACCEPT.
  338. # # Default: "" (no user modes)
  339. # # userModes: "R"
  340. #
  341. # # Configuration for an ident server. If you are running a public bridge it is
  342. # # advised you setup an ident server so IRC mods can ban specific matrix users
  343. # # rather than the application service itself.
  344. # ident:
  345. # # True to listen for Ident requests and respond with the
  346. # # matrix user's user_id (converted to ASCII, respecting RFC 1413).
  347. # # Default: false.
  348. # enabled: false
  349. # # The port to listen on for incoming ident requests.
  350. # # Ports below 1024 require root to listen on, and you may not want this to
  351. # # run as root. Instead, you can get something like an Apache to yank up
  352. # # incoming requests to 113 to a high numbered port. Set the port to listen
  353. # # on instead of 113 here.
  354. # # Default: 113.
  355. # port: 1113
  356. # # The address to listen on for incoming ident requests.
  357. # # Default: 0.0.0.0
  358. # address: "::"
  359. #
  360. # # Configuration for logging. Optional. Default: console debug level logging
  361. # # only.
  362. # logging:
  363. # # Level to log on console/logfile. One of error|warn|info|debug
  364. # level: "debug"
  365. # # The file location to log to. This is relative to the project directory.
  366. # logfile: "debug.log"
  367. # # The file location to log errors to. This is relative to the project
  368. # # directory.
  369. # errfile: "errors.log"
  370. # # Whether to log to the console or not.
  371. # toConsole: true
  372. # # The max number of files to keep. Files will be overwritten eventually due
  373. # # to rotations.
  374. # maxFiles: 5
  375. #
  376. # # Optional. Enable Prometheus metrics. If this is enabled, you MUST install `prom-client`:
  377. # # $ npm install prom-client@6.3.0
  378. # # Metrics will then be available via GET /metrics on the bridge listening port (-p).
  379. # metrics:
  380. # # Whether to actually enable the metric endpoint. Default: false
  381. # enabled: true
  382. # # When collecting remote user active times, which "buckets" should be used. Defaults are given below.
  383. # # The bucket name is formed of a duration and a period. (h=hours,d=days,w=weeks).
  384. # remoteUserAgeBuckets:
  385. # - "1h"
  386. # - "1d"
  387. # - "1w"
  388. #
  389. # # Configuration options for the debug HTTP API. To access this API, you must
  390. # # append ?access_token=$APPSERVICE_TOKEN (from the registration file) to the requests.
  391. # #
  392. # # The debug API exposes the following endpoints:
  393. # #
  394. # # GET /irc/$domain/user/$user_id => Return internal state for the IRC client for this user ID.
  395. # #
  396. # # POST /irc/$domain/user/$user_id => Issue a raw IRC command down this connection.
  397. # # Format: new line delimited commands as per IRC protocol.
  398. # #
  399. # debugApi:
  400. # # True to enable the HTTP API endpoint. Default: false.
  401. # enabled: false
  402. # # The port to host the HTTP API.
  403. # port: 11100
  404. #
  405. # # Configuration for the provisioning API.
  406. # #
  407. # # GET /_matrix/provision/link
  408. # # GET /_matrix/provision/unlink
  409. # # GET /_matrix/provision/listlinks
  410. # #
  411. # provisioning:
  412. # # True to enable the provisioning HTTP endpoint. Default: false.
  413. # enabled: false
  414. # # The number of seconds to wait before giving up on getting a response from
  415. # # an IRC channel operator. If the channel operator does not respond within the
  416. # # allotted time period, the provisioning request will fail.
  417. # # Default: 300 seconds (5 mins)
  418. # requestTimeoutSeconds: 300
  419. #
  420. # # WARNING: The bridge needs to send plaintext passwords to the IRC server, it cannot
  421. # # send a password hash. As a result, passwords (NOT hashes) are stored encrypted in
  422. # # the database.
  423. # #
  424. matrix_appservice_irc_configuration_extension: "{{ matrix_appservice_irc_configuration_extension_yaml|from_yaml if matrix_appservice_irc_configuration_extension_yaml|from_yaml else {} }}"
  425. matrix_appservice_irc_configuration: "{{ matrix_appservice_irc_configuration_yaml|from_yaml|combine(matrix_appservice_irc_configuration_extension, recursive=True) }}"