A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/orgrim/pg_back/commit/db1ac0d9f2ef8922e14e3de0a1ad289468e0ae7d below:

add options to avoid dumping hash passwords with pg_dumpall · orgrim/pg_back@db1ac0d · GitHub

@@ -47,38 +47,39 @@ var defaultCfg string

47 47 48 48

// options struct holds command line and configuration file options

49 49

type options struct {

50 -

NoConfigFile bool

51 -

BinDirectory string

52 -

Directory string

53 -

Host string

54 -

Port int

55 -

Username string

56 -

ConnDb string

57 -

ExcludeDbs []string

58 -

Dbnames []string

59 -

WithTemplates bool

60 -

Format rune

61 -

DirJobs int

62 -

CompressLevel int

63 -

Jobs int

64 -

PauseTimeout int

65 -

PurgeInterval time.Duration

66 -

PurgeKeep int

67 -

SumAlgo string

68 -

PreHook string

69 -

PostHook string

70 -

PgDumpOpts []string

71 -

PerDbOpts map[string]*dbOpts

72 -

CfgFile string

73 -

TimeFormat string

74 -

Verbose bool

75 -

Quiet bool

76 -

Encrypt bool

77 -

EncryptKeepSrc bool

78 -

CipherPassphrase string

79 -

CipherPublicKey string

80 -

CipherPrivateKey string

81 -

Decrypt bool

50 +

NoConfigFile bool

51 +

BinDirectory string

52 +

Directory string

53 +

Host string

54 +

Port int

55 +

Username string

56 +

ConnDb string

57 +

ExcludeDbs []string

58 +

Dbnames []string

59 +

WithTemplates bool

60 +

Format rune

61 +

DirJobs int

62 +

CompressLevel int

63 +

Jobs int

64 +

PauseTimeout int

65 +

PurgeInterval time.Duration

66 +

PurgeKeep int

67 +

SumAlgo string

68 +

PreHook string

69 +

PostHook string

70 +

PgDumpOpts []string

71 +

PerDbOpts map[string]*dbOpts

72 +

CfgFile string

73 +

TimeFormat string

74 +

Verbose bool

75 +

Quiet bool

76 +

Encrypt bool

77 +

EncryptKeepSrc bool

78 +

CipherPassphrase string

79 +

CipherPublicKey string

80 +

CipherPrivateKey string

81 +

Decrypt bool

82 +

WithRolePasswords bool

82 83 83 84

Upload string // values are none, s3, sftp, gcs

84 85

PurgeRemote bool

@@ -116,20 +117,21 @@ func defaultOptions() options {

116 117

}

117 118 118 119

return options{

119 -

NoConfigFile: false,

120 -

Directory: "/var/backups/postgresql",

121 -

Format: 'c',

122 -

DirJobs: 1,

123 -

CompressLevel: -1,

124 -

Jobs: 1,

125 -

PauseTimeout: 3600,

126 -

PurgeInterval: -30 * 24 * time.Hour,

127 -

PurgeKeep: 0,

128 -

SumAlgo: "none",

129 -

CfgFile: defaultCfgFile,

130 -

TimeFormat: timeFormat,

131 -

Upload: "none",

132 -

AzureEndpoint: "blob.core.windows.net",

120 +

NoConfigFile: false,

121 +

Directory: "/var/backups/postgresql",

122 +

Format: 'c',

123 +

DirJobs: 1,

124 +

CompressLevel: -1,

125 +

Jobs: 1,

126 +

PauseTimeout: 3600,

127 +

PurgeInterval: -30 * 24 * time.Hour,

128 +

PurgeKeep: 0,

129 +

SumAlgo: "none",

130 +

CfgFile: defaultCfgFile,

131 +

TimeFormat: timeFormat,

132 +

WithRolePasswords: true,

133 +

Upload: "none",

134 +

AzureEndpoint: "blob.core.windows.net",

133 135

}

134 136

}

135 137

@@ -257,6 +259,8 @@ func parseCli(args []string) (options, []string, error) {

257 259

pflag.StringSliceVarP(&opts.ExcludeDbs, "exclude-dbs", "D", []string{}, "list of databases to exclude")

258 260

pflag.BoolVarP(&opts.WithTemplates, "with-templates", "t", false, "include templates")

259 261

WithoutTemplates := pflag.Bool("without-templates", false, "force exclude templates")

262 +

pflag.BoolVar(&opts.WithRolePasswords, "with-role-passwords", true, "dump globals with role passwords")

263 +

WithoutRolePasswords := pflag.Bool("without-role-passwords", false, "do not dump passwords of roles")

260 264

pflag.IntVarP(&opts.PauseTimeout, "pause-timeout", "T", 3600, "abort if replication cannot be paused after this number\nof seconds")

261 265

pflag.IntVarP(&opts.Jobs, "jobs", "j", 1, "dump this many databases concurrently")

262 266

pflag.StringVarP(&format, "format", "F", "custom", "database dump format: plain, custom, tar or directory")

@@ -338,6 +342,12 @@ func parseCli(args []string) (options, []string, error) {

338 342

changed = append(changed, "with-templates")

339 343

}

340 344 345 +

// Same for dump_role_passwords

346 +

if *WithoutRolePasswords {

347 +

opts.WithRolePasswords = false

348 +

changed = append(changed, "with-role-passwords")

349 +

}

350 + 341 351

// To override encrypt = true from the config file on the command line,

342 352

// have MergeCliAndConfigOptions() use the false value

343 353

if *NoEncrypt {

@@ -474,6 +484,7 @@ func validateConfigurationFile(cfg *ini.File) error {

474 484

"sftp_port", "sftp_user", "sftp_password", "sftp_directory", "sftp_identity",

475 485

"sftp_ignore_hostkey", "gcs_bucket", "gcs_endpoint", "gcs_keyfile",

476 486

"azure_container", "azure_account", "azure_key", "azure_endpoint", "pg_dump_options",

487 +

"dump_role_passwords",

477 488

}

478 489 479 490

gkLoop:

@@ -549,6 +560,7 @@ func loadConfigurationFile(path string) (options, error) {

549 560

opts.ExcludeDbs = s.Key("exclude_dbs").Strings(",")

550 561

opts.Dbnames = s.Key("include_dbs").Strings(",")

551 562

opts.WithTemplates = s.Key("with_templates").MustBool(false)

563 +

opts.WithRolePasswords = s.Key("dump_role_passwords").MustBool(true)

552 564

format = s.Key("format").MustString("custom")

553 565

opts.DirJobs = s.Key("parallel_backup_jobs").MustInt(1)

554 566

opts.CompressLevel = s.Key("compress_level").MustInt(-1)

@@ -744,6 +756,8 @@ func mergeCliAndConfigOptions(cliOpts options, configOpts options, onCli []strin

744 756

opts.Dbnames = cliOpts.Dbnames

745 757

case "with-templates":

746 758

opts.WithTemplates = cliOpts.WithTemplates

759 +

case "with-role-passwords":

760 +

opts.WithRolePasswords = cliOpts.WithRolePasswords

747 761

case "pause-timeout":

748 762

opts.PauseTimeout = cliOpts.PauseTimeout

749 763

case "jobs":


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4