403Webshell
Server IP : 66.29.132.122  /  Your IP : 3.12.161.29
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/migrations//051_cleanup_vd_license.py
import json
import logging
from contextlib import suppress

logger = logging.getLogger(__name__)


class VirusdieLicense:
    CONFIG_FILE = "/usr/local/vdserver/config.json"

    def unregister(self):
        self._write_key("")

    def _write_key(self, key):
        with open(self.CONFIG_FILE) as read_file:
            content = json.load(read_file)

        content["vdbApiKey"] = key

        with open(self.CONFIG_FILE, "w") as write_file:
            json.dump(
                content,
                write_file,
                sort_keys=True,
                indent=2,
                separators=(",", ": "),
            )


def migrate(migrator, database, fake=False, **kwargs):
    """Write your migrations here."""

    with suppress(FileNotFoundError):
        VirusdieLicense().unregister()


def rollback(migrator, database, fake=False, **kwargs):
    """Write your rollback migrations here."""
    pass

Youez - 2016 - github.com/yon3zu
LinuXploit