h/ dZddlmZddlZddlmZmZddlmZddl m Z m Z ddlm Z m Z ddlmZmZdd lmZdd lmZdd lmZdd lmZed ejZeeZGddeZdS)u  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.  If not, see . Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see ) getLoggerN) MessageSinkScope) LicenseCLN) hosting_panelcpanel)CLNCLNError)RecurringCheckStoprecurring_check) check_lock)DAY)register_lock_file) MalwareTuneim360_registerc\eZdZdZejZdZdZe e de e dZ dS)Imunify360RegisterziThis plugin is used to register the server by IP and should work only for cPanel and ImunifyAV cases.c2K||_tjrtddSt jjtj jkr3|j | |_ dSd|_ dS)Nz0No upgrade flag file exists. Plugin will be noop) _looprNO_AUTO_UPGRADEloggerwarningr HostingPanelNAMErcPanel create_task _register_task)selfloops P/opt/imunify360/venv/lib/python3.11/site-packages/imav/plugins/im360_register.py create_sinkzImunify360Register.create_sink-s|  &  NNM N N N F  % ' ' , 0B B B//0@0@AADJJJDJJJchK|jr(|j|jd{VdSdS)N)rcancel)rs r!shutdownzImunify360Register.shutdown7sN :  J     *           r#T)check_period_firstcheck_lock_period lock_filecKtjs(tjddvrt  t jdd{VdS#tj$rt$rB}dt|j vr!t d|Yd}~dSYd}~dSd}~wt$r&}t d|Yd}~dSd}~wwxYw)N license_type) imunifyAVPlus imunify360IPLzIP license not foundz+CLN errror on attempt to register by ip: %sz&Error on attempt to register by ip: %r)ris_ip_license_type license_infogetr r registerasyncioCancelledErrorr strmessagererror Exception)res r!rzImunify360Register._register<sI  ( * * 'j.E.G.G.K.K / / ,/-/-%&& & F,u%% % % % % % % % % %%     O O O%S^^;; JANNNNNNNNN<;;;;; F F F LLA1 E E E E E E E E E Fs$ A))C21B?? C2 C--C2N)__name__ __module__ __qualname____doc__rAVSCOPEr"r&r r r LOCK_FILErr#r!rr's## HE _  F F  F F Fr#r)r=loggingrr3!defence360agent.contracts.pluginsrrdefence360agent.internals.clnrdefence360agent.subsys.panelsrrr r defence360agent.utilsr r defence360agent.utils.check_lockr defence360agent.utils.commonr'defence360agent.subsys.persistent_staterimav.contracts.configrr>r@r:rrrAr#r!rKsH*@@@@@@@@444444????????77777777EEEEEEEE777777,,,,,,FFFFFF------  / : : 8  (F(F(F(F(F(F(F(F(F(Fr#