fix(admin): align UTM notes and block obsolete chb publication
deploy-preland / deploy zoomstage.online (push) Successful in 54s

This commit is contained in:
Panfilov Konstantin committed 2026-10-25 23:16:35 +03:00
1 parent f2097d4800
commit 84f70b1c71
14 files changed
+93 -29

No files matched your search

+6
View File
@@ -32,6 +32,12 @@ final class Remote
ksort($hashes);return hash('sha256',json_encode($hashes,JSON_THROW_ON_ERROR));
}
public static function execute(array $p): array {
// Этот обработчик исполняется отдельно по SSH, без автозагрузки Config.
// Отказ до любых приватных каталогов, recovery, резервов и temp-файлов.
if(($p['op']??null)==='write'&&is_string($p['content']??null)){
$candidate=json_decode($p['content']);
if($candidate instanceof \stdClass&&($candidate->utm??null) instanceof \stdClass&&property_exists($candidate->utm,'chb'))return ['ok'=>false,'error'=>'Устаревший ключ utm.chb нельзя записывать. Явно удалите его перед сохранением; восстановление такого архива запрещено.'];
}
$root=$p['root'];
if (!is_string($root)||!str_starts_with($root,'/')||str_contains($root,'..')||str_contains($root,'\\')||realpath($root)!==$root||is_link($root)) return ['ok'=>false,'error'=>'Небезопасный корневой путь.'];
$private=$p['local_private']??dirname($root).'/.preland-admin-'.substr(hash('sha256',$root),0,16);