I use IRC both at home and at work. I also log-on while traveling. As such, I end up having two or more repositories of logs at any given time that remain segregated from one another. I miss what happens when I’m not logged-in. For some, this is par for the course. I am not usually one to settle for par, so I set about investigating a way to resolve this issue. I’ve known for a while about a program called Irssi, which is the definitive Linux IRC program. Irssi includes a “proxy” module that serves as a robust IRC bouncer. Unfortunately, I can’t get Irssi to compile under Cygwin. I set about searching for other solutions and was pointed at ZNC. ZNC seemed quite promising, so I gave it a spin. Unfortunately, it won’t compile under Cygwin either — at least, not with module support. ZNC without modules was too stripped down.
Not one to give up, I went and sought out the ZNC developers. It was no surprise that they had already run into this particular issue and had a solution already prepared. After a bit of fiddling, I managed to get ZNC to compile with modules and can now maintain a single, persistent IRC presence from anywhere!
What follows is the process I followed to get all this to work. I assume a basic knowledge of Cygwin and Linux commands here, and also assume that you have the correct Cygwin packages installed and a proper Cygwin home directory.
- Download the latest source for ZNC and place it in your Cygwin home directory.
- Launch Cygwin.
- Extract the contents of the source archive with the command tar -xzvf znc*.*gz
- Change to the newly created ZNC directory with cd znc*
- Update Makefile.in and Modules/Makefile.in
- In Makefile.in:
# OLD VERSION
# SRCS := ZNCString.cpp Csocket.cpp main.cpp znc.cpp User.cpp IRCSock.cpp Client.cpp DCCBounce.cpp \
# DCCSock.cpp Chan.cpp Nick.cpp Server.cpp Modules.cpp MD5.cpp Buffer.cpp Utils.cpp \
# FileUtils.cpp HTTPSock.cpp Template.cpp ClientCommand.cpp
# NEW VERSION
SRCS := ZNCString.cpp Csocket.cpp znc.cpp User.cpp IRCSock.cpp Client.cpp DCCBounce.cpp \
DCCSock.cpp Chan.cpp Nick.cpp Server.cpp Modules.cpp MD5.cpp Buffer.cpp Utils.cpp \
FileUtils.cpp HTTPSock.cpp Template.cpp ClientCommand.cpp
# END NEW VERSION
# OLD VERSION
# znc: $(OBJS)
# $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
# NEW VERSION
znc: main.o libznc.dll
$(CXX) $(LDFLAGS) -o $@ main.o -L. -lznc -Wl,-rpath -Wl,$$(pwd) $(LIBS)
libznc.dll: $(OBJS)
$(CXX) $(LDFLAGS) -shared -o $@ $(OBJS) $(LIBS)
# END NEW VERSION - In Modules/Makefile.in
# OLD VERSION
# LDFLAGS := @LDFLAGS@
# NEW VERSION
LDFLAGS := @LDFLAGS@ -L.. -lznc -Wl,-rpath -Wl,$$(pwd)/..
# END NEW VERSION
- In Makefile.in:
- Run ./configure --disable-ipv6
- I don’t think Cygwin supports IPv6. It wouldn’t compile when I had this option enabled, but that could have been the same issue as the modules. YMMV.
- Run make
- Do not run make install! Instead, copy znc.exe from the current directory to the usr/local/bin directory.
- Run znc --makeconf
- Choose your desired options as prompted. You can edit this stuff later in the znc.conf file that you’re currently generating.
- Select a port with a fairly high value so as to not interfere with other operations. 50000+ is usually a good choice.
- Set your router to forward all external connections on the IP address of the machine on which you’re running ZNC, to the port you configured ZNC to use.
- Point your IRC client at the machine on which ZNC is running.
- If you’re connecting to a machine on the same network, use the internal network address (i.e. 192.168.x.x). For example, /server 192.168.x.x 51000
- If you’re connecting to a machine from outside the network, use the external IP address. For example, /server x.x.x.x 51000
- Authenticate your username and password (ZNC will prompt you).
- Ta-da!
From here, you can configure the individual modules to your liking. I’ve still got a bit of learning and tweaking to do, but so far I’m really happy with it. Many thanks to psychon for providing the altered Makefiles.