📁 File Manager Pro
v10.0.2 | PHP: 8.1.34
Server: LiteSpeed
2026-06-29 11:10:41
📂
/
/
opt
/
imunify360
/
venv
/
lib
/
python3.11
/
site-packages
/
defence360agent
/
subsys
/
panels
/
plesk
/
__pycache__
✏️
Editing: upgrade_urls.cpython-311.opt-1.pyc
� �j � � � d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ej e� � Z ed� � Z ed� � ZdZd Zd ee fd�Zd efd�ZdS ) a* Fetch Plesk buyUrl/upgradeLicenseUrl via extension context. Plesk resellers configure buyUrl through pm_Context, which is only accessible from within the Plesk extension runtime. This module dynamically creates a PHP script, runs it via ``plesk bin extension --exec``, and parses the JSON output. � N)�Path)�Optional)�is_plesk_installedz%/var/imunify360/plesk-ext-marketplacez4/usr/local/psa/admin/plib/modules/imunify360/scriptszget-upgrade-urls.phpz�<?php echo json_encode([ 'buyUrl' => pm_Context::getBuyUrl(), 'upgradeLicenseUrl' => pm_Context::getUpgradeLicenseUrl(), ]); �returnc �H � t t z } | � t � � | � d� � t j dddddt gdd� � � }|j d k rYt � d|j |j dd � � � | � d�� � dS # t $ r Y dS w xY wt j |j � � | � d�� � S # t $ r Y S w xY w# t t j t j f$ rN}t � d|� � Y d}~ | � d�� � dS # t $ r Y dS w xY wd}~ww xY w# | � d�� � w # t $ r Y w w xY wxY w)zBCreate a temporary PHP script, execute it, and return parsed JSON.i� �plesk�bin� extensionz--exec� imunify360T� )�capture_output�timeoutr z)plesk extension --exec failed (rc=%d): %sNi� )� missing_okz&Failed to fetch Plesk upgrade URLs: %s)�PLESK_EXT_SCRIPTS_DIR�_SCRIPT_NAME� write_text�_SCRIPT_CONTENT�chmod� subprocess�run� returncode�logger�warning�stderr�unlink�OSError�json�loads�stdout�TimeoutExpired�JSONDecodeError)�script_path�result�excs �e/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/subsys/panels/plesk/upgrade_urls.py�_run_plesk_scriptr&