update version info

This commit is contained in:
Alex Tsai 2023-08-27 23:28:47 +08:00
parent 2deea0fcce
commit ef151d35f4
2 changed files with 26 additions and 22 deletions

View File

@ -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)

View File

@ -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.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)
}
}