Differences between revisions 1 and 2
Revision 1 as of 2020-05-11 18:56:18
Size: 3770
Editor: DhyanNataraj
Comment:
Revision 2 as of 2020-05-11 18:58:24
Size: 3780
Editor: DhyanNataraj
Comment:
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
matrix-appservice-irc is written in {{{Node.js}}} and uses {{{npm}}} for installation. {{{npm}}}'s integration into Debian is not really {{{matrix-appservice-irc}}} is written in {{{Node.js}}} and uses {{{npm}}} for installation. {{{npm}}}'s integration into Debian is not really
Line 61: Line 61:
$ createuser --pwprompt irc_bridge_user $ createuser --pwprompt irc_bridge_db_user
Line 73: Line 73:
OWNER irc_bridge_user; OWNER irc_bridge_db_user;
Line 125: Line 125:
Reboot, if you can, make sure it is still work. And have a nice IRC<->Matrix chat! Reboot, if you can, make sure it still works. And have a nice IRC<->Matrix chat!

Translation(s): српски


Describe in one or two lines what your page is about.

Setting up matrix-appservice-irc on debian

matrix-appservice-irc is tool for bridging IRC into Matrix communication network.

matrix-appservice-irc have not been packaged for debian use, so here goes a guide explaining how to set it up on current Debian GNU/Linux.

Debian Buster

matrix-appservice-irc is written in Node.js and uses npm for installation. npm's integration into Debian is not really good, so we will need to make some extra action to make it fit.

Installing

So, to install it, you will need git and npm to set it up, and postgresql to run it

$ sudo apt-get install git npm postgresql

Then we will need to create a user that would run bridge service

$ sudo adduser --system  matrix-bridge-irc

Please notice that we do not set --no-create-home option here, as npm will need this user home dir for installation process.

Then you will need to precreate path that where matrix-appservice-irc will be installed, and change it's owner to matrix-bridge-irc user

$ sudo mkdir -p /usr/local/lib/node_modules/matrix-appservice-irc/bin/matrix-appservice-irc
$ sudo ln -s /usr/local/lib/node_modules/matrix-appservice-irc/bin/matrix-appservice-irc /usr/local/bin/matrix-appservice-irc
$ chown -R nataraj: /usr/local/lib/node_modules/

Then switch to matrix-bridge-irc user and run installation process

$ sudo su matrix-bridge-irc
$ npm install matrix-appservice-irc --global
$ cd /usr/local/lib/node_modules/matrix-appservice-irc
$ npm install
$ npm test  # make sure these pass!

If you have good karma, you might get it installed well.

Then you will need to create an empty database that will be used by matrix-appservice-irc

$ sudo su postgres
$ createuser --pwprompt irc_bridge_db_user
$ psql

and in the psql console type

CREATE DATABASE irc_bridge_db
ENCODING 'UTF8'
LC_COLLATE='C'
LC_CTYPE='C'
template=template0
OWNER irc_bridge_db_user;

This will create a database for you.

Configuring

For bridge configuring please follow upstream instruction at https://github.com/matrix-org/matrix-appservice-irc/blob/master/HOWTO.md Do not forget to change database connection options in the end of config file

Running as a systemd service

When you make sure you can run this daemon manually, it is good time to make it run automatically. To do it we will need to create a systemd service file:

$ sudo vi /etc/systemd/system/matrix-appservice-irc.service

And add following content to the file

[Unit]
Description=Matrix AppService IRC
 
[Service]
WorkingDirectory=/usr/local/lib/node_modules/matrix-appservice-irc
ExecStart=node app.js -c config.yaml -f my_registration_file.yaml -p 9999
User=matrix-bridge-irc

[Install]
WantedBy=multi-user.target

Start a service, you've just created

$ sudo systemctl start matrix-appservice-irc

Make sure it is up and running

$ sudo systemctl status matrix-appservice-irc

And then enable service autostart

sudo systemctl enable matrix-appservice-irc

Reboot, if you can, make sure it still works. And have a nice IRC<->Matrix chat!