small fixes

rc/1.0.3
Ilya Sosnovsky 2 years ago
parent 4abbc1a308
commit 6b60439325
  1. 2
      Dockerfile
  2. 10
      openvpn-user.go

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

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

Loading…
Cancel
Save