Documentation ¶
Overview ¶
Package home contains AdGuard Home's HTTP API methods.
Index ¶
- Constants
- Variables
- func InitTLSCiphers() (ciphers []uint16)
- func LoadSystemRootCAs() (roots *x509.CertPool)
- func Main(clientBuildFS fs.FS)
- func RegisterAuthHandlers()
- func StartMods() error
- func WebCheckPortAvailable(port int) bool
- type Auth
- type Client
- type Filtering
- type HTTPSServer
- type RDNS
- type RuntimeClient
- type RuntimeClientWHOISInfo
- type TLSMod
- type User
- type WHOIS
- type Web
Constants ¶
const ( ClientSourceWHOIS clientSource = iota ClientSourceARP ClientSourceRDNS ClientSourceDHCP ClientSourceHostsFile )
Client sources. The order determines the priority.
const MaxConnReadSize = 64 * 1024
MaxConnReadSize is an upper limit in bytes for reading from net.Conn.
const MaxFileSize = 1024 * 1024
MaxFileSize is a maximum file length in bytes.
const PasswordMinRunes = 8
PasswordMinRunes is the minimum length of user's password in runes.
Variables ¶
var Context homeContext
Context - a global context object
var GLMode bool
GLMode - enable GL-Inet compatibility mode
Functions ¶
func InitTLSCiphers ¶ added in v0.106.0
func InitTLSCiphers() (ciphers []uint16)
InitTLSCiphers performs the same work as initDefaultCipherSuites() from crypto/tls/common.go but don't uses lots of other default ciphers.
func LoadSystemRootCAs ¶ added in v0.106.0
LoadSystemRootCAs tries to load root certificates from the operating system. It returns nil in case nothing is found so that that Go.crypto will use it's default algorithm to find system root CA list.
See https://github.com/AdguardTeam/AdGuardHome/internal/issues/1311.
func StartMods ¶
func StartMods() error
StartMods initializes and starts the DNS server after installation.
func WebCheckPortAvailable ¶
WebCheckPortAvailable - check if port is available BUT: if we are already using this port, no need
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth - global object
func (*Auth) AuthRequired ¶
AuthRequired - if authentication is required
func (*Auth) RemoveSession ¶
RemoveSession - remove session
type Client ¶
type Client struct { Name string IDs []string Tags []string BlockedServices []string Upstreams []string UseOwnSettings bool FilteringEnabled bool SafeSearchEnabled bool SafeBrowsingEnabled bool ParentalEnabled bool UseOwnBlockedServices bool // contains filtered or unexported fields }
Client contains information about persistent clients.
type Filtering ¶
type Filtering struct {
// contains filtered or unexported fields
}
Filtering - module object
func (*Filtering) RegisterFilteringHandlers ¶
func (f *Filtering) RegisterFilteringHandlers()
RegisterFilteringHandlers - register handlers
type HTTPSServer ¶
type HTTPSServer struct {
// contains filtered or unexported fields
}
HTTPSServer - HTTPS Server
type RDNS ¶
type RDNS struct {
// contains filtered or unexported fields
}
RDNS resolves clients' addresses to enrich their metadata.
func NewRDNS ¶ added in v0.106.0
func NewRDNS( exchanger dnsforward.RDNSExchanger, clients *clientsContainer, usePrivate bool, ) (rDNS *RDNS)
NewRDNS creates and returns initialized RDNS.
type RuntimeClient ¶ added in v0.106.0
type RuntimeClient struct { WHOISInfo *RuntimeClientWHOISInfo Host string Source clientSource }
RuntimeClient information
type RuntimeClientWHOISInfo ¶ added in v0.107.0
type RuntimeClientWHOISInfo struct { City string `json:"city,omitempty"` Country string `json:"country,omitempty"` Orgname string `json:"orgname,omitempty"` }
RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type TLSMod ¶
type TLSMod struct {
// contains filtered or unexported fields
}
TLSMod - TLS module object
func (*TLSMod) Reload ¶
func (t *TLSMod) Reload()
Reload updates the configuration of TLSMod and restarts it.
func (*TLSMod) Start ¶
func (t *TLSMod) Start()
Start updates the configuration of TLSMod and starts it.
func (*TLSMod) WriteDiskConfig ¶
func (t *TLSMod) WriteDiskConfig(conf *tlsConfigSettings)
WriteDiskConfig - write config
type WHOIS ¶ added in v0.107.0
type WHOIS struct {
// contains filtered or unexported fields
}
WHOIS - module context
Source Files ¶
- auth.go
- authglinet.go
- authratelimiter.go
- clients.go
- clientshttp.go
- clientstags.go
- config.go
- control.go
- controlfiltering.go
- controlinstall.go
- controlupdate.go
- dns.go
- filter.go
- home.go
- i18n.go
- middlewares.go
- mobileconfig.go
- options.go
- rdns.go
- service.go
- service_linux.go
- tls.go
- upgrade.go
- web.go
- whois.go