config

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("invalid configuration")

Functions

This section is empty.

Types

type ArchiveLimits

type ArchiveLimits struct {
	MaxDownloadBytes, MaxExtractedBytes, MaxFileBytes int64
	MaxFiles, MaxPathBytes                            int
}

type Config

type Config struct {
	ListenAddress, ZoektURL, RepositoriesFile, SearchBackend string
	UserToken, AdminToken                                    string
	UserRepositories, AdminRepositories                      []string
	DatabaseURL                                              string
	GitHub                                                   GitHub
	Graph                                                    Graph
	Indexer                                                  Indexer
	UserInstallationID, AdminInstallationID                  int64
	UserRepositoryIDs, AdminRepositoryIDs                    []int64
	Limits                                                   Limits
	SSO                                                      SSO
	SCIM                                                     SCIM
	SupplyChain                                              SupplyChain
}

func Load

func Load() (Config, error)

type GitHub

type GitHub struct {
	WebURL, APIURL, UploadURL, GitURL, ArchiveURL string
	PrivateKeyFile, WebhookSecretFile             string
	APIVersion, CAFile                            string
	AppID                                         int64
}

type GitHubOAuth

type GitHubOAuth struct {
	Enabled          bool
	ClientID         string
	ClientSecretFile string
	// AccessSync provisions users on first sign-in and mirrors the repositories
	// they can reach through the configured GitHub App. It requires the OAuth
	// client to be that GitHub App's own OAuth credential.
	AccessSync bool
}

type Graph

type Graph struct {
	DefaultImpactDepth, MaxImpactDepth, DefaultTraceDepth int
	MaxTraceDepth, MaxRows, MaxNodes, MaxEdges            int
	MaxRequestBytes, MaxResponseBytes                     int64
	QueryLimits                                           GraphQueryLimits
}

type GraphQueryLimits

type GraphQueryLimits struct {
	PerCategory, DefaultImpactDepth, MaxDepth int
	DefaultTraceDepth, MaxTraceDepth, MaxRows int
	MaxNodes, MaxEdges, MaxFanout             int
}

type GraphScanLimits

type GraphScanLimits struct {
	MaxFileBytes, MaxTotalBytes  int64
	MaxFiles, MaxNodes, MaxEdges int
	ParseTimeout                 time.Duration
	SkipDirectories              []string
}

type Indexer

type Indexer struct {
	DatabaseURL, ZoektURL, MetricsListenAddress                     string
	GitHub                                                          GitHub
	DataDir, IndexDir, GitPath, ZoektIndex, ZoektGitIndex, WorkerID string
	ZoektGitIndexDeprecated                                         bool
	MinFreeBytes, MaxRepositoryBytes                                int64
	SourceProvider                                                  string
	ArchiveLimits                                                   ArchiveLimits
}

func LoadIndexer

func LoadIndexer() (Indexer, error)

type Limits

type Limits struct {
	DefaultResults, MaxResults              int
	DefaultContextLines, MaxContextLines    int
	DefaultTimeout, MaxTimeout              time.Duration
	MaxRequestBytes, MaxResponseBytes       int64
	SCIPMaxUploadBytes, GraphMaxUploadBytes int64
}

type MCPOAuth

type MCPOAuth struct {
	Enabled bool
	KeyFile string
}

MCPOAuth turns GraphNest into an OAuth 2.1 authorization server for MCP clients: they sign in through the browser provider and receive short-lived access tokens for /mcp. KeyFile holds the 32-byte key that seals the GitHub token kept for refresh-time access sync; it is required only when GitHub access sync is enabled.

type OAuth

type OAuth struct{ GitHub GitHubOAuth }

type OIDC

type OIDC struct {
	Enabled          bool
	IssuerURL        string
	ClientID         string
	ClientSecretFile string
	CAFile           string
	Scopes           []string
	LinkClaim        string
	DisplayNameClaim string
}

type SCIM

type SCIM struct {
	Enabled   bool
	TokenFile string
	PublicURL *url.URL
}

type SSO

type SSO struct {
	PublicURL    *url.URL
	SessionIdle  time.Duration
	SessionTTL   time.Duration
	LoginFlowTTL time.Duration
	BreakGlass   bool
	OIDC         OIDC
	OAuth        OAuth
	MCPOAuth     MCPOAuth
}

type Scanner

type Scanner struct {
	DatabaseURL, DataDir, GitPath, WorkerID, MetricsListenAddress string
	GitHub                                                        GitHub
	Limits                                                        GraphScanLimits
	MinFreeBytes, MaxRepositoryBytes                              int64
	ScanTimeout                                                   time.Duration
}

func LoadScanner

func LoadScanner() (Scanner, error)

type SupplyChain added in v0.6.0

type SupplyChain struct {
	Enabled          bool
	Interval         time.Duration
	Workers          int
	MaxDocumentBytes int64
	MaxComponents    int
	// RetainSnapshots is how many snapshots per repository stream are kept
	// beyond those referenced by reviews; 0 disables pruning.
	RetainSnapshots int
}

SupplyChain configures the Dependencies & Licenses module (ADR-0017). It is disabled by default and requires durable mode: collection needs the GitHub App and the PostgreSQL queue.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL