mirror of
https://github.com/net-byte/vtun
synced 2024-03-14 10:50:03 +08:00
update version info
This commit is contained in:
parent
2deea0fcce
commit
ef151d35f4
16
app/app.go
16
app/app.go
@ -1,6 +1,8 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/net-byte/vtun/common"
|
||||
"github.com/net-byte/vtun/common/cipher"
|
||||
"github.com/net-byte/vtun/common/config"
|
||||
@ -18,20 +20,8 @@ import (
|
||||
"github.com/net-byte/vtun/transport/protocol/ws"
|
||||
"github.com/net-byte/vtun/transport/tun"
|
||||
"github.com/net-byte/water"
|
||||
"log"
|
||||
)
|
||||
|
||||
var _banner = `
|
||||
_
|
||||
__ __ | |_ _ _ _ _
|
||||
\ V / | _| | || | | ' \
|
||||
\_/ \__| \_,_| |_||_|
|
||||
|
||||
A simple VPN written in Go.
|
||||
%s
|
||||
`
|
||||
var _srcUrl = "https://github.com/net-byte/vtun"
|
||||
|
||||
// App vtun app struct
|
||||
type App struct {
|
||||
Config *config.Config
|
||||
@ -48,8 +38,6 @@ func NewApp(config *config.Config) *App {
|
||||
|
||||
// InitConfig initializes the config
|
||||
func (app *App) InitConfig() {
|
||||
log.Printf(_banner, _srcUrl)
|
||||
log.Printf("vtun version %s", app.Version)
|
||||
if !app.Config.ServerMode {
|
||||
app.Config.LocalGateway = netutil.DiscoverGateway(true)
|
||||
app.Config.LocalGatewayv6 = netutil.DiscoverGateway(false)
|
||||
|
@ -3,15 +3,31 @@ package common
|
||||
import "log"
|
||||
|
||||
var (
|
||||
Version = "v1.7.1"
|
||||
GitHash = "nil"
|
||||
BuildTime = "nil"
|
||||
GoVersion = "nil"
|
||||
Version = "v1.7.2"
|
||||
GitHash = ""
|
||||
BuildTime = ""
|
||||
GoVersion = ""
|
||||
Banner = `
|
||||
_
|
||||
__ __ | |_ _ _ _ _
|
||||
\ V / | _| | || | | ' \
|
||||
\_/ \__| \_,_| |_||_|
|
||||
|
||||
A simple VPN written in Go.
|
||||
https://github.com/net-byte/vtun
|
||||
`
|
||||
)
|
||||
|
||||
func DisplayVersionInfo() {
|
||||
log.Printf("vtun version -> %s", Version)
|
||||
log.Printf("git hash -> %s", GitHash)
|
||||
log.Printf("build time -> %s", BuildTime)
|
||||
log.Printf("go version -> %s", GoVersion)
|
||||
log.Println(Banner)
|
||||
log.Printf("version -> %s", Version)
|
||||
if GitHash != "" {
|
||||
log.Printf("git hash -> %s", GitHash)
|
||||
}
|
||||
if BuildTime != "" {
|
||||
log.Printf("build time -> %s", BuildTime)
|
||||
}
|
||||
if GoVersion != "" {
|
||||
log.Printf("go version -> %s", GoVersion)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user