Matrix Docker Ansible eploy
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 

425 рядки
22 KiB

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