You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2026-06-20 01:17:49 +02:00
Cleanup repo-host options for remote backup.
931435c0 added the ability to backup to a remote repo but did not quite get the option updates right. It worked, but a number of options were marked as internal so would not be visible to the user in command-line help.
Also reverse the dependency of repo-host and repo-host-type, i.e. make repo-host-type depend on repo-host, and alter repo-host-cmd and repo-host-user to depend on repo-host-type=ssh.
This commit is contained in:
@@ -1723,11 +1723,9 @@ option:
|
||||
annotate: {}
|
||||
archive-get: {}
|
||||
archive-push: {}
|
||||
backup:
|
||||
internal: true
|
||||
backup: {}
|
||||
check: {}
|
||||
expire:
|
||||
internal: true
|
||||
expire: {}
|
||||
info: {}
|
||||
manifest: {}
|
||||
repo-get: {}
|
||||
@@ -1756,24 +1754,7 @@ option:
|
||||
- posix
|
||||
- s3
|
||||
- sftp: HAVE_LIBSSH2
|
||||
command:
|
||||
annotate: {}
|
||||
archive-get: {}
|
||||
archive-push: {}
|
||||
backup: {}
|
||||
check: {}
|
||||
expire: {}
|
||||
info: {}
|
||||
manifest: {}
|
||||
repo-get: {}
|
||||
repo-ls: {}
|
||||
repo-put: {}
|
||||
repo-rm: {}
|
||||
restore: {}
|
||||
stanza-create: {}
|
||||
stanza-delete: {}
|
||||
stanza-upgrade: {}
|
||||
verify: {}
|
||||
command: repo-local
|
||||
deprecate:
|
||||
repo-type: {}
|
||||
|
||||
@@ -2013,6 +1994,23 @@ option:
|
||||
deprecate:
|
||||
hardlink: {}
|
||||
|
||||
repo-host:
|
||||
section: global
|
||||
group: repo
|
||||
type: string
|
||||
required: false
|
||||
command: repo-local
|
||||
command-role:
|
||||
async: {}
|
||||
main: {}
|
||||
local: {}
|
||||
depend:
|
||||
option: repo-local
|
||||
list:
|
||||
- false
|
||||
deprecate:
|
||||
backup-host: {}
|
||||
|
||||
repo-host-type:
|
||||
section: global
|
||||
group: repo
|
||||
@@ -2027,23 +2025,7 @@ option:
|
||||
main: {}
|
||||
local: {}
|
||||
depend:
|
||||
option: repo-local
|
||||
list:
|
||||
- false
|
||||
|
||||
repo-host:
|
||||
section: global
|
||||
group: repo
|
||||
type: string
|
||||
required: false
|
||||
command: repo-local
|
||||
command-role:
|
||||
async: {}
|
||||
main: {}
|
||||
local: {}
|
||||
depend: repo-host-type
|
||||
deprecate:
|
||||
backup-host: {}
|
||||
option: repo-host
|
||||
|
||||
repo-host-cert-file:
|
||||
section: global
|
||||
@@ -2076,30 +2058,15 @@ option:
|
||||
type: string
|
||||
default-type: dynamic
|
||||
default: bin
|
||||
command:
|
||||
annotate: {}
|
||||
archive-get: {}
|
||||
archive-push: {}
|
||||
backup: {}
|
||||
check: {}
|
||||
expire: {}
|
||||
info: {}
|
||||
manifest: {}
|
||||
repo-get: {}
|
||||
repo-ls: {}
|
||||
repo-put: {}
|
||||
repo-rm: {}
|
||||
restore: {}
|
||||
stanza-create: {}
|
||||
stanza-delete: {}
|
||||
stanza-upgrade: {}
|
||||
verify: {}
|
||||
command: repo-local
|
||||
command-role:
|
||||
async: {}
|
||||
main: {}
|
||||
local: {}
|
||||
depend:
|
||||
option: repo-host
|
||||
option: repo-host-type
|
||||
list:
|
||||
- ssh
|
||||
deprecate:
|
||||
backup-cmd: {}
|
||||
|
||||
@@ -2164,7 +2131,9 @@ option:
|
||||
local: {}
|
||||
default: pgbackrest
|
||||
depend:
|
||||
option: repo-host
|
||||
option: repo-host-type
|
||||
list:
|
||||
- ssh
|
||||
deprecate:
|
||||
backup-user: {}
|
||||
|
||||
|
||||
@@ -6566,12 +6566,6 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_SECTION(Global), // opt/repo-host
|
||||
PARSE_RULE_OPTION_GROUP_ID(Repo), // opt/repo-host
|
||||
// opt/repo-host
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL_LIST // opt/repo-host
|
||||
( // opt/repo-host
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Backup, true), // opt/repo-host
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Expire, true), // opt/repo-host
|
||||
) // opt/repo-host
|
||||
// opt/repo-host
|
||||
PARSE_RULE_OPTION_COMMAND_ROLE_MAIN_VALID_LIST // opt/repo-host
|
||||
( // opt/repo-host
|
||||
PARSE_RULE_OPTION_COMMAND(Annotate) // opt/repo-host
|
||||
@@ -6630,12 +6624,6 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_SECTION(Global), // opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_GROUP_ID(Repo), // opt/repo-host-ca-file
|
||||
// opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL_LIST // opt/repo-host-ca-file
|
||||
( // opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Backup, true), // opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Expire, true), // opt/repo-host-ca-file
|
||||
) // opt/repo-host-ca-file
|
||||
// opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND_ROLE_MAIN_VALID_LIST // opt/repo-host-ca-file
|
||||
( // opt/repo-host-ca-file
|
||||
PARSE_RULE_OPTION_COMMAND(Annotate) // opt/repo-host-ca-file
|
||||
@@ -6694,12 +6682,6 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_SECTION(Global), // opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_GROUP_ID(Repo), // opt/repo-host-ca-path
|
||||
// opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL_LIST // opt/repo-host-ca-path
|
||||
( // opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Backup, true), // opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Expire, true), // opt/repo-host-ca-path
|
||||
) // opt/repo-host-ca-path
|
||||
// opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND_ROLE_MAIN_VALID_LIST // opt/repo-host-ca-path
|
||||
( // opt/repo-host-ca-path
|
||||
PARSE_RULE_OPTION_COMMAND(Annotate) // opt/repo-host-ca-path
|
||||
@@ -6758,12 +6740,6 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_SECTION(Global), // opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_GROUP_ID(Repo), // opt/repo-host-cert-file
|
||||
// opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL_LIST // opt/repo-host-cert-file
|
||||
( // opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Backup, true), // opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Expire, true), // opt/repo-host-cert-file
|
||||
) // opt/repo-host-cert-file
|
||||
// opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND_ROLE_MAIN_VALID_LIST // opt/repo-host-cert-file
|
||||
( // opt/repo-host-cert-file
|
||||
PARSE_RULE_OPTION_COMMAND(Annotate) // opt/repo-host-cert-file
|
||||
@@ -6865,7 +6841,8 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
( // opt/repo-host-cmd
|
||||
PARSE_RULE_OPTIONAL_DEPEND // opt/repo-host-cmd
|
||||
( // opt/repo-host-cmd
|
||||
PARSE_RULE_VAL_OPT(RepoHost), // opt/repo-host-cmd
|
||||
PARSE_RULE_VAL_OPT(RepoHostType), // opt/repo-host-cmd
|
||||
PARSE_RULE_VAL_STRID(Ssh), // opt/repo-host-cmd
|
||||
), // opt/repo-host-cmd
|
||||
// opt/repo-host-cmd
|
||||
PARSE_RULE_OPTIONAL_DEFAULT // opt/repo-host-cmd
|
||||
@@ -7071,12 +7048,6 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_SECTION(Global), // opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_GROUP_ID(Repo), // opt/repo-host-key-file
|
||||
// opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL_LIST // opt/repo-host-key-file
|
||||
( // opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Backup, true), // opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Expire, true), // opt/repo-host-key-file
|
||||
) // opt/repo-host-key-file
|
||||
// opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND_ROLE_MAIN_VALID_LIST // opt/repo-host-key-file
|
||||
( // opt/repo-host-key-file
|
||||
PARSE_RULE_OPTION_COMMAND(Annotate) // opt/repo-host-key-file
|
||||
@@ -7209,12 +7180,6 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
PARSE_RULE_OPTION_SECTION(Global), // opt/repo-host-type
|
||||
PARSE_RULE_OPTION_GROUP_ID(Repo), // opt/repo-host-type
|
||||
// opt/repo-host-type
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL_LIST // opt/repo-host-type
|
||||
( // opt/repo-host-type
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Backup, true), // opt/repo-host-type
|
||||
PARSE_RULE_OPTION_COMMAND_INTERNAL(Expire, true), // opt/repo-host-type
|
||||
) // opt/repo-host-type
|
||||
// opt/repo-host-type
|
||||
PARSE_RULE_OPTION_COMMAND_ROLE_MAIN_VALID_LIST // opt/repo-host-type
|
||||
( // opt/repo-host-type
|
||||
PARSE_RULE_OPTION_COMMAND(Annotate) // opt/repo-host-type
|
||||
@@ -7257,8 +7222,7 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
( // opt/repo-host-type
|
||||
PARSE_RULE_OPTIONAL_DEPEND // opt/repo-host-type
|
||||
( // opt/repo-host-type
|
||||
PARSE_RULE_VAL_OPT(RepoLocal), // opt/repo-host-type
|
||||
PARSE_RULE_VAL_BOOL_FALSE, // opt/repo-host-type
|
||||
PARSE_RULE_VAL_OPT(RepoHost), // opt/repo-host-type
|
||||
), // opt/repo-host-type
|
||||
// opt/repo-host-type
|
||||
PARSE_RULE_OPTIONAL_ALLOW_LIST // opt/repo-host-type
|
||||
@@ -7326,7 +7290,8 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
|
||||
( // opt/repo-host-user
|
||||
PARSE_RULE_OPTIONAL_DEPEND // opt/repo-host-user
|
||||
( // opt/repo-host-user
|
||||
PARSE_RULE_VAL_OPT(RepoHost), // opt/repo-host-user
|
||||
PARSE_RULE_VAL_OPT(RepoHostType), // opt/repo-host-user
|
||||
PARSE_RULE_VAL_STRID(Ssh), // opt/repo-host-user
|
||||
), // opt/repo-host-user
|
||||
// opt/repo-host-user
|
||||
PARSE_RULE_OPTIONAL_DEFAULT // opt/repo-host-user
|
||||
@@ -11791,7 +11756,6 @@ static const uint8_t optionResolveOrder[] =
|
||||
cfgOptRepoCipherPass, // opt-resolve-order
|
||||
cfgOptRepoGcsKeyType, // opt-resolve-order
|
||||
cfgOptRepoHost, // opt-resolve-order
|
||||
cfgOptRepoHostCmd, // opt-resolve-order
|
||||
cfgOptRepoHostConfig, // opt-resolve-order
|
||||
cfgOptRepoHostConfigIncludePath, // opt-resolve-order
|
||||
cfgOptRepoHostConfigPath, // opt-resolve-order
|
||||
@@ -11839,6 +11803,7 @@ static const uint8_t optionResolveOrder[] =
|
||||
cfgOptRepoHostCaFile, // opt-resolve-order
|
||||
cfgOptRepoHostCaPath, // opt-resolve-order
|
||||
cfgOptRepoHostCertFile, // opt-resolve-order
|
||||
cfgOptRepoHostCmd, // opt-resolve-order
|
||||
cfgOptRepoHostKeyFile, // opt-resolve-order
|
||||
cfgOptRepoHostPort, // opt-resolve-order
|
||||
cfgOptRepoS3Key, // opt-resolve-order
|
||||
|
||||
@@ -1260,7 +1260,7 @@ testRun(void)
|
||||
strLstAddZ(argList, TEST_COMMAND_RESTORE);
|
||||
TEST_ERROR(
|
||||
cfgParseP(storageTest, strLstSize(argList), strLstPtr(argList), .noResetLogLevel = true), OptionInvalidError,
|
||||
"option 'repo1-host-user' not valid without option 'repo1-host'");
|
||||
"option 'repo1-host-user' not valid without option 'repo1-host-type'");
|
||||
|
||||
argList = strLstNew();
|
||||
strLstAddZ(argList, TEST_BACKREST_EXE);
|
||||
|
||||
Reference in New Issue
Block a user