feat: Dodane parsowanie pliku pgpass
pgpass jest prsowany i przy uruchomieniu psql podawane jest wybrane hasło pasujące do połaczenia
This commit is contained in:
12
mgr/mgr.go
12
mgr/mgr.go
@ -9,6 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"baal.ar76.eu/x/pub/multisql/cfg"
|
||||
"baal.ar76.eu/x/pub/multisql/pass"
|
||||
"baal.ar76.eu/x/pub/multisql/psql"
|
||||
)
|
||||
|
||||
@ -69,6 +70,15 @@ func (self Manager) Run() error {
|
||||
return err
|
||||
}
|
||||
|
||||
var passdb *pass.PassDb
|
||||
|
||||
if self.config.PassFile != "" {
|
||||
passdb, err = pass.Load(self.config.PassFile, "TODO")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
var group sync.WaitGroup
|
||||
|
||||
for _, con := range self.config.Connections {
|
||||
@ -84,7 +94,7 @@ func (self Manager) Run() error {
|
||||
go self.Logger(&group, stream, con)
|
||||
|
||||
sql := psql.Create(
|
||||
self.config.PassFile,
|
||||
passdb,
|
||||
dbDir,
|
||||
scripts,
|
||||
con,
|
||||
|
Reference in New Issue
Block a user