Point botconfig and botlogs to data/ subdirectory

Matches bashyBot's new data/ layout for safe www-data write access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-05-26 17:19:17 +03:00
parent 796bc15302
commit 3d7b620b6c
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@ $project = $stmt->fetch();
if (!$project) { http_response_code(404); echo json_encode(['error' => 'Project not found']); exit; } if (!$project) { http_response_code(404); echo json_encode(['error' => 'Project not found']); exit; }
$base = realpath($project['path']); $base = realpath($project['path']);
$config_path = $base . '/config.json'; $config_path = $base . '/data/config.json';
if (!$base || !is_dir($base)) { if (!$base || !is_dir($base)) {
echo json_encode(['error' => 'Project path not accessible']); exit; echo json_encode(['error' => 'Project path not accessible']); exit;

View file

@ -12,7 +12,7 @@ if (!$project) { http_response_code(404); echo json_encode(['error' => 'Project
$psStmt = $db->prepare('SELECT value FROM project_settings WHERE project_id = ? AND key = ?'); $psStmt = $db->prepare('SELECT value FROM project_settings WHERE project_id = ? AND key = ?');
$psStmt->execute([$pid, 'bot_log_file']); $psStmt->execute([$pid, 'bot_log_file']);
$row = $psStmt->fetch(); $row = $psStmt->fetch();
$rel = $row ? $row['value'] : 'logs/bashybot.log'; $rel = $row ? $row['value'] : 'data/bashybot.log';
$base = realpath($project['path']); $base = realpath($project['path']);
$logPath = realpath($base . '/' . ltrim($rel, '/')); $logPath = realpath($base . '/' . ltrim($rel, '/'));