move conf templates and conf_populate to Deployment/; add rogue-prevention rules to CLAUDE.md
This commit is contained in:
@@ -55,7 +55,7 @@ if ($action === 'ssh_generate') {
|
||||
|
||||
// ── POST: run conf_populate.sh ─────────────────────────────────────────────────────────────────
|
||||
if ($action === 'populate') {
|
||||
$script = SCRIPTS_DIR . '/Plugin/unraid/Tools/conf_populate.sh';
|
||||
$script = DEPLOY_DIR . '/conf_populate.sh';
|
||||
if (!file_exists($script)) {
|
||||
echo json_encode(['ok' => false, 'error' => 'conf_populate.sh not found']);
|
||||
exit;
|
||||
@@ -137,7 +137,7 @@ if ($action === 'pull') {
|
||||
// Create host conf from template if it doesn't exist
|
||||
$confFile = $hostIdLow . '.conf';
|
||||
if (!file_exists(CONF_DIR . '/' . $confFile)) {
|
||||
$template = @file_get_contents(CONF_DIR . '/host.conf.template') ?: '';
|
||||
$template = @file_get_contents(DEPLOY_DIR . '/host.conf.template') ?: '';
|
||||
if ($template) {
|
||||
$bootPart2 = trim(shell_exec('findmnt -n -o SOURCE /boot 2>/dev/null') ?: '');
|
||||
$bootDisk2 = $bootPart2 ? trim(shell_exec('lsblk -no pkname ' . escapeshellarg($bootPart2) . ' 2>/dev/null') ?: '') : '';
|
||||
@@ -229,7 +229,7 @@ if ($smParam === 'flash') {
|
||||
}
|
||||
|
||||
if (!file_exists(CONF_DIR . '/' . $confFile)) {
|
||||
$template = @file_get_contents(CONF_DIR . '/host.conf.template') ?: '';
|
||||
$template = @file_get_contents(DEPLOY_DIR . '/host.conf.template') ?: '';
|
||||
if ($template) {
|
||||
$sshOwner = strtolower(preg_replace('/^unraid-/i', '', $myHostname));
|
||||
$sshKeyPath = '/root/.ssh/' . $sshOwner . '_rsync_automation';
|
||||
|
||||
Reference in New Issue
Block a user