== One Client for Everything
== Table of Contents
[arabic]
. link:#foreword[Foreword]
. link:#two-ways-of-solving-this[Two ways of solving this]
. link:#the-web-app-way[The web app way]
. link:#gui-or-terminal-client[gui or terminal client]
. link:#matrix-or-irc[Matrix or IRC]
=== Foreword
First let’s talk about the problem we’re trying to solve here. I want to
have a unified interface into all the communication forms that I use. I
can’t be bothered to have different clients open all the time. I want to
have one client that takes care of all things mostly well.
=== Two ways of solving this
There is generally two ways one can try to solve this. Number one is to
just use a browser. Almost all forms of comm nowadays have a web client
so basically one way of solving our problem is to a dedicated browser
that has all the clients open. Mind you, there are even specialized and
more lightweight browser offerings specifically geared towards this
use-case but still this option is not ideal in terms of resources and
the interface you’re getting is not really unified.
==== The web app way
An example that comes to mind for this sort of solution is `rambox`
though they are no longer offering a FOSS solution. I’m just mentioning
them as an example of what’s being offered out there as a ready-to-use
solution.
Although this way of doing things is very resource-intensive, this is
the *complete* way of doing things. What I mean by that is that by using
the official web apps, you will not be compromising on any features that
the clients offer since you will be using the official clients.
==== gui or terminal client
The second way of going about and solving this is to pick a very good
client that supports a protocol with a lot of bridges and then bridge
everything through to the app of that one protocol. Currently there are
only three protocols that have enough facilities for bridging to make
this feasible. IRC, Matrix and XMPP. I’m adding XMPP for the sake of
completion but in terms of practicality XMPP doesn’t have nearly as many
bridges as IRC and Matrix.
So this basically narrows down our choice to either IRC or Matrix. Now
lets look at the clients that are available for these two protocols.
==== Matrix or IRC
The last requirement on my side is that i would rather use a unified
terminal keyboard-based client than a web application client. That being
said, i definitely expect to use a web client since using a terminal
client on a smart phone is pretty much just pain. A lot of pain.
Unfortunately at the time of writing this post, Matrix has no terminal
client that comes close to either https://github.com/irssi/irssi[irssi]
or https://github.com/weechat/weechat[weechat], both terminal clients
originally only supporting IRC but later advertising themselves as
multi-chat clients. Also as an added bonus, starting from the next irssi
release which should be irssi v1.5 one can elect not to build the IRC
module at all while building irssi.
Matrix and IRC both have a rich ecosystem of bridges. Matrix has a
growing fan base which means more and more bridges or tools with similar
functionality will be releases for it. Contrast that with IRC where that
number seems to be smaller than Matrix but still is very much alive and
well.
=== https://github.com/bitlbee/bitlbee[bitlbee-libpurple]
....
it'll be bitlbee
....
bitlbee is a bridge software for IRC. The distinguishing feature for
bitlbee is that the way it bridges other protocols to IRC is by
masquerading as an ircd. You could also use libpurple as the backend for
bitlbee (https://wiki.bitlbee.org/HowtoPurple[link]). libpurple has an
origin story similar to libreadline. Basically it used to live inside
pidgin, but later on it was turned into a library so that other
applications could use it as well.
List of protocols supported by libpurple:
....
aim
bitlbee-discord
bitlbee-mastodon
bonjour
eionrobb-icyque
eionrobb-mattermost
eionrobb-rocketchat
facebook
gg
hangouts
hehoe-signald
hehoe-whatsmeow
icq
irc
jabber
matrix
meanwhile
novell
otr
simple
sipe
skypeweb
slack
steam
telegram-tdlib
zephyr
....
=== https://github.com/42wim/matterbridge[matterbridge]
matterbridge is an everything-to-everything bridge.
Please keep in mind that with matterbridge, you don’t get the full
functionality of a protocol as in you get no private messages and such.
You get the ability to join public chat rooms or whatever they call it
in that protocol.
=== bridge ircds
==== https://github.com/42wim/matterircd[matterircd]
a mattermost bridge that emulates an ircd as the name implies.
==== https://github.com/progval/matrix2051[matrix2051]
another bridge that emulates an ircd, but for matrix.
==== https://github.com/adsr/irslackd[irslackd]
a bridge to slack that emulates an ircd.
==== docker compose
https://github.com/ezkrg/docker-bitlbee-libpurple[Here]’s the original
Dockerfile. You can find mine
https://github.com/terminaldweller/docker-bitlbee-libpurple[here]. And
here’s the docker compose file I use that goes with that:
[source,yaml]
----
version: "3.8"
services:
bitlbee:
image: devi_bitlbee
deploy:
resources:
limits:
memory: 384M
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
- bitlbeenet
ports:
- "127.0.0.1:8667:6667"
- "172.17.0.1:8667:6667"
restart: unless-stopped
user: "bitlbee:bitlbee"
command:
[
"/usr/sbin/bitlbee",
"-F",
"-n",
"-u",
"bitlbee",
"-c",
"/var/lib/bitlbee/bitlbee.conf",
"-d",
"/var/lib/bitlbee",
]
dns:
- 9.9.9.9
volumes:
- ./conf/bitlbee.conf:/var/lib/bitlbee/bitlbee.conf:ro
- userdata:/var/lib/bitlbee
- /home/devi/.cache/docker-bitlbee/signald/run:/var/run/signald
- /etc/ssl/certs:/etc/ssl/certs:ro
signald:
image: signald/signald:stable
deploy:
resources:
limits:
memory: 384M
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
- signalnet
ports:
- "127.0.0.1:7775:7775"
- "172.17.0.1:7775:7775"
restart: unless-stopped
dns:
- 9.9.9.9
volumes:
- /home/devi/.cache/docker-bitlbee/signald/run:/signald
- /etc/ssl/certs:/etc/ssl/certs:ro
environment:
- SIGNALD_ENABLE_METRICS=false
- SIGNALD_HTTP_LOGGING=true
- SIGNALD_VERBOSE_LOGGING=true
- SIGNALD_METRICS_PORT=7775
- SIGNALD_LOG_DB_TRANSACTIONS=true
matterircd:
image: 42wim/matterircd:latest
deploy:
resources:
limits:
memory: 384M
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
- matterircdnet
ports:
- "127.0.0.1:7667:7667"
- "172.17.0.1:7667:7667"
dns:
- 9.9.9.9
restart: unless-stopped
command: ["--conf", "/matterircd.toml"]
volumes:
- ./matterircd.toml:/matterircd.toml:ro
networks:
bitlbeenet:
signalnet:
matterircdnet:
volumes:
userdata:
matterircddb:
----
==== SMS
I have an entire post about how one can get their SMS on IRC
link:posts/how_to_get_your_sms_on_irc[here]. You need a piece of
software on your phone to forward the SMS to a web hook server and then
we send the SMS over to IRC. You can find the web-hook server that I use
https://github.com/terminaldweller/sms-webhook[here].
==== where to sink all the bridges
Bridges connect two things. You need to have a sink for your bridges. I
was contemplating making a lot of invite-only channels protected by
password on public networks then I found out about
https://github.com/ergochat/ergo[ergo]. I’d say the main advantage of
using ergo is, it’s easy to setup. You don’t need any other services to
run to get basic functionality like chanserv or nickserv. You don’t even
need a bouncer if you need to have your messages when your client
disconnects. ergo has that functionality built-in. Here are some other
perks:
* ergo allow you to define a ``private'' IRC network. You do that by
requiring SASL while connecting, so others can’t connect to your
instance without having an account
* it is under active development
* it has good documentation
* its one executable written in go so it’s very easy to deploy
==== bots
We have LLMs now. The genie is out of the box. They are useful.’ I
needed a bunch of them to I wrote
https://github.com/terminaldweller/milla[milla]. At the time of writing
milla supports chatgpt, gemini and of course ollama.
===== Deploying milla
[source,yaml]
----
version: "3.9"
services:
milla:
image: milla
build:
context: .
deploy:
resources:
limits:
memory: 64M
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
- millanet
restart: unless-stopped
command: ["--config", "/opt/milla/config.toml"]
volumes:
- ./config.toml:/opt/milla/config.toml
cap_drop:
- ALL
dns:
- 9.9.9.9
environment:
- SERVER_DEPLOYMENT_TYPE=deployment
entrypoint: ["/milla/milla"]
networks:
millanet:
----
[source,toml]
----
ircServer = "irc.terminaldweller.com"
ircPort = 6697
ircNick = "mybot"
ircSaslUser = "mybot"
ircSaslPass = "mypass"
ircChannel = "#mychannel"
ollamaEndpoint = ""
temp = 0.2
ollamaSystem = ""
requestTimeout = 10
millaReconnectDelay = 60
enableSasl = true
model = "llama2-uncensored"
chromaStyle = "rose-pine-moon"
chromaFormatter = "terminal256"
provider = "ollama" # ollama, chatgpt, gemini
apikey = "key"
topP = 0.9
topK = 20
----
timestamp:1713480455
version:1.0.0
https://blog.terminaldweller.com/rss/feed
https://raw.githubusercontent.com/terminaldweller/blog/main/mds/oneclientforeverything.md