unrealircd_mods/man/autovhost.md

1.8 KiB

autovhost

Apply vhosts at connect time based on users' raw nick formats or IP addresses. The vhosts are entered in unrealircd.conf and they must be at least 5 chars in length. Furthermore, you can only enter the host part for the new host (so not ident@host).

There are some dynamic variables you can specify in the config, which will be replaced with a certain value on user connect:

  • $nick: nickname 0bv m8
  • $ident: ident/username 0bv m9
  • $account: account name from services 0bv m9, keep in mind though that if they don't do any on-connect authentication (like SASL) the vhost will be seen as invalid and thus not applied

Usage:
Add a config block that looks like this:

autovhost {
	// Just some simple nick!user@host matches
	*!*@some.host $nick.big.heks;
	*!*@some.host $ident.big.heks;
	*!*@some.host $account.big.heks;
	Mibbit*!*@*mibbit.com mibbit.is.gay;

	// You can also use CIDR notation
	192.168.1.0/24 $account.premium.lan;

	// You can even combine all that shit
	poo!loo@192.168.133.7/24 $nick.$ident.$account.hackers.inc

	// Fallback for any other small-network LAN IP
	192.168.* premium.lan;

	// This one will never apply because 192.168.* already matched it
	192.168.2.0/24 some.other.premium.lan;
};

Vhosts are checked from top to bottom and it will only stop if it can apply one successfully. So if you're connecting from 192.168.133.7 but you're not logged into services, opers will get a message about that vhost being invalid and you will still get the vhost for 192.168.* applied to you.

Keep in mind it replaces virthost and not cloakedhost, so when you do /umode -x this custom vhost is lost (why would you do -x anyways? ;]). Furthermore, services like for example Anope's HostServ could override this vhost as they might set it after we changed it.