fix(docs): correct GitHub storage configuration (#119)

Co-authored-by: Innei <tukon479@gmail.com>
This commit is contained in:
Whitewater
2025-10-20 17:21:23 +08:00
committed by GitHub
parent c4448cef1e
commit 2ffcb5d04f
4 changed files with 28 additions and 44 deletions

View File

@@ -95,10 +95,10 @@ export type GitHubConfig = {
export type LocalConfig = {
provider: 'local'
basePath: string
baseUrl?: string
excludeRegex?: string
maxFileLimit?: number
basePath: string // 本地照片存储的基础路径
baseUrl?: string // 用于生成公共 URL 的基础 URL可选
excludeRegex?: string // 排除文件的正则表达式
maxFileLimit?: number // 最大文件数量限制
}
export type EagleRule =

View File

@@ -40,14 +40,12 @@ const s3Config: StorageConfig = {
```typescript
const githubConfig: StorageConfig = {
provider: 'github',
github: {
owner: 'your-username', // GitHub 用户名或组织名
repo: 'photo-gallery', // 仓库名称
branch: 'main', // 分支名称(可选,默认 'main'
token: 'ghp_xxxxxxxxxxxx', // GitHub 访问令牌(可选)
path: 'photos', // 照片存储路径(可选
useRawUrl: true, // 使用 raw.githubusercontent.com默认 true
},
owner: 'your-username', // GitHub 用户名或组织名
repo: 'photo-gallery', // 仓库名称
branch: 'main', // 分支名称(可选,默认 'main'
token: 'ghp_xxxxxxxxxxxx', // GitHub 访问令牌(可选
path: 'photos', // 照片存储路径(可选)
useRawUrl: true, // 使用 raw.githubusercontent.com默认 true
}
```
@@ -79,14 +77,12 @@ const githubConfig: StorageConfig = {
...defaultBuilderConfig,
storage: {
provider: 'github',
github: {
owner: 'your-username',
repo: 'photo-gallery',
branch: 'main',
token: process.env.GITHUB_TOKEN,
path: 'photos',
useRawUrl: true,
},
owner: 'your-username',
repo: 'photo-gallery',
branch: 'main',
token: process.env.GITHUB_TOKEN,
path: 'photos',
useRawUrl: true,
},
}
```
@@ -98,13 +94,11 @@ import { GitHubStorageProvider } from '@/core/storage'
const githubProvider = new GitHubStorageProvider({
provider: 'github',
github: {
owner: 'octocat',
repo: 'Hello-World',
branch: 'main',
token: 'your-token',
path: 'images',
},
owner: 'octocat',
repo: 'Hello-World',
branch: 'main',
token: 'your-token',
path: 'images',
})
// 获取文件

View File

@@ -5,15 +5,7 @@ import { fileURLToPath } from 'node:url'
import { SUPPORTED_FORMATS } from '../../constants/index.js'
import { logger } from '../../logger/index.js'
import type { StorageObject, StorageProvider } from '../interfaces'
export interface LocalConfig {
provider: 'local'
basePath: string // 本地照片存储的基础路径
baseUrl?: string // 用于生成公共 URL 的基础 URL可选
excludeRegex?: string // 排除文件的正则表达式
maxFileLimit?: number // 最大文件数量限制
}
import type { LocalConfig, StorageObject, StorageProvider } from '../interfaces'
export interface ScanProgress {
currentPath: string

View File

@@ -2,7 +2,7 @@
title: Storage providers
description: Afilmory can work with multiple storage providers, including S3, Git, Eagle, and local file system
createdAt: 2025-08-12T15:09:08+08:00
lastModified: 2025-10-20T01:42:38+08:00
lastModified: 2025-10-19T14:03:13+08:00
---
# Storage Providers
@@ -54,13 +54,11 @@ GitHub storage leverages Git repositories for photo storage, ideal for static si
{
"storage": {
"provider": "github",
"github": {
"owner": "your-username",
"repo": "photo-storage",
"branch": "main",
"path": "photos",
"useRawUrl": true
}
"owner": "your-username",
"repo": "photo-storage",
"branch": "main",
"path": "photos",
"useRawUrl": true
}
}
```