KiwiIRC

Updated 30 October 2019

KiwiIRC

Introduction

KiwiIRC is a multi-functional Web IRC client.

Preparing a LXC container

We suggest that you install KiwiIRC in a separate contain and set it up according to the manual.

Installing software

Install the required accessories:

emerge -a sys-apps/yarn dev-lang/go

Creating a user

Create the kiwiirc system user:

mkdir -p /var/calculate/www

useradd -r -s /usr/sbin/nologin -d /var/calculate/www/kiwiirc -m kiwiirc

Log in as the newly created user:

su - -s /bin/bash kiwiirc

Compiling the KiwiIRC front-end

Fetch the source code of KiwiIRC, stored on GitHub:

git clone https://github.com/kiwiirc/kiwiirc

Go to the project directory:

cd kiwiirc

Edit the configuration file for chat.example.org:

~/kiwiirc/static/config.json
{
    "windowTitle": "Kiwi IRC - The web IRC client",
    "startupScreen": "welcome",
    "kiwiServer": "http://chat.example.org/webirc/kiwiirc/"
    "restricted": true,
    "theme": "Default",
    "themes": [
        { "name": "Default", "url": "static/themes/default" },
        { "name": "Dark", "url": "static/themes/dark" },
        { "name": "Coffee", "url": "static/themes/coffee" },
        { "name": "GrayFox", "url": "static/themes/grayfox" },
        { "name": "Nightswatch", "url": "static/themes/nightswatch" },
        { "name": "Osprey", "url": "static/themes/osprey" },
        { "name": "Radioactive", "url": "static/themes/radioactive" },
        { "name": "Sky", "url": "static/themes/sky" },
        { "name": "Elite", "url": "static/themes/elite" }
    ],
    "startupOptions" : {
        "channel": "#example-channel",
        "nick": "guest-n?",
        "server": "irc.freenode.net",
        "port": 6667,
    },
    "embedly": {
        "key": ""
    },
    "plugins": [

    ]
}

If you use ReCaptcha, add the site key in startupOptions in the configuration:

~/kiwiirc/static/config.json
"startupOptions" : {
    "channel": "#example-channel",
    "nick": "guest-n?",
    "server": "irc.freenode.net",
    "port": 6667,
    "recaptchaSiteId":"secret"
},

Install the dependencies of the package:

yarn install

Now proceed to building:

yarn run build

Installing WebircGateway

Fetch the source code of WebircGateway, stored on GitHub:

cd

git clone https://github.com/kiwiirc/webircgateway

Compile:

cd webircgateway

make

Copy the sample configuration file:

cp config.conf.example config.conf

~/webircgateway/config.conf
[server.1]
bind = "0.0.0.0"
port = 80

[fileserving]
enabled = true
webroot = /var/calculate/www/kiwiirc/kiwiirc/dist

[transports]
websocket
sockjs
kiwiirc

[allowed_origins]
"*://chat.example.org"

# Connections will be sent to a random upstream
[upstream.1]
hostname = "irc.freenode.net"
port = 6667
tls = false

[gateway.whitelist]
*.freenode.net

If you use ReCaptcha, add the site key in startupOptions in the configuration:

~/webircgateway/config.conf
[verify]
recaptcha_key = "site_id"
recaptcha_secret = "secret_id"

Launching KiwiIRC

Create the init script for KiwiIRC:

/etc/init.d/kiwiirc
#!/sbin/openrc-run
# Copyright 2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

name="Kiwiirc gateway server"
description="Kiwiirc gateway server"
command_user=kiwiirc
command=/var/calculate/www/kiwiirc/webircgateway/webircgateway
command_args="--config /var/calculate/www/kiwiirc/webircgateway/config.conf"
directory=/var/calculate/www/kiwiirc/webircgateway
pidfile="/run/kiwiirc.pid"
command_background=true
output_log=/var/log/kiwiirc.log
error_log=/var/log/kiwiirc.log

depend() {
        use net
}

start_pre() {
        checkpath -f -o kiwiirc -m 0600 /var/log/kiwiirc.log
}

Assign privileges for starting the KiwiIRC server:

chmod 0755 /etc/init.d/kiwiirc

Start the Kiwiirc server:

/etc/init.d/kiwiirc start

Add KiwiIRC to autorun:

rc-update add kiwiirc