feat: add encrypt backup using public key, migrate gpg to go gpg dependency
This commit is contained in:
@@ -10,7 +10,6 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/jkaninda/pg-bkup/utils"
|
||||
"gopkg.in/yaml.v3"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -140,24 +139,6 @@ func testDatabaseConnection(db *dbConfig) {
|
||||
utils.Info("Successfully connected to %s database", db.dbName)
|
||||
|
||||
}
|
||||
func readConf(filename string) (*Config, error) {
|
||||
configFile := filepath.Join("", filename)
|
||||
if utils.FileExists(configFile) {
|
||||
buf, err := os.ReadFile(configFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
c := &Config{}
|
||||
err = yaml.Unmarshal(buf, c)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("in file %q: %w", filename, err)
|
||||
}
|
||||
|
||||
return c, err
|
||||
}
|
||||
return nil, fmt.Errorf("config file %q not found", filename)
|
||||
}
|
||||
func checkPubKeyFile(pubKey string) (string, error) {
|
||||
utils.Info("Checking file %s ...", pubKey)
|
||||
// Define possible key file names
|
||||
|
||||
Reference in New Issue
Block a user