-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,6 +210,14 @@ dashboard: | |
# 签名推送 JWT 时的 subject, 请将其设为 "mailto:<您的邮箱>" 或 "https://<您的域名>" | ||
notification-subject: mailto:[email protected] | ||
|
||
# Github API 客户端配置 | ||
github-api: | ||
# 更新检测间隔 | ||
update-check-interval: 1h0m0s | ||
# Github API 访问令牌, 绕过IP速率限制 | ||
# 请访问 <https://github.com/settings/tokens> 生成新的无权限令牌 | ||
authorization: Bearer ghp_xxxx | ||
|
||
# 数据库 | ||
database: | ||
# 数据库驱动, 可选值有: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ import ( | |
"regexp" | ||
"strconv" | ||
"strings" | ||
"time" | ||
|
||
"gopkg.in/yaml.v3" | ||
|
||
|
@@ -118,6 +119,11 @@ func (c *CacheConfig) UnmarshalYAML(n *yaml.Node) (err error) { | |
return nil | ||
} | ||
|
||
type GithubAPIConfig struct { | ||
UpdateCheckInterval utils.YAMLDuration `yaml:"update-check-interval"` | ||
Authorization string `yaml:"authorization"` | ||
} | ||
|
||
type DashboardConfig struct { | ||
Enable bool `yaml:"enable"` | ||
Username string `yaml:"username"` | ||
|
@@ -184,6 +190,7 @@ type Config struct { | |
Cache CacheConfig `yaml:"cache"` | ||
ServeLimit ServeLimitConfig `yaml:"serve-limit"` | ||
Dashboard DashboardConfig `yaml:"dashboard"` | ||
GithubAPI GithubAPIConfig `yaml:"github-api"` | ||
Database DatabaseConfig `yaml:"database"` | ||
Hijack HijackConfig `yaml:"hijack"` | ||
Storages []storage.StorageOption `yaml:"storages"` | ||
|
@@ -248,6 +255,10 @@ var defaultConfig = Config{ | |
NotifySubject: "mailto:[email protected]", | ||
}, | ||
|
||
GithubAPI: GithubAPIConfig{ | ||
UpdateCheckInterval: (utils.YAMLDuration)(time.Hour), | ||
}, | ||
|
||
Database: DatabaseConfig{ | ||
Driver: "sqlite", | ||
DSN: filepath.Join("data", "files.db"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,9 @@ dashboard: | |
pwa-short_name: GOBA Dash | ||
pwa-description: Go-Openbmclapi Internal Dashboard | ||
notification-subject: mailto:[email protected] | ||
github-api: | ||
update-check-interval: 1h0m0s | ||
authorization: "" | ||
database: | ||
driver: sqlite | ||
data-source-name: files.db | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters