Server IP : 66.29.132.122 / Your IP : 18.189.185.62 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/migrations/ |
Upload File : |
import logging import os import shutil from defence360agent.utils import OsReleaseInfo logger = logging.getLogger(__name__) _DEBIAN_NEW_MODSEC_DISABLE_FILENAME = ( "/etc/apache2/conf/plesk.conf.d/i360_modsec_disable.conf" ) _DEBIAN_OLD_MODSEC_DISABLE_FILENAME = ( "/etc/apache2/conf/plesk.conf.d/vhosts/i360_modsec_disable.conf" ) _NEW_MODSEC_DISABLE_FILENAME = ( "/etc/httpd/conf/plesk.conf.d/i360_modsec_disable.conf" ) _OLD_MODSEC_DISABLE_FILENAME = ( "/etc/httpd/conf/plesk.conf.d/vhosts/i360_modsec_disable.conf" ) def migrate(migrator, database, fake=False, **kwargs): if fake: return if OsReleaseInfo.id_like() & OsReleaseInfo.DEBIAN: old_file_name = _DEBIAN_OLD_MODSEC_DISABLE_FILENAME new_file_name = _DEBIAN_NEW_MODSEC_DISABLE_FILENAME else: old_file_name = _OLD_MODSEC_DISABLE_FILENAME new_file_name = _NEW_MODSEC_DISABLE_FILENAME if os.path.exists(old_file_name): try: shutil.move(old_file_name, new_file_name) except Exception as e: logger.exception("Failed move %s", old_file_name) def rollback(migrator, database, fake=False, **kwargs): pass