feat: add versioning system
Some checks failed
renovate / renovate (push) Successful in 38s
Docker Build and Push / build-and-push-branches (push) Has been skipped
Docker Build and Push / build-and-push-tags (push) Has been cancelled

This commit is contained in:
2025-12-31 12:29:43 +07:00
parent ab34b34765
commit 075dd7ecad
4 changed files with 116 additions and 5 deletions

10
main.go
View File

@@ -8,14 +8,22 @@ import (
"os"
"tunnel_pls/server"
"tunnel_pls/utils"
"tunnel_pls/version"
"golang.org/x/crypto/ssh"
)
func main() {
if len(os.Args) > 1 && (os.Args[1] == "--version" || os.Args[1] == "-v") {
fmt.Println(version.GetVersion())
os.Exit(0)
}
log.SetOutput(os.Stdout)
log.SetFlags(log.LstdFlags | log.Lshortfile)
log.Printf("Starting %s", version.GetVersion())
pprofEnabled := utils.Getenv("PPROF_ENABLED", "false")
if pprofEnabled == "true" {
pprofPort := utils.Getenv("PPROF_PORT", "6060")
@@ -30,7 +38,7 @@ func main() {
sshConfig := &ssh.ServerConfig{
NoClientAuth: true,
ServerVersion: "SSH-2.0-TunnlPls-1.0",
ServerVersion: fmt.Sprintf("SSH-2.0-TunnlPls-%s", version.GetShortVersion()),
}
sshKeyPath := "certs/ssh/id_rsa"