Sid Gifari From Gifari Industries - BD Cyber Security Team
Home
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
clselector
/
__pycache__
/
✏️
Editing: bun_delivery_hook.cpython-311.pyc
� ���j�E � � � d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z ddl mZmZ ddl mZ ddlmZ ej ZdZd Zd ZdZdZd Z ej d� � ZdZdZdZdZdZdZ dZ!dZ"dZ# e$� � Z%dZ& G d� de$� � Z'efd�Z(efd�Z)d� Z*d'd�Z+dZ,dZ-dZ.d(d�Z/ d)d!�Z0d"� Z1e d#� � � Z2d$� Z3d%� Z4d*d&�Z5dS )+a� Root-side orchestration of the install-time delivery. Design: docs/design/nodejs-bun-delivery.md. Same shape as the pnpm delivery hook: `cloudlinux-selector install-modules --user <u>` is invoked by the panel as root and would normally re-exec the whole selector inside the account's CageFS. The delivery replaces that single descent with three steps driven from the root side that is already there: 1. cagefs_enter_user -> bun_user_phase resolve (user, no package code) 2. root -> cloudlinux-bun-delivery (stage as root; rebuild through CageFS as user; commit or roll back) There is no user->root bridge: inside a cage there is not even a sudo binary. A qualifying enabled request reports a failed delivery if any phase fails; it does not silently proceed with the ordinary npm path. � N)�contextmanager)�_terminate_process_group�run_process_in_cagefs)�clselectctlnodejsuser� )�node_modules_storagez/opt/cl-bun/bunz-/usr/share/l.v.e-manager/utils/bun_user_phasez9/usr/share/l.v.e-manager/utils/cloudlinux-bun-delivery.pyz/usr/sbin/cloudlinux-selector�x i� z^[0-9]{1,3}$� z!cl-bun:unsupported-npm-shrinkwrapzcl-bun:unsupported-manifest)�patchedDependencies� workspaces�symlinkzcl-bun:legacy-package-lock-v1zcl-bun:no-dependencieszPShared node_modules Store unavailable: cannot determine Node.js Selector supportc � � e Zd Zd� Zd� ZeZdS )�_UserPhaseResultc �0 � || _ || _ || _ d S �N)�failed� returncode�output)�selfr r r s �S/opt/cloudlinux/venv/lib64/python3.11/site-packages/clselector/bun_delivery_hook.py�__init__z_UserPhaseResult.__init__F s � ����$�������� c � � | j S r )r )r s r �__bool__z_UserPhaseResult.__bool__K s � ��;��r N)�__name__� __module__�__qualname__r r �__nonzero__� r r r r E s3 � � � � � �� � � � � � �K�K�Kr r c �` � t j | � � }|d ot j � � S )zBThe global administrator switch fails closed on bad configuration.�enabled)r �read_config�nodejs_selector_supported)�config_path�configs r � is_enabledr&