From 3d7b620b6c79f1b09082ec9ef4f6f1efa9fbf766 Mon Sep 17 00:00:00 2001 From: Bashy Date: Tue, 26 May 2026 17:19:17 +0300 Subject: [PATCH] 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 --- web/api/botconfig.php | 2 +- web/api/botlogs.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/api/botconfig.php b/web/api/botconfig.php index f097b38..4496972 100644 --- a/web/api/botconfig.php +++ b/web/api/botconfig.php @@ -12,7 +12,7 @@ $project = $stmt->fetch(); if (!$project) { http_response_code(404); echo json_encode(['error' => 'Project not found']); exit; } $base = realpath($project['path']); -$config_path = $base . '/config.json'; +$config_path = $base . '/data/config.json'; if (!$base || !is_dir($base)) { echo json_encode(['error' => 'Project path not accessible']); exit; diff --git a/web/api/botlogs.php b/web/api/botlogs.php index b85b2b1..146b5b5 100644 --- a/web/api/botlogs.php +++ b/web/api/botlogs.php @@ -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->execute([$pid, 'bot_log_file']); $row = $psStmt->fetch(); -$rel = $row ? $row['value'] : 'logs/bashybot.log'; +$rel = $row ? $row['value'] : 'data/bashybot.log'; $base = realpath($project['path']); $logPath = realpath($base . '/' . ltrim($rel, '/'));