Documentation
¶
Index ¶
- func BindingExternalAccount(c *gin.Context)
- func CreatePluginMarketSource(c *gin.Context)
- func CreateThemeMarketSource(c *gin.Context)
- func DeleteFavicon(c *gin.Context)
- func DeletePluginMarketSource(c *gin.Context)
- func DeleteTheme(c *gin.Context)
- func DeleteThemeMarketSource(c *gin.Context)
- func Disable2FA(c *gin.Context)
- func DownloadBackup(c *gin.Context)
- func DownloadMarketURL(rawURL string, maxSize int64) ([]byte, error)
- func Enable2FA(c *gin.Context)
- func Generate2FA(c *gin.Context)
- func ImportTheme(c *gin.Context)
- func InstallPluginFromMarket(c *gin.Context)
- func InstallThemeFromMarket(c *gin.Context)
- func IsSSRFProtectionEnabled() bool
- func ListPluginMarketCatalog(c *gin.Context)
- func ListPluginMarketSources(c *gin.Context)
- func ListThemeMarketCatalog(c *gin.Context)
- func ListThemeMarketSources(c *gin.Context)
- func ListThemes(c *gin.Context)
- func NewArchiveUploadHandler() *upload.Handler
- func Rebind2FA(c *gin.Context)
- func RegisterPprofRoutes(group *gin.RouterGroup)
- func ServePluginFile(c *gin.Context)
- func SetTheme(c *gin.Context)
- func UnbindExternalAccount(c *gin.Context)
- func UpdateMmdbGeoIP(c *gin.Context)
- func UpdatePluginMarketSource(c *gin.Context)
- func UpdateTheme(c *gin.Context)
- func UpdateThemeMarketSource(c *gin.Context)
- func UpdateThemeSettings(c *gin.Context)
- func UpdateUser(c *gin.Context)
- func UploadFavicon(c *gin.Context)
- type PluginMarketPlugin
- type PluginMarketSource
- type ThemeMarketSource
- type ThemeMarketTheme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindingExternalAccount ¶
func CreateThemeMarketSource ¶
func DeleteFavicon ¶
func DeleteThemeMarketSource ¶
func Disable2FA ¶
func DownloadBackup ¶
DownloadBackup 使用白名单打包 ./data 及数据库文件为 zip 并下载, 同时归档到 ./data/backup/ 确保 Docker 挂载后备份文件可持久化。
归档文件由前端后续统一管理,服务端只负责生成并保存。
func DownloadMarketURL ¶
DownloadMarketURL performs a market download. When SSRF protection is enabled, URLs resolving to private or internal addresses are rejected (including on every redirect hop); when disabled, downloads proceed without address filtering.
func Generate2FA ¶
func ImportTheme ¶
ImportTheme 导入远程主题 支持preview查询参数:preview=true时仅返回主题信息,否则下载安装 请求body: {"url": "https://..."} URL支持GitHub仓库地址(自动取latest release)和直接ZIP下载链接
func InstallPluginFromMarket ¶
func InstallThemeFromMarket ¶
func IsSSRFProtectionEnabled ¶
func IsSSRFProtectionEnabled() bool
IsSSRFProtectionEnabled reports whether SSRF protection is enabled for market downloads. An unreadable setting is treated as enabled so callers using this status helper fail closed.
func ListPluginMarketCatalog ¶
func ListPluginMarketSources ¶
func ListThemeMarketCatalog ¶
func ListThemeMarketSources ¶
func NewArchiveUploadHandler ¶
func Rebind2FA ¶ added in v0.1.14
Rebind2FA starts a replacement enrollment for an account that already has a factor. It is the recovery path for a lost authenticator: /2fa/disable requires a valid code, so without this the only way back in was the disable2FA command on the server. The account password is the step-up, and it is checked against the same buckets as login so a stolen session cannot use this endpoint to grind passwords for free. The current factor keeps working until the new code is verified, so a failed replacement leaves the account as it was.
func RegisterPprofRoutes ¶
func RegisterPprofRoutes(group *gin.RouterGroup)
RegisterPprofRoutes adds diagnostic endpoints to an already administrator- protected route group. It deliberately uses runtime/pprof directly instead of net/http/pprof, which would register unauthenticated /debug/pprof routes on http.DefaultServeMux as a package side effect.
func ServePluginFile ¶
ServePluginFile serves a static file from an installed plugin directory, used by injected plugin admin pages.
func UnbindExternalAccount ¶
func UpdateMmdbGeoIP ¶
func UpdateTheme ¶
UpdateTheme 更新主题 支持四种更新方式: 1. 使用主题原有URL下载更新 2. 提供新的直接下载URL进行更新 3. 提供GitHub仓库信息,从最新release下载更新 4. 如果主题URL是GitHub仓库地址,自动获取最新release
func UpdateThemeMarketSource ¶
func UpdateThemeSettings ¶
func UpdateUser ¶
func UploadFavicon ¶
Types ¶
type PluginMarketPlugin ¶
type PluginMarketPlugin struct {
Name any `json:"name"`
Short string `json:"short"`
Description any `json:"description"`
Version string `json:"version"`
Author any `json:"author"`
URL string `json:"url"`
Download string `json:"download"`
SHA256 string `json:"sha256"`
Komari string `json:"komari"`
Installable bool `json:"installable"`
SourceID string `json:"source_id,omitempty"`
SourceName string `json:"source_name,omitempty"`
}
type PluginMarketSource ¶
type ThemeMarketSource ¶
type ThemeMarketTheme ¶
type ThemeMarketTheme struct {
Name any `json:"name"`
Short string `json:"short"`
Description any `json:"description"`
Version string `json:"version"`
Author any `json:"author"`
URL string `json:"url"`
Preview string `json:"preview"`
Download string `json:"download"`
SHA256 string `json:"sha256"`
Installable bool `json:"installable"`
SourceID string `json:"source_id,omitempty"`
SourceName string `json:"source_name,omitempty"`
}