cmc/cleberg.net
My personal web garden & blog.
clone: git clone https://gitbay.org/cmc/cleberg.net.git
main: content/blog/2023-06-23-self-hosting-convos.org · raw
1#+date: [2023-06-23 Fri 00:00:00]
2#+title: Self-Hosting Guide: Convos
3#+description: How to self-host Convos, a web-based IRC client.
4#+slug: self-hosting-convos
5#+filetags: :linux:self-hosting:
6
7* Convos
8
9[[https://convos.chat/][Convos]] is an always-online web client for IRC.
10It has a few features that made it attractive to me as a self-hosted
11option:
12
13- Extremely simple Docker Compose installation method.
14- Runs in the background and monitors chats even while you're not logged
15 in.
16- Neatly organized sidebar for conversation and client settings.
17- Ability to connect to different hosts and create profiles for hosts.
18- By default, registration is closed to the public. You can enable
19 public registration on the Settings page or generate invitation links
20 on the Users page.
21- Customization of the client theme, organization name and URL, admin
22 email, and video service.
23
24* Docker Installation
25
26To install Convos, simply create a directory and a =docker-compose.yml=
27file:
28
29#+begin_src sh
30mkdir ~/convos && cd ~/convos
31nano docker-compose.yml
32#+end_src
33
34With the =docker-compose.yml= file open, paste the configuration below
35into the file. You can customize the host port to be something unique,
36such as =21897:3000=. You can also change the =data= folder to be a
37docker volume instead, if you prefer.
38
39#+begin_src config
40version: '3'
41
42services:
43 convos:
44 image: 'convos/convos:stable'
45 ports:
46 - '3000:3000'
47 volumes:
48 - './data:/data'
49 environment:
50 - CONVOS_REVERSE_PROXY=1
51 restart: always
52#+end_src
53
54Save the =docker-compose.yml= file and bring the container up:
55
56#+begin_src sh
57sudo docker-compose up -d
58#+end_src
59
60At this point, Convos is available at =<server_ip>:3000= but not
61available to the public.
62
63* Nginx Reverse Proxy
64
65If you're using Nginx, you can create a configuration file for the
66convos application. Start by opening the file:
67
68#+begin_src sh
69nano /etc/nginx/sites-available/convos
70#+end_src
71
72Within the nginx configuration file, paste the following content and be
73sure to update =convos.example.com= to match your domain and
74=127.0.0.1:3000= to match the port you opened in the
75=docker-compose.yml= file.
76
77#+begin_src config
78# Host and port where convos is running
79upstream convos_upstream { server 127.0.0.1:3000; }
80
81server {
82 if ($host ~ ^[^.]+\.example\.com$) {
83 return 301 https://$host$request_uri;
84 }
85
86 listen [::]:80;
87 listen 80;
88 server_name convos.example.com;
89 return 404;
90}
91
92server {
93 listen [::]:443 ssl http2;
94 listen 443 ssl http2;
95 server_name convos.example.com;
96 access_log /var/log/nginx/convos.access.log;
97 error_log /var/log/nginx/convos.error.log;
98
99 location / {
100 proxy_pass http://convos_upstream;
101 proxy_http_version 1.1;
102 proxy_set_header Upgrade $http_upgrade;
103 proxy_set_header Connection "upgrade";
104 client_max_body_size 0;
105 proxy_set_header Host $host;
106 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
107 proxy_set_header X-Request-Base "$scheme://$host/";
108 }
109
110 ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
111 ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
112 include /etc/letsencrypt/options-ssl-nginx.conf;
113 ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
114}
115#+end_src
116
117Once the file is saved, link it to the =sites-enabled= directory and
118restart Nginx.
119
120#+begin_src sh
121sudo ln -s /etc/nginx/sites-available/convos /etc/nginx/sites-enabled/convos
122sudo systemctl restart nginx.service
123#+end_src
124
125* Screenshots
126
127See the screenshots below for an example of the Convos homepage and an
128excerpt of the chat screen.
129
130There are numerous themes to choose from; the theme shown in the images
131below is Dracula.
132
133#+caption: Convos Home
134#+attr_html: :alt The Convos login page, requiring an email and password.
135[[https://img.cleberg.net/blog/20230623-convos/convos_home.webp]]
136
137#+caption: Convos Chat
138#+attr_html: :alt An example of the #org-mode channel on Libera.Chat.
139[[https://img.cleberg.net/blog/20230623-convos/convos_chat.webp]]
140
141* Registering a Nickname
142
143Hop into the server channel so that you can message NickServ. In the
144case of Convos, the default sever is libera.chat. Simply click the
145=libera= conversation at the top of the sidebar to open it. Once the
146chat is open, you can claim a nickname by typing:
147
148#+begin_src txt
149/nick <nick>
150#+end_src
151
152If the nickname is available, and you'd like to register the nickname to
153yourself, you'll need to type another command:
154
155#+begin_src txt
156/msg NickServ REGISTER
157<password> <email>
158#+end_src
159
160On libera.chat, the server will send a confirmation email with a command
161that you must message in IRC to verify registration of the nickname:
162
163#+begin_src txt
164/msg NickServ VERIFY REGISTER <nick> <verification_code>
165#+end_src
166
167Once entered, the server should confirm registration of the nickname to
168the supplied email with the password specified.