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.
 
 

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