mirror of
https://github.com/gomods/athens
synced 2026-02-10 14:38:12 +00:00
* Remove nolonger used moniker package
Usage was removed in 97d8013
* Remove reference to Zeus
Use name Proxy for now.
* Remove Olympus code
See github issue #777
* Remove Olympus related vendor modules
* Mention Olympus removal in docs
* Add note about no registries existing
* Remove eventlog
* Update docs for Olympus removal
27 lines
1.1 KiB
Go
27 lines
1.1 KiB
Go
package config
|
|
|
|
// ProxyConfig specifies the properties required to run the proxy
|
|
type ProxyConfig struct {
|
|
StorageType string `validate:"required" envconfig:"ATHENS_STORAGE_TYPE"`
|
|
GlobalEndpoint string `envconfig:"ATHENS_GLOBAL_ENDPOINT"` // This feature is not yet implemented
|
|
Port string `validate:"required" envconfig:"PORT"`
|
|
FilterOff bool `validate:"required" envconfig:"PROXY_FILTER_OFF"`
|
|
BasicAuthUser string `envconfig:"BASIC_AUTH_USER"`
|
|
BasicAuthPass string `envconfig:"BASIC_AUTH_PASS"`
|
|
ForceSSL bool `envconfig:"PROXY_FORCE_SSL"`
|
|
ValidatorHook string `envconfig:"ATHENS_PROXY_VALIDATOR"`
|
|
PathPrefix string `envconfig:"ATHENS_PATH_PREFIX"`
|
|
NETRCPath string `envconfig:"ATHENS_NETRC_PATH"`
|
|
GithubToken string `envconfig:"ATHENS_GITHUB_TOKEN"`
|
|
HGRCPath string `envconfig:"ATHENS_HGRC_PATH"`
|
|
}
|
|
|
|
// BasicAuth returns BasicAuthUser and BasicAuthPassword
|
|
// and ok if neither of them are empty
|
|
func (p *ProxyConfig) BasicAuth() (user, pass string, ok bool) {
|
|
user = p.BasicAuthUser
|
|
pass = p.BasicAuthPass
|
|
ok = user != "" && pass != ""
|
|
return user, pass, ok
|
|
}
|