3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

service_support: support optionally setting servprotect on service bots

Closes #243.
This commit is contained in:
James Lu 2016-07-01 21:25:58 -07:00
parent 017d6a4651
commit 408ce701b1
2 changed files with 14 additions and 3 deletions

View File

@ -29,10 +29,15 @@ def spawn_service(irc, source, command, args):
# TODO: make this configurable?
host = irc.serverdata["hostname"]
# Prefer spawning service clients with umode +io, plus hideoper and
# hidechans if supported.
# Spawning service clients with these umodes where supported. servprotect usage is a
# configuration option.
preferred_modes = ['oper', 'hideoper', 'hidechans', 'invisible', 'bot']
modes = []
for mode in ('oper', 'hideoper', 'hidechans', 'invisible', 'bot'):
if conf.conf['bot'].get('protect_services'):
preferred_modes.append('servprotect')
for mode in preferred_modes:
mode = irc.umodes.get(mode)
if mode:
modes.append((mode, None))

View File

@ -30,6 +30,12 @@ bot:
# Defaults to true if not specified.
whois_use_hideoper: true
# Determines whether PyLink service clients should protect themselves from
# kicks, kills, etc. using IRCd-side servprotect modes. For this to work
# properly, this requires that PyLink be U-Lined (on most IRCds). Defaults to
# False.
protect_services: false
login:
# PyLink administrative login - Change this, or the service will not start!
user: admin