In my case JDK is already installed, so the dependencies I needed where
sudo apt-get install python python-twisted python-twisted-bin \Download the source somewhere
python-twisted-core python-twisted-runner python-twisted-names \
python-twisted-mail python-twisted-words python-twisted-web \
python-zope.interface python-openss mercurial
hg clone http://hg.qwebirc.org/qwebirc qwebircI decided to switch to their stable branch
hg up -C stableOk, in my case, I needed to apply two patches for SSL and server authentication. For the authentication I applied the patch from here, direct link to the patch here. For the SSL support I applied the patch from anacart's post in this thread, direct link to the patch here.
To apply the patch cd to the source root and do
patch -p1 < patch.diffOnce your done, put the qwebirc folder somewhere permanent, like /usr/local/qwebirc, or /usr/share/qwebirc, and make a copy of the config file.
cp config.py.example config.pyEdit config.py. Change IRCPORT and SSL port to match the client port of your IRC server.
Set IDENT to a valid user on your LDAP domain. I created an account called "webirc" in ldap-account-manager.
IDENT = "webirc"Set the NETWORK to the IRC network name, specified in the inspircd.conf
NETWORK_NAME = "IRCNet"I wasn't sure what to see the URLs to, but here's how mine is set. Set REALNAME to the server address.
REALNAME = "https://www.domain.com/webirc"Set BASE_URL to the local address, i don't think this is right, needs checking.
BASE_URL = "http://localhost:9090"For the Nginx proxy, set the following.
FORWARDED_FOR_HEADER="x-forwarded-for"Finally compile qwebirc.
FORWARDED_FOR_IPS=["127.0.0.1"]
python compile.pyAnd test it
python run.pyYou should be able to browse to http://localhost:9090/
Lastly, create a file to launch qwebirc as a service. If qwebirc crashes, this script will not restart the process, it needs some tweaking. Edit /etc/init/qwebirc.conf
# qwebirc - qwebirc job file
start on runlevel [2345]stop on runlevel [016]
chdir /usr/local/qwebirc
export fork
exec /usr/local/qwebirc/run.py
If all goes well, it should start on reboot, or by running
sudo service qwebirc startNow to tweak Nginx. I just had to add the following to /etc/nginx/sites-enabled/default
location ^~ /webirc/ {Restart nginx
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://127.0.0.1:9090/;
}
sudo service nginx restartAnd browse to https://www.domain.com/webirc
No comments:
Post a Comment