move conf templates and conf_populate to Deployment/; add rogue-prevention rules to CLAUDE.md

This commit is contained in:
Gmer4Lfe
2026-06-14 13:18:08 -04:00
parent 722e688783
commit 6153283de4
11 changed files with 38 additions and 13 deletions
+3 -3
View File
@@ -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';