mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-04-07 00:47:05 +00:00
No impact in case the region is not necessary
For users who have been using mail-in-a-box from before version v60 and who do not need the region parameter in duplicity configuration, the backup continues to work without impacts.
This commit is contained in:
parent
e6c12d9ac7
commit
da06fcbb09
@ -222,8 +222,18 @@ def get_duplicity_additional_args(env):
|
|||||||
from urllib.parse import urlsplit, urlunsplit
|
from urllib.parse import urlsplit, urlunsplit
|
||||||
target = urlsplit(config["target"])
|
target = urlsplit(config["target"])
|
||||||
endpoint_url = urlunsplit(("https", target.netloc, '', '', ''))
|
endpoint_url = urlunsplit(("https", target.netloc, '', '', ''))
|
||||||
region = config["target_region"]
|
|
||||||
return ["--s3-endpoint-url", endpoint_url, "--s3-region-name", region]
|
# The target_region parameter has been added since duplicity
|
||||||
|
# now requires it for most cases in which
|
||||||
|
# the S3-compatible service is not provided by AWS.
|
||||||
|
# Nevertheless, some users who use mail-in-a-box
|
||||||
|
# from before version v60 and who use AWS's S3 service
|
||||||
|
# may not have this parameter in the configuration.
|
||||||
|
if "target_region" in config:
|
||||||
|
region = config["target_region"]
|
||||||
|
return ["--s3-endpoint-url", endpoint_url, "--s3-region-name", region]
|
||||||
|
else:
|
||||||
|
return ["--s3-endpoint-url", endpoint_url]
|
||||||
|
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user