mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-03 14:32:56 +03:00
Pull request: all: fix lint and naming issues vol. 3
Merge in DNS/adguard-home from 2276-fix-lint-3 to master Updates #2276. Squashed commit of the following: commit 6ee94cc6ed2a9762b70ef395b58b496434244b80 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Mon Dec 7 15:55:45 2020 +0300 all: fix lint and naming issues vol. 3
This commit is contained in:
parent
7f29d4e546
commit
9b963fc777
23 changed files with 234 additions and 226 deletions
internal/home
|
@ -44,6 +44,7 @@ var (
|
|||
updateChannel = "none"
|
||||
versionCheckURL = ""
|
||||
ARMVersion = ""
|
||||
MIPSVersion = ""
|
||||
)
|
||||
|
||||
// Global context
|
||||
|
@ -98,11 +99,12 @@ func (c *homeContext) getDataDir() string {
|
|||
var Context homeContext
|
||||
|
||||
// Main is the entry point
|
||||
func Main(version, channel, armVer string) {
|
||||
func Main(version, channel, armVer, mipsVer string) {
|
||||
// Init update-related global variables
|
||||
versionString = version
|
||||
updateChannel = channel
|
||||
ARMVersion = armVer
|
||||
MIPSVersion = mipsVer
|
||||
versionCheckURL = "https://static.adguard.com/adguardhome/" + updateChannel + "/version.json"
|
||||
|
||||
// config can be specified, which reads options from there, but other command line flags have to override config values
|
||||
|
@ -139,10 +141,15 @@ func Main(version, channel, armVer string) {
|
|||
|
||||
// version - returns the current version string
|
||||
func version() string {
|
||||
// TODO(a.garipov): I'm pretty sure we can extract some of this stuff
|
||||
// from the build info.
|
||||
msg := "AdGuard Home, version %s, channel %s, arch %s %s"
|
||||
if ARMVersion != "" {
|
||||
msg = msg + " v" + ARMVersion
|
||||
} else if MIPSVersion != "" {
|
||||
msg = msg + " " + MIPSVersion
|
||||
}
|
||||
|
||||
return fmt.Sprintf(msg, versionString, updateChannel, runtime.GOOS, runtime.GOARCH)
|
||||
}
|
||||
|
||||
|
@ -308,7 +315,7 @@ func run(args options) {
|
|||
log.Fatalf("Can't initialize TLS module")
|
||||
}
|
||||
|
||||
webConf := WebConfig{
|
||||
webConf := webConfig{
|
||||
firstRun: Context.firstRun,
|
||||
BindHost: config.BindHost,
|
||||
BindPort: config.BindPort,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue