Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

409 строки
21 KiB

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