§ À•¿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 ` 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&