feat: support read config file from stdin

via `-f -`
This commit is contained in:
wwqgtxx committed 2024-12-10 09:57:20 +08:00
1 parent 9a959202ed
commit f3a43fe3a6
1 file changed
+8
+8
View File
@@ -5,6 +5,7 @@ import (
"encoding/base64"
"flag"
"fmt"
"io"
"net"
"os"
"os/signal"
@@ -99,6 +100,13 @@ func main() {
log.Fatalln("Initial configuration error: %s", err.Error())
return
}
} else if configFile == "-" {
var err error
configBytes, err = io.ReadAll(os.Stdin)
if err != nil {
log.Fatalln("Initial configuration error: %s", err.Error())
return
}
} else {
if configFile != "" {
if !filepath.IsAbs(configFile) {