ZNC - NonaSuomy/PuRe GitHub Wiki

ZNC

ZNC is an IRC network bouncer or BNC. It can detach the client from the actual IRC server, and also from selected channels. Multiple clients from different locations can connect to a single ZNC account simultaneously and therefore appear under the same nickname on IRC. It supports SSL secured connections and IPv6.

More NFO here.

ZNC Install

sudo apt-get install znc

ZNC Config Script:

znc --makeconf

Compile ZNC from source V0.206 (Debian 6.0)

sudo apt-get update && sudo apt-get install build-essential libssl-dev openssl tcl-dev libsasl2-dev swig libperl-dev pkg-config libc-ares-dev python3-dev

cd /usr/src/

sudo wget  wget http://znc.in/releases/znc-0.206.tar.gz

sudo tar -xzvf znc*.*gz

cd znc-0.206

sudo ./configure --prefix=$HOME/znc --enable-extra --enable-tcl --with-tcl=/usr/bin/tclsh --enable-sasl --

enable-perl --enable-python

sudo make -j4

sudo make install

Compile ZNC from git source (+1.0) (Debian 6.0)

sudo nano /etc/apt/sources.list

#Sid Unstable
deb http://ftp.ca.debian.org/debian unstable main
deb-src http://ftp.ca.debian.org/debian unstable main

sudo apt-get -t unstable install tcl8.6 tcl8.6-dev

sudo apt-get update && sudo apt-get install build-essential libssl-dev openssl libsasl2-dev swig2.0 libperl-dev pkg-config libc-ares-dev python3-dev 

cd /usr/src/

git clone git://github.com/znc/znc.git

cd znc

sudo ./configure --prefix=$HOME/znc --enable-extra --enable-tcl --with-tcl=/usr/bin/tclsh8.6 --enable-sasl --enable-perl --enable-python --enable-cyrus

sudo make -j4

sudo make install

Start ZNC

~./znc/bin/znc 

Add Colloquy to 1.3 git modules

 cd ~/code/znc/modules
 wget http://github.com/wired/colloquypush/raw/master/znc/colloquy.cpp

Compile ZNC from git source (+1.3) (Debian 7.0)

 cd ~/code/znc
 git pull
 sudo apt-get install gettext
 sudo make clean
 ./configure --prefix=$HOME/znc --enable-tcl --with-tcl=/usr/bin/tclsh8.6 --enable-perl --enable-python --enable-cyrus
 ./bootstrap.sh
 sudo make
 sudo make install

Manually Editing Config

In most cases you should NOT edit znc.conf directly. Use webadmin instead. If you really need to edit znc.conf by hand, do the following:

To save current runtime configuration to znc.conf:

pkill -SIGUSR1 znc

To shutdown running ZNC instance:

pkill znc

To edit config in any text editor:

sudo nano ~/.znc/configs/znc.conf

Sample User:

<User TeknoJuce>
        Pass = sha256#HASH$
        Nick = TeknoBNC
        AltNick = TeknoBNC2
        Ident = Tekno
        RealName = Tekno
        QuitMsg = Man down! CPR to that connection, stat!
        StatusPrefix = *
        Skin = dark-clouds
        ChanModes = +stn
        Buffer = 300
        KeepBuffer = true
        MultiClients = true
        DenyLoadMod = false
        Admin = true
        DenySetBindHost = false
        TimestampFormat = [%H:%M:%S]
        AppendTimestamp = false
        PrependTimestamp = true
        TimezoneOffset = 0.00
        JoinTries = 10
        MaxJoins = 5
        IRCConnectEnabled = true

        Allow = *
        LoadModule = admin
        LoadModule = chansaver
        LoadModule = keepnick
        LoadModule = kickrejoin
        LoadModule = nickserv
        LoadModule = perform
        LoadModule = simple_away

        Server = irc.freenode.net 6667
       <Chan #UnLondon>
        </chan>
</user>

To start ZNC again with new configuration:

znc

How to reload ZNC config without restart?

The best way is NOT to change znc.conf and other files manually while ZNC is running. Try to use webadmin or admin instead, or use:

/msg *status help

If you really need to rehash config from file, there's 2 ways to do that: from IRC (

/msg *status rehash

and from shell:

pkill -SIGHUP znc

WebAdmin

Connect to WebAdmin with your web browser: http://127.0.0.1:6667 Note: If Chromium gives you crap about unsafe port: “Error 312 (net::ERR_UNSAFE_PORT): Unknown error” you will have to manually open the port in chrome by adding to the command-line arguments:

  • nix
chromium-browser --explicitly-allowed-ports=6667

Windows XP C:\Documents and Settings\username\Local Settings\Application Data\Google\Chrome\Application\chrome.exe --explicitly-allowed-ports=6667

Windows 7 C:\Users\USERNAME\AppData\Local\Google\Chrome\Application\chrome.exe --explicitly-allowed-ports=6667

OSX /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --explicitly-allowed-ports=6667

Android We can set command line flags for chrome in a file at /data/local/chrome-command-line. Here's an adb one-liner: adb shell 'echo '\chrome --explicitly-allowed-ports=6667'\ > /data/local/chrome-command-line'



Note: Firefox / Internet Explorer / Safari do not block ports

Login

Home Screen



Add User

Settings

Preform

List Users

Traffic Info

Your Settings

Changing passwords

Change password for yourself and others if you have admin rights manually:

/msg *admin set password USERNAME PASSWORD

IDENT for ZNC

Load Module IDENTFILE ( for freenode gateway cloak )

Forward port 113 to ZNC box (appServer)

Using identfile with oidentd

Your /etc/oidentd.conf must allow ident spoofing for the user ZNC runs as (the allow spoof privilege). Example file:

default {
    default {
        allow spoof
        allow spoof_all
        allow spoof_privport
        allow random
        allow random_numeric
        allow numeric
        allow hide
    }
}

Create an empty .oidentd.conf in the homedir of the user you are running ZNC as (this step may be unnecessary)

touch ~/.oidentd.conf
chmod 644 ~/.oidentd.conf

Oidentd must be able to read your ~/.oidentd.conf. Therefore ZNC's homedir should at least have 711 (world executable, rwx--x--x) permissions.

chmod 711 ~
<pre>

Next load and configure the identfile module. This can be done with the following commands.

<pre>
/msg *status loadmod identfile
/msg *identfile setfile ~/.oidentd.conf
/msg *identfile setformat global { reply "%ident%" }

Check ExpandString for possible variables Note: If you use ipv6 with oidentd and it is not working for an unknown reason, try running it like this: oidentd -a :: - it should force ipv6.

Connect to ZNC with IRC client

If already in an IRC server window type: /server irc.lab.unlab.ca

IRC Server: gw.lab.unlab.ca Port: 6667

Once connected it will ask you to type: /quote PASS USER:PASS

/quote PASS Stifflers-Mom:H4><Su4s4g3

Note: (Caps matter in usernames & passwords!v)

Connect to ZNC with Colloquy IRC client

Colloquy is a OSX/iOS IRC client. The iOS client supports push notifications with a plugin... unfortunately the plugin looks for an old version of ZNC, so we'll have to wait for an update, or fix it ourselves.

OSX

 * Make a new connection. DO NOT EDIT AN EXISTING ONE.
 * Nickname: whatever you want
 * Chat Server: 198.20.49.65
 * Username: ZNC_USERNAME
 * Server Password: ZNC_PASSWORD

iOS

 * New IRC Connection (NOT BOUNCER)
 * Address: 198.20.49.65
 * Nickname: whatever you want
 * Advanced/Attempt SASL: On
 * Advanced/Username: ZNC_USERNAME
 * Advanced/Password: ZNC_PASSWORD
 * [optional] Push Notifications: On

Start ZNC on boot

*/10 * * * *   /home/unlab/znc/bin/znc >/dev/null 2>&1

Sticky A Channel

So it won't close and you will get a history playback on reconnect.

 /msg *stickychan stick #unLab <optional channel-password>
 /msg *stickychan unstick #unLab
⚠️ **GitHub.com Fallback** ⚠️