diff --git a/.gitignore b/.gitignore index 56e4f2d..efaa5e4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ db/ logs/ __pycache__/ configuration.json +configuration.yaml configuration_inspircd.json configuration_unreal6.json *.log diff --git a/config/exemple_configuration.json b/config/exemple_configuration.json deleted file mode 100644 index 3d784f4..0000000 --- a/config/exemple_configuration.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "SERVEUR_IP": "YOUR.SERVER.IP", - "SERVEUR_HOSTNAME": "YOUR.SERVER.HOST", - "SERVEUR_LINK": "LINK.DE.TON.SERVER", - "SERVEUR_PORT": 7002, - "SERVEUR_PASSWORD": "YOUR_LINK_PASSWORD", - "SERVEUR_ID": "006", - "SERVEUR_SSL": true, - - "SERVICE_NAME": "defender", - "SERVICE_NICKNAME": "PyDefender", - "SERVICE_REALNAME": "Python Defender Security", - "SERVICE_USERNAME": "PyDefender", - "SERVICE_HOST": "HOST.DE.TON.DEFENDER", - "SERVICE_INFO": "Network IRC Service", - "SERVICE_CHANLOG": "#services", - "SERVICE_SMODES": "+ioqBS", - "SERVICE_CMODES": "ntsOP", - "SERVICE_UMODES": "o", - "SERVICE_PREFIX": "!", - - "OWNER": "TON_NICK_NAME", - "PASSWORD": "TON_PASSWORD", - - "JSONRPC_URL": "https://your.domaine.com:8600/api", - "JSONRPC_PATH_TO_SOCKET_FILE": "/PATH/TO/YOUR/IRCD/data/rpc.socket", - "JSONRPC_METHOD": "socket", - "JSONRPC_USER": "YOUR_RPC_USER", - "JSONRPC_PASSWORD": "YOUR_RPC_PASSWORD", - - "SALON_JAIL": "#jail", - "SALON_JAIL_MODES": "sS", - "SALON_LIBERER": "#welcome", - - "CLONE_CHANNEL": "#clones", - "CLONE_CMODES": "+nts", - "CLONE_LOG_HOST_EXEMPT": ["HOST.TO.SKIP"], - "CLONE_CHANNEL_PASSWORD": "YOUR_CHANNEL_PASSWORD", - - "API_TIMEOUT": 2, - - "PORTS_TO_SCAN": [3028, 8080, 1080, 1085, 4145, 9050], - "WHITELISTED_IP": ["127.0.0.1"], - "GLINE_DURATION": "30", - - "DEBUG_LEVEL": 20, - "DEBUG_HARD": true -} \ No newline at end of file diff --git a/config/exemple_configuration.yaml b/config/exemple_configuration.yaml new file mode 100644 index 0000000..6bd50a6 --- /dev/null +++ b/config/exemple_configuration.yaml @@ -0,0 +1,47 @@ +configuration: + SERVEUR_IP: "YOUR.SERVER.IP" + SERVEUR_HOSTNAME: "YOUR.SERVER.HOST" + SERVEUR_LINK: "LINK.DE.TON.SERVER" + SERVEUR_PORT: 7002 + SERVEUR_PASSWORD: "YOUR_LINK_PASSWORD" + SERVEUR_ID: "006" + SERVEUR_SSL: true + + SERVICE_NAME: "defender" + SERVICE_NICKNAME: "PyDefender" + SERVICE_REALNAME: "Python Defender Security" + SERVICE_USERNAME: "PyDefender" + SERVICE_HOST: "HOST.DE.TON.DEFENDER" + SERVICE_INFO: "Network IRC Service" + SERVICE_CHANLOG: "#services" + SERVICE_SMODES: "+ioqBS" + SERVICE_CMODES: "ntsOP" + SERVICE_UMODES: "o" + SERVICE_PREFIX: "!" + + OWNER: "TON_NICK_NAME" + PASSWORD: "TON_PASSWORD" + + JSONRPC_URL: "https://your.domaine.com:8600/api" + JSONRPC_PATH_TO_SOCKET_FILE: "/PATH/TO/YOUR/IRCD/data/rpc.socket" + JSONRPC_METHOD: "socket" + JSONRPC_USER: "YOUR_RPC_USER" + JSONRPC_PASSWORD: "YOUR_RPC_PASSWORD" + + SALON_JAIL: "#jail" + SALON_JAIL_MODES: "sS" + SALON_LIBERER: "#welcome" + + CLONE_CHANNEL: "#clones" + CLONE_CMODES: "+nts" + CLONE_LOG_HOST_EXEMPT: ["HOST.TO.SKIP"] + CLONE_CHANNEL_PASSWORD: "YOUR_CHANNEL_PASSWORD" + + API_TIMEOUT: 2 + + PORTS_TO_SCAN: [3028 8080 1080 1085 4145 9050] + WHITELISTED_IP: ["127.0.0.1"] + GLINE_DURATION: "30" + + DEBUG_LEVEL: 20 + DEBUG_HARD: true diff --git a/core/classes/commands.py b/core/classes/commands.py index 29863a9..412756a 100644 --- a/core/classes/commands.py +++ b/core/classes/commands.py @@ -36,7 +36,7 @@ class Command: def get_command(self, command_name: str, module_name: str) -> Optional[MCommand]: for command in self.DB_COMMANDS: - if command.command_name.lower() == command_name and command.module_name == module_name: + if command.command_name.lower() == command_name.lower() and command.module_name.lower() == module_name.lower(): return command return None @@ -90,7 +90,7 @@ class Command: admin_level = admin.level if admin else 0 commands = self.get_commands_by_level(admin_level) - if command_name in [command.command_name for command in commands]: + if command_name.lower() in [command.command_name.lower() for command in commands]: return True return False diff --git a/core/classes/config.py b/core/classes/config.py index 724ee2a..359ccff 100644 --- a/core/classes/config.py +++ b/core/classes/config.py @@ -1,3 +1,5 @@ +import sys +import yaml from json import load from sys import exit from os import sep @@ -13,49 +15,43 @@ class Configuration: self.Loader = loader self.Logs = loader.Logs - self._config_model: MConfig = self.__load_service_configuration() + self.configuration_model = self.__load_service_configuration() loader.ServiceLogging.set_file_handler_level(self._config_model.DEBUG_LEVEL) loader.ServiceLogging.set_stdout_handler_level(self._config_model.DEBUG_LEVEL) loader.ServiceLogging.update_handler_format(self._config_model.DEBUG_HARD) return None - def get_config_model(self) -> MConfig: + @property + def configuration_model(self) -> MConfig: return self._config_model + + @configuration_model.setter + def configuration_model(self, conf_model: MConfig): + self._config_model = conf_model - def __load_json_service_configuration(self) -> Optional[dict[str, Any]]: + def __load_config_file(self) -> Optional[dict[str, Any]]: try: - conf_filename = f'config{sep}configuration.json' - with open(conf_filename, 'r') as configuration_data: - configuration: dict[str, Union[str, int, list, dict]] = load(configuration_data) - - return configuration - + conf_filename = f'config{sep}configuration.yaml' + with open(conf_filename, 'r') as conf: + configuration: dict[str, dict[str, Any]] = yaml.safe_load(conf) + + return configuration.get('configuration', None) except FileNotFoundError as fe: self.Logs.error(f'FileNotFound: {fe}') - self.Logs.error('Configuration file not found please create config/configuration.json') - exit(0) - except KeyError as ke: - self.Logs.error(f'Key Error: {ke}') - self.Logs.error('The key must be defined in core/configuration.json') + self.Logs.error('Configuration file not found please create config/configuration.yaml') + exit("Configuration file not found please create config/configuration.yaml") def __load_service_configuration(self) -> MConfig: try: - import_config = self.__load_json_service_configuration() + import_config = self.__load_config_file() + if import_config is None: + self.Logs.error("Error While importing configuration file!", exc_info=True) + raise Exception("Error While importing yaml configuration") - Model_keys = MConfig().to_dict() - model_key_list: list = [] - json_config_key_list: list = [] - - for key in Model_keys: - model_key_list.append(key) - - for key in import_config: - json_config_key_list.append(key) - - for json_conf in json_config_key_list: - if not json_conf in model_key_list: - import_config.pop(json_conf, None) - self.Logs.warning(f"[!] The key {json_conf} is not expected, it has been removed from the system ! please remove it from configuration.json file [!]") + list_key_to_remove: list[str] = [key_to_del for key_to_del in import_config if key_to_del not in MConfig().get_attributes()] + for key_to_remove in list_key_to_remove: + import_config.pop(key_to_remove, None) + self.Logs.warning(f"[!] The key {key_to_remove} is not expected, it has been removed from the system ! please remove it from configuration.json file [!]") self.Logs.debug(f"[LOADING CONFIGURATION]: Loading configuration with {len(import_config)} parameters!") return MConfig(**import_config) diff --git a/core/classes/protocols/interface.py b/core/classes/protocols/interface.py index 676d383..dc3546d 100644 --- a/core/classes/protocols/interface.py +++ b/core/classes/protocols/interface.py @@ -288,46 +288,46 @@ class IProtocol(ABC): # ------------------------------------------------------------------------ @abstractmethod - def parse_uid(self, server_msg: list[str]) -> dict[str, str]: + def parse_uid(self, serverMsg: list[str]) -> dict[str, str]: """Parse UID and return dictionary. Args: - server_msg (list[str]): The UID IRCD message + serverMsg (list[str]): The UID IRCD message Returns: dict[str, str]: The response as dictionary. """ @abstractmethod - def parse_quit(self, server_msg: list[str]) -> dict[str, str]: + def parse_quit(self, serverMsg: list[str]) -> dict[str, str]: """Parse quit and return dictionary. >>> [':97KAAAAAB', 'QUIT', ':Quit:', 'this', 'is', 'my', 'reason', 'to', 'quit'] Args: - server_msg (list[str]): The server message to parse + serverMsg (list[str]): The server message to parse Returns: dict[str, str]: The response as dictionary. """ @abstractmethod - def parse_nick(self, server_msg: list[str]) -> dict[str, str]: + def parse_nick(self, serverMsg: list[str]) -> dict[str, str]: """Parse nick changes and return dictionary. >>> [':97KAAAAAC', 'NICK', 'testinspir', '1757360740'] Args: - server_msg (list[str]): The server message to parse + serverMsg (list[str]): The server message to parse Returns: dict[str, str]: The response as dictionary. """ @abstractmethod - def parse_privmsg(self, server_msg: list[str]) -> dict[str, str]: + def parse_privmsg(self, serverMsg: list[str]) -> dict[str, str]: """Parse PRIVMSG message. >>> [':97KAAAAAE', 'PRIVMSG', '#welcome', ':This', 'is', 'my', 'public', 'message'] Args: - server_msg (list[str]): The server message to parse + serverMsg (list[str]): The server message to parse Returns: dict[str, str]: The response as dictionary. @@ -345,174 +345,174 @@ class IProtocol(ABC): # ------------------------------------------------------------------------ @abstractmethod - def on_svs2mode(self, server_msg: list[str]) -> None: + def on_svs2mode(self, serverMsg: list[str]) -> None: """Handle svs2mode coming from a server >>> [':00BAAAAAG', 'SVS2MODE', '001U01R03', '-r'] Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_mode(self, server_msg: list[str]) -> None: + def on_mode(self, serverMsg: list[str]) -> None: """Handle mode coming from a server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_umode2(self, server_msg: list[str]) -> None: + def on_umode2(self, serverMsg: list[str]) -> None: """Handle umode2 coming from a server >>> [':adator_', 'UMODE2', '-i'] Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_quit(self, server_msg: list[str]) -> None: + def on_quit(self, serverMsg: list[str]) -> None: """Handle quit coming from a server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_squit(self, server_msg: list[str]) -> None: + def on_squit(self, serverMsg: list[str]) -> None: """Handle squit coming from a server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_protoctl(self, server_msg: list[str]) -> None: + def on_protoctl(self, serverMsg: list[str]) -> None: """Handle protoctl coming from a server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_nick(self, server_msg: list[str]) -> None: + def on_nick(self, serverMsg: list[str]) -> None: """Handle nick coming from a server new nickname Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_sjoin(self, server_msg: list[str]) -> None: + def on_sjoin(self, serverMsg: list[str]) -> None: """Handle sjoin coming from a server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_part(self, server_msg: list[str]) -> None: + def on_part(self, serverMsg: list[str]) -> None: """Handle part coming from a server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_eos(self, server_msg: list[str]) -> None: + def on_eos(self, serverMsg: list[str]) -> None: """Handle EOS coming from a server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_reputation(self, server_msg: list[str]) -> None: + def on_reputation(self, serverMsg: list[str]) -> None: """Handle REPUTATION coming from a server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_uid(self, server_msg: list[str]) -> None: + def on_uid(self, serverMsg: list[str]) -> None: """Handle uid message coming from the server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_privmsg(self, server_msg: list[str]) -> None: + def on_privmsg(self, serverMsg: list[str]) -> None: """Handle PRIVMSG message coming from the server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_server_ping(self, server_msg: list[str]) -> None: + def on_server_ping(self, serverMsg: list[str]) -> None: """Send a PONG message to the server Args: - server_msg (list[str]): List of str coming from the server + serverMsg (list[str]): List of str coming from the server """ @abstractmethod - def on_server(self, server_msg: list[str]) -> None: + def on_server(self, serverMsg: list[str]) -> None: """_summary_ Args: - server_msg (list[str]): _description_ + serverMsg (list[str]): _description_ """ @abstractmethod - def on_version(self, server_msg: list[str]) -> None: + def on_version(self, serverMsg: list[str]) -> None: """Sending Server Version to the server Args: - server_msg (list[str]): List of str coming from the server + serverMsg (list[str]): List of str coming from the server """ @abstractmethod - def on_time(self, server_msg: list[str]) -> None: + def on_time(self, serverMsg: list[str]) -> None: """Sending TIME answer to a requestor Args: - server_msg (list[str]): List of str coming from the server + serverMsg (list[str]): List of str coming from the server """ @abstractmethod - def on_ping(self, server_msg: list[str]) -> None: + def on_ping(self, serverMsg: list[str]) -> None: """Sending a PING answer to requestor Args: - server_msg (list[str]): List of str coming from the server + serverMsg (list[str]): List of str coming from the server """ @abstractmethod - def on_version_msg(self, server_msg: list[str]) -> None: + def on_version_msg(self, serverMsg: list[str]) -> None: """Handle version coming from the server \n ex. /version Defender Args: - server_msg (list[str]): Original message from the server + serverMsg (list[str]): Original message from the server """ @abstractmethod - def on_smod(self, server_msg: list[str]) -> None: + def on_smod(self, serverMsg: list[str]) -> None: """Handle SMOD message coming from the server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message """ @abstractmethod - def on_sasl(self, server_msg: list[str]) -> Optional['MSasl']: + def on_sasl(self, serverMsg: list[str]) -> Optional['MSasl']: """Handle SASL coming from a server Args: - server_msg (list[str]): Original server message + serverMsg (list[str]): Original server message Returns: @@ -530,9 +530,18 @@ class IProtocol(ABC): """ @abstractmethod - def on_md(self, server_msg: list[str]) -> None: + def on_md(self, serverMsg: list[str]) -> None: """Handle MD responses [':001', 'MD', 'client', '001MYIZ03', 'certfp', ':d1235648...'] Args: - server_msg (list[str]): The server reply + serverMsg (list[str]): The server reply + """ + + @abstractmethod + def on_kick(self, serverMsg: list[str]) -> None: + """When a user is kicked out from a channel + + Eg. ['@unrealircd.org...', ':001', 'KICK', '#jsonrpc', '001ELW13T', ':Kicked', 'from', 'JSONRPC', 'User'] + Args: + serverMsg (list[str]): The server message """ diff --git a/core/classes/protocols/unreal6.py b/core/classes/protocols/unreal6.py index 0c94362..66933de 100644 --- a/core/classes/protocols/unreal6.py +++ b/core/classes/protocols/unreal6.py @@ -76,6 +76,7 @@ class Unrealircd6(IProtocol): self.Handler.register(m(command_name="SASL", func=self.on_sasl)) self.Handler.register(m(command_name="MD", func=self.on_md)) self.Handler.register(m(command_name="PRIVMSG", func=self.on_privmsg)) + self.Handler.register(m(command_name="KICK", func=self.on_kick)) return None @@ -699,7 +700,9 @@ class Unrealircd6(IProtocol): serverMsg (list[str]): The server message to parse Returns: - dict[str, str]: The response as dictionary. + dict: The response as dictionary. + + >>> {"uid": "", "newnickname": "", "timestamp": ""} """ scopy = serverMsg.copy() if scopy[0].startswith('@'): @@ -1199,7 +1202,7 @@ class Unrealircd6(IProtocol): admin = self.__Irc.Admin.get_admin(uid) account = admin.account if admin else '' self.send_priv_msg(nick_from=dnickname, - msg=tr("[ %sSASL AUTO AUTH%s ] - %s (%s) is now connected successfuly to %s", GREEN, NOGC, nickname, account, dnickname), + msg=tr("[ %sFINGERPRINT AUTH%s ] - %s (%s) is now connected successfuly to %s", GREEN, NOGC, nickname, account, dnickname), channel=dchanlog) self.send_notice(nick_from=dnickname, nick_to=nickname, msg=tr("Successfuly connected to %s", dnickname)) @@ -1611,4 +1614,19 @@ class Unrealircd6(IProtocol): ... except Exception as e: - self.__Logs.error(f"General Error: {e}") \ No newline at end of file + self.__Logs.error(f"General Error: {e}") + + def on_kick(self, serverMsg: list[str]) -> None: + """When a user is kicked out from a channel + + ['@unrealircd.org/issued-by=RPC:admin-for-test@...', ':001', 'KICK', '#jsonrpc', '001ELW13T', ':Kicked', 'from', 'JSONRPC', 'User'] + Args: + serverMsg (list[str]): The server message + """ + scopy = serverMsg.copy() + uid = scopy[4] + channel = scopy[3] + + # Delete the user from the channel. + self.__Irc.Channel.delete_user_from_channel(channel, uid) + return None \ No newline at end of file diff --git a/core/classes/rehash.py b/core/classes/rehash.py index da8cd61..75c5947 100644 --- a/core/classes/rehash.py +++ b/core/classes/rehash.py @@ -49,7 +49,7 @@ def restart_service(uplink: 'Irc', reason: str = "Restarting with no reason!") - uplink.Logs.warning('-- Waiting for socket to close ...') # Reload configuration - uplink.Loader.Config = uplink.Loader.ConfModule.Configuration(uplink.Loader).get_config_model() + uplink.Loader.Config = uplink.Loader.ConfModule.Configuration(uplink.Loader).configuration_model uplink.Loader.Base = uplink.Loader.BaseModule.Base(uplink.Loader) for mod in REHASH_MODULES: @@ -77,7 +77,7 @@ def rehash_service(uplink: 'Irc', nickname: str) -> None: channel=uplink.Config.SERVICE_CHANLOG ) uplink.Utils = sys.modules['core.utils'] - uplink.Config = uplink.Loader.ConfModule.Configuration(uplink.Loader).get_config_model() + uplink.Config = uplink.Loader.ConfModule.Configuration(uplink.Loader).configuration_model uplink.Config.HSID = config_model_bakcup.HSID uplink.Config.DEFENDER_INIT = config_model_bakcup.DEFENDER_INIT uplink.Config.DEFENDER_RESTART = config_model_bakcup.DEFENDER_RESTART diff --git a/core/irc.py b/core/irc.py index 08b4263..5602238 100644 --- a/core/irc.py +++ b/core/irc.py @@ -847,12 +847,15 @@ class Irc: try: admin_obj = self.Admin.get_admin(fromuser) if admin_obj: - query = f'UPDATE {self.Config.TABLE_ADMIN} SET fingerprint = :fingerprint WHERE user = :user' - r = self.Base.db_execute_query(query, {'fingerprint': admin_obj.fingerprint, 'user': admin_obj.account}) - if r.rowcount > 0: - self.Protocol.send_notice(dnickname, fromuser, f'[ {GREEN}CERT{NOGC} ] Your new fingerprint has been attached to your account. {admin_obj.fingerprint}') + if admin_obj.fingerprint is not None: + query = f'UPDATE {self.Config.TABLE_ADMIN} SET fingerprint = :fingerprint WHERE user = :user' + r = self.Base.db_execute_query(query, {'fingerprint': admin_obj.fingerprint, 'user': admin_obj.account}) + if r.rowcount > 0: + self.Protocol.send_notice(dnickname, fromuser, f'[ {GREEN}CERT{NOGC} ] Your new fingerprint has been attached to your account. {admin_obj.fingerprint}') + else: + self.Protocol.send_notice(dnickname, fromuser, f'[ {RED}CERT{NOGC} ] Impossible to add your fingerprint.{admin_obj.fingerprint}') else: - self.Protocol.send_notice(dnickname, fromuser, f'[ {RED}CERT{NOGC} ] Impossible to add your fingerprint.{admin_obj.fingerprint}') + self.Protocol.send_notice(dnickname, fromuser, f'[ {RED}CERT{NOGC} ] There is no fingerprint to add.') except Exception as e: self.Logs.error(e) diff --git a/core/loader.py b/core/loader.py index b92f2d6..4953940 100644 --- a/core/loader.py +++ b/core/loader.py @@ -35,7 +35,7 @@ class Loader: self.Logs: Logger = self.ServiceLogging.get_logger() - self.Config: df.MConfig = self.ConfModule.Configuration(self).get_config_model() + self.Config: df.MConfig = self.ConfModule.Configuration(self).configuration_model self.Settings.global_lang = self.Config.LANG if self.Config.LANG else "EN" diff --git a/defender.py b/defender.py index 4a6ca45..10577d2 100644 --- a/defender.py +++ b/defender.py @@ -10,15 +10,10 @@ from core import installation ############################################# try: - installation.Install() - from core.loader import Loader loader = Loader() loader.Irc.init_irc() - # from core.irc import Irc - # ircInstance = Irc(Loader()) - # ircInstance.init_irc(ircInstance) except AssertionError as ae: print(f'Assertion Error -> {ae}') diff --git a/mods/defender/mod_defender.py b/mods/defender/mod_defender.py index c5a674d..d727f9c 100644 --- a/mods/defender/mod_defender.py +++ b/mods/defender/mod_defender.py @@ -217,7 +217,7 @@ class Defender: if response is not None: q_insert = "INSERT INTO def_trusted (datetime, user, host, vhost) VALUES (?, ?, ?, ?)" - mes_donnees = {'datetime': self.Base.get_datetime(), 'user': nickname, 'host': '*', 'vhost': '*'} + mes_donnees = {'datetime': self.Loader.Utils.get_datetime(), 'user': nickname, 'host': '*', 'vhost': '*'} exec_query = self.Base.db_execute_query(q_insert, mes_donnees) pass diff --git a/mods/defender/utils.py b/mods/defender/utils.py index 5c3d155..32fb911 100644 --- a/mods/defender/utils.py +++ b/mods/defender/utils.py @@ -383,14 +383,11 @@ def action_apply_reputation_santions(uplink: 'Defender') -> None: color_red = gconfig.COLORS.red nogc = gconfig.COLORS.nogc salon_jail = gconfig.SALON_JAIL - - if reputation_flag == 0: - return None - elif reputation_timer == 0: - return None - uid_to_clean = [] + if reputation_flag == 0 or reputation_timer == 0: + return None + for user in irc.Reputation.UID_REPUTATION_DB: if not user.isWebirc: # Si il ne vient pas de WebIRC if irc.User.get_user_uptime_in_minutes(user.uid) >= reputation_timer and int(user.score_connexion) <= int(reputation_seuil): diff --git a/version.json b/version.json index bc371e8..b0b4b2f 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "6.3.0", + "version": "6.3.2", "requests": "2.32.3", "psutil": "6.0.0", @@ -7,4 +7,4 @@ "sqlalchemy": "2.0.35", "faker": "30.1.0", "pyyaml": "6.0.2" -} \ No newline at end of file +}