show client config in log only in verbose mode; actions changes
This commit is contained in:
parent
c1970c26e4
commit
8db6d93bcb
3 changed files with 16 additions and 9 deletions
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
|
@ -6,6 +6,8 @@ jobs:
|
|||
releases-matrix:
|
||||
name: Release Go Binary
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CGO_ENABLED: 1
|
||||
strategy:
|
||||
matrix:
|
||||
# build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/386, darwin/amd64
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
apt-get update
|
||||
apt-get install -y npm nodejs
|
||||
apt-get install -y curl
|
||||
apt-get install -y gcc-multilib libc6-dev-i386 linux-libc-dev:i386
|
||||
|
||||
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
|
||||
apt-get install -y nodejs
|
||||
|
||||
PATH=$PATH:~/go/bin
|
||||
|
||||
|
@ -11,3 +16,4 @@ cd frontend && npm install && npm run build && cd ..
|
|||
|
||||
packr2
|
||||
|
||||
export CGO_ENABLED=1
|
||||
|
|
13
main.go
13
main.go
|
@ -578,20 +578,19 @@ func (oAdmin *OvpnAdmin) renderClientConfig(username string) string {
|
|||
var tmp bytes.Buffer
|
||||
err := t.Execute(&tmp, conf)
|
||||
if err != nil {
|
||||
|
||||
log.Printf("WARNING: something goes wrong during rendering config for %s\n", username )
|
||||
log.Printf("ERROR: something goes wrong during rendering config for %s\n", username )
|
||||
if *debug {
|
||||
log.Printf("ERROR: rendering config for %s failed \n %v\n", username, err )
|
||||
|
||||
log.Printf("DEBUG: rendering config for %s failed with error %v\n", username, err )
|
||||
}
|
||||
}
|
||||
|
||||
hosts = nil
|
||||
|
||||
fmt.Printf("%+v\n", tmp.String())
|
||||
if *verbose {
|
||||
log.Printf("INFO: Rendered config for user %s: %+v\n", username, tmp.String())
|
||||
}
|
||||
return fmt.Sprintf("%+v\n", tmp.String())
|
||||
}
|
||||
fmt.Printf("User \"%s\" not found", username)
|
||||
log.Printf("WARNING: User \"%s\" not found", username)
|
||||
return fmt.Sprintf("User \"%s\" not found", username)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue