diff options
author | EuAndreh <eu@euandre.org> | 2020-08-17 07:35:32 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-08-18 09:05:51 -0300 |
commit | e8efa9cd981b7fc72b7e2973f051c4dc27b7565c (patch) | |
tree | 643bd4bb92ccb47fc79f71b1b2d93bd6cadaced4 | |
parent | Checkpoint: Working Prosody server (diff) | |
download | server-e8efa9cd981b7fc72b7e2973f051c4dc27b7565c.tar.gz server-e8efa9cd981b7fc72b7e2973f051c4dc27b7565c.tar.xz |
Checkpoint: working matterbridge server
I was able to make matterbridge work, but only to realize that it doesn't
support private groups on most services. So I can't use this as a replacement
for other chat systems as I desired.
I ended up using my conversations.im account due to the lack of MUC support in
my current server.
I was also able to setup the Converse client, but my Prosody server also doesn't
have HTTP (or WebSockets, I don't remember) yet, so it didn't work for my
server.
So this may serve as a useful future reference, but I pan to turn off the
matterbridge server itself.
-rw-r--r-- | TODOs.org | 16 | ||||
-rw-r--r-- | secrets/secret-envrc.sh | bin | 3617 -> 4315 bytes | |||
-rw-r--r-- | vps-configuration.env.nix | 46 |
3 files changed, 50 insertions, 12 deletions
@@ -33,15 +33,10 @@ server { Use Prosody as a server itself ** DONE Prosody TLS CLOSED: [2020-08-16 dim. 18:52] -** TODO matterbridge -#+BEGIN_SRC nix -matterbridge = { - enable = false; - configFile = '' - ''; -}; -#+END_SRC -** TODO Converse +** DONE matterbridge +CLOSED: [2020-08-16 dim. 21:58] +** DONE Converse +CLOSED: [2020-08-16 dim. 21:58] ** DONE cgit CLOSED: [2020-08-14 ven. 09:29] ** TODO Terraform restore from backup when provisioning @@ -83,7 +78,8 @@ resource "vultr_block_storage" "vps_storage" { * Services - v2 ** DONE =cloud.$tld=: Nextcloud: storage, calendar, contacts, notes and talk CLOSED: [2020-08-14 ven. 09:29] -** TODO =chat.$tld=: [[https://conversejs.org/][Converse]] interface to Prosody server +** DONE =chat.$tld=: [[https://conversejs.org/][Converse]] interface to Prosody server +CLOSED: [2020-08-16 dim. 21:58] Setup under Prosody server, and bridge it with Telegram and WhatsApp using matterbridge. #+BEGIN_SRC nix muc = [{ diff --git a/secrets/secret-envrc.sh b/secrets/secret-envrc.sh Binary files differindex c4fcf1c..18af943 100644 --- a/secrets/secret-envrc.sh +++ b/secrets/secret-envrc.sh diff --git a/vps-configuration.env.nix b/vps-configuration.env.nix index dad3a9c..831a714 100644 --- a/vps-configuration.env.nix +++ b/vps-configuration.env.nix @@ -21,8 +21,16 @@ let systemStateVersion = "$SYSTEM_STATE_VERSION"; prosodyAdminUser = "$PROSODY_ADMIN_USER"; prosodyMUCTLD = "$PROSODY_MUC_TLD"; - prosodyHTTPUploadTLD = "$PROSODY_HTTP_UPLOAD_TLD"; + prosodyPort = "$PROSODY_PORT"; prosodyHTTPPort = "$PROSODY_HTTP_PORT"; + matterbridgeTelegramToken = "$MATTERBRIDGE_TELEGRAM_TOKEN"; + matterbridgeTelegramChannel = "$MATTERBRIDGE_TELEGRAM_CHANNEL"; + matterbridgeBotJID = "$MATTERBRIDGE_BOT_JID"; + matterbridgeBotPassword = "$MATTERBRIDGE_BOT_PASSWORD"; + matterbridgeBotNick = "$MATTERBRIDGE_BOT_NICK"; + matterbridgeMUCServer = "$MATTERBRIDGE_MUC_SERVER"; + matterbridgeXMPPServer = "$MATTERBRIDGE_XMPP_SERVER"; + matterbridgeXMPPChannel = "$MATTERBRIDGE_XMPP_CHANNEL"; }; boneco = pkgs.stdenv.mkDerivation { name = "boneco"; @@ -108,6 +116,7 @@ in { "${envsubstConfiguration.prosodyTLD}" = { forceSSL = true; enableACME = true; + serverAliases = [ envsubstConfiguration.prosodyMUCTLD ]; locations = { "/" = { proxyPass = @@ -155,7 +164,8 @@ in { in { enable = true; admins = [ envsubstConfiguration.prosodyAdminUser ]; - allowRegistration = true; + allowRegistration = false; + modules = { websocket = true; }; package = pkgs.prosody.override { withCommunityModules = [ "http_upload" "conversejs" "bookmarks" ]; }; @@ -174,6 +184,38 @@ in { }; }; }; + # muc = [{ + # domain = envsubstConfiguration.prosodyMUCTLD; + # }]; + }; + + matterbridge = { + enable = true; + configFile = '' + [telegram.mytelegram] + Token="${envsubstConfiguration.matterbridgeTelegramToken}" + RemoteNickFormat="[{PROTOCOL}] <{NICK}>" + + [xmpp.myxmpp] + Server="${envsubstConfiguration.matterbridgeXMPPServer}" + Jid="${envsubstConfiguration.matterbridgeBotJID}" + Password="${envsubstConfiguration.matterbridgeBotPassword}" + Muc="${envsubstConfiguration.matterbridgeMUCServer}" + Nick="${envsubstConfiguration.matterbridgeBotNick}" + RemoteNickFormat="[{PROTOCOL}] <{NICK}>" + + [[gateway]] + name="gateway1" + enable=true + + [[gateway.inout]] + account="telegram.mytelegram" + channel="${envsubstConfiguration.matterbridgeTelegramChannel}" + + [[gateway.inout]] + account="xmpp.myxmpp" + channel="${envsubstConfiguration.matterbridgeXMPPChannel}" + ''; }; lighttpd = { |