VvvebJs / README-DEPLOY.md
CatPtain's picture
Upload 10 files
676a3be verified

VvvebJs - Hugging Face Deployment Guide

Environment Variables Configuration

Configure these environment variables in your Hugging Face Space settings:

Authentication (Required)

USER_1_NAME=admin
USER_1_PASSWORD=your_secure_password
USER_2_NAME=editor
USER_2_PASSWORD=another_secure_password

Add more users by incrementing the number (USER_3_NAME, USER_3_PASSWORD, etc.)

Storage Configuration

STORAGE_TYPE=github
# Options: 'github', 'kv', 'both'

GitHub Storage (Recommended)

GITHUB_TOKEN=ghp_your_github_token
GITHUB_OWNER=your_username
GITHUB_REPO=your_repo_name
GITHUB_BRANCH=main
GITHUB_PATH=pages/

EdgeOne KV Storage (Optional)

EDGEONE_KV_API_KEY=your_api_key
EDGEONE_KV_SECRET_KEY=your_secret_key
EDGEONE_KV_ZONE_ID=your_zone_id
EDGEONE_KV_NAMESPACE=vvvebjs
EDGEONE_KV_ENDPOINT=https://edgeone.tencentcloudapi.com

Setup Instructions

  1. Create a new Hugging Face Space with Docker
  2. Upload this repository
  3. Configure environment variables in Space Settings
  4. Deploy and access via Basic Authentication

Features

  • ✅ Docker deployment on Hugging Face
  • ✅ GitHub repository as permanent storage
  • ✅ EdgeOne KV storage support
  • ✅ Multi-user authentication via environment variables
  • ✅ Automatic fallback to local storage
  • ✅ Dual storage support (GitHub + KV)

Usage

  1. Access your Space URL
  2. Enter username/password (configured in environment variables)
  3. Create and edit pages using the visual editor
  4. Pages are automatically saved to external storage

🔧 紧急修复:GitHub 用户名配置错误

问题诊断

  • ✅ GitHub Token 验证成功
  • ❌ 仓库访问失败 (HTTP 404)
  • 原因: GITHUB_OWNER 配置错误

当前配置问题

GITHUB_OWNER=CaPaCatptain  # ❌ 错误 - 中间是 "Cat"

正确配置

GITHUB_OWNER=CaPaCaptain   # ✅ 正确 - 中间是 "Capt"

立即修复步骤

  1. 在 Hugging Face Space Settings 中更新环境变量

    GITHUB_OWNER=CaPaCaptain
    
  2. 重启 Space

    • 修改环境变量后
    • Space 会自动重启
    • 等待 1-2 分钟
  3. 重新测试

    • 访问高级诊断页面
    • 运行完整诊断
    • 应该会看到所有测试通过 ✅

验证步骤

修复后,诊断结果应该显示:

  • ✅ GitHub Token 验证:有效
  • ✅ 仓库访问检查:可访问
  • ✅ 分支检查:分支存在
  • ✅ 文件创建权限测试:可以创建文件

仓库信息确认

  • 正确的仓库 URL: https://github.com/CaPaCaptain/VvvebJs_huggingface_db_01
  • 用户名: CaPaCaptain (注意大小写)
  • 仓库名: VvvebJs_huggingface_db_01

注意: 这个错误很容易被忽略,因为差异很小(Cat vs Capt),但 GitHub API 对大小写和拼写非常敏感。