Documentation
¶
Overview ¶
Package config loads and validates the gitbayd server configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
Enabled bool `toml:"enabled"`
}
API controls the HTTPS/JSON control-plane API (bearer tokens minted over SSH). Off by default: an instance that never enables it has no credential-bearing HTTP surface at all.
type Config ¶
type Config struct {
Server Server `toml:"server"`
SSH SSH `toml:"ssh"`
HTTP HTTP `toml:"http"`
GitDaemon GitDaemon `toml:"git_daemon"`
Web Web `toml:"web"`
Registration Registration `toml:"registration"`
API API `toml:"api"`
Webhooks Webhooks `toml:"webhooks"`
Pages Pages `toml:"pages"`
LFS LFS `toml:"lfs"`
Limits Limits `toml:"limits"`
Mail Mail `toml:"mail"`
Mirrors Mirrors `toml:"mirrors"`
// GoImport maps vanity Go module paths to repositories, e.g.
// "gitbay.org/gitbay" = "krz/gitbay". Requests carrying ?go-get=1
// under a mapped path get a go-import meta tag.
GoImport map[string]string `toml:"go_import"`
}
func Default ¶
func Default() Config
Default returns the configuration used when a key is absent from the file.
func Load ¶
Load reads path, applies defaults, and validates. It does not probe the host (see CheckHost) so it is safe in tests and on non-target machines.
func (Config) CheckHost ¶
CheckHost performs environment probes that only make sense on the target machine: port availability for the embedded listener and root existence.
func (Config) SiteHost ¶
SiteHost returns the bare hostname from site_url (no scheme, port, path).
type HTTP ¶
type HTTP struct {
Addr string `toml:"addr"`
TLS string `toml:"tls"` // acme | files | off
CertFile string `toml:"cert_file"`
KeyFile string `toml:"key_file"`
// ACME (Let's Encrypt by default). Certificates are cached under
// server.root/acme. acme_http_addr serves HTTP-01 challenges and
// redirects to HTTPS; "off" disables it (TLS-ALPN-01 on the HTTPS
// port still works).
ACMEEmail string `toml:"acme_email"`
ACMEHTTPAddr string `toml:"acme_http_addr"`
}
type LFS ¶ added in v0.4.0
LFS stores large-file objects content-addressed under Root (default <server.root>/lfs). MaxObjectBytes caps a single object; 0 means the 512MB default.
type Limits ¶
type Mail ¶
type Mirrors ¶ added in v0.2.0
type Mirrors struct {
PullIntervalMinutes int `toml:"pull_interval_minutes"`
}
type Pages ¶ added in v0.3.0
type Pages struct {
Domain string `toml:"domain"`
}
Pages serves each public repo's `pages` branch as a static site on <owner>.<domain> — a separate origin, so page-authored scripts never run on the forge's own host. Empty domain disables the feature.
type Registration ¶
type Registration struct {
Mode string `toml:"mode"` // closed | invite | open
}
type SSH ¶
type Web ¶
type Web struct {
Mode string `toml:"mode"` // view_only | accounts
PasswordAuth bool `toml:"password_auth"`
// Title is the instance's display name in the header and page titles.
// Empty falls back to the site host.
Title string `toml:"title"`
// PrivacyNotice is operator-provided text shown on /privacy under the
// fixed project-level statement. Plain text; blank paragraphs split.
PrivacyNotice string `toml:"privacy_notice"`
}
Source Files
¶
- config.go