'error', 'title' => 'GitHub Token 未在Hugging Face Space中配置', 'message' => 'GITHUB_TOKEN 环境变量为空,请在Hugging Face Space的Settings中添加此私有密钥' ]; } } else { // 在本地环境中,检查.env文件配置 if (empty($github['token']) || $github['token'] === 'YOUR_ACTUAL_GITHUB_TOKEN') { $issues[] = [ 'type' => 'error', 'title' => 'GitHub Token 未配置', 'message' => 'GITHUB_TOKEN 仍然是占位符或为空,需要设置真实的GitHub Token' ]; } } // 检查GitHub基本配置 if (empty($github['owner'])) { $issues[] = [ 'type' => 'error', 'title' => 'GitHub Owner 未配置', 'message' => 'GITHUB_OWNER 为空' ]; } if (empty($github['repo'])) { $issues[] = [ 'type' => 'error', 'title' => 'GitHub Repo 未配置', 'message' => 'GITHUB_REPO 为空' ]; } return $issues; } $configIssues = checkConfig(); ?>
= htmlspecialchars($issue['message']) ?>
.env 文件中将 GITHUB_TOKEN=YOUR_ACTUAL_GITHUB_TOKEN 替换为 GITHUB_TOKEN=你的真实Token基本配置项都已正确设置。
存储类型: = htmlspecialchars($storageType) ?>
Token:
Owner: = htmlspecialchars($github['owner']) ?>
Repo: = htmlspecialchars($github['repo']) ?>
Branch: = htmlspecialchars($github['branch']) ?>
Path: = htmlspecialchars($github['path']) ?>
API Key: = !empty($kv['api_key']) ? '✅ ' . substr($kv['api_key'], 0, 8) . '...' : '❌ 未设置' ?>
Secret Key: = !empty($kv['secret_key']) ? '✅ ' . substr($kv['secret_key'], 0, 8) . '...' : '❌ 未设置' ?>
Zone ID: = htmlspecialchars($kv['zone_id']) ?>
Namespace: = htmlspecialchars($kv['namespace']) ?>
Endpoint: = htmlspecialchars($kv['endpoint']) ?>
当前用户: = htmlspecialchars(StorageConfig::getCurrentUser()) ?>
用户路径: = htmlspecialchars(StorageConfig::getUserPath()) ?>
.env 文件: = file_exists(__DIR__ . '/.env') ? '✅ 存在' : '❌ 不存在' ?>
.env.example 文件: = file_exists(__DIR__ . '/.env.example') ? '✅ 存在' : '⚠️ 不存在' ?>
请从 .env.example 复制创建 .env 文件:
copy .env.example .env