Merge pull request #190 from lykoss/server-pass
Add SERVER_PASS config to control PASS command
This commit is contained in:
commit
eaf226d640
@ -12,6 +12,14 @@ CHANNEL = "##mywolfgame"
|
|||||||
|
|
||||||
CMD_CHAR = "!"
|
CMD_CHAR = "!"
|
||||||
|
|
||||||
|
# If your server requires a connection password, or your services package expects
|
||||||
|
# a different format if authenticating to NickServ via the PASS command, modify this.
|
||||||
|
# The default should work fine on Atheme-based services packages.
|
||||||
|
#
|
||||||
|
# Note: Do not put the account and password here; they will be automatically substituted
|
||||||
|
# from the USERNAME (or NICK) and PASS variables on the top of the file.
|
||||||
|
|
||||||
|
SERVER_PASS = "{account}:{password}"
|
||||||
|
|
||||||
OWNERS = ("unaffiliated/wolfbot_admin1",) # The comma is required at the end if there is only one owner.
|
OWNERS = ("unaffiliated/wolfbot_admin1",) # The comma is required at the end if there is only one owner.
|
||||||
ADMINS = ("unaffiliated/wolfbot_admin2", "unaffiliated/wolfbot_test*")
|
ADMINS = ("unaffiliated/wolfbot_admin2", "unaffiliated/wolfbot_test*")
|
||||||
|
@ -112,6 +112,7 @@ class IRCClient(object):
|
|||||||
self.blocking = True
|
self.blocking = True
|
||||||
self.sasl_auth = False
|
self.sasl_auth = False
|
||||||
self.use_ssl = False
|
self.use_ssl = False
|
||||||
|
self.server_pass = None
|
||||||
self.lock = threading.RLock()
|
self.lock = threading.RLock()
|
||||||
self.stream_handler = lambda output, level=None: print(output)
|
self.stream_handler = lambda output, level=None: print(output)
|
||||||
|
|
||||||
@ -189,9 +190,11 @@ class IRCClient(object):
|
|||||||
|
|
||||||
self.cap("LS", "302")
|
self.cap("LS", "302")
|
||||||
|
|
||||||
if not self.sasl_auth:
|
if self.server_pass and (not self.sasl_auth or "{password}" not in self.server_pass):
|
||||||
self.send("PASS {0}:{1}".format(self.authname if self.authname else self.nickname,
|
message = "PASS :{0}".format(self.server_pass).format(
|
||||||
self.password if self.password else "NOPASS"))
|
account=self.authname if self.authname else self.nickname,
|
||||||
|
password=self.password)
|
||||||
|
self.send(message)
|
||||||
|
|
||||||
self.nick(self.nickname)
|
self.nick(self.nickname)
|
||||||
self.user(self.ident, self.real_name)
|
self.user(self.ident, self.real_name)
|
||||||
|
@ -57,6 +57,7 @@ def main():
|
|||||||
ident=botconfig.IDENT,
|
ident=botconfig.IDENT,
|
||||||
real_name=botconfig.REALNAME,
|
real_name=botconfig.REALNAME,
|
||||||
sasl_auth=botconfig.SASL_AUTHENTICATION,
|
sasl_auth=botconfig.SASL_AUTHENTICATION,
|
||||||
|
server_pass=botconfig.SERVER_PASS,
|
||||||
use_ssl=botconfig.USE_SSL,
|
use_ssl=botconfig.USE_SSL,
|
||||||
connect_cb=handler.connect_callback,
|
connect_cb=handler.connect_callback,
|
||||||
stream_handler=src.stream,
|
stream_handler=src.stream,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user