mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-24 11:42:51 +01:00
service_support: support optionally setting servprotect on service bots
Closes #243.
This commit is contained in:
parent
017d6a4651
commit
408ce701b1
@ -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))
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user