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/ebbcdfb3ff030898e7bb1dff34c509fcc31605d9 below:

Implement Backblaze B2 as remote provider · orgrim/pg_back@ebbcdfb · GitHub

@@ -96,13 +96,11 @@ type options struct {

96 96

S3ForcePath bool

97 97

S3DisableTLS bool

98 98 99 -

B2Region string

100 -

B2Bucket string

101 -

B2Endpoint string

102 -

B2KeyID string

103 -

B2AppKey string

104 -

B2ForcePath bool

105 -

B2ConcurrentUploads int

99 +

B2Bucket string

100 +

B2KeyID string

101 +

B2AppKey string

102 +

B2ForcePath bool

103 +

B2ConcurrentConnections int

106 104 107 105

SFTPHost string

108 106

SFTPPort string

@@ -129,24 +127,24 @@ func defaultOptions() options {

129 127

}

130 128 131 129

return options{

132 -

NoConfigFile: false,

133 -

Directory: "/var/backups/postgresql",

134 -

Format: 'c',

135 -

DirJobs: 1,

136 -

CompressLevel: -1,

137 -

Jobs: 1,

138 -

PauseTimeout: 3600,

139 -

PurgeInterval: -30 * 24 * time.Hour,

140 -

PurgeKeep: 0,

141 -

SumAlgo: "none",

142 -

CfgFile: defaultCfgFile,

143 -

TimeFormat: timeFormat,

144 -

WithRolePasswords: true,

145 -

Upload: "none",

146 -

Download: "none",

147 -

ListRemote: "none",

148 -

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

149 -

B2ConcurrentUploads: 5,

130 +

NoConfigFile: false,

131 +

Directory: "/var/backups/postgresql",

132 +

Format: 'c',

133 +

DirJobs: 1,

134 +

CompressLevel: -1,

135 +

Jobs: 1,

136 +

PauseTimeout: 3600,

137 +

PurgeInterval: -30 * 24 * time.Hour,

138 +

PurgeKeep: 0,

139 +

SumAlgo: "none",

140 +

CfgFile: defaultCfgFile,

141 +

TimeFormat: timeFormat,

142 +

WithRolePasswords: true,

143 +

Upload: "none",

144 +

Download: "none",

145 +

ListRemote: "none",

146 +

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

147 +

B2ConcurrentConnections: 5,

150 148

}

151 149

}

152 150

@@ -303,13 +301,11 @@ func parseCli(args []string) (options, []string, error) {

303 301

pflag.StringVar(&opts.ListRemote, "list-remote", "none", "list the remote files on s3, gcs, sftp, azure instead of dumping. DBNAMEs become\nglobs to select files")

304 302

purgeRemote := pflag.String("purge-remote", "no", "purge the file on remote location after upload, with the same rules\nas the local directory")

305 303 306 -

pflag.StringVar(&opts.B2Region, "b2-region", "", "B2 region")

307 304

pflag.StringVar(&opts.B2Bucket, "b2-bucket", "", "B2 bucket")

308 -

pflag.StringVar(&opts.B2Endpoint, "b2-endpoint", "", "B2 endpoint")

309 305

pflag.StringVar(&opts.B2KeyID, "b2-key-id", "", "B2 access key ID")

310 306

pflag.StringVar(&opts.B2AppKey, "b2-app-key", "", "B2 app key")

311 307

B2ForcePath := pflag.String("b2-force-path", "no", "force path style addressing instead of virtual hosted bucket\naddressing")

312 -

B2ConcurrentUploads := pflag.Int("b2-concurrent-uploads", 5, "set the amount of concurrent b2 http uploads")

308 +

B2ConcurrentConnections := pflag.Int("b2-concurrent-connections", 5, "set the amount of concurrent b2 http connections")

313 309 314 310

pflag.StringVar(&opts.S3Region, "s3-region", "", "S3 region")

315 311

pflag.StringVar(&opts.S3Bucket, "s3-bucket", "", "S3 bucket")

@@ -490,10 +486,10 @@ func parseCli(args []string) (options, []string, error) {

490 486

return opts, changed, fmt.Errorf("invalid value for --b2-force-path: %s", err)

491 487

}

492 488 493 -

if *B2ConcurrentUploads <= 0 {

494 -

return opts, changed, fmt.Errorf("b2 concurrent uploads must be more than 0 (current %d)", *B2ConcurrentUploads)

489 +

if *B2ConcurrentConnections <= 0 {

490 +

return opts, changed, fmt.Errorf("b2 concurrent connections must be more than 0 (current %d)", *B2ConcurrentConnections)

495 491

} else {

496 -

opts.B2ConcurrentUploads = *B2ConcurrentUploads

492 +

opts.B2ConcurrentConnections = *B2ConcurrentConnections

497 493

}

498 494 499 495

case "s3":

@@ -530,8 +526,8 @@ func validateConfigurationFile(cfg *ini.File) error {

530 526

"purge_older_than", "purge_min_keep", "checksum_algorithm", "pre_backup_hook",

531 527

"post_backup_hook", "encrypt", "cipher_pass", "cipher_public_key", "cipher_private_key",

532 528

"encrypt_keep_source", "upload", "purge_remote",

533 -

"b2_region", "b2_bucket", "b2_endpoint", "b2_key_id", "b2_app_key", "b2_force_path",

534 -

"b2_concurrent_uploads", "s3_region", "s3_bucket", "s3_endpoint",

529 +

"b2_bucket", "b2_key_id", "b2_app_key", "b2_force_path",

530 +

"b2_concurrent_connections", "s3_region", "s3_bucket", "s3_endpoint",

535 531

"s3_profile", "s3_key_id", "s3_secret", "s3_force_path", "s3_tls", "sftp_host",

536 532

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

537 533

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

@@ -634,13 +630,11 @@ func loadConfigurationFile(path string) (options, error) {

634 630

opts.UploadPrefix = s.Key("upload_prefix").MustString("")

635 631

opts.PurgeRemote = s.Key("purge_remote").MustBool(false)

636 632 637 -

opts.B2Region = s.Key("b2_region").MustString("")

638 633

opts.B2Bucket = s.Key("b2_bucket").MustString("")

639 -

opts.B2Endpoint = s.Key("b2_endpoint").MustString("")

640 634

opts.B2KeyID = s.Key("b2_key_id").MustString("")

641 635

opts.B2AppKey = s.Key("b2_app_key").MustString("")

642 636

opts.B2ForcePath = s.Key("b2_force_path").MustBool(false)

643 -

opts.B2ConcurrentUploads = s.Key("b2_concurrent_uploads").MustInt(5)

637 +

opts.B2ConcurrentConnections = s.Key("b2_concurrent_connections").MustInt(5)

644 638 645 639

opts.S3Region = s.Key("s3_region").MustString("")

646 640

opts.S3Bucket = s.Key("s3_bucket").MustString("")

@@ -700,8 +694,8 @@ func loadConfigurationFile(path string) (options, error) {

700 694

}

701 695

}

702 696 703 -

if opts.B2ConcurrentUploads <= 0 {

704 -

return opts, fmt.Errorf("b2 concurrent uploads must be more than 0 (current %d)", opts.B2ConcurrentUploads)

697 +

if opts.B2ConcurrentConnections <= 0 {

698 +

return opts, fmt.Errorf("b2 concurrent connections must be more than 0 (current %d)", opts.B2ConcurrentConnections)

705 699

}

706 700 707 701

// Validate upload option

@@ -888,20 +882,16 @@ func mergeCliAndConfigOptions(cliOpts options, configOpts options, onCli []strin

888 882

case "purge-remote":

889 883

opts.PurgeRemote = cliOpts.PurgeRemote

890 884 891 -

case "b2-region":

892 -

opts.B2Region = cliOpts.B2Region

893 885

case "b2-bucket":

894 886

opts.B2Bucket = cliOpts.B2Bucket

895 -

case "b2-endpoint":

896 -

opts.B2Endpoint = cliOpts.B2Endpoint

897 887

case "b2-key-id":

898 888

opts.B2KeyID = cliOpts.B2KeyID

899 889

case "b2-app-key":

900 890

opts.B2AppKey = cliOpts.B2AppKey

901 891

case "b2-force-path":

902 892

opts.B2ForcePath = cliOpts.B2ForcePath

903 -

case "b2-concurrent-uploads":

904 -

opts.B2ConcurrentUploads = cliOpts.B2ConcurrentUploads

893 +

case "b2-concurrent-connections":

894 +

opts.B2ConcurrentConnections = cliOpts.B2ConcurrentConnections

905 895 906 896

case "s3-region":

907 897

opts.S3Region = cliOpts.S3Region


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