fix(admin): align UTM notes and block obsolete chb publication
deploy-preland / deploy zoomstage.online (push) Successful in 54s
deploy-preland / deploy zoomstage.online (push) Successful in 54s
This commit is contained in:
1 parent
f2097d4800
commit
84f70b1c71
14 files changed
+93
-29
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user