changed configuration read to work by default
This commit is contained in:
parent
824a587eae
commit
119c9937d7
10
main.go
10
main.go
|
@ -5,23 +5,22 @@ import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
lumberjack "gopkg.in/natefinch/lumberjack.v2"
|
||||||
"io"
|
|
||||||
|
|
||||||
"git.daplie.com/Daplie/go-rvpn-server/rvpn/genericlistener"
|
"git.daplie.com/Daplie/go-rvpn-server/rvpn/genericlistener"
|
||||||
lumberjack "gopkg.in/natefinch/lumberjack.v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
logfile = "stdout"
|
logfile = "stdout"
|
||||||
configPath = "./"
|
configPath = "./"
|
||||||
configFile = "go-rvpn-server.yaml"
|
configFile = "go-rvpn-server"
|
||||||
|
|
||||||
loginfo *log.Logger
|
loginfo *log.Logger
|
||||||
logdebug *log.Logger
|
logdebug *log.Logger
|
||||||
|
@ -77,7 +76,8 @@ func main() {
|
||||||
loginfo = log.New(logoutput, "INFO: main: ", logFlags)
|
loginfo = log.New(logoutput, "INFO: main: ", logFlags)
|
||||||
logdebug = log.New(logoutput, "DEBUG: main:", logFlags)
|
logdebug = log.New(logoutput, "DEBUG: main:", logFlags)
|
||||||
|
|
||||||
viper.SetConfigName(configPath)
|
viper.SetConfigName(configFile)
|
||||||
|
viper.AddConfigPath(configPath)
|
||||||
viper.AddConfigPath("./")
|
viper.AddConfigPath("./")
|
||||||
err := viper.ReadInConfig()
|
err := viper.ReadInConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue