sasl authentication

This commit is contained in:
Stefan Harmuth 2024-11-30 10:28:20 +01:00
parent c44a4cf451
commit 686746cd1f
2 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,8 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
import os.path import os.path
import time
import requests import requests
import sys import sys
from datetime import datetime, timedelta from datetime import datetime, timedelta
@ -40,6 +42,10 @@ class AOCBot:
self.__aoc_session_file = config["AOC"]["session_file"] self.__aoc_session_file = config["AOC"]["session_file"]
self.__aoc_user_agent = config["AOC"]["user_agent"] self.__aoc_user_agent = config["AOC"]["user_agent"]
self.__cache_file = config["AOC"]["cache_file"] self.__cache_file = config["AOC"]["cache_file"]
if "sasl_password" in config["IRC"]:
self.__sasl_password = config["IRC"]["sasl_password"]
else:
self.__sasl_password = None
except AttributeError as e: except AttributeError as e:
print("CONFIGURATION ERROR: %s" % e) print("CONFIGURATION ERROR: %s" % e)
sys.exit(1) sys.exit(1)
@ -226,6 +232,7 @@ class AOCBot:
nick=self.__irc_nick, nick=self.__irc_nick,
username=self.__irc_user, username=self.__irc_user,
realname=self.__irc_real_name, realname=self.__irc_real_name,
sasl_password=self.__sasl_password,
) )
print("[AoCBot] Joining Channel %s" % self.__irc_channel) print("[AoCBot] Joining Channel %s" % self.__irc_channel)

View File

@ -11,7 +11,10 @@
// The Bots IRC identity // The Bots IRC identity
"nick": "AoCBot", "nick": "AoCBot",
"user": "aucbot", "user": "aucbot",
"name": "Advent of Code Leaderboard Announcer" "name": "Advent of Code Leaderboard Announcer",
// If your IRC server requires SASL authentication, set the password here,
"sasl_password": null
}, },
"AOC": { "AOC": {
// The content of your aoc session cookie should be stored in this file // The content of your aoc session cookie should be stored in this file