- Go 54.2%
- Python 45.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| betterident.py | ||
| go.mod | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
znc-betterident
Better ident integration for ZNC
the idea
identfile is slow, identserver is unstable.
identfile requires using a spoof with an existing identd, which isn't granular enough so connections have to go through one at a time
from my experience, identserver has had times where it has outputted for somebody else's network.
so, why not use a daemon for the actual ident stuff, and make a znc module that communicates with it, what could possibly go wro-
okay, i am bad at using znc modpython, this is my first time, though i have fixed most segfault bugs, and i am running this module on znc.swee.codes.
installation
you need:
- ZNC 1.10.x and newer (with modpython included)
- Go (for building the daemon)
put the betterident.py file in your znc modules folder
run go build to build the daemon
after that, move the betterident file to /usr/local/sbin/
create a service file for betterident
OpenRC
#!/sbin/openrc-run
command="/usr/local/sbin/betterident"
command_args="/tmp/betterident.sock"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"
output_log="/var/log/betterident.log"
depend() {
need net
use dns
before znc
}
systemd
[Unit]
Description=ZNC betterident
Wants=network-online.target
After=network-online.target
Before=znc.service
[Service]
ExecStart=/usr/local/sbin/betterident /tmp/betterident.sock
Type=simple
Restart=on-failure
[Install]
WantedBy=multi-user.target
FreeBSD rc
#!/bin/sh
# PROVIDE: betterident
# REQUIRE: NETWORKING
# BEFORE: znc
# KEYWORD: shutdown
. /etc/rc.subr
name="betterident"
rcvar="betterident_enable"
start_precmd="betterident_precmd"
procname="/usr/local/sbin/betterident"
pidfile="/var/run/${name}.pid"
load_rc_config $name
: ${betterident_enable:="NO"}
command="/usr/sbin/daemon"
command_args="-f -l daemon -s info -p ${pidfile} /usr/local/sbin/betterident /tmp/betterident.sock"
betterident_precmd() {
if [ ! -e "${pidfile}" ]; then
install "/dev/null" "${pidfile}"
fi
}
run_rc_command "$1"
in all examples, the socket will be stored in /tmp/betterident.sock
after that, load the ZNC module
/msg *status loadmod betterident /tmp/betterident.sock
and you're set!
Important
this setup is SUPER fragile, so make sure you unload the ZNC module before stopping the daemon.