From 051e68254e1675333fc8a20517dd986426e46726 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Sun, 9 Jun 2024 01:46:00 +0100 Subject: [PATCH] nixos/chatterbox: Add Instagram bridge --- .../vms/shill/containers/chatterbox.nix | 61 +++++++++++++++++-- secrets/chatterbox/mautrix-instagram.env.age | 15 +++++ 2 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 secrets/chatterbox/mautrix-instagram.env.age diff --git a/nixos/boxes/colony/vms/shill/containers/chatterbox.nix b/nixos/boxes/colony/vms/shill/containers/chatterbox.nix index 033ca74..385928a 100644 --- a/nixos/boxes/colony/vms/shill/containers/chatterbox.nix +++ b/nixos/boxes/colony/vms/shill/containers/chatterbox.nix @@ -56,12 +56,16 @@ in }; "chatterbox/mautrix-whatsapp.env" = { - owner = "matrix-whatsapp"; - group = "matrix-whatsapp"; + owner = "mautrix-whatsapp"; + group = "mautrix-whatsapp"; }; "chatterbox/mautrix-messenger.env" = { - owner = "matrix-meta-messenger"; - group = "matrix-meta"; + owner = "mautrix-meta-messenger"; + group = "mautrix-meta"; + }; + "chatterbox/mautrix-instagram.env" = { + owner = "mautrix-meta-instagram"; + group = "mautrix-meta"; }; }; }; @@ -287,6 +291,55 @@ in management_room_text.welcome = "Hello, I'm a Messenger bridge bot."; command_prefix = "!fbm"; login_shared_secret_map."nul.ie" = "$MAU_FBM_DOUBLE_PUPPET_TOKEN"; + backfill = { + history_fetch_pages = 5; + }; + encryption = { + allow = true; + default = true; + require = true; + }; + permissions = { + "@dev:nul.ie" = "admin"; + }; + }; + }; + }; + + instagram = { + enable = true; + registerToSynapse = true; + dataDir = "mautrix-instagram"; + environmentFile = config.age.secrets."chatterbox/mautrix-instagram.env".path; + settings = { + homeserver = { + address = "http://localhost:8008"; + domain = "nul.ie"; + }; + appservice = { + database = { + type = "postgres"; + uri = "$MAU_IG_PSQL_URI"; + }; + id = "instagram"; + bot = { + username = "instagram"; + displayname = "Instagram Bridge Bot"; + avatar = "mxc://maunium.net/JxjlbZUlCPULEeHZSwleUXQv"; + }; + }; + meta.mode = "instagram"; + bridge = { + username_template = "ig_{{.}}"; + displayname_template = ''{{or .DisplayName .Username "Unknown user"}} (IG)''; + personal_filtering_spaces = true; + delivery_receipts = true; + management_room_text.welcome = "Hello, I'm an Instagram bridge bot."; + command_prefix = "!ig"; + login_shared_secret_map."nul.ie" = "$MAU_IG_DOUBLE_PUPPET_TOKEN"; + backfill = { + history_fetch_pages = 5; + }; encryption = { allow = true; default = true; diff --git a/secrets/chatterbox/mautrix-instagram.env.age b/secrets/chatterbox/mautrix-instagram.env.age new file mode 100644 index 0000000..3e60f8d --- /dev/null +++ b/secrets/chatterbox/mautrix-instagram.env.age @@ -0,0 +1,15 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IFpCM2U2USBhVkhZ +azNHVFdNUnJ6MVpJaGo0T0h0L3ZMbHB3RG9Ic2ZZajQ4amt1S3dVCmo0YnZxL0p3 +Y2RHVWFUSVlySTNDNThYMks0aGdOdHdGQjdrRTZZdTFpdlUKLT4gWDI1NTE5IGxZ +elhYTEtMUHR6VlR2b0VwM01XNnFNR0tuK2hFenlhWTIwS3hSMlVIR0kKbVNLWFRZ +c0ZrK3YraTdhR1IzL3FxMEFQYndsYm5NUmpDd3M4Sm43aUJ3VQotPiBuZ0BNPnxi +Ny1ncmVhc2UgUHIgJ0hvbT0oCmMwcmVHR2dTd3VaSFpHUWh1ajA5M1FUTS9WQkNQ +UzZqK0JETmlUOU44eFQ4emw0Ci0tLSBhT01BQ3VVdHBQK29GdmN0VEtoazNCcFpY +WFhIeTh4VTlHeDBhcG1lNUhrCmxtBrEH3ornrPQi4eIIOskkKMTDs1Ow3Z70WuEd +FyXGsYXFwpibxFxAWWLwAYiq7cMTEE0GmYRlNYt7bWwJn12Kv5LVZCL8HXTNXCLl +xf0za7pHvXF8XWaZwU2eMMZRdkzE6HNnbLt+DB0TKS9vf33i7tmwduqJ8oiUtTRD +XTm5IPyULH2rikDuDm0aAvaZhSFlzPIe1MKr93ZaHGrvcnbzhADyt5DRmmDuYSk4 +SSSrhHP3P0LB0OoMGVU8DM9O7QNVwScs07T7ll238Jc/JG/KHj1kT2K9LYAiNl4Q +JfhOOA== +-----END AGE ENCRYPTED FILE-----