version=pmwiki-2.2.130 ordered=1 urlencoded=1 agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 author=bejelentkezni charset=UTF-8 csum=back to 6.9 to see real changes ctime=1620263815 host=184.99.100.20 name=Znc.Chroot69 rev=3 targets=Openbsd.Syspatch,Oidentd.Znc,Openbsd.Relayd,Openbsd.Nsd,Openbsd.Buyvm text=You will want to get a ddos-filtered IPv4 and an IPv6 subnet from your internet provider.%0a%0aCreate the user znc:%0a%0a[@%0a$ doas adduser%0a@]%0a%0aNote: If this is the first user you are creating after the initial install process, you will first be asked for global defaults. Do not change any of these.%0a%0a[@%0aName: znc%0aPassword: ****%0aFullname: znc%0aUid: 1001%0aGid: 1001 (znc)%0aGroups: znc %0aLogin Class: default%0aHOME: /home/znc%0aShell: /sbin/nologin%0aOK? (y/n) [y]: y%0a@]%0a%0aI am not sure if this is necessary, but in /etc/login.conf, I add the following:%0a%0a[@%0aznc:\%0a :openfiles-cur=4096:\%0a :openfiles-max=8182:\%0a :openfiles=4096:\%0a :stacksize-cur=48M:\%0a :stacksize-max=48M:\%0a :maxproc-max=infinity:\%0a :maxproc-cur=4096:\%0a :tc=daemon:%0a@]%0a%0a'''WARNING''': Use tabs and not spaces. Spaces will not parse properly.%0a%0aI check to make sure znc is set to the right login class.%0a%0a[@%0a$ doas vipw%0a@]%0a%0aThere should be a line with znc that looks like this (I check to make sure znc has the right login class; the '1001' is the uid, which you may find to be different from this example, but it should not be changed):%0a%0a[@%0aznc:*:1001:1001:znc:0:0:znc:/home/znc:/sbin/nologin%0a@]%0a%0aYou will want to make sure that any login.conf.db database is deleted:%0a%0a[@%0a$ doas rm /etc/login.conf.db%0a@]%0a%0aNow change znc shell to ksh with [@ doas usermod -s /bin/ksh znc@], then continue with the steps below.%0a%0a[@%0a$ doas su -c znc znc%0a$ ulimit -a%0atime(cpu-seconds) unlimited%0afile(blocks) unlimited%0acoredump(blocks) unlimited%0adata(kbytes) 33554432%0astack(kbytes) 32768%0alockedmem(kbytes) 329478%0amemory(kbytes) 985092%0anofiles(descriptors) 4096%0aprocesses 1310%0a@]%0a%0aI then set the default shell to nologin with [@doas usermod -s /sbin/nologin znc@] (note: the '1001' is the uid, which you may find to be different from this example, but it should not be changed.):%0a%0a[@%0a$ doas vipw%0a%0a...%0a%0aznc:*:1001:1001:znc:0:0:znc:/home/znc:/sbin/nologin%0a@]%0a%0aInstall needed dependencies:%0a%0a[@%0a$ doas pkg_add icu4c-68.2v0%0a$ doas pkg_add boost-1.72.0%0a$ doas pkg_add cmake-3.19.4p0v0%0a@]%0a%0aThe below install scripts are tested for OpenBSD 6.9 [[openbsd/syspatch|stable]] and our patched znc-1.8.2. It will put znc inside the chroot at /home/znc. Before you begin the installation, check that you are using OpenBSD 6.9 and that your system is patched:%0a%0a[@%0a$ uname -a%0aOpenBSD example.ircnow.org 6.9 GENERIC#464 amd64%0a$ doas syspatch%0a@]%0a%0a[@%0a$ cd ~%0a$ curl -L -O https://ircnow.org/software/znc-1.8.2a.tar.gz%0a$ tar xvzf znc-1.8.2a.tar.gz%0a$ cd znc-1.8.2%0a$ mkdir build%0a$ cd build%0a$ cmake ..%0a$ make%0a$ doas make install%0a@]%0a%0a'''NOTE''': A patched version of znc-1.8.2 release is used to prevent a threading bug. Please do '''not''' use the standard znc 1.8.2 release.%0a%0aThen run as root:%0a%0a[@%0amkdir -p /home/znc/usr/lib/%0amkdir -p /home/znc/usr/local/lib/pkgconfig%0amkdir -p /home/znc/usr/local/bin/%0amkdir -p /home/znc/usr/local/share/%0amkdir -p /home/znc/usr/local/man/man1/%0amkdir -p /home/znc/usr/libexec/%0amkdir -p /home/znc/etc/ssl%0amkdir -p /home/znc/dev/%0amkdir -p /home/znc/var/run/%0amkdir -p /home/znc/home/znc/.znc%0amknod -m 644 /home/znc/dev/random c 45 0%0amknod -m 644 /home/znc/dev/urandom c 45 2%0amknod -m 666 /home/znc/dev/null c 2 2%0acp /usr/lib/libc++.so.7.0 /home/znc/usr/lib/libc++.so.7.0%0acp /usr/lib/libc++abi.so.5.0 /home/znc/usr/lib/libc++abi.so.5.0%0acp /usr/lib/libc.so.96.0 /home/znc/usr/lib/libc.so.96.0%0acp /usr/lib/libcrypto.so.46.2 /home/znc/usr/lib/libcrypto.so.46.2%0acp /usr/lib/libm.so.10.1 /home/znc/usr/lib/libm.so.10.1%0acp /usr/lib/libpthread.so.26.1 /home/znc/usr/lib/libpthread.so.26.1%0acp /usr/lib/libssl.so.48.2 /home/znc/usr/lib/libssl.so.48.2%0acp /usr/lib/libz.so.5.0 /home/znc/usr/lib/libz.so.5.0%0acp /usr/libexec/ld.so /home/znc/usr/libexec/ld.so%0acp /etc/resolv.conf /home/znc/etc/resolv.conf%0acp /etc/ssl/cert.pem /home/znc/etc/ssl/cert.pem%0acp /var/run/ld.so.hints /home/znc/var/run/ld.so.hints%0acp /usr/local/bin/znc /home/znc/usr/local/bin/znc%0acp /usr/local/man/man1/znc.1 /home/znc/usr/local/man/man1/znc.1%0acp /usr/local/man/man1/znc-buildmod.1 /home/znc/usr/local/man/man1/znc-buildmod.1%0acp /usr/local/bin/znc-buildmod /home/znc/usr/local/bin/znc-buildmod%0acp /usr/local/lib/pkgconfig/znc.pc /home/znc/usr/local/lib/pkgconfig/znc.pc%0acp /usr/local/lib/libicuuc.so.19.2 /home/znc/usr/local/lib/%0acp /usr/local/lib/libicudata.so.19.2 /home/znc/usr/local/lib/%0acp /usr/local/lib/libboost_locale-mt.so.13.0 /home/znc/usr/local/lib/%0acp /usr/local/lib/libboost_chrono-mt.so.13.0 /home/znc/usr/local/lib/%0acp /usr/local/lib/libboost_system-mt.so.13.0 /home/znc/usr/local/lib/%0acp /usr/local/lib/libboost_thread-mt.so.13.0 /home/znc/usr/local/lib/%0acp /usr/local/lib/libicui18n.so.19.2 /home/znc/usr/local/lib/%0acp -R /usr/local/share/znc /home/znc/usr/local/share/%0acp -R /usr/local/lib/znc /home/znc/usr/local/lib/%0acp -R /usr/local/include/znc /home/znc/usr/local/include/%0achown -R znc:znc /home/znc/%0achown -R root:wheel /home/znc/dev /home/znc/etc /home/znc/usr /home/znc/var%0achmod -R o-rx /home/znc/home/znc/.znc/%0ausermod -G znc botnow%0ausermod -G znc _identd%0a@]%0a%0aAt first, you will need to create a conf file:%0a%0a[@%0a# export HOME=/home/znc/%0a# chroot -u znc -g znc /home/znc znc --makeconf%0a@]%0a%0a[@%0a[ .. ] Checking for list of available modules...%0a[ ** ] %0a[ ** ] -- Global settings --%0a[ ** ] %0a[ ?? ] Listen on port (1025 to 65534): 31337%0a[ ?? ] Listen using SSL (yes/no) [no]: yes%0a[ ?? ] Listen using both IPv4 and IPv6 (yes/no) [yes]: no%0a[ .. ] Verifying the listener...%0a[ ** ] Unable to locate pem file: [/home/znc/.znc/znc.pem], creating it%0a[ .. ] Writing Pem file [/home/znc/.znc/znc.pem]...%0a[ ** ] Enabled global modules [webadmin]%0a[ ** ] %0a[ ** ] -- Admin user settings --%0a[ ** ] %0a[ ?? ] Username (alphanumeric): %0a@]%0a%0a[@%0a# cp /etc/ssl/my.example.com.fullchain.pem /home/znc/home/znc/.znc/%0a# cp /etc/ssl/private/my.example.com.key /home/znc/home/znc/.znc/%0a# chown znc:znc /home/znc/home/znc/.znc/my.example.com.*%0a@]%0a%0aInside ~:%0a%0a[@%0a$ openssl dhparam -out dhparam.pem 2048%0a$ doas chown znc:znc dhparam.pem%0a$ doas mv dhparam.pem /home/znc/home/znc/.znc/%0a@]%0a%0aAfterwards, to run znc:%0a%0a[@%0a# export HOME=/home/znc%0a# /usr/sbin/chroot -u znc -g znc /home/znc znc >>/var/log/znc.log 2>&1 &%0a@]%0a%0aNow you must add this rule in /etc/pf.conf:%0a%0a[@%0apass in log quick proto tcp to port {80 443} keep state (max-src-conn 30, max-src-conn-rate 20/60) #relayd web%0apass in log quick proto tcp to port {1337 31337} keep state (max 3000, max-src-conn 200) #bnc%0a@]%0a%0a[@%0a$ doas pfctl -f /etc/pf.conf%0a@]%0a%0a(Here the steps are a bit out of chronology)%0a%0aTo start the bouncer, I run this command:%0a%0a[@%0a# HOME=/home/znc && /usr/sbin/chroot -u znc -g znc /home/znc znc >>/var/log/znc.log 2>&1 &%0a@]%0a%0aIf your bouncer is already online, make sure to save the config by logging into your irc client, connected to the bouncer:%0a%0a[@%0a/msg *status saveconfig%0a@]%0a%0aThen, go add this at the top of /home/znc/home/znc/.znc/configs/znc.conf (yes I deliberately ignore the warnings):%0a%0a[@%0aAnonIPLimit = 10000%0aAuthOnlyViaModule = false%0aConfigWriteDelay = 60%0aConnectDelay = 1%0aHideVersion = false%0aLoadModule = chansaver%0aLoadModule = lastseen%0aLoadModule = adminlog%0aLoadModule = identfile%0aLoadModule = webadmin%0aLoadModule = certauth%0aMaxBufferSize = 10000%0aProtectWebSessions = true%0aSSLCertFile = /home/znc/.znc/my.example.com.fullchain.pem%0aSSLDHParamFile = /home/znc/.znc/dhparam.pem%0aSSLKeyFile = /home/znc/.znc/my.example.com.key%0aPidFile = /home/znc/.znc/znc.pid%0aServerThrottle = 1%0aVersion = 1.8.2%0a%0a%3cListener listener0>%0a AllowIRC = true%0a AllowWeb = false%0a Host = 192.168.1.1%0a IPv4 = true%0a IPv6 = false%0a Port = 1337%0a SSL = false%0a URIPrefix = /%0a%3c/Listener>%0a%0a%3cListener listener1>%0a AllowIRC = true%0a AllowWeb = false%0a Host = 192.168.1.1%0a IPv4 = true%0a IPv6 = false%0a Port = 31337%0a SSL = true%0a URIPrefix = /%0a%3c/Listener>%0a%0a%3cListener listener2>%0a AllowIRC = true%0a AllowWeb = false%0a Host = 2001:db8::%0a IPv4 = false%0a IPv6 = true%0a Port = 1337%0a SSL = false%0a URIPrefix = /%0a%3c/Listener>%0a%0a%3cListener listener3>%0a AllowIRC = true%0a AllowWeb = false%0a Host = 2001:db8::%0a IPv4 = false%0a IPv6 = true%0a Port = 31337%0a SSL = true%0a URIPrefix = /%0a%3c/Listener>%0a%0a%3cListener listener4>%0a AllowIRC = true%0a AllowWeb = false%0a Host = 127.0.0.1%0a IPv4 = true%0a IPv6 = false%0a Port = 1337%0a SSL = false%0a URIPrefix = /%0a%3c/Listener>%0a%0a%3cListener listener5>%0a AllowIRC = false%0a AllowWeb = true%0a Host = 127.0.0.1%0a IPv4 = true%0a IPv6 = false%0a Port = 1338%0a SSL = false%0a URIPrefix = /%0a%3c/Listener>%0a@]%0a%0aWe will load the identfile module by default. This is necessary to provide proper ident using [[oidentd/znc|oidentd]]. Please follow the instructions in the link to configure ident.%0a%0aI have znc bind to port 1338 without SSL for the web server. I will later use [[openbsd/relayd|relayd]] to provide TLS acceleration on port 443.%0a%0aReplace with your own IP addresses. Then, on your irc client logged into the bouncer:%0a%0a[@%0a/msg *status rehash%0a@]%0a%0a[@%0a$ doas crontab -e%0a@]%0a%0aAdd a few lines to have ZNC reconnect every 5 minutes. ZNC will only connect if no other ZNC instance is running:%0a%0a[@%0aHOME=/home/znc%0a*/5 * * * * /usr/sbin/chroot -u znc -g znc /home/znc znc >>/var/log/znc.log 2>&1 &%0a@]%0a%0aTo test the connection (and SSL certificate), run:%0a%0a[@%0a$ openssl s_client -connect my.example.com:31337%0a@]%0a%0aMake sure you have the proper SSL cert configured.%0a%0aWhile you are at it, you will want to redirect any plaintext requests to the webpanel on port 80 to use SSL on port 443. Add this to /etc/httpd.conf:%0a%0a[@%0aserver "bnc.example.com" {%0a listen on * port 80%0a location "/.well-known/acme-challenge/*" {%0a root "/acme"%0a request strip 2%0a }%0a location * {%0a block return 302 "https://$HTTP_HOST$REQUEST_URI"%0a }%0a}%0a@]%0a%0aGo ahead and reboot the web server:%0a%0a[@%0a$ doas rcctl restart httpd%0a@]%0a%0aNote: If you are using IPv6 and IPv4 for the same listener, perl IO::Socket::INET is unable to connect. Use two separate listeners.%0a%0a'''Integration with the operating system'''%0a%0a[@%0adoas touch /etc/rc.d/znc%0adoas chmod +x /etc/rc.d/znc%0a@]%0a%0a [= %0a#!/bin/ksh%0a#%0a# $OpenBSD: znc,v 1.2 2020/01/21 19:27:07 rpe Exp $%0a%0adaemon_pidfile="/home/znc/home/znc/.znc/znc.pid"%0adaemon="env HOME=/home/znc /usr/sbin/chroot -u znc -g znc /home/znc znc"%0a%0a%0aservice_stop() {%0a if [ -f $daemon_pidfile ]; then%0a pid=$(sed 's/[^0-9]*//g' $daemon_pidfile)%0a kill $pid%0a fi%0a}%0a%0acase "$1" in%0a stop)%0a service_stop%0a ;;%0aesac%0a%0a%0a. /etc/rc.d/rc.subr%0a%0arc_reload=NO%0a%0arc_cmd $1%0a%0a%0a =]%0a%0a'''Automatic start'''%0a%0aAutomatic start of the service in case of a crash. %0a%0aThis prevents the loss of users due to software errors. Make sure your users feel good.%0a [=%0adoas mkdir /usr/local/project_name/%0adoas touch /usr/local/project_name/checker_znc.sh%0adoas chmod +x /usr/local/project_name/checker_znc.sh%0a =]%0a%0a [=%0a#!/bin/sh%0a%0aSERVICE_NAME="znc"%0aSERVICE_USER="znc"%0aSERVICE_PID="/home/znc/home/znc/.znc/znc.pid"%0a%0aif ! pgrep -u $SERVICE_USER -x "$SERVICE_NAME" > /dev/null%0athen%0a if [ -f $SERVICE_PID ]; then%0a rm -f $SERVICE_PID%0a rcctl -d restart $SERVICE_NAME%0a fi%0afi%0a%0a =]%0aThis may have issues in the 6.9 release.%0a [=%0a doas crontab -e%0a =]%0a%0a [=%0a*/2 * * * * /usr/local/project_name/checker_znc.sh 2>&1 &%0a =]%0a%0a(:if false:)%0a'''ZNC console'''%0a%0aConnect%0a [=%0a/quote PASS admin:mysuperadminpassqwerty%0a =]%0a%0aGenerate new pass for user%0a [=%0aGo to site: https://passwordsgenerator.net/%0aand disable "Include Symbols"%0aclick "generate password"%0aor you can create a password yourself (the password must be between 12 and 16 characters long and include numbers and letters)%0a =]%0a(:ifend:)%0a%0aUser login%0a [=%0ausername must be the same or derived from the network login (contain a suffix)%0a =]%0a%0aCreate new user%0a [=%0a/msg *controlpanel AddUser bob 12345678%0a/msg *controlpanel LoadModule bob perform%0a =]%0a%0aAdd network for new ner%0a [=%0a/msg *controlpanel AddNetwork bob IRCNow%0a/msg *controlpanel AddServer vasya IRCNow irc.ircnow.org +6697%0a/msg *controlpanel SetNetwork BindHost bob IRCNow 2605:6400:20:bb8:dae2:32a2%0a/msg *controlpanel help%0a =]%0a%0aSet channels%0a [=%0a/msg *controlpanel AddChan bob IRCNow #ircnow%0a =]%0a%0aSet pass (this must be done with a user account or offer to run this command yourself) %0a [=%0a/msg *perform add PRIVMSG NickServ IDENTIFY bob 12345678%0a/msg *perform help%0a =]%0a%0aReconnect user`s network%0a [=%0a/msg *controlpanel Reconnect bob IRCNow%0a =]%0a%0aSaving settings to disk (please save your changes to disk immediately)%0a [=%0a/msg *status SaveConfig%0a =]%0a%0aDeleting user and user entities%0a [=%0a/msg *controlpanel DelUser bob%0a/msg *controlpanel DelNetwork bob IRCNow%0a =]%0a%0a!! Custom vhosts%0a%0a'''WARNING''': do '''not''' set individual IPv6 addresses for a user's bindhost. Do not set a user's bindhost to be something like 2605:6400:10::. If you specify an IPv6 address for the bindhost, that user can *only* connect to networks that support IPv6. IPv4-only networks completely fail.%0a%0aIt is better to set the bindhost to be username.fruit.ircnow.org. Then, for the [[openbsd/nsd|nameserver]], create an AAAA record and an A record. That way, the bindhost will use IPv6 if the network is IPv6-only, and IPv4 if it is an IPv4-only network. This solution is more flexible and allows your user to fall back to IPv4 when IPv6 is not supported.%0a%0aIf a user requests to change their vhost, do not edit the bindhost -- all you need to do is update the rDNS record (see the [[openbsd/buyvm|buyvm web panel]]. Don't delete the bindhost or the DNS A/AAAA records.%0a%0aFor example, suppose the vhost was formerly user.fruit.ircnow.org. If the user wants to change it to example.com, you just need to update the rDNS to example.com, but leave the znc bindhost as username.fruit.ircnow.org and keep the A/AAAA records for username.fruit.ircnow.org.%0a%0aOnce example.com's AAAA record is working, and the rDNS has been configured properly, you can reconnect the user (either the user types @@/znc connect@@ or you type @@/msg *controlpanel reconnect %3cusername> %3cnetwork>@@), and the vhost will update properly.%0a%0aKeeping the old A/AAAA record and bindhost working will make it easier if the user changes vhosts or if their 3rd party dns server for example.com fails for whatever reason. This method will allow the user to still connect. Otherwise, if the 3rd party dns server fails for example.com (which frequently happens with cheap, free dns services), users will be unable to connect and blame you. %0a%0a!! Troubleshooting%0a%0aIf your user is getting disconnected, these are the most likely causes:%0a%0a# mismatch of ports or SSL (using plaintext on 6697 or SSL on 6667)%0a# SSL is not supported%0a# user has a server password where none belongs (most likely he confused server password with nickserv password)%0a# ident is not working%0a# ircd bans a certain username or ident for no good reason (the ircd mistakenly assumes your connection is a bot and glines it)%0a# typo of server name or IP address%0a# dns lookup error%0a%0aYou may be need to install icu4c-68.2v0.%0a%0a!! WARNING%0a%0aIf a znc user has a bindhost that is IPv6 only but the network is IPv4 only, it will not connect.%0a%0aTo prevent this, you '''must be absolutely 100%25 certain''' that each bindhost is symbolic (such as username.fruit.ircnow.org) and that each hostname has a single A record and a single AAAA record in your DNS zone. If any part is misconfigured, users will be unable to connect.%0a%0aA quick way to check if there are DNS errors:%0a%0a[@%0a$ doas grep -i host /home/znc/home/znc/.znc/configs/znc.conf | grep -v > ~/bindhost%0a$ vi ~/bindhost%0a@]%0a%0aThen with vi:%0a%0a[@%0a:%25s_.* = _host _g%0a@]%0a%0aThen:%0a%0a[@%0a$ sh ~/bindhost%0a@]%0a%0aIf you see any records there with only a single IPv4 address but no IPv6, or a single IPv6 but no IPv4, or any NXDOMAIN responses, you need to fix your DNS records. There should be exactly one shared IPv4 and one unique IPv6 for each hostname, and zero NXDOMAIN responses.%0a%0a!!! Missing libraries%0a%0aIf you are getting errors such as:%0a%0a[@%0ald.so: znc: can't load library 'libc++abi.so.5.0' %0a@]%0a%0aThen it could be due to the fact that you are on the wrong OpenBSD version (6.8 or earlier), you did not apply [[openbsd/syspatch|syspatch]], and you have not upgraded all dependencies:%0a%0a[@%0a$ doas syspatch%0a$ doas pkg_add -Uu%0a@]%0a%0aThen, delete the build folder and compile again.%0a%0a!! Adding ICU support%0a%0aCopy the following directories:%0a%0a[@%0a# cp -R /usr/local/share/icu /home/znc/usr/local/share/%0a# cp -R /usr/local/lib/icu /home/znc/usr/local/lib/%0a@]%0a%0aThen, restart BNC. Encoding options should be available.%0a%0a(The patched ZNC was made before ICU support is added. So, we cannot ensure that adding ICU support after the patch will not cause any other bugs.)%0a%0a!! Running znc in debug mode%0a%0a[@%0a$ cd ~%0a$ curl -L -O https://znc.in/releases/znc-1.8.2.tar.gz%0a$ tar xvzf znc-1.8.2.tar.gz%0a$ cd znc-1.8.2%0a$ mkdir build%0a$ cd build%0a$ ../configure --enable-debug CXX=c++%0a$ gmake%0a$ doas make install%0a@]%0a%0a[@%0amkdir -p /home/znc/usr/lib/%0amkdir -p /home/znc/usr/local/lib/pkgconfig%0amkdir -p /home/znc/usr/local/bin/%0amkdir -p /home/znc/usr/local/share/%0amkdir -p /home/znc/usr/local/man/man1/%0amkdir -p /home/znc/usr/libexec/%0amkdir -p /home/znc/etc/ssl%0amkdir -p /home/znc/dev/%0amkdir -p /home/znc/var/run/%0amkdir -p /home/znc/home/znc/%0amknod -m 644 /home/znc/dev/random c 45 0%0amknod -m 644 /home/znc/dev/urandom c 45 2%0amknod -m 666 /home/znc/dev/null c 2 2%0acp /usr/lib/libc++.so.7.0 /home/znc/usr/lib/libc++.so.7.0 %0acp /usr/lib/libc++abi.so.5.0 /home/znc/usr/lib/libc++abi.so.5.0%0acp /usr/lib/libc.so.96.0 /home/znc/usr/lib/libc.so.96.0%0acp /usr/lib/libcrypto.so.46.2 /home/znc/usr/lib/libcrypto.so.46.2%0acp /usr/lib/libm.so.10.1 /home/znc/usr/lib/libm.so.10.1%0acp /usr/lib/libpthread.so.26.1 /home/znc/usr/lib/libpthread.so.26.1%0acp /usr/lib/libssl.so.48.2 /home/znc/usr/lib/libssl.so.48.2%0acp /usr/lib/libz.so.5.0 /home/znc/usr/lib/libz.so.5.0%0acp /usr/libexec/ld.so /home/znc/usr/libexec/ld.so%0acp /etc/resolv.conf /home/znc/etc/resolv.conf%0acp /etc/ssl/cert.pem /home/znc/etc/ssl/cert.pem%0acp /var/run/ld.so.hints /home/znc/var/run/ld.so.hints%0acp /usr/local/bin/znc /home/znc/usr/local/bin/znc%0acp /usr/local/man/man1/znc.1 /home/znc/usr/local/man/man1/znc.1%0acp /usr/local/man/man1/znc-buildmod.1 /home/znc/usr/local/man/man1/znc-buildmod.1%0acp /usr/local/bin/znc-buildmod /home/znc/usr/local/bin/znc-buildmod%0acp /usr/local/lib/pkgconfig/znc.pc /home/znc/usr/local/lib/pkgconfig/znc.pc%0acp /usr/local/lib/libicuuc.so.19.2 /home/znc/usr/local/lib/%0acp /usr/local/lib/libicudata.so.19.2 /home/znc/usr/local/lib/%0acp /usr/local/lib/libboost_locale-mt.so.13.0 /home/znc/usr/local/lib/%0acp /usr/local/lib/libboost_system-mt.so.13.0 /home/znc/usr/local/lib/%0acp /usr/local/lib/libboost_thread-mt.so.13.0 /home/znc/usr/local/lib/%0acp /usr/local/lib/libboost_chrono-mt.so.13.0 /home/znc/usr/local/lib/%0acp /usr/local/lib/libicui18n.so.19.2 /home/znc/usr/local/lib/%0acp -R /usr/local/share/znc /home/znc/usr/local/share/%0acp -R /usr/local/lib/znc /home/znc/usr/local/lib/%0acp -R /usr/local/include/znc /home/znc/usr/local/include/%0achown -R znc:znc /home/znc/%0achown -R root:wheel /home/znc/dev /home/znc/etc /home/znc/usr /home/znc/var%0achmod -R o-rx /home/znc/home/znc/.znc/%0ausermod -G znc botnow%0ausermod -G znc _identd%0a@]%0a%0a$ doas gdb chroot time=1620272213 author:1620272213=bejelentkezni csum:1620272213=back to 6.9 to see real changes diff:1620272213:1620272185:=9,10d8%0a%3c Note: If this is the first user you are creating after the initial install process, you will first be asked for global defaults. Do not change any of these.%0a%3c %0a58,59c56,57%0a%3c Now change znc shell to ksh with [@ doas usermod -s /bin/ksh znc@], then continue with the steps below.%0a%3c %0a---%0a> Now change znc shell to /bin/ksh , then continue with the steps below.%0a> %0a74,75c72,73%0a%3c I then set the default shell to nologin with [@doas usermod -s /sbin/nologin znc@] (note: the '1001' is the uid, which you may find to be different from this example, but it should not be changed.):%0a%3c %0a---%0a> I then set the default shell to /sbin/nologin (note: the '1001' is the uid, which you may find to be different from this example, but it should not be changed.):%0a> %0a87,89c85,87%0a%3c $ doas pkg_add icu4c-68.2v0%0a%3c $ doas pkg_add boost-1.72.0%0a%3c $ doas pkg_add cmake-3.19.4p0v0%0a---%0a> $ doas pkg_add icu4c-67.1%0a> $ doas pkg_add boost-1.67.0p0%0a> $ doas pkg_add cmake%0a92,93c90,91%0a%3c The below install scripts are tested for OpenBSD 6.9 [[openbsd/syspatch|stable]] and our patched znc-1.8.2. It will put znc inside the chroot at /home/znc. Before you begin the installation, check that you are using OpenBSD 6.9 and that your system is patched:%0a%3c %0a---%0a> The below install scripts are tested for OpenBSD 6.8 [[openbsd/syspatch|stable]] and znc-1.8.2. It will put znc inside the chroot at /home/znc. Before you begin the installation, check that you are using OpenBSD 6.8 and that your system is patched:%0a> %0a96c94%0a%3c OpenBSD example.ircnow.org 6.9 GENERIC#464 amd64%0a---%0a> OpenBSD example.ircnow.org 6.8 GENERIC#97 amd64%0a130,131c128,129%0a%3c cp /usr/lib/libc++.so.7.0 /home/znc/usr/lib/libc++.so.7.0%0a%3c cp /usr/lib/libc++abi.so.5.0 /home/znc/usr/lib/libc++abi.so.5.0%0a---%0a> cp /usr/lib/libc++.so.5.0 /home/znc/usr/lib/libc++.so.5.0%0a> cp /usr/lib/libc++abi.so.3.0 /home/znc/usr/lib/libc++abi.so.3.0%0a133c131%0a%3c cp /usr/lib/libcrypto.so.46.2 /home/znc/usr/lib/libcrypto.so.46.2%0a---%0a> cp /usr/lib/libcrypto.so.46.1 /home/znc/usr/lib/libcrypto.so.46.1%0a136c134%0a%3c cp /usr/lib/libssl.so.48.2 /home/znc/usr/lib/libssl.so.48.2%0a---%0a> cp /usr/lib/libssl.so.48.1 /home/znc/usr/lib/libssl.so.48.1%0a147,153c145,151%0a%3c cp /usr/local/lib/libicuuc.so.19.2 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicudata.so.19.2 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_locale-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_chrono-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_system-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_thread-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicui18n.so.19.2 /home/znc/usr/local/lib/%0a---%0a> cp /usr/local/lib/libicuuc.so.18.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libicudata.so.18.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_locale-mt.so.11.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_chrono-mt.so.11.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_system-mt.so.11.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_thread-mt.so.11.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libicui18n.so.18.0 /home/znc/usr/local/lib/%0a213,214c211,212%0a%3c pass in log quick proto tcp to port {80 443} keep state (max-src-conn 30, max-src-conn-rate 20/60) #relayd web%0a%3c pass in log quick proto tcp to port {1337 31337} keep state (max 3000, max-src-conn 200) #bnc%0a---%0a> pass in log quick proto tcp to port {http https} keep state (max-src-conn 30, max-src-conn-rate 20/60)%0a> pass in log quick proto tcp to port { 1337 31337 } keep state (max 3000, max-src-conn 200) #bnc%0a443c441%0a%3c This may have issues in the 6.9 release.%0a---%0a> %0a484c482%0a%3c /msg *controlpanel SetNetwork BindHost bob IRCNow 2605:6400:20:bb8:dae2:32a2%0a---%0a> /msg *controlpanel SetNetwork BindHost bob IRCNow 2703:6401:30:faa1:6184:399c:dae2:32a2%0a541,542c539,540%0a%3c You may be need to install icu4c-68.2v0.%0a%3c %0a---%0a> You may be need to install icu4c-67.1 .%0a> %0a552c550%0a%3c $ doas grep -i host /home/znc/home/znc/.znc/configs/znc.conf | grep -v > ~/bindhost%0a---%0a> $ doas grep Host /home/znc/home/znc/.znc/configs/znc.conf | grep -v > ~/bindhost%0a575c573%0a%3c ld.so: znc: can't load library 'libc++abi.so.5.0' %0a---%0a> ld.so: znc: can't load library 'libc++abi.so.2.1' %0a578,579c576,577%0a%3c Then it could be due to the fact that you are on the wrong OpenBSD version (6.8 or earlier), you did not apply [[openbsd/syspatch|syspatch]], and you have not upgraded all dependencies:%0a%3c %0a---%0a> Then it could be due to the fact that you are on the wrong OpenBSD version (6.7 or earlier), you did not apply [[openbsd/syspatch|syspatch]], and you have not upgraded all dependencies:%0a> %0a582c580%0a%3c $ doas pkg_add -Uu%0a---%0a> $ doas pkg_add -u%0a600,601c598,601%0a%3c !! Running znc in debug mode%0a%3c %0a---%0a> !! Obsolete Setups%0a> %0a> The old install script (tested for OpenBSD 6.7 and znc-1.7.5) is now '''obsoleted''':%0a> %0a603,614d602%0a%3c $ cd ~%0a%3c $ curl -L -O https://znc.in/releases/znc-1.8.2.tar.gz%0a%3c $ tar xvzf znc-1.8.2.tar.gz%0a%3c $ cd znc-1.8.2%0a%3c $ mkdir build%0a%3c $ cd build%0a%3c $ ../configure --enable-debug CXX=c++%0a%3c $ gmake%0a%3c $ doas make install%0a%3c @]%0a%3c %0a%3c [@%0a616,619d603%0a%3c mkdir -p /home/znc/usr/local/lib/pkgconfig%0a%3c mkdir -p /home/znc/usr/local/bin/%0a%3c mkdir -p /home/znc/usr/local/share/%0a%3c mkdir -p /home/znc/usr/local/man/man1/%0a628,629c612,613%0a%3c cp /usr/lib/libc++.so.7.0 /home/znc/usr/lib/libc++.so.7.0 %0a%3c cp /usr/lib/libc++abi.so.5.0 /home/znc/usr/lib/libc++abi.so.5.0%0a---%0a> cp /usr/lib/libc++.so.5.0 /home/znc/usr/lib/libc++.so.5.0%0a> cp /usr/lib/libc++abi.so.3.0 /home/znc/usr/lib/libc++abi.so.3.0%0a631c615%0a%3c cp /usr/lib/libcrypto.so.46.2 /home/znc/usr/lib/libcrypto.so.46.2%0a---%0a> cp /usr/lib/libcrypto.so.46.1 /home/znc/usr/lib/libcrypto.so.46.1%0a634c618%0a%3c cp /usr/lib/libssl.so.48.2 /home/znc/usr/lib/libssl.so.48.2%0a---%0a> cp /usr/lib/libssl.so.48.1 /home/znc/usr/lib/libssl.so.48.1%0a639a624,670%0a> pkg_add -B /home/znc znc%0a> chown -R root:wheel /home/znc/dev /home/znc/etc /home/znc/usr /home/znc/var%0a> chown -R znc:znc /home/znc/%0a> usermod -G znc botnow%0a> usermod -G znc _identd%0a> @]%0a> %0a> !! Running znc in debug mode%0a> %0a> [@%0a> $ cd ~%0a> $ curl -L -O https://znc.in/releases/znc-1.8.2.tar.gz%0a> $ tar xvzf znc-1.8.2.tar.gz%0a> $ cd znc-1.8.2%0a> $ mkdir build%0a> $ cd build%0a> $ ../configure --enable-debug CXX=c++%0a> $ gmake%0a> $ doas make install%0a> @]%0a> %0a> [@%0a> mkdir -p /home/znc/usr/lib/%0a> mkdir -p /home/znc/usr/local/lib/pkgconfig%0a> mkdir -p /home/znc/usr/local/bin/%0a> mkdir -p /home/znc/usr/local/share/%0a> mkdir -p /home/znc/usr/local/man/man1/%0a> mkdir -p /home/znc/usr/libexec/%0a> mkdir -p /home/znc/etc/ssl%0a> mkdir -p /home/znc/dev/%0a> mkdir -p /home/znc/var/run/%0a> mkdir -p /home/znc/home/znc/%0a> mknod -m 644 /home/znc/dev/random c 45 0%0a> mknod -m 644 /home/znc/dev/urandom c 45 2%0a> mknod -m 666 /home/znc/dev/null c 2 2%0a> cp /usr/lib/libc++.so.5.0 /home/znc/usr/lib/libc++.so.5.0 %0a> cp /usr/lib/libc++abi.so.3.0 /home/znc/usr/lib/libc++abi.so.3.0%0a> cp /usr/lib/libc.so.96.0 /home/znc/usr/lib/libc.so.96.0%0a> cp /usr/lib/libcrypto.so.46.1 /home/znc/usr/lib/libcrypto.so.46.1%0a> cp /usr/lib/libm.so.10.1 /home/znc/usr/lib/libm.so.10.1%0a> cp /usr/lib/libpthread.so.26.1 /home/znc/usr/lib/libpthread.so.26.1%0a> cp /usr/lib/libssl.so.48.1 /home/znc/usr/lib/libssl.so.48.1%0a> cp /usr/lib/libz.so.5.0 /home/znc/usr/lib/libz.so.5.0%0a> cp /usr/libexec/ld.so /home/znc/usr/libexec/ld.so%0a> cp /etc/resolv.conf /home/znc/etc/resolv.conf%0a> cp /etc/ssl/cert.pem /home/znc/etc/ssl/cert.pem%0a> cp /var/run/ld.so.hints /home/znc/var/run/ld.so.hints%0a645,651c676,682%0a%3c cp /usr/local/lib/libicuuc.so.19.2 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicudata.so.19.2 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_locale-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_system-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_thread-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_chrono-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicui18n.so.19.2 /home/znc/usr/local/lib/%0a---%0a> cp /usr/local/lib/libicuuc.so.18.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libicudata.so.18.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_locale-mt.so.11.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_system-mt.so.11.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_thread-mt.so.11.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_chrono-mt.so.11.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libicui18n.so.18.0 /home/znc/usr/local/lib/%0a host:1620272213=184.99.100.20 author:1620272185=bejelentkezni csum:1620272185=resetting to 6.8 to see changes on second/third commit diff:1620272185:1620263815:=8a9,10%0a> Note: If this is the first user you are creating after the initial install process, you will first be asked for global defaults. Do not change any of these.%0a> %0a56,57c58,59%0a%3c Now change znc shell to /bin/ksh , then continue with the steps below.%0a%3c %0a---%0a> Now change znc shell to ksh with [@ doas usermod -s /bin/ksh znc@], then continue with the steps below.%0a> %0a72,73c74,75%0a%3c I then set the default shell to /sbin/nologin (note: the '1001' is the uid, which you may find to be different from this example, but it should not be changed.):%0a%3c %0a---%0a> I then set the default shell to nologin with [@doas usermod -s /sbin/nologin znc@] (note: the '1001' is the uid, which you may find to be different from this example, but it should not be changed.):%0a> %0a85,87c87,89%0a%3c $ doas pkg_add icu4c-67.1%0a%3c $ doas pkg_add boost-1.67.0p0%0a%3c $ doas pkg_add cmake%0a---%0a> $ doas pkg_add icu4c-68.2v0%0a> $ doas pkg_add boost-1.72.0%0a> $ doas pkg_add cmake-3.19.4p0v0%0a90,91c92,93%0a%3c The below install scripts are tested for OpenBSD 6.8 [[openbsd/syspatch|stable]] and znc-1.8.2. It will put znc inside the chroot at /home/znc. Before you begin the installation, check that you are using OpenBSD 6.8 and that your system is patched:%0a%3c %0a---%0a> The below install scripts are tested for OpenBSD 6.9 [[openbsd/syspatch|stable]] and our patched znc-1.8.2. It will put znc inside the chroot at /home/znc. Before you begin the installation, check that you are using OpenBSD 6.9 and that your system is patched:%0a> %0a94c96%0a%3c OpenBSD example.ircnow.org 6.8 GENERIC#97 amd64%0a---%0a> OpenBSD example.ircnow.org 6.9 GENERIC#464 amd64%0a128,129c130,131%0a%3c cp /usr/lib/libc++.so.5.0 /home/znc/usr/lib/libc++.so.5.0%0a%3c cp /usr/lib/libc++abi.so.3.0 /home/znc/usr/lib/libc++abi.so.3.0%0a---%0a> cp /usr/lib/libc++.so.7.0 /home/znc/usr/lib/libc++.so.7.0%0a> cp /usr/lib/libc++abi.so.5.0 /home/znc/usr/lib/libc++abi.so.5.0%0a131c133%0a%3c cp /usr/lib/libcrypto.so.46.1 /home/znc/usr/lib/libcrypto.so.46.1%0a---%0a> cp /usr/lib/libcrypto.so.46.2 /home/znc/usr/lib/libcrypto.so.46.2%0a134c136%0a%3c cp /usr/lib/libssl.so.48.1 /home/znc/usr/lib/libssl.so.48.1%0a---%0a> cp /usr/lib/libssl.so.48.2 /home/znc/usr/lib/libssl.so.48.2%0a145,151c147,153%0a%3c cp /usr/local/lib/libicuuc.so.18.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicudata.so.18.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_locale-mt.so.11.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_chrono-mt.so.11.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_system-mt.so.11.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_thread-mt.so.11.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicui18n.so.18.0 /home/znc/usr/local/lib/%0a---%0a> cp /usr/local/lib/libicuuc.so.19.2 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libicudata.so.19.2 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_locale-mt.so.13.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_chrono-mt.so.13.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_system-mt.so.13.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_thread-mt.so.13.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libicui18n.so.19.2 /home/znc/usr/local/lib/%0a211,212c213,214%0a%3c pass in log quick proto tcp to port {http https} keep state (max-src-conn 30, max-src-conn-rate 20/60)%0a%3c pass in log quick proto tcp to port { 1337 31337 } keep state (max 3000, max-src-conn 200) #bnc%0a---%0a> pass in log quick proto tcp to port {80 443} keep state (max-src-conn 30, max-src-conn-rate 20/60) #relayd web%0a> pass in log quick proto tcp to port {1337 31337} keep state (max 3000, max-src-conn 200) #bnc%0a441c443%0a%3c %0a---%0a> This may have issues in the 6.9 release.%0a482c484%0a%3c /msg *controlpanel SetNetwork BindHost bob IRCNow 2703:6401:30:faa1:6184:399c:dae2:32a2%0a---%0a> /msg *controlpanel SetNetwork BindHost bob IRCNow 2605:6400:20:bb8:dae2:32a2%0a539,540c541,542%0a%3c You may be need to install icu4c-67.1 .%0a%3c %0a---%0a> You may be need to install icu4c-68.2v0.%0a> %0a550c552%0a%3c $ doas grep Host /home/znc/home/znc/.znc/configs/znc.conf | grep -v > ~/bindhost%0a---%0a> $ doas grep -i host /home/znc/home/znc/.znc/configs/znc.conf | grep -v > ~/bindhost%0a573c575%0a%3c ld.so: znc: can't load library 'libc++abi.so.2.1' %0a---%0a> ld.so: znc: can't load library 'libc++abi.so.5.0' %0a576,577c578,579%0a%3c Then it could be due to the fact that you are on the wrong OpenBSD version (6.7 or earlier), you did not apply [[openbsd/syspatch|syspatch]], and you have not upgraded all dependencies:%0a%3c %0a---%0a> Then it could be due to the fact that you are on the wrong OpenBSD version (6.8 or earlier), you did not apply [[openbsd/syspatch|syspatch]], and you have not upgraded all dependencies:%0a> %0a580c582%0a%3c $ doas pkg_add -u%0a---%0a> $ doas pkg_add -Uu%0a598,601c600,601%0a%3c !! Obsolete Setups%0a%3c %0a%3c The old install script (tested for OpenBSD 6.7 and znc-1.7.5) is now '''obsoleted''':%0a%3c %0a---%0a> !! Running znc in debug mode%0a> %0a602a603,614%0a> $ cd ~%0a> $ curl -L -O https://znc.in/releases/znc-1.8.2.tar.gz%0a> $ tar xvzf znc-1.8.2.tar.gz%0a> $ cd znc-1.8.2%0a> $ mkdir build%0a> $ cd build%0a> $ ../configure --enable-debug CXX=c++%0a> $ gmake%0a> $ doas make install%0a> @]%0a> %0a> [@%0a603a616,619%0a> mkdir -p /home/znc/usr/local/lib/pkgconfig%0a> mkdir -p /home/znc/usr/local/bin/%0a> mkdir -p /home/znc/usr/local/share/%0a> mkdir -p /home/znc/usr/local/man/man1/%0a612,613c628,629%0a%3c cp /usr/lib/libc++.so.5.0 /home/znc/usr/lib/libc++.so.5.0%0a%3c cp /usr/lib/libc++abi.so.3.0 /home/znc/usr/lib/libc++abi.so.3.0%0a---%0a> cp /usr/lib/libc++.so.7.0 /home/znc/usr/lib/libc++.so.7.0 %0a> cp /usr/lib/libc++abi.so.5.0 /home/znc/usr/lib/libc++abi.so.5.0%0a615c631%0a%3c cp /usr/lib/libcrypto.so.46.1 /home/znc/usr/lib/libcrypto.so.46.1%0a---%0a> cp /usr/lib/libcrypto.so.46.2 /home/znc/usr/lib/libcrypto.so.46.2%0a618c634%0a%3c cp /usr/lib/libssl.so.48.1 /home/znc/usr/lib/libssl.so.48.1%0a---%0a> cp /usr/lib/libssl.so.48.2 /home/znc/usr/lib/libssl.so.48.2%0a624,670d639%0a%3c pkg_add -B /home/znc znc%0a%3c chown -R root:wheel /home/znc/dev /home/znc/etc /home/znc/usr /home/znc/var%0a%3c chown -R znc:znc /home/znc/%0a%3c usermod -G znc botnow%0a%3c usermod -G znc _identd%0a%3c @]%0a%3c %0a%3c !! Running znc in debug mode%0a%3c %0a%3c [@%0a%3c $ cd ~%0a%3c $ curl -L -O https://znc.in/releases/znc-1.8.2.tar.gz%0a%3c $ tar xvzf znc-1.8.2.tar.gz%0a%3c $ cd znc-1.8.2%0a%3c $ mkdir build%0a%3c $ cd build%0a%3c $ ../configure --enable-debug CXX=c++%0a%3c $ gmake%0a%3c $ doas make install%0a%3c @]%0a%3c %0a%3c [@%0a%3c mkdir -p /home/znc/usr/lib/%0a%3c mkdir -p /home/znc/usr/local/lib/pkgconfig%0a%3c mkdir -p /home/znc/usr/local/bin/%0a%3c mkdir -p /home/znc/usr/local/share/%0a%3c mkdir -p /home/znc/usr/local/man/man1/%0a%3c mkdir -p /home/znc/usr/libexec/%0a%3c mkdir -p /home/znc/etc/ssl%0a%3c mkdir -p /home/znc/dev/%0a%3c mkdir -p /home/znc/var/run/%0a%3c mkdir -p /home/znc/home/znc/%0a%3c mknod -m 644 /home/znc/dev/random c 45 0%0a%3c mknod -m 644 /home/znc/dev/urandom c 45 2%0a%3c mknod -m 666 /home/znc/dev/null c 2 2%0a%3c cp /usr/lib/libc++.so.5.0 /home/znc/usr/lib/libc++.so.5.0 %0a%3c cp /usr/lib/libc++abi.so.3.0 /home/znc/usr/lib/libc++abi.so.3.0%0a%3c cp /usr/lib/libc.so.96.0 /home/znc/usr/lib/libc.so.96.0%0a%3c cp /usr/lib/libcrypto.so.46.1 /home/znc/usr/lib/libcrypto.so.46.1%0a%3c cp /usr/lib/libm.so.10.1 /home/znc/usr/lib/libm.so.10.1%0a%3c cp /usr/lib/libpthread.so.26.1 /home/znc/usr/lib/libpthread.so.26.1%0a%3c cp /usr/lib/libssl.so.48.1 /home/znc/usr/lib/libssl.so.48.1%0a%3c cp /usr/lib/libz.so.5.0 /home/znc/usr/lib/libz.so.5.0%0a%3c cp /usr/libexec/ld.so /home/znc/usr/libexec/ld.so%0a%3c cp /etc/resolv.conf /home/znc/etc/resolv.conf%0a%3c cp /etc/ssl/cert.pem /home/znc/etc/ssl/cert.pem%0a%3c cp /var/run/ld.so.hints /home/znc/var/run/ld.so.hints%0a676,682c645,651%0a%3c cp /usr/local/lib/libicuuc.so.18.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicudata.so.18.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_locale-mt.so.11.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_system-mt.so.11.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_thread-mt.so.11.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_chrono-mt.so.11.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicui18n.so.18.0 /home/znc/usr/local/lib/%0a---%0a> cp /usr/local/lib/libicuuc.so.19.2 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libicudata.so.19.2 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_locale-mt.so.13.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_system-mt.so.13.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_thread-mt.so.13.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libboost_chrono-mt.so.13.0 /home/znc/usr/local/lib/%0a> cp /usr/local/lib/libicui18n.so.19.2 /home/znc/usr/local/lib/%0a host:1620272185=184.99.100.20 author:1620263815=bejelentkezni diff:1620263815:1620263815:=1,662d0%0a%3c You will want to get a ddos-filtered IPv4 and an IPv6 subnet from your internet provider.%0a%3c %0a%3c Create the user znc:%0a%3c %0a%3c [@%0a%3c $ doas adduser%0a%3c @]%0a%3c %0a%3c Note: If this is the first user you are creating after the initial install process, you will first be asked for global defaults. Do not change any of these.%0a%3c %0a%3c [@%0a%3c Name: znc%0a%3c Password: ****%0a%3c Fullname: znc%0a%3c Uid: 1001%0a%3c Gid: 1001 (znc)%0a%3c Groups: znc %0a%3c Login Class: default%0a%3c HOME: /home/znc%0a%3c Shell: /sbin/nologin%0a%3c OK? (y/n) [y]: y%0a%3c @]%0a%3c %0a%3c I am not sure if this is necessary, but in /etc/login.conf, I add the following:%0a%3c %0a%3c [@%0a%3c znc:\%0a%3c :openfiles-cur=4096:\%0a%3c :openfiles-max=8182:\%0a%3c :openfiles=4096:\%0a%3c :stacksize-cur=48M:\%0a%3c :stacksize-max=48M:\%0a%3c :maxproc-max=infinity:\%0a%3c :maxproc-cur=4096:\%0a%3c :tc=daemon:%0a%3c @]%0a%3c %0a%3c '''WARNING''': Use tabs and not spaces. Spaces will not parse properly.%0a%3c %0a%3c I check to make sure znc is set to the right login class.%0a%3c %0a%3c [@%0a%3c $ doas vipw%0a%3c @]%0a%3c %0a%3c There should be a line with znc that looks like this (I check to make sure znc has the right login class; the '1001' is the uid, which you may find to be different from this example, but it should not be changed):%0a%3c %0a%3c [@%0a%3c znc:*:1001:1001:znc:0:0:znc:/home/znc:/sbin/nologin%0a%3c @]%0a%3c %0a%3c You will want to make sure that any login.conf.db database is deleted:%0a%3c %0a%3c [@%0a%3c $ doas rm /etc/login.conf.db%0a%3c @]%0a%3c %0a%3c Now change znc shell to ksh with [@ doas usermod -s /bin/ksh znc@], then continue with the steps below.%0a%3c %0a%3c [@%0a%3c $ doas su -c znc znc%0a%3c $ ulimit -a%0a%3c time(cpu-seconds) unlimited%0a%3c file(blocks) unlimited%0a%3c coredump(blocks) unlimited%0a%3c data(kbytes) 33554432%0a%3c stack(kbytes) 32768%0a%3c lockedmem(kbytes) 329478%0a%3c memory(kbytes) 985092%0a%3c nofiles(descriptors) 4096%0a%3c processes 1310%0a%3c @]%0a%3c %0a%3c I then set the default shell to nologin with [@doas usermod -s /sbin/nologin znc@] (note: the '1001' is the uid, which you may find to be different from this example, but it should not be changed.):%0a%3c %0a%3c [@%0a%3c $ doas vipw%0a%3c %0a%3c ...%0a%3c %0a%3c znc:*:1001:1001:znc:0:0:znc:/home/znc:/sbin/nologin%0a%3c @]%0a%3c %0a%3c Install needed dependencies:%0a%3c %0a%3c [@%0a%3c $ doas pkg_add icu4c-68.2v0%0a%3c $ doas pkg_add boost-1.72.0%0a%3c $ doas pkg_add cmake-3.19.4p0v0%0a%3c @]%0a%3c %0a%3c The below install scripts are tested for OpenBSD 6.9 [[openbsd/syspatch|stable]] and our patched znc-1.8.2. It will put znc inside the chroot at /home/znc. Before you begin the installation, check that you are using OpenBSD 6.9 and that your system is patched:%0a%3c %0a%3c [@%0a%3c $ uname -a%0a%3c OpenBSD example.ircnow.org 6.9 GENERIC#464 amd64%0a%3c $ doas syspatch%0a%3c @]%0a%3c %0a%3c [@%0a%3c $ cd ~%0a%3c $ curl -L -O https://ircnow.org/software/znc-1.8.2a.tar.gz%0a%3c $ tar xvzf znc-1.8.2a.tar.gz%0a%3c $ cd znc-1.8.2%0a%3c $ mkdir build%0a%3c $ cd build%0a%3c $ cmake ..%0a%3c $ make%0a%3c $ doas make install%0a%3c @]%0a%3c %0a%3c '''NOTE''': A patched version of znc-1.8.2 release is used to prevent a threading bug. Please do '''not''' use the standard znc 1.8.2 release.%0a%3c %0a%3c Then run as root:%0a%3c %0a%3c [@%0a%3c mkdir -p /home/znc/usr/lib/%0a%3c mkdir -p /home/znc/usr/local/lib/pkgconfig%0a%3c mkdir -p /home/znc/usr/local/bin/%0a%3c mkdir -p /home/znc/usr/local/share/%0a%3c mkdir -p /home/znc/usr/local/man/man1/%0a%3c mkdir -p /home/znc/usr/libexec/%0a%3c mkdir -p /home/znc/etc/ssl%0a%3c mkdir -p /home/znc/dev/%0a%3c mkdir -p /home/znc/var/run/%0a%3c mkdir -p /home/znc/home/znc/.znc%0a%3c mknod -m 644 /home/znc/dev/random c 45 0%0a%3c mknod -m 644 /home/znc/dev/urandom c 45 2%0a%3c mknod -m 666 /home/znc/dev/null c 2 2%0a%3c cp /usr/lib/libc++.so.7.0 /home/znc/usr/lib/libc++.so.7.0%0a%3c cp /usr/lib/libc++abi.so.5.0 /home/znc/usr/lib/libc++abi.so.5.0%0a%3c cp /usr/lib/libc.so.96.0 /home/znc/usr/lib/libc.so.96.0%0a%3c cp /usr/lib/libcrypto.so.46.2 /home/znc/usr/lib/libcrypto.so.46.2%0a%3c cp /usr/lib/libm.so.10.1 /home/znc/usr/lib/libm.so.10.1%0a%3c cp /usr/lib/libpthread.so.26.1 /home/znc/usr/lib/libpthread.so.26.1%0a%3c cp /usr/lib/libssl.so.48.2 /home/znc/usr/lib/libssl.so.48.2%0a%3c cp /usr/lib/libz.so.5.0 /home/znc/usr/lib/libz.so.5.0%0a%3c cp /usr/libexec/ld.so /home/znc/usr/libexec/ld.so%0a%3c cp /etc/resolv.conf /home/znc/etc/resolv.conf%0a%3c cp /etc/ssl/cert.pem /home/znc/etc/ssl/cert.pem%0a%3c cp /var/run/ld.so.hints /home/znc/var/run/ld.so.hints%0a%3c cp /usr/local/bin/znc /home/znc/usr/local/bin/znc%0a%3c cp /usr/local/man/man1/znc.1 /home/znc/usr/local/man/man1/znc.1%0a%3c cp /usr/local/man/man1/znc-buildmod.1 /home/znc/usr/local/man/man1/znc-buildmod.1%0a%3c cp /usr/local/bin/znc-buildmod /home/znc/usr/local/bin/znc-buildmod%0a%3c cp /usr/local/lib/pkgconfig/znc.pc /home/znc/usr/local/lib/pkgconfig/znc.pc%0a%3c cp /usr/local/lib/libicuuc.so.19.2 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicudata.so.19.2 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_locale-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_chrono-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_system-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_thread-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicui18n.so.19.2 /home/znc/usr/local/lib/%0a%3c cp -R /usr/local/share/znc /home/znc/usr/local/share/%0a%3c cp -R /usr/local/lib/znc /home/znc/usr/local/lib/%0a%3c cp -R /usr/local/include/znc /home/znc/usr/local/include/%0a%3c chown -R znc:znc /home/znc/%0a%3c chown -R root:wheel /home/znc/dev /home/znc/etc /home/znc/usr /home/znc/var%0a%3c chmod -R o-rx /home/znc/home/znc/.znc/%0a%3c usermod -G znc botnow%0a%3c usermod -G znc _identd%0a%3c @]%0a%3c %0a%3c At first, you will need to create a conf file:%0a%3c %0a%3c [@%0a%3c # export HOME=/home/znc/%0a%3c # chroot -u znc -g znc /home/znc znc --makeconf%0a%3c @]%0a%3c %0a%3c [@%0a%3c [ .. ] Checking for list of available modules...%0a%3c [ ** ] %0a%3c [ ** ] -- Global settings --%0a%3c [ ** ] %0a%3c [ ?? ] Listen on port (1025 to 65534): 31337%0a%3c [ ?? ] Listen using SSL (yes/no) [no]: yes%0a%3c [ ?? ] Listen using both IPv4 and IPv6 (yes/no) [yes]: no%0a%3c [ .. ] Verifying the listener...%0a%3c [ ** ] Unable to locate pem file: [/home/znc/.znc/znc.pem], creating it%0a%3c [ .. ] Writing Pem file [/home/znc/.znc/znc.pem]...%0a%3c [ ** ] Enabled global modules [webadmin]%0a%3c [ ** ] %0a%3c [ ** ] -- Admin user settings --%0a%3c [ ** ] %0a%3c [ ?? ] Username (alphanumeric): %0a%3c @]%0a%3c %0a%3c [@%0a%3c # cp /etc/ssl/my.example.com.fullchain.pem /home/znc/home/znc/.znc/%0a%3c # cp /etc/ssl/private/my.example.com.key /home/znc/home/znc/.znc/%0a%3c # chown znc:znc /home/znc/home/znc/.znc/my.example.com.*%0a%3c @]%0a%3c %0a%3c Inside ~:%0a%3c %0a%3c [@%0a%3c $ openssl dhparam -out dhparam.pem 2048%0a%3c $ doas chown znc:znc dhparam.pem%0a%3c $ doas mv dhparam.pem /home/znc/home/znc/.znc/%0a%3c @]%0a%3c %0a%3c Afterwards, to run znc:%0a%3c %0a%3c [@%0a%3c # export HOME=/home/znc%0a%3c # /usr/sbin/chroot -u znc -g znc /home/znc znc >>/var/log/znc.log 2>&1 &%0a%3c @]%0a%3c %0a%3c Now you must add this rule in /etc/pf.conf:%0a%3c %0a%3c [@%0a%3c pass in log quick proto tcp to port {80 443} keep state (max-src-conn 30, max-src-conn-rate 20/60) #relayd web%0a%3c pass in log quick proto tcp to port {1337 31337} keep state (max 3000, max-src-conn 200) #bnc%0a%3c @]%0a%3c %0a%3c [@%0a%3c $ doas pfctl -f /etc/pf.conf%0a%3c @]%0a%3c %0a%3c (Here the steps are a bit out of chronology)%0a%3c %0a%3c To start the bouncer, I run this command:%0a%3c %0a%3c [@%0a%3c # HOME=/home/znc && /usr/sbin/chroot -u znc -g znc /home/znc znc >>/var/log/znc.log 2>&1 &%0a%3c @]%0a%3c %0a%3c If your bouncer is already online, make sure to save the config by logging into your irc client, connected to the bouncer:%0a%3c %0a%3c [@%0a%3c /msg *status saveconfig%0a%3c @]%0a%3c %0a%3c Then, go add this at the top of /home/znc/home/znc/.znc/configs/znc.conf (yes I deliberately ignore the warnings):%0a%3c %0a%3c [@%0a%3c AnonIPLimit = 10000%0a%3c AuthOnlyViaModule = false%0a%3c ConfigWriteDelay = 60%0a%3c ConnectDelay = 1%0a%3c HideVersion = false%0a%3c LoadModule = chansaver%0a%3c LoadModule = lastseen%0a%3c LoadModule = adminlog%0a%3c LoadModule = identfile%0a%3c LoadModule = webadmin%0a%3c LoadModule = certauth%0a%3c MaxBufferSize = 10000%0a%3c ProtectWebSessions = true%0a%3c SSLCertFile = /home/znc/.znc/my.example.com.fullchain.pem%0a%3c SSLDHParamFile = /home/znc/.znc/dhparam.pem%0a%3c SSLKeyFile = /home/znc/.znc/my.example.com.key%0a%3c PidFile = /home/znc/.znc/znc.pid%0a%3c ServerThrottle = 1%0a%3c Version = 1.8.2%0a%3c %0a%3c %3cListener listener0>%0a%3c AllowIRC = true%0a%3c AllowWeb = false%0a%3c Host = 192.168.1.1%0a%3c IPv4 = true%0a%3c IPv6 = false%0a%3c Port = 1337%0a%3c SSL = false%0a%3c URIPrefix = /%0a%3c %3c/Listener>%0a%3c %0a%3c %3cListener listener1>%0a%3c AllowIRC = true%0a%3c AllowWeb = false%0a%3c Host = 192.168.1.1%0a%3c IPv4 = true%0a%3c IPv6 = false%0a%3c Port = 31337%0a%3c SSL = true%0a%3c URIPrefix = /%0a%3c %3c/Listener>%0a%3c %0a%3c %3cListener listener2>%0a%3c AllowIRC = true%0a%3c AllowWeb = false%0a%3c Host = 2001:db8::%0a%3c IPv4 = false%0a%3c IPv6 = true%0a%3c Port = 1337%0a%3c SSL = false%0a%3c URIPrefix = /%0a%3c %3c/Listener>%0a%3c %0a%3c %3cListener listener3>%0a%3c AllowIRC = true%0a%3c AllowWeb = false%0a%3c Host = 2001:db8::%0a%3c IPv4 = false%0a%3c IPv6 = true%0a%3c Port = 31337%0a%3c SSL = true%0a%3c URIPrefix = /%0a%3c %3c/Listener>%0a%3c %0a%3c %3cListener listener4>%0a%3c AllowIRC = true%0a%3c AllowWeb = false%0a%3c Host = 127.0.0.1%0a%3c IPv4 = true%0a%3c IPv6 = false%0a%3c Port = 1337%0a%3c SSL = false%0a%3c URIPrefix = /%0a%3c %3c/Listener>%0a%3c %0a%3c %3cListener listener5>%0a%3c AllowIRC = false%0a%3c AllowWeb = true%0a%3c Host = 127.0.0.1%0a%3c IPv4 = true%0a%3c IPv6 = false%0a%3c Port = 1338%0a%3c SSL = false%0a%3c URIPrefix = /%0a%3c %3c/Listener>%0a%3c @]%0a%3c %0a%3c We will load the identfile module by default. This is necessary to provide proper ident using [[oidentd/znc|oidentd]]. Please follow the instructions in the link to configure ident.%0a%3c %0a%3c I have znc bind to port 1338 without SSL for the web server. I will later use [[openbsd/relayd|relayd]] to provide TLS acceleration on port 443.%0a%3c %0a%3c Replace with your own IP addresses. Then, on your irc client logged into the bouncer:%0a%3c %0a%3c [@%0a%3c /msg *status rehash%0a%3c @]%0a%3c %0a%3c [@%0a%3c $ doas crontab -e%0a%3c @]%0a%3c %0a%3c Add a few lines to have ZNC reconnect every 5 minutes. ZNC will only connect if no other ZNC instance is running:%0a%3c %0a%3c [@%0a%3c HOME=/home/znc%0a%3c */5 * * * * /usr/sbin/chroot -u znc -g znc /home/znc znc >>/var/log/znc.log 2>&1 &%0a%3c @]%0a%3c %0a%3c To test the connection (and SSL certificate), run:%0a%3c %0a%3c [@%0a%3c $ openssl s_client -connect my.example.com:31337%0a%3c @]%0a%3c %0a%3c Make sure you have the proper SSL cert configured.%0a%3c %0a%3c While you are at it, you will want to redirect any plaintext requests to the webpanel on port 80 to use SSL on port 443. Add this to /etc/httpd.conf:%0a%3c %0a%3c [@%0a%3c server "bnc.example.com" {%0a%3c listen on * port 80%0a%3c location "/.well-known/acme-challenge/*" {%0a%3c root "/acme"%0a%3c request strip 2%0a%3c }%0a%3c location * {%0a%3c block return 302 "https://$HTTP_HOST$REQUEST_URI"%0a%3c }%0a%3c }%0a%3c @]%0a%3c %0a%3c Go ahead and reboot the web server:%0a%3c %0a%3c [@%0a%3c $ doas rcctl restart httpd%0a%3c @]%0a%3c %0a%3c Note: If you are using IPv6 and IPv4 for the same listener, perl IO::Socket::INET is unable to connect. Use two separate listeners.%0a%3c %0a%3c '''Integration with the operating system'''%0a%3c %0a%3c [@%0a%3c doas touch /etc/rc.d/znc%0a%3c doas chmod +x /etc/rc.d/znc%0a%3c @]%0a%3c %0a%3c [= %0a%3c #!/bin/ksh%0a%3c #%0a%3c # $OpenBSD: znc,v 1.2 2020/01/21 19:27:07 rpe Exp $%0a%3c %0a%3c daemon_pidfile="/home/znc/home/znc/.znc/znc.pid"%0a%3c daemon="env HOME=/home/znc /usr/sbin/chroot -u znc -g znc /home/znc znc"%0a%3c %0a%3c %0a%3c service_stop() {%0a%3c if [ -f $daemon_pidfile ]; then%0a%3c pid=$(sed 's/[^0-9]*//g' $daemon_pidfile)%0a%3c kill $pid%0a%3c fi%0a%3c }%0a%3c %0a%3c case "$1" in%0a%3c stop)%0a%3c service_stop%0a%3c ;;%0a%3c esac%0a%3c %0a%3c %0a%3c . /etc/rc.d/rc.subr%0a%3c %0a%3c rc_reload=NO%0a%3c %0a%3c rc_cmd $1%0a%3c %0a%3c %0a%3c =]%0a%3c %0a%3c '''Automatic start'''%0a%3c %0a%3c Automatic start of the service in case of a crash. %0a%3c %0a%3c This prevents the loss of users due to software errors. Make sure your users feel good.%0a%3c [=%0a%3c doas mkdir /usr/local/project_name/%0a%3c doas touch /usr/local/project_name/checker_znc.sh%0a%3c doas chmod +x /usr/local/project_name/checker_znc.sh%0a%3c =]%0a%3c %0a%3c [=%0a%3c #!/bin/sh%0a%3c %0a%3c SERVICE_NAME="znc"%0a%3c SERVICE_USER="znc"%0a%3c SERVICE_PID="/home/znc/home/znc/.znc/znc.pid"%0a%3c %0a%3c if ! pgrep -u $SERVICE_USER -x "$SERVICE_NAME" > /dev/null%0a%3c then%0a%3c if [ -f $SERVICE_PID ]; then%0a%3c rm -f $SERVICE_PID%0a%3c rcctl -d restart $SERVICE_NAME%0a%3c fi%0a%3c fi%0a%3c %0a%3c =]%0a%3c This may have issues in the 6.9 release.%0a%3c [=%0a%3c doas crontab -e%0a%3c =]%0a%3c %0a%3c [=%0a%3c */2 * * * * /usr/local/project_name/checker_znc.sh 2>&1 &%0a%3c =]%0a%3c %0a%3c (:if false:)%0a%3c '''ZNC console'''%0a%3c %0a%3c Connect%0a%3c [=%0a%3c /quote PASS admin:mysuperadminpassqwerty%0a%3c =]%0a%3c %0a%3c Generate new pass for user%0a%3c [=%0a%3c Go to site: https://passwordsgenerator.net/%0a%3c and disable "Include Symbols"%0a%3c click "generate password"%0a%3c or you can create a password yourself (the password must be between 12 and 16 characters long and include numbers and letters)%0a%3c =]%0a%3c (:ifend:)%0a%3c %0a%3c User login%0a%3c [=%0a%3c username must be the same or derived from the network login (contain a suffix)%0a%3c =]%0a%3c %0a%3c Create new user%0a%3c [=%0a%3c /msg *controlpanel AddUser bob 12345678%0a%3c /msg *controlpanel LoadModule bob perform%0a%3c =]%0a%3c %0a%3c Add network for new ner%0a%3c [=%0a%3c /msg *controlpanel AddNetwork bob IRCNow%0a%3c /msg *controlpanel AddServer vasya IRCNow irc.ircnow.org +6697%0a%3c /msg *controlpanel SetNetwork BindHost bob IRCNow 2605:6400:20:bb8:dae2:32a2%0a%3c /msg *controlpanel help%0a%3c =]%0a%3c %0a%3c Set channels%0a%3c [=%0a%3c /msg *controlpanel AddChan bob IRCNow #ircnow%0a%3c =]%0a%3c %0a%3c Set pass (this must be done with a user account or offer to run this command yourself) %0a%3c [=%0a%3c /msg *perform add PRIVMSG NickServ IDENTIFY bob 12345678%0a%3c /msg *perform help%0a%3c =]%0a%3c %0a%3c Reconnect user`s network%0a%3c [=%0a%3c /msg *controlpanel Reconnect bob IRCNow%0a%3c =]%0a%3c %0a%3c Saving settings to disk (please save your changes to disk immediately)%0a%3c [=%0a%3c /msg *status SaveConfig%0a%3c =]%0a%3c %0a%3c Deleting user and user entities%0a%3c [=%0a%3c /msg *controlpanel DelUser bob%0a%3c /msg *controlpanel DelNetwork bob IRCNow%0a%3c =]%0a%3c %0a%3c !! Custom vhosts%0a%3c %0a%3c '''WARNING''': do '''not''' set individual IPv6 addresses for a user's bindhost. Do not set a user's bindhost to be something like 2605:6400:10::. If you specify an IPv6 address for the bindhost, that user can *only* connect to networks that support IPv6. IPv4-only networks completely fail.%0a%3c %0a%3c It is better to set the bindhost to be username.fruit.ircnow.org. Then, for the [[openbsd/nsd|nameserver]], create an AAAA record and an A record. That way, the bindhost will use IPv6 if the network is IPv6-only, and IPv4 if it is an IPv4-only network. This solution is more flexible and allows your user to fall back to IPv4 when IPv6 is not supported.%0a%3c %0a%3c If a user requests to change their vhost, do not edit the bindhost -- all you need to do is update the rDNS record (see the [[openbsd/buyvm|buyvm web panel]]. Don't delete the bindhost or the DNS A/AAAA records.%0a%3c %0a%3c For example, suppose the vhost was formerly user.fruit.ircnow.org. If the user wants to change it to example.com, you just need to update the rDNS to example.com, but leave the znc bindhost as username.fruit.ircnow.org and keep the A/AAAA records for username.fruit.ircnow.org.%0a%3c %0a%3c Once example.com's AAAA record is working, and the rDNS has been configured properly, you can reconnect the user (either the user types @@/znc connect@@ or you type @@/msg *controlpanel reconnect %3cusername> %3cnetwork>@@), and the vhost will update properly.%0a%3c %0a%3c Keeping the old A/AAAA record and bindhost working will make it easier if the user changes vhosts or if their 3rd party dns server for example.com fails for whatever reason. This method will allow the user to still connect. Otherwise, if the 3rd party dns server fails for example.com (which frequently happens with cheap, free dns services), users will be unable to connect and blame you. %0a%3c %0a%3c !! Troubleshooting%0a%3c %0a%3c If your user is getting disconnected, these are the most likely causes:%0a%3c %0a%3c # mismatch of ports or SSL (using plaintext on 6697 or SSL on 6667)%0a%3c # SSL is not supported%0a%3c # user has a server password where none belongs (most likely he confused server password with nickserv password)%0a%3c # ident is not working%0a%3c # ircd bans a certain username or ident for no good reason (the ircd mistakenly assumes your connection is a bot and glines it)%0a%3c # typo of server name or IP address%0a%3c # dns lookup error%0a%3c %0a%3c You may be need to install icu4c-68.2v0.%0a%3c %0a%3c !! WARNING%0a%3c %0a%3c If a znc user has a bindhost that is IPv6 only but the network is IPv4 only, it will not connect.%0a%3c %0a%3c To prevent this, you '''must be absolutely 100%25 certain''' that each bindhost is symbolic (such as username.fruit.ircnow.org) and that each hostname has a single A record and a single AAAA record in your DNS zone. If any part is misconfigured, users will be unable to connect.%0a%3c %0a%3c A quick way to check if there are DNS errors:%0a%3c %0a%3c [@%0a%3c $ doas grep -i host /home/znc/home/znc/.znc/configs/znc.conf | grep -v > ~/bindhost%0a%3c $ vi ~/bindhost%0a%3c @]%0a%3c %0a%3c Then with vi:%0a%3c %0a%3c [@%0a%3c :%25s_.* = _host _g%0a%3c @]%0a%3c %0a%3c Then:%0a%3c %0a%3c [@%0a%3c $ sh ~/bindhost%0a%3c @]%0a%3c %0a%3c If you see any records there with only a single IPv4 address but no IPv6, or a single IPv6 but no IPv4, or any NXDOMAIN responses, you need to fix your DNS records. There should be exactly one shared IPv4 and one unique IPv6 for each hostname, and zero NXDOMAIN responses.%0a%3c %0a%3c !!! Missing libraries%0a%3c %0a%3c If you are getting errors such as:%0a%3c %0a%3c [@%0a%3c ld.so: znc: can't load library 'libc++abi.so.5.0' %0a%3c @]%0a%3c %0a%3c Then it could be due to the fact that you are on the wrong OpenBSD version (6.8 or earlier), you did not apply [[openbsd/syspatch|syspatch]], and you have not upgraded all dependencies:%0a%3c %0a%3c [@%0a%3c $ doas syspatch%0a%3c $ doas pkg_add -Uu%0a%3c @]%0a%3c %0a%3c Then, delete the build folder and compile again.%0a%3c %0a%3c !! Adding ICU support%0a%3c %0a%3c Copy the following directories:%0a%3c %0a%3c [@%0a%3c # cp -R /usr/local/share/icu /home/znc/usr/local/share/%0a%3c # cp -R /usr/local/lib/icu /home/znc/usr/local/lib/%0a%3c @]%0a%3c %0a%3c Then, restart BNC. Encoding options should be available.%0a%3c %0a%3c (The patched ZNC was made before ICU support is added. So, we cannot ensure that adding ICU support after the patch will not cause any other bugs.)%0a%3c %0a%3c !! Running znc in debug mode%0a%3c %0a%3c [@%0a%3c $ cd ~%0a%3c $ curl -L -O https://znc.in/releases/znc-1.8.2.tar.gz%0a%3c $ tar xvzf znc-1.8.2.tar.gz%0a%3c $ cd znc-1.8.2%0a%3c $ mkdir build%0a%3c $ cd build%0a%3c $ ../configure --enable-debug CXX=c++%0a%3c $ gmake%0a%3c $ doas make install%0a%3c @]%0a%3c %0a%3c [@%0a%3c mkdir -p /home/znc/usr/lib/%0a%3c mkdir -p /home/znc/usr/local/lib/pkgconfig%0a%3c mkdir -p /home/znc/usr/local/bin/%0a%3c mkdir -p /home/znc/usr/local/share/%0a%3c mkdir -p /home/znc/usr/local/man/man1/%0a%3c mkdir -p /home/znc/usr/libexec/%0a%3c mkdir -p /home/znc/etc/ssl%0a%3c mkdir -p /home/znc/dev/%0a%3c mkdir -p /home/znc/var/run/%0a%3c mkdir -p /home/znc/home/znc/%0a%3c mknod -m 644 /home/znc/dev/random c 45 0%0a%3c mknod -m 644 /home/znc/dev/urandom c 45 2%0a%3c mknod -m 666 /home/znc/dev/null c 2 2%0a%3c cp /usr/lib/libc++.so.7.0 /home/znc/usr/lib/libc++.so.7.0 %0a%3c cp /usr/lib/libc++abi.so.5.0 /home/znc/usr/lib/libc++abi.so.5.0%0a%3c cp /usr/lib/libc.so.96.0 /home/znc/usr/lib/libc.so.96.0%0a%3c cp /usr/lib/libcrypto.so.46.2 /home/znc/usr/lib/libcrypto.so.46.2%0a%3c cp /usr/lib/libm.so.10.1 /home/znc/usr/lib/libm.so.10.1%0a%3c cp /usr/lib/libpthread.so.26.1 /home/znc/usr/lib/libpthread.so.26.1%0a%3c cp /usr/lib/libssl.so.48.2 /home/znc/usr/lib/libssl.so.48.2%0a%3c cp /usr/lib/libz.so.5.0 /home/znc/usr/lib/libz.so.5.0%0a%3c cp /usr/libexec/ld.so /home/znc/usr/libexec/ld.so%0a%3c cp /etc/resolv.conf /home/znc/etc/resolv.conf%0a%3c cp /etc/ssl/cert.pem /home/znc/etc/ssl/cert.pem%0a%3c cp /var/run/ld.so.hints /home/znc/var/run/ld.so.hints%0a%3c cp /usr/local/bin/znc /home/znc/usr/local/bin/znc%0a%3c cp /usr/local/man/man1/znc.1 /home/znc/usr/local/man/man1/znc.1%0a%3c cp /usr/local/man/man1/znc-buildmod.1 /home/znc/usr/local/man/man1/znc-buildmod.1%0a%3c cp /usr/local/bin/znc-buildmod /home/znc/usr/local/bin/znc-buildmod%0a%3c cp /usr/local/lib/pkgconfig/znc.pc /home/znc/usr/local/lib/pkgconfig/znc.pc%0a%3c cp /usr/local/lib/libicuuc.so.19.2 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicudata.so.19.2 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_locale-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_system-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_thread-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libboost_chrono-mt.so.13.0 /home/znc/usr/local/lib/%0a%3c cp /usr/local/lib/libicui18n.so.19.2 /home/znc/usr/local/lib/%0a%3c cp -R /usr/local/share/znc /home/znc/usr/local/share/%0a%3c cp -R /usr/local/lib/znc /home/znc/usr/local/lib/%0a%3c cp -R /usr/local/include/znc /home/znc/usr/local/include/%0a%3c chown -R znc:znc /home/znc/%0a%3c chown -R root:wheel /home/znc/dev /home/znc/etc /home/znc/usr /home/znc/var%0a%3c chmod -R o-rx /home/znc/home/znc/.znc/%0a%3c usermod -G znc botnow%0a%3c usermod -G znc _identd%0a%3c @]%0a%3c %0a%3c $ doas gdb chroot%0a\ No newline at end of file%0a host:1620263815=184.99.100.20