Some checks failed
Build and Release / Create Release (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 2m28s
Build and Release / Unit Tests (push) Successful in 2m31s
Build and Release / Lint (push) Failing after 2m57s
Build and Release / Build Binaries (amd64, darwin) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin) (push) Has been skipped
Build and Release / Build Binaries (arm64, linux) (push) Has been skipped
- New files: Copyright 2026 MarketAlly - Modified files: Copyright YYYY The Gitea Authors and MarketAlly 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
// Copyright 2023 The Gitea Authors and MarketAlly. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package setting
|
|
|
|
import (
|
|
"net/url"
|
|
"path"
|
|
|
|
"code.gitea.io/gitea/modules/log"
|
|
)
|
|
|
|
// API settings
|
|
var API = struct {
|
|
EnableSwagger bool
|
|
SwaggerURL string
|
|
MaxResponseItems int
|
|
DefaultPagingNum int
|
|
DefaultGitTreesPerPage int
|
|
DefaultMaxBlobSize int64
|
|
DefaultMaxResponseSize int64
|
|
RateLimitEnabled bool
|
|
RateLimitPerHour int
|
|
}{
|
|
EnableSwagger: true,
|
|
SwaggerURL: "",
|
|
MaxResponseItems: 50,
|
|
DefaultPagingNum: 30,
|
|
DefaultGitTreesPerPage: 1000,
|
|
DefaultMaxBlobSize: 10485760,
|
|
DefaultMaxResponseSize: 104857600,
|
|
RateLimitEnabled: false,
|
|
RateLimitPerHour: 5000,
|
|
}
|
|
|
|
func loadAPIFrom(rootCfg ConfigProvider) {
|
|
mustMapSetting(rootCfg, "api", &API)
|
|
|
|
defaultAppURL := string(Protocol) + "://" + Domain + ":" + HTTPPort
|
|
u, err := url.Parse(rootCfg.Section("server").Key("ROOT_URL").MustString(defaultAppURL))
|
|
if err != nil {
|
|
log.Fatal("Invalid ROOT_URL '%s': %s", AppURL, err)
|
|
}
|
|
u.Path = path.Join(u.Path, "api", "swagger")
|
|
API.SwaggerURL = u.String()
|
|
}
|