Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize s3-backup #5

Closed
wants to merge 1 commit into from
Closed

Conversation

hobbypunk90
Copy link

Closes #2 😁
I run my changes with scaleways object storage ☺️

@thomasfr
Copy link
Owner

thomasfr commented Mar 4, 2023

Thanks for the pull request. Very much appreciated!! I will take a look into it this weekend

@hobbypunk90
Copy link
Author

@thomasfr i hope it's okay, that i've added also an option to set the max_concurrent_requests param for aws.

@hobbypunk90
Copy link
Author

@thomasfr do you had time for a look? :)

Copy link
Owner

@thomasfr thomasfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, sorry for my late reply. Had a car accident recently and was off.
Nevertheless, thank you very much for your changes.

In general, i understand why you want to rename it. I do not want to rename though, let me explain why:
By default it uses Amazon S3, the Amazon S3 APIs, the official aws cli and will work that way by default. Additionally, i personally think its easier to search for and easier to understand what it does - since "S3" is not explicit enough imho.
So please remove all changes where you remove Amazon and AWS.

Besides that, i would like to keep also the cli command as explicit as possible with all used arguments and parameters. In this scenario, i do not see any benefits of setting the parameters first in the awscli configuration.

Thanks again, looking forward for your changes. Will then merge as asap as possible ;)

s3-backup/run.sh Outdated Show resolved Hide resolved
@@ -20,6 +20,8 @@
"options": {
"aws_access_key": "",
"aws_secret_access_key": "",
"endpoint_url": "",
"max_concurrent_requests": 10,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value is already 10 (https://docs.aws.amazon.com/cli/latest/topic/s3-config.html#max-concurrent-requests).
Could you make it optional, the same way you are doing it with endpoint_url? This way, one can just leave it as is and be sure that the default value is used by the cli by default.

s3-backup/run.sh Outdated
export AWS_SECRET_ACCESS_KEY="$(bashio::config 'aws_secret_access_key')"
export AWS_REGION="$bucket_region"
bashio::log.info "Configure S3 Backup..."
aws configure set aws_access_key_id "$(bashio::config 'aws_access_key')"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this is necessary. I am not aware that there is a benefit of setting it, especially in this situation since its a one-off script anyways. Could you revert this change please?

s3-backup/run.sh Outdated
aws configure set s3.max_concurrent_requests "$(bashio::config 'max_concurrent_requests')"
fi

aws configure set region "$(bashio::config 'bucket_region' 'eu-central-1')"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not set region like that, i would like to be as explicit as possible with the cli command as it makes it easier to reason on one line what will happen. Otherwise a reader of the code has to go through the whole command or log outputs.

s3-backup/run.sh Outdated
Comment on lines 20 to 23
endpoint_url="$(bashio::config 'endpoint_url' '')"
bashio::log.info "Configure S3 Backup endpoint to ${endpoint_url}"
aws configure set s3.endpoint_url "${endpoint_url}"
aws configure set s3api.endpoint_url "${endpoint_url}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would highly prefer having this set as cli parameters. This way we can output pretty much all used parameters on line (https://github.com/thomasfr/hass-addons/pull/5/files#diff-06c5463fab0981ee606b95f4aee978538574d4d7a9884998c868a4f6370273a6R34)

@thomasfr thomasfr self-requested a review April 12, 2023 15:24
@garritfra
Copy link

Really looking forward to seeing this merged. Thanks for your work! :)

@hobbypunk90
Copy link
Author

sorry for my long delay, i was a little bit busy the last weeks 😒
i hope everything is fine again after your accident.

@hobbypunk90
Copy link
Author

@thomasfr i reverted the renaming stuff.
I fully understand why you don't like the way i set the configs, i have a similar problem with that.
The problem is, that the endpoint/endpointapi is not able to setup via cli, as i know 🙈

This is the reason why i think, it's better to use the aws configure way to setup, instead of mix env variables, aws configure and cli 😂

@bwint
Copy link

bwint commented Jul 25, 2023

Hi there!
Are there any news regarding this pull request?
Would absolutely love to use this repo for backing up my hass instance to a non aws s3 storage.

@DavidBoettger
Copy link

Hi,
Are there any updates? It seems to me that everything should be working fine. I am really looking forward for this.

@jpillora
Copy link

Keen to use cloudflare R2 with this PR 😄

@hobbypunk90 hobbypunk90 closed this by deleting the head repository Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could make it compatible with other S3 providers?
6 participants