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.
 
 

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