관리-도구
편집 파일: sentry.cpython-311.opt-1.pyc
� IMgd � � � d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl Z ddlZdZdZ dZd Zd ZdZdZ ed � � ZdZdefd�Zdefd�Zde e defd�Zdedefd�Zdedefd�Zd� Zd� Zdefd�Zd� Zd� ZdS )z2Helper for integrate sentry in stand-alone scripts� N)�suppress)�Path)�List� imunify360zimunify-antiviruszimunify360-firewallz/var/imunify360/license.jsonz!/var/imunify360/license-free.json� IMUNIFYAV�UNKNOWNz,/opt/imunify360/venv/share/imunify360/sentryzQhttps://6de77a2763bd40c58fc9e3a89285aaa8@im360.sentry.cloudlinux.com/3?timeout=20�returnc � � t � d�� � � � � S # t t f$ r t cY S w xY w)z,Return dsn from the file or the default one.�ascii)�encoding)�SENTRY_DSN_PATH� read_text�strip�OSError�UnicodeDecodeError�SENTRY_DSN_DEFAULT� � �K/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/sentry.py�get_sentry_dsnr sW � �"��(�(�'�(�:�:�@�@�B�B�B���'�(� "� "� "�!�!�!�!�"���s �,/ �A � A c � � t t � � 5 t t fD ]�} t t � � 5 t | � � 5 }t j |� � d cd d d � � cd d d � � c cd d d � � S # 1 swxY w Y d d d � � n# 1 swxY w Y �� d d d � � n# 1 swxY w Y t S )N�id) r � Exception�LICENSE�LICENSE_FREE�FileNotFoundError�open�json�load� UNKNOWN_ID)�filename�files r � get_server_idr# s� � � �)� � � -� -� �,�/� -� -�H��+�,�,� -� -�d�8�n�n� -���y����t�,� -� -� -� -� -� -� -� -� -� -� -� -� -� -� -� -�-� -� -� -� -� -� -� -� -� -� -� -���� -� -� -� -� -� -� -� -� -� -� -� -� -� -� -���� -� -� -� -�� -�-� -� -� -� -� -� -� -� -� -� -���� -� -� -� -� �s^ �%B;�B"� B �$B"�0B;�B �B"�B �B"�B;�"B&�&B;�)B&�*B;�;B?�B?�cmdc �� � t j | t j t j t j �� � }n# t $ r Y dS w xY w|j dk rdS t j |j � � S )N)�stdin�stdout�stderr� r ) � subprocess�run�DEVNULL�PIPEr � returncode�os�fsdecoder'