diff --git a/Dockerfile b/Dockerfile index ed4ccea..6b20c21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM golang:1.14.2-buster AS builder COPY . /app -RUN cd /app && env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags='-linkmode external -extldflags "-static" -s -w' -o openvpn-user +RUN cd /app && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags='-linkmode external -extldflags "-static" -s -w' -o openvpn-user FROM alpine:3.13 WORKDIR /app diff --git a/openvpn-user.go b/openvpn-user.go index ce3013e..1e17a20 100644 --- a/openvpn-user.go +++ b/openvpn-user.go @@ -11,7 +11,7 @@ import ( ) const ( - version = "1.0.3-alpha" + version = "1.0.3-rc.1" ) var ( @@ -49,7 +49,6 @@ var ( debug = kingpin.Flag("debug", "Enable debug mode.").Default("false").Bool() - versionCommand = kingpin.Command("version", "Show version.") ) type User struct { @@ -61,7 +60,7 @@ type User struct { } func main() { - + kingpin.Version(version) switch kingpin.Parse() { case createCommand.FullCommand(): createUser(*createCommandUserFlag, *createCommandPasswordFlag) @@ -83,13 +82,8 @@ func main() { initDb() case dbMigrateCommand.FullCommand(): migrateDb() - case versionCommand.FullCommand(): - showVersion() } } -func showVersion() { - fmt.Printf("openvpn-user: version %s n", version) -} func getDb() *sql.DB { db, err := sql.Open("sqlite3", *dbPath)