From 45f5a96ce1dfcbd59afa61bfd566370907382684 Mon Sep 17 00:00:00 2001 From: Buckaroo Banzai <39065740+BuckarooBanzay@users.noreply.github.com> Date: Mon, 29 Aug 2022 07:38:51 +0200 Subject: [PATCH] matterbridge config (#746) * matterbridge config * add bot channels and api Co-authored-by: BuckarooBanzay --- config/beerchat.js | 49 ------- config/beerchat.test.js | 12 -- config/matterbridge.test.toml | 36 +++++ config/matterbridge.toml | 252 ++++++++++++++++++++++++++++++++++ data/.gitignore | 1 - deploy.yml | 6 + docker-compose.yml | 11 +- group_vars/all.yml | 39 ++++-- minetest.conf | 3 +- 9 files changed, 324 insertions(+), 85 deletions(-) delete mode 100644 config/beerchat.js delete mode 100644 config/beerchat.test.js create mode 100644 config/matterbridge.test.toml create mode 100644 config/matterbridge.toml diff --git a/config/beerchat.js b/config/beerchat.js deleted file mode 100644 index a441e75..0000000 --- a/config/beerchat.js +++ /dev/null @@ -1,49 +0,0 @@ - -module.exports = { - "remotes": [{ - "name": "IRC", - "type": "irc", - "host": "irc.libera.chat", - "username": "pandorabot", - "password": process.env.BEERCHAT_LIBERA_PASSWORD, - "system_channel": "main", - "channels": { - "main": "pandorabox", - "mod": "pandorabox-mod", - "offtopic": "pandorabox-offtopic", - "fr": "pandorabox-fr", - "de": "pandorabox-de", - "es": "pandorabox-es", - "lag": "pandorabox-lag", - "bot": "pandorabox-bot", - "events": "pandorabox-events", - "nsfw": "pandorabox-nsfw", - "ideas": "pandorabox-ideas" - } - },{ - "name": "Discord", - "type": "discord", - "token": process.env.BEERCHAT_DISCORD_TOKEN, - "system_channel": "main", - "channels": { - "main": "main", - "audit": "audit", - "mod": "mod", - "de": "de", - "en": "en", - "fr": "fr", - "es": "es", - "lag": "lag", - "vote": "vote", - "offtopic": "offtopic", - "ru": "ru", - "nsfw": "nsfw", - "grounded": "grounded", - "bot": "bot", - "events": "events-chat", - "ideas": "đŸ’¡ideas", - "fun": "fun", - "reports": "reports" - } - }] -}; diff --git a/config/beerchat.test.js b/config/beerchat.test.js deleted file mode 100644 index 78a03e1..0000000 --- a/config/beerchat.test.js +++ /dev/null @@ -1,12 +0,0 @@ - -module.exports = { - "remotes": [{ - "name": "Discord", - "type": "discord", - "token": process.env.BEERCHAT_DISCORD_TEST_TOKEN, - "system_channel": "main", - "channels": { - "main": "pandorabox-test" - } - }] -}; diff --git a/config/matterbridge.test.toml b/config/matterbridge.test.toml new file mode 100644 index 0000000..e222e71 --- /dev/null +++ b/config/matterbridge.test.toml @@ -0,0 +1,36 @@ +[irc] +[irc.Libera] +Server="irc.libera.chat:6667" +Nick="pandorabot-test" +RemoteNickFormat="[{BRIDGE}] <{NICK}> " +ColorNicks=true +ShowJoinPart=true + +[discord] +[discord.Discord] +Token="{{discord_token}}" +Server="642691106932523028" +RemoteNickFormat="[{BRIDGE}] <{NICK}> " +ShowJoinPart=true +UseUserName=true +AllowMention=["users"] + +[api.minetest] +BindAddress="0.0.0.0:4242" +Token="{{matterbridge_token}}" +Buffer=1000 +RemoteNickFormat="[{BRIDGE}] {NICK}" +ShowJoinPart=true + +[[gateway]] +name="main" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-test" +[[gateway.inout]] +account = "discord.Discord" +channel="pandorabox-test" +[[gateway.inout]] +account="api.minetest" +channel="api" diff --git a/config/matterbridge.toml b/config/matterbridge.toml new file mode 100644 index 0000000..e766027 --- /dev/null +++ b/config/matterbridge.toml @@ -0,0 +1,252 @@ +[irc] +[irc.Libera] +Server="irc.libera.chat:6667" +Nick="pandorabot" +Password="{{irc_password}}" +RemoteNickFormat="[{BRIDGE}] <{NICK}> " +ColorNicks=true +ShowJoinPart=true + +[discord] +[discord.Discord] +Token="{{discord_token}}" +Server="642691106932523028" +RemoteNickFormat="[{BRIDGE}] <{NICK}> " +ShowJoinPart=true +UseUserName=true +AllowMention=["users"] + +[api.minetest] +BindAddress="0.0.0.0:4242" +Token="{{matterbridge_token}}" +Buffer=1000 +RemoteNickFormat="[{BRIDGE}] {NICK}" +ShowJoinPart=true + +[api.bot] +BindAddress="0.0.0.0:4243" +Token="{{matterbridge_bot_token}}" +Buffer=1000 +RemoteNickFormat="[{BRIDGE}] {NICK}" + +[[gateway]] +name="main" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox" +[[gateway.inout]] +account = "discord.Discord" +channel="main" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="audit" +enable=true +[[gateway.inout]] +account = "discord.Discord" +channel="audit" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="mod" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-mod" +[[gateway.inout]] +account = "discord.Discord" +channel="mod" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="de" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-de" +[[gateway.inout]] +account = "discord.Discord" +channel="de" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="en" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-en" +[[gateway.inout]] +account = "discord.Discord" +channel="en" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="fr" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-offtopic" +[[gateway.inout]] +account = "discord.Discord" +channel="offtopic" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="es" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-es" +[[gateway.inout]] +account = "discord.Discord" +channel="es" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="lag" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-lag" +[[gateway.inout]] +account = "discord.Discord" +channel="lag" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="vote" +enable=true +[[gateway.inout]] +account = "discord.Discord" +channel="vote" +[[gateway.inout]] +account="api.minetest" +channel="api" +[[gateway.inout]] +account="api.bot" +channel="api" + +[[gateway]] +name="offtopic" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-offtopic" +[[gateway.inout]] +account = "discord.Discord" +channel="offtopic" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="ru" +enable=true +[[gateway.inout]] +account = "discord.Discord" +channel="ru" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="nsfw" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-nsfw" +[[gateway.inout]] +account = "discord.Discord" +channel="nsfw" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="grounded" +enable=true +[[gateway.inout]] +account = "discord.Discord" +channel="grounded" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="bot" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-bot" +[[gateway.inout]] +account = "discord.Discord" +channel="bot" +[[gateway.inout]] +account="api.minetest" +channel="api" +[[gateway.inout]] +account="api.bot" +channel="api" + +[[gateway]] +name="events" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-events" +[[gateway.inout]] +account = "discord.Discord" +channel="events-chat" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="ideas" +enable=true +[[gateway.inout]] +account="irc.Libera" +channel="#pandorabox-ideas" +[[gateway.inout]] +account = "discord.Discord" +channel="đŸ’¡ideas" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="fun" +enable=true +[[gateway.inout]] +account = "discord.Discord" +channel="fun" +[[gateway.inout]] +account="api.minetest" +channel="api" + +[[gateway]] +name="reports" +enable=true +[[gateway.inout]] +account = "discord.Discord" +channel="reports" +[[gateway.inout]] +account="api.minetest" +channel="api" \ No newline at end of file diff --git a/data/.gitignore b/data/.gitignore index f7c4228..3e6623b 100644 --- a/data/.gitignore +++ b/data/.gitignore @@ -2,7 +2,6 @@ wiki grafana postgres minetest -beerchat.json crashlogs nodered pandorabox-textures diff --git a/deploy.yml b/deploy.yml index 1a084b4..58aff0d 100644 --- a/deploy.yml +++ b/deploy.yml @@ -9,6 +9,7 @@ repo: https://github.com/pandorabox-io/pandorabox.io dest: "{{ compose_directory }}" single_branch: yes + force: yes version: master - name: Template minetest config @@ -16,6 +17,11 @@ src: "minetest.conf" dest: "{{compose_directory}}/data/minetest/minetest.conf" + - name: Template matterbridge config + template: + src: "config/matterbridge.conf" + dest: "{{compose_directory}}/config/matterbridge.conf" + - name: Create and start services community.general.docker_compose: project_src: "{{ compose_directory }}" diff --git a/docker-compose.yml b/docker-compose.yml index 90c174d..10e2a9f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,13 +58,10 @@ services: - "minetest" restart: always - beerchat-proxy: - image: beerchat/beerchat:1.5 - depends_on: - - "minetest" - volumes: - - "./config/beerchat.js:/data/beerchat.js:ro" - restart: always + matterbridge: + image: 42wim/matterbridge:1.25.2 + volumes: + - ./config/matterbridge.toml:/etc/matterbridge/matterbridge.toml mapserver: image: minetestmapserver/mapserver:latest diff --git a/group_vars/all.yml b/group_vars/all.yml index d05b92b..6be6845 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -1,16 +1,25 @@ $ANSIBLE_VAULT;1.1;AES256 -38323531633439666362336432666539383938666639643732303434663730376233663035313265 -6163333835393633326363623866643639633963303666630a323165303964633737366162646461 -64646165386361653930383437653230376531666233616164656334306533653836326361613263 -6563353233643636310a313435326538643063326263616562366531633632666166336131353364 -64313833623438373634636534656436623136353762353965313464373535336166633238323036 -61376561613938666561363636613832333837356231313437353663613661393436313833613262 -31653933316365366337653965343266623061623735643533333936393662396133353736396136 -35396430636238346562616638333630326464633433303437306432353138313638373236313037 -36653636316135386137326166626233666163353438366139316133393730356562663333363164 -65383635633931376439323966383837653464643362636334346364643464313235313932336566 -37333838383935323061333731386662393261343831363532363461313363353962623034616262 -37613566643734393731656533306265373838636166323465323238306561353431313037613661 -39363533363263393630643036613332343864303161646233303732633733636332393237363638 -35373332613363316431353662393637643265633337313661653762653066653238323265396331 -376335303439393461353133306337356361 +32343235643762353639353563386135363234323233326636653730333439353739373131373632 +3761376235316437626464396464303338353735303065380a323161363830393234326437313365 +38643837376233306235386439633233643539643136623231366131303966646165623530393763 +6635323337633134340a333338363165396532626632306536636131373632333361663936343630 +62633138356664326164663633303731373863363031366261333433313431633862333463333762 +32336166383538646232626433303762666331383539353635363764326137636336323638616330 +64373936306535373038623536366165333033306136663834633064356139336630356362376366 +63383133373563386165653435333235656336343138666665386364646339333332306462623033 +36666166333632313234636330636334623562656236623038643337623537373862336339323236 +30313832326566386430303835343062663932336531666233343733373665623165373831303933 +33313231306132663665306538383131613134326165363338376262663337383835366339373730 +33396366396565373161343562336565346463663266393361353864626662396130623834386638 +39363937646431343337323134613435373263633664386236366535326139613663613364373861 +34303561373830633437356661343730373165623061663165313034653830383465306561366265 +34326138633765646435356263303233376464323561376334313730366636636535656464316236 +33313836373461366430623534383466313134346665353766323164656637653765663466353036 +39646532316136343331353536353637333232633132383936306633623239666333323336666265 +64333462363432383433653236386434613731343236343264363130383535366530656130643830 +33666664656262636266366430303962316366616636393931373133323762323964633832333739 +35646132623537366561393035396132396139356138613266326131366335336530613562386165 +36303836666361656534633639353134646634643934663832363863386138343631363631356434 +34396666323034393264353636663431663135376232623136333164636566613037343833396362 +37396434633734626239366662343262383161613932323435653366656665323933353834643234 +64376239333165346531 diff --git a/minetest.conf b/minetest.conf index f24c66b..75c7d36 100644 --- a/minetest.conf +++ b/minetest.conf @@ -96,7 +96,8 @@ xp_redo.discord.webhook_url = {{xp_redo_discord_webhook_url}} xp.limit_dig_rate = 25 # beerchat -beerchat.url = http://beerchat-proxy:8080 +beerchat.matterbridge_url = http://matterbridge:4242 +beerchat.matterbridge_token = {{matterbridge_token}} beerchat.enable_jail = true beerchat.enable_cleaner = true beerchat.enable_announce = true