From e2e1c8b293795db87293b6878b10d59d77634dc8 Mon Sep 17 00:00:00 2001 From: juskalalie <42800189+juskalalie@users.noreply.github.com> Date: Tue, 25 Feb 2025 22:17:51 +0100 Subject: [PATCH] replaced mentions to "google drive" with filenio --- .github/FUNDING.yml | 2 +- .github/workflows/test_staging_push.yml | 2 +- CONTRIBUTING.md | 26 +++---- LOCAL_AUTH.md | 2 +- README.md | 10 +-- donate-crypto.md | 2 +- hassio-google-drive-backup/AUTHENTICATION.md | 4 +- .../BACKUP_AND_SNAPSHOT.md | 12 ++-- hassio-google-drive-backup/CHANGELOG.md | 2 +- hassio-google-drive-backup/DOCS.md | 18 ++--- .../GENERATIONAL_BACKUP.md | 10 +-- hassio-google-drive-backup/README.md | 16 ++--- .../backup/config/config.py | 4 +- .../backup/config/settings.py | 24 +++---- hassio-google-drive-backup/backup/const.py | 4 +- .../backup/creds/driverequester.py | 4 +- .../backup/drive/__init__.py | 2 +- .../backup/drive/driverequests.py | 2 +- .../backup/drive/drivesource.py | 8 +-- .../backup/exceptions/exceptions.py | 2 +- .../backup/ha/haupdater.py | 18 ++--- .../backup/model/backups.py | 4 +- .../backup/model/drivebackup.py | 4 +- .../backup/server/server.py | 2 +- .../backup/static/index.jinja2 | 4 +- .../backup/static/js/about.js | 4 +- .../backup/static/js/scripts.js | 2 +- .../layouts/partials/error-messages.jinja2 | 12 ++-- .../static/layouts/partials/icons.jinja2 | 2 +- .../layouts/partials/modals/about.jinja2 | 6 +- .../layouts/partials/modals/backup/new.jinja2 | 2 +- .../static/layouts/partials/modals/bug.jinja2 | 4 +- .../layouts/partials/modals/help.jinja2 | 4 +- .../layouts/partials/modals/settings.jinja2 | 18 ++--- .../backup/static/logs.jinja2 | 2 +- .../backup/static/picker.jinja2 | 2 +- .../backup/static/server-index.jinja2 | 6 +- .../backup/static/working.jinja2 | 8 +-- .../backup/ui/uiserver.py | 6 +- .../dev/data/dev_options.json | 22 +++--- .../dev/data/drive_dev_options.json | 22 +++--- .../dev/data/drive_options.json | 22 +++--- .../dev/data/options.json | 2 +- .../dev/deploy_addon.py | 6 +- .../dev/deploy_dev_addon.py | 2 +- .../dev/deploy_dev_server.py | 2 +- .../dev/deploy_server.py | 2 +- .../dev/simulated_supervisor.py | 4 +- .../tests/test_config.py | 6 +- .../tests/test_coordinator.py | 4 +- .../tests/test_drivesource.py | 2 +- .../tests/test_hasource.py | 16 ++--- .../tests/test_haupdater.py | 40 +++++------ .../tests/test_model.py | 36 +++++----- .../tests/test_uiserver.py | 68 +++++++++---------- 55 files changed, 261 insertions(+), 261 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 74e2af92..89fd679a 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -3,4 +3,4 @@ patreon: stephenbeechen custom: - https://www.buymeacoffee.com/sabeechen - https://www.paypal.com/paypalme/stephenbeechen - - https://github.com/sabeechen/hassio-google-drive-backup/blob/master/donate-crypto.md + - https://github.com/sabeechen/hassio-filenio-backup/blob/master/donate-crypto.md diff --git a/.github/workflows/test_staging_push.yml b/.github/workflows/test_staging_push.yml index f674e71b..06fc84cb 100644 --- a/.github/workflows/test_staging_push.yml +++ b/.github/workflows/test_staging_push.yml @@ -44,7 +44,7 @@ jobs: with: args: | --all \ - --target dev/hassio-google-drive-backup \ + --target dev/hassio-filenio-backup \ --docker-hub "ghcr.io/sabeechen" - name: Publish Staging Addon Version diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15775640..204d793b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ ## About the project -The project is mostly maintained by juskalalie@gmail.com, and is a fork from [the original Google Drive backup add-on](https://github.com/sabeechen/hassio-google-drive-backup) from Stephen Beechen (stephen@beechens.com). Before digging in to this, you might be helpful to familiarize yourself with some of the technologies used in the project. +The project is mostly maintained by juskalalie@gmail.com, and is a fork from [the original Google Drive backup add-on](https://github.com/sabeechen/hassio-filenio-backup) from Stephen Beechen (stephen@beechens.com). Before digging in to this, you might be helpful to familiarize yourself with some of the technologies used in the project. - [Developing Addons for Home Assistant](https://developers.home-assistant.io/docs/add-ons) - Useful to understand how addons work. - [Python](https://www.python.org/) - The addon is written in Python 3.11 and makes heavy use of the asyncio framework. @@ -12,11 +12,11 @@ The project is mostly maintained by juskalalie@gmail.com, and is a fork from [th - [Docker](https://www.docker.com/) - All Home Assistant addons run in their own Docker container, and while you could certainly contribute without knowing much about it, knowledge of the basic commands will help. ## Approval Process - - Please only make PR's against the [dev branch](https://github.com/sabeechen/hassio-google-drive-backup/tree/dev). Making a PR against master/main will result in an embarrassing song-and-dance where I ignore your PR for a little while, then ask you to remake it against dev, then ignore it again for a little while out of spite. Neither of us wants this, and you can avoid it by making it against dev in the first place. + - Please only make PR's against the [dev branch](https://github.com/sabeechen/hassio-filenio-backup/tree/dev). Making a PR against master/main will result in an embarrassing song-and-dance where I ignore your PR for a little while, then ask you to remake it against dev, then ignore it again for a little while out of spite. Neither of us wants this, and you can avoid it by making it against dev in the first place. - If you're making a small change that fixes a bug I'm going to approve your PR quickly and heap you with praise. If you make a huge change without talking to me first I'm going to review your PR slowly and move through it with suspicion. A spectrum exists between those two extremes. Please try to understand that I'm the one ultimately on the line for the addon's reputation. - Breaking up a large change into smaller manageable pieces make things easier. - You can reach out to me in any of these ways to talk about a change you're considering: - - Preferred: [File an issue on github](https://github.com/sabeechen/hassio-google-drive-backup/issues) proposing your changes. + - Preferred: [File an issue on github](https://github.com/sabeechen/hassio-filenio-backup/issues) proposing your changes. - Next best: Email: stephen@beechens.com - Acceptable but worst: Home Assistant Forums: [@sabeechen](https://community.home-assistant.io/u/sabeechen/summary) - Any submissions to the dev branch get automatically built and pushed to a staging version of the addon that you can install using [this repository](https://github.com/sabeechen/hgdb-dev-staging). Its identical to the "Production" addon but talks to [https://dev.habackup.io](https://dev.habackup.io) instead of [https://habackup.io](https://habackup.io). @@ -32,7 +32,7 @@ If the you open the repository folder in Visual Studio code with docker installe 3. Install a git client. I like [GitHub Desktop](https://desktop.github.com/) 4. Clone the project repository ``` - https://github.com/sabeechen/hassio-google-drive-backup.git + https://github.com/sabeechen/hassio-filenio-backup.git ``` 5. Open Visual studio Code, go to the extension menu, and install the Desktop] (Python extension from Microsoft. It may prompt you to choose a Python interpreter (you want Python 3.11) and select a test framework (you want pytest). 6. File > Open Folder to open the cloned repository folder. @@ -53,7 +53,7 @@ Here are some pointers about how things work that might get you to where you wan ## Trying Out Changes -To try out changes locally during development, I've written a server that simulates Home Assistant, Supervisor, habackup.io, and Google Drive HTTP endpoints that the addon expects in [simulationserver.py](https://github.com/sabeechen/hassio-google-drive-backup/blob/master/hassio-google-drive-backup/dev/simulationserver.py). It’s a beast of a class and does a lot. It simulates the services for development and is also used to make unit tests work. +To try out changes locally during development, I've written a server that simulates Home Assistant, Supervisor, habackup.io, and Google Drive HTTP endpoints that the addon expects in [simulationserver.py](https://github.com/sabeechen/hassio-filenio-backup/blob/master/hassio-filenio-backup/dev/simulationserver.py). It’s a beast of a class and does a lot. It simulates the services for development and is also used to make unit tests work. To give it a shot, open up Visual Studio's "Run" Dialog and start up `Run Mock Backend Server`. Then also run one of these options: @@ -72,19 +72,19 @@ Any submissions made to the dev branch (including PR's) get automatically built For some changes, just testing locally might not be enough, you may want to run it as a real addon. You can do this roughly following the instruction for [Add-on Testing](https://developers.home-assistant.io/docs/add-ons/testing#local-build). Here are the two methods I've found work best: - ### Building a Local Addon Container in Home Assistant - Copy the folder `hassio-google-drive-backup` (the one with `config.json` inside it) into the local addon folder (you'll need the samba addon or something similar to do so). Modify the uploaded `config.json` to remove the `"image"` line near the bottom. Then in Home Assistant Web-UI go to Supervisor -> Addon-Store, Reload, and the addon should show up under "Local Addons". It should include buttons for building the container, starting/stopping etc. + Copy the folder `hassio-filenio-backup` (the one with `config.json` inside it) into the local addon folder (you'll need the samba addon or something similar to do so). Modify the uploaded `config.json` to remove the `"image"` line near the bottom. Then in Home Assistant Web-UI go to Supervisor -> Addon-Store, Reload, and the addon should show up under "Local Addons". It should include buttons for building the container, starting/stopping etc. - ### Building a container You could also build the container as a docker container locally, upload it to Docker Hub, and then have Home Assistant download the image. First install docker desktop, then: ```bash - > cd hassio-google-drive-backup + > cd hassio-filenio-backup > docker login - > docker build -f Dockerfile-addon -t YOUR_DOCKER_USERNAME/hassio-google-drive-backup-amd64:dev_testing --build-arg BUILD_FROM=homeassistant/amd64-base . - > docker push YOUR_DOCKER_USERNAME/hassio-google-drive-backup-amd64:dev-testing + > docker build -f Dockerfile-addon -t YOUR_DOCKER_USERNAME/hassio-filenio-backup-amd64:dev_testing --build-arg BUILD_FROM=homeassistant/amd64-base . + > docker push YOUR_DOCKER_USERNAME/hassio-filenio-backup-amd64:dev-testing ``` Then make a folder in the local addon directory like before, but only copy in config.json. change these two keys in config.json to match what you uploaded: ```json { - "image": "YOUR_DOCKER_USERNAME/hassio-google-drive-backup-{arch}", + "image": "YOUR_DOCKER_USERNAME/hassio-filenio-backup-{arch}", "version": "dev-testing" } ``` @@ -98,10 +98,10 @@ I haven't tried using the Supervisor's new devcontainers for development yet (th You should be able to run tests from within the Visual Studio tests tab. Make sure all the tests pass before you to make a PR. You can also run them from the command line with: ```bash -> python3.11 -m pytest hassio-google-drive-backup +> python3.11 -m pytest hassio-filenio-backup ``` ## Writing Tests -Test dependencies get injected by `pytest`, which are defined in the [conftest.py](https://github.com/sabeechen/hassio-google-drive-backup/blob/master/hassio-google-drive-backup/tests/conftest.py) file. This is responsible for starting the simulation server, mocking necessary classes, etc. -Most classes have their own test file in the [tests](https://github.com/sabeechen/hassio-google-drive-backup/tree/master/hassio-google-drive-backup/tests) directory. If you change anything in the code, you must also submit tests with your PR that verify that change. The only exception is that all the addon's JavaScript, I've never found a good way to do JavaScript tests. +Test dependencies get injected by `pytest`, which are defined in the [conftest.py](https://github.com/sabeechen/hassio-filenio-backup/blob/master/hassio-filenio-backup/tests/conftest.py) file. This is responsible for starting the simulation server, mocking necessary classes, etc. +Most classes have their own test file in the [tests](https://github.com/sabeechen/hassio-filenio-backup/tree/master/hassio-filenio-backup/tests) directory. If you change anything in the code, you must also submit tests with your PR that verify that change. The only exception is that all the addon's JavaScript, I've never found a good way to do JavaScript tests. diff --git a/LOCAL_AUTH.md b/LOCAL_AUTH.md index ad54554a..f26f3e38 100644 --- a/LOCAL_AUTH.md +++ b/LOCAL_AUTH.md @@ -1,5 +1,5 @@ # Using Custom/Personal Google Credentials -You've arrived here because you'd like to use your own client ID and client secret to authenticate the add-on with Google Drive. I'll caution that this is a very detailed and complicated process geared more toward developers than end users, so if you'd like to do it the easy way, go back to your add-on (typically http://homeassistant.local:8123/hassio/ingress/hassio_google_drive_backup) and click the "Authenticate with Google Drive" button. These instructions will have you create a project on Google's Developer Cloud console, generate your own credentials, and use them to authenticate with Google Drive. You can expect this to take about 15 minutes. Typically this is what would be done by a developer when releasing a project that several users would use, but in this case you will be the only user. This workflow is for you if: +You've arrived here because you'd like to use your own client ID and client secret to authenticate the add-on with Google Drive. I'll caution that this is a very detailed and complicated process geared more toward developers than end users, so if you'd like to do it the easy way, go back to your add-on (typically http://homeassistant.local:8123/hassio/ingress/hassio_filenio_backup) and click the "Authenticate with Google Drive" button. These instructions will have you create a project on Google's Developer Cloud console, generate your own credentials, and use them to authenticate with Google Drive. You can expect this to take about 15 minutes. Typically this is what would be done by a developer when releasing a project that several users would use, but in this case you will be the only user. This workflow is for you if: * You'd like to avoid having your account's credentials go through a server maintained by the developer of this addon. The typical authentication workflow never sees your Google account password, but it does receive a token from Google that, if I were malicious, I could use to see the backups you've uploaded to Google Drive. I don't store this token anywhere and instead just pass it back to you, but because of how Google OAuth tokens are generated there is no way you could verify that. I tip my tinfoil hat to yours and respect your desire to protect your personal information :) * The typical authentication flow didn't work. This may be because of a bug, or because the server I set up to handle it is down or broken. Its just me back here providing this as a free service to the community, so apologies if things fall into disrepair. diff --git a/README.md b/README.md index 60cfff18..43c903ea 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## About A complete and easy way to back up Home Assistant to filen.io. -Based on [the original Google Drive backup add-on](https://github.com/sabeechen/hassio-google-drive-backup) from Stephen Beechen. +Based on [the original Google Drive backup add-on](https://github.com/sabeechen/hassio-filenio-backup) from Stephen Beechen. This is for you if you want to quickly set up a backup strategy without much fuss. It doesn't require much familiarity with Home Assistant, its architecture, or filen.io. Detailed install instructions are provided below but you can just add this repo, click install and open the Web UI. It will tell you what to do and only takes a few simple clicks. [Detailed install instructions are below](#detailed-install-instructions) if that doesn't seem clear. @@ -44,7 +44,7 @@ This addon has been featured by %YOUR_FAVORITE_HA_YOUTUBER% and is often listed ### Detailed Install Instructions 1. Navigate in your Home Assistant frontend to Settings -> Add-ons -> Add-on Store (Bottom Right). -2. Click the 3-dots menu at upper right ... > Repositories and add this repository's URL: [https://github.com/sabeechen/hassio-google-drive-backup](https://github.com/sabeechen/hassio-google-drive-backup) +2. Click the 3-dots menu at upper right ... > Repositories and add this repository's URL: [https://github.com/sabeechen/hassio-filenio-backup](https://github.com/sabeechen/hassio-filenio-backup) @@ -67,7 +67,7 @@ This addon has been featured by %YOUR_FAVORITE_HA_YOUTUBER% and is often listed After you start the addon you have an opportunity to review your settings within the addon's Web-UI before you connect it to Google Drive. It is recommended to modify the setting this way because the UI makes it easy and explains what each option does. -If you'd still prefer use edit your setting in yaml or through the supervisor, the list of configurable options with explanations is available [here](./hassio-google-drive-backup/DOCS.md#configuration). +If you'd still prefer use edit your setting in yaml or through the supervisor, the list of configurable options with explanations is available [here](./hassio-filenio-backup/DOCS.md#configuration). ## FAQ ### Is this for me? @@ -151,7 +151,7 @@ You can add `"backup_time_of_day": "13:00"` to your add-on configuration to make ### Can I keep older backups for longer? -> This is just an overview of how to keep older backups longer. [See here](https://github.com/sabeechen/hassio-google-drive-backup/blob/master/hassio-google-drive-backup/GENERATIONAL_BACKUP.md) for a more in-depth explanation. +> This is just an overview of how to keep older backups longer. [See here](https://github.com/sabeechen/hassio-filenio-backup/blob/master/hassio-filenio-backup/GENERATIONAL_BACKUP.md) for a more in-depth explanation. The add-on can be configured to keep [generational backups](https://en.wikipedia.org/wiki/Backup_rotation_scheme) on daily, weekly, monthly, and yearly intervals instead of just deleting the oldest backup. This can be useful if, for example, you've made an erroneous change but haven't noticed for several days and all the backups before the change are gone. With a configuration setting like this... @@ -227,7 +227,7 @@ Maybe. You can encrypt your backups by giving a password in the add-on's options On a matter of principle, I only keep track of and store information necessary for the add-on to function. To the best of my knowledge the scope of this is: - You can opt-in to sending error reports from the add-on sent to a database maintained by me. This includes the full text of the error's stack trace, the error message, and the version of the add-on you're running. This helps notice problems with new releases but leaving it off (the default unless you turn it on) doesn't affect the functionality of the add-on in any way. -- Once authenticated with Google, your Google credentials are only stored locally on your Home Assistant instance. This isn't your actual username and password, only an opaque token returned from Google used to verify that you previously gave the Add-on permission to access your Google Drive. Your password is never seen by me or the add-on. You can read more about how authentication with Google is accomplished [here](https://github.com/sabeechen/hassio-google-drive-backup/blob/master/hassio-google-drive-backup/AUTHENTICATION.md). +- Once authenticated with Google, your Google credentials are only stored locally on your Home Assistant instance. This isn't your actual username and password, only an opaque token returned from Google used to verify that you previously gave the Add-on permission to access your Google Drive. Your password is never seen by me or the add-on. You can read more about how authentication with Google is accomplished [here](https://github.com/sabeechen/hassio-filenio-backup/blob/master/hassio-filenio-backup/AUTHENTICATION.md). - The add-on has access to the files in Google Drive it created, which is the 'Home Assistant Backups' folder and any backups it uploads. See the https://www.googleapis.com/auth/drive.file scope in the [Drive REST API v3 Documentation](https://developers.google.com/drive/api/v3/about-auth) for details, this is the only scope the add-on requests for your account. - Google stores a history of information about the number of requests, number of errors, and latency of requests made by this Add-on and makes a graph of that visible to me. This is needed because Google only gives me a certain quota for requests shared between all users of the add-on, so I need to be aware if someone is abusing it. - The Add-on is distributed as a Docker container hosted on Docker Hub, which is how almost all add-ons work. Docker keeps track of how many people have requested an image and makes that information publicly visible. diff --git a/donate-crypto.md b/donate-crypto.md index 9089bced..c7536fcf 100644 --- a/donate-crypto.md +++ b/donate-crypto.md @@ -1,5 +1,5 @@ ## Contributing with Cryptocurrency -Below are the addresses and relevant QR Codes for contributiong to the project with Monreo, Ethereum and Bitcoin. Thank you for considering! If you'd like to donate using a currency not listed, make an [issue](https://github.com/sabeechen/hassio-google-drive-backup/issues) so I can consider it. Cryptocurrency might be the purest way to contribute, because I have no way of knowing who you are. Your anonymous support is appreciated <3 +Below are the addresses and relevant QR Codes for contributiong to the project with Monreo, Ethereum and Bitcoin. Thank you for considering! If you'd like to donate using a currency not listed, make an [issue](https://github.com/sabeechen/hassio-filenio-backup/issues) so I can consider it. Cryptocurrency might be the purest way to contribute, because I have no way of knowing who you are. Your anonymous support is appreciated <3

###
diff --git a/hassio-google-drive-backup/AUTHENTICATION.md b/hassio-google-drive-backup/AUTHENTICATION.md index 098c3be5..a6a664f0 100644 --- a/hassio-google-drive-backup/AUTHENTICATION.md +++ b/hassio-google-drive-backup/AUTHENTICATION.md @@ -1,7 +1,7 @@ # Authentication with Google Drive This document describes how the addon (Home Assistant Google Drive Backup) authenticates with Google Drive and stores your credentials. It's geared toward those who wish to know more detail and is not necessary to take advantage of the full features of the addon. The document is provided in the interest of providing full transparency into how the add-on works. I've tried to describe this as plainly as possible, but it is technical and therefore may not be understandable to everyone. Feedback on its clarity is appreciated. - > This document describes how authentication works if you use the big blue "AUTHENTICATE WITH GOOGLE DRIVE" button in the addon. If you're using [your own Google Drive credentials](https://github.com/sabeechen/hassio-google-drive-backup/blob/master/LOCAL_AUTH.md), then none of this applies. + > This document describes how authentication works if you use the big blue "AUTHENTICATE WITH GOOGLE DRIVE" button in the addon. If you're using [your own Google Drive credentials](https://github.com/sabeechen/hassio-filenio-backup/blob/master/LOCAL_AUTH.md), then none of this applies. ## Your Credentials and the Needed Permission To have access to any information in Google Drive, Google's authentication servers must be told that the add-on has the permission. The add-on uses [Google Drive's Rest API (v3)](https://developers.google.com/drive/api/v3/about-sdk) for communication and requests the [drive.file](https://developers.google.com/drive/api/v3/about-auth) permission *scope*. This *scope* means the add-on has access to files and folders that the add-on created, but nothing else. It can't see files you've added to Google Drive through their web interface or anywhere else. Google Drive's Rest API allows the addon to periodically check what backups are uploaded and upload new ones if necessary by making requests over the internet. @@ -27,7 +27,7 @@ Google puts some limitations on how the access token must be generated that will These limitations make a technical problem for the addon because most people's Home Assistant instances aren't publicly accessible and the address is different for each one. Performing the authentication workflow exactly as described above won't work. To get around this, I (the developer of this addon) set up a website, https://habackup.io, which serves as the known public and statically addressable website that Google redirects from/to. The source code for this server is available within the add-on's GitHub repository. So when you authenticate the add-on, the workflow looks like this: -1. You start at the add-on's web interface, something like https://homeassistant.local:8123/ingress/hassio_google_drive_backup +1. You start at the add-on's web interface, something like https://homeassistant.local:8123/ingress/hassio_filenio_backup 2. You click the "Authenticate With Google Drive" button, which takes note of the address of your Home Assistant installation (https://homeassistant.local:8123 in this case) and sends you to https://habackup.io/drive/authorize 3. https://habackup.io immediately generates the Google login URL for you and redirects you to https://accounts.google.com 4. You log in with your Google credentials on Google's domain, and confirm you want to give the add-on permission to see files and folders it creates (the drive.file scope) diff --git a/hassio-google-drive-backup/BACKUP_AND_SNAPSHOT.md b/hassio-google-drive-backup/BACKUP_AND_SNAPSHOT.md index 0a82ab53..63cf679b 100644 --- a/hassio-google-drive-backup/BACKUP_AND_SNAPSHOT.md +++ b/hassio-google-drive-backup/BACKUP_AND_SNAPSHOT.md @@ -37,10 +37,10 @@ backed_up ```yaml friendly_name: Snapshots State last_snapshot: 2021-09-01T20:26:49.100376+00:00 -snapshots_in_google_drive: 2 +snapshots_in_filenio: 2 snapshots_in_hassio: 2 snapshots_in_home_assistant: 2 -size_in_google_drive: 2.5 GB +size_in_filenio: 2.5 GB size_in_home_assistant: 2.5 GB snapshots: - name: Full Snapshot 2021-02-06 11:37:00 @@ -86,9 +86,9 @@ backed_up friendly_name: Backup State last_backup: 2021-09-01T20:26:49.100376+00:00 last_upload: 2021-09-01T20:26:49.100376+00:00 -backups_in_google_drive: 2 +backups_in_filenio: 2 backups_in_home_assistant: 2 -size_in_google_drive: 2.5 GB +size_in_filenio: 2.5 GB size_in_home_assistant: 2.5 GB backups: - name: Full Snapshot 2021-02-06 11:37:00 @@ -112,9 +112,9 @@ backups: It's attributes are: - ```last_backup``` The UTC ISO-8601 date of the most recent backup in Home Assistant or Google Drive. - ```last_upload``` The UTC ISO-8601 date of the most recent backup uploaded to Google Drive. -- ```backups_in_google_drive``` The number of backups in Google Drive. +- ```backups_in_filenio``` The number of backups in Google Drive. - ```backups_in_home_assistant``` The number of backups in Home Assistant. -- ```size_in_google_drive``` A string representation of the space used by backups in Google Drive. +- ```size_in_filenio``` A string representation of the space used by backups in Google Drive. - ```size_in_home_assistant``` A string representation of the space used by backups in Home Assistant. - ```backups``` The list of each snapshot in decending order of date. Each snapshot includes its ```name```, ```date```, ```slug```, and ```state```. ```state``` can be one of: - ```Backed Up``` if its in Home Assistant and Google Drive. diff --git a/hassio-google-drive-backup/CHANGELOG.md b/hassio-google-drive-backup/CHANGELOG.md index 6ff6ef2f..0b871b63 100644 --- a/hassio-google-drive-backup/CHANGELOG.md +++ b/hassio-google-drive-backup/CHANGELOG.md @@ -1,6 +1,6 @@ ## v0.112.1 [2023-11-03] -- Added warnings about using the "Stop Addons" feature. I plan on removing this in the near future. If you'd like to keep the feature around, please give your feedback in [this GitHub issue](https://github.com/sabeechen/hassio-google-drive-backup/issues/940). +- Added warnings about using the "Stop Addons" feature. I plan on removing this in the near future. If you'd like to keep the feature around, please give your feedback in [this GitHub issue](https://github.com/sabeechen/hassio-filenio-backup/issues/940). - When backups are stuck in the "pending" state, the addon now provides you with the Supervisor logs to help figure out whats wrong. - Added support for the "exclude Home Assistant database" options for automatic backups - Added configuration options to limit the speed of uploads to Google Drive diff --git a/hassio-google-drive-backup/DOCS.md b/hassio-google-drive-backup/DOCS.md index 521e351d..16d4330a 100644 --- a/hassio-google-drive-backup/DOCS.md +++ b/hassio-google-drive-backup/DOCS.md @@ -2,7 +2,7 @@ ## Installation -To install the add-on, first follow the installation steps from the [README on GitHub](https://github.com/sabeechen/hassio-google-drive-backup#installation). +To install the add-on, first follow the installation steps from the [README on GitHub](https://github.com/sabeechen/hassio-filenio-backup#installation). ## Configuration @@ -18,7 +18,7 @@ Don't use this directly, the addon has a lot of configuration options that most max_backups_in_ha: 10 # Keep 10 backups in Google Drive -max_backups_in_google_drive: 10 +max_backups_in_filenio: 10 # Create backups in Home Assistant on network storage backup_location: my_nfs_share @@ -80,7 +80,7 @@ delete_after_upload: true The number of backups the add-on will allow Home Assistant to store locally before old ones are deleted. -### Option: `max_backups_in_google_drive` (default: 4) +### Option: `max_backups_in_filenio` (default: 4) The number of backups the add-on will keep in Google Drive before old ones are deleted. Google Drive gives you 15GB of free storage (at the time of writing) so plan accordingly if you know how big your backups are. @@ -132,11 +132,11 @@ When set, backups are created with a password. You can use a value from your sec ### Option: `backup_name` (default: "{type} Backup {year}-{month}-{day} {hr24}:{min}:{sec}") -Sets the name for new backups. Variable parameters of the form `{variable_name}` can be used to modify the name to your liking. A list of available variables is available [here](https://github.com/sabeechen/hassio-google-drive-backup#can-i-give-backups-a-different-name). +Sets the name for new backups. Variable parameters of the form `{variable_name}` can be used to modify the name to your liking. A list of available variables is available [here](https://github.com/sabeechen/hassio-filenio-backup#can-i-give-backups-a-different-name). ### Option: `generational_*` -When set, older backups will be kept longer using a [generational backup scheme](https://en.wikipedia.org/wiki/Backup_rotation_scheme). See the [question here](https://github.com/sabeechen/hassio-google-drive-backup#can-i-keep-older-backups-for-longer) for configuration options. +When set, older backups will be kept longer using a [generational backup scheme](https://en.wikipedia.org/wiki/Backup_rotation_scheme). See the [question here](https://github.com/sabeechen/hassio-filenio-backup#can-i-keep-older-backups-for-longer) for configuration options. ### Option: `exclude_folders` @@ -150,15 +150,15 @@ _Note_: Folders and add-ons must be identified by their "slug" name. It is recom ### Option: `enable_backup_stale_sensor` (default: True) -When false, the add-on will not publish the [binary_sensor.backups_stale](https://github.com/sabeechen/hassio-google-drive-backup#how-will-i-know-this-will-be-there-when-i-need-it) stale sensor. +When false, the add-on will not publish the [binary_sensor.backups_stale](https://github.com/sabeechen/hassio-filenio-backup#how-will-i-know-this-will-be-there-when-i-need-it) stale sensor. ### Option: `enable_backup_state_sensor` (default: True) -When false, the add-on will not publish the [sensor.backup_state](https://github.com/sabeechen/hassio-google-drive-backup#how-will-i-know-this-will-be-there-when-i-need-it) sensor. +When false, the add-on will not publish the [sensor.backup_state](https://github.com/sabeechen/hassio-filenio-backup#how-will-i-know-this-will-be-there-when-i-need-it) sensor. ### Option: `notify_for_stale_backups` (default: True) -When false, the add-on will send a [persistent notification](https://github.com/sabeechen/hassio-google-drive-backup#how-will-i-know-this-will-be-there-when-i-need-it) in Home Assistant when backups are stale. +When false, the add-on will send a [persistent notification](https://github.com/sabeechen/hassio-filenio-backup#how-will-i-know-this-will-be-there-when-i-need-it) in Home Assistant when backups are stale. --- @@ -202,4 +202,4 @@ When true, backups are always deleted after they've been uploaded to Google Driv ## FAQ -Read the [FAQ on GitHub](https://github.com/sabeechen/hassio-google-drive-backup#faq). +Read the [FAQ on GitHub](https://github.com/sabeechen/hassio-filenio-backup#faq). diff --git a/hassio-google-drive-backup/GENERATIONAL_BACKUP.md b/hassio-google-drive-backup/GENERATIONAL_BACKUP.md index 770ee536..969bf1f0 100644 --- a/hassio-google-drive-backup/GENERATIONAL_BACKUP.md +++ b/hassio-google-drive-backup/GENERATIONAL_BACKUP.md @@ -13,9 +13,9 @@ The generational backup will be used when any one of `generational_days`, `gene ## Some Details to Consider * Generational backup assumes that a backup is available for every day to work properly, so it's recommended that you set `days_between_backups`=1 if you're using the feature. Otherwise, a backup may not be available to be saved for a given day. -* The backups maintained by generational backup will still never exceed the number you permit to be maintained in Google Drive or Home Assistant. For example, if `max_backups_in_google_drive`=3 and `generational_weeks`=4, then only 3 weeks of backups will be kept in Google Drive. -* Generational backup will only delete older backups when it has to. For example, if you've configured it to keep 5 weekly backups on Monday, you've been running it for a week (so you have 7 backups), and `max_backups_in_google_drive`=7, then your backups on Tuesday, Wednesday, etc won't get deleted yet. They won't get deleted until doing so is necessary to keep older backups around without violating the maximum allowed in Google Drive. ->Note: You can configure the addon to delete backups more aggressively by setting `generational_delete_early`=true. With this, the addon will delete old backups that don't match a daily, weekly, monthly, or yearly configured cycle even if you aren't yet at risk of exceeding `max_backups_in_ha` or `max_backups_in_google_drive`. Careful though! You can accidentally delete all your backups this way if you don't have all your settings configured just the way you want them. +* The backups maintained by generational backup will still never exceed the number you permit to be maintained in Google Drive or Home Assistant. For example, if `max_backups_in_filenio`=3 and `generational_weeks`=4, then only 3 weeks of backups will be kept in Google Drive. +* Generational backup will only delete older backups when it has to. For example, if you've configured it to keep 5 weekly backups on Monday, you've been running it for a week (so you have 7 backups), and `max_backups_in_filenio`=7, then your backups on Tuesday, Wednesday, etc won't get deleted yet. They won't get deleted until doing so is necessary to keep older backups around without violating the maximum allowed in Google Drive. +>Note: You can configure the addon to delete backups more aggressively by setting `generational_delete_early`=true. With this, the addon will delete old backups that don't match a daily, weekly, monthly, or yearly configured cycle even if you aren't yet at risk of exceeding `max_backups_in_ha` or `max_backups_in_filenio`. Careful though! You can accidentally delete all your backups this way if you don't have all your settings configured just the way you want them. * If more than one backup is created for a day (for example if you create one manually) then only the latest backup from that day will be kept. ## Schedule @@ -26,7 +26,7 @@ Figuring out date math in your head is hard, so it's useful to see a concrete ex "generational_weeks": 2, "generational_months": 2 "generational_years": 2 -"max_backups_in_google_drive": 8 +"max_backups_in_filenio": 8 ``` Imagine you've been running the add-on for 2 years now, diligently making a backup every day with no interruptions. On 19 May 2021, you could expect your list of backups in Google Drive to look like this: - May 19, 2021 <-- 1st Daily backup @@ -38,4 +38,4 @@ Imagine you've been running the add-on for 2 years now, diligently making a back - January 01, 2021 <-- 1st Yearly backup - January 01, 2020 <-- 2nd Yearly backup -Note that sometimes a day might overlap more than one schedule. For example, a backup on January 1st could satisfy the constraints for both a yearly and monthly backup. In this case, the add-on will only delete older backups when it *must* to keep from exceeding `max_backups_in_ha` or `max_backups_in_google_drive`. Thus, the most recent backup that would otherwise be deleted will be kept until space is needed somewhere else in the schedule. +Note that sometimes a day might overlap more than one schedule. For example, a backup on January 1st could satisfy the constraints for both a yearly and monthly backup. In this case, the add-on will only delete older backups when it *must* to keep from exceeding `max_backups_in_ha` or `max_backups_in_filenio`. Thus, the most recent backup that would otherwise be deleted will be kept until space is needed somewhere else in the schedule. diff --git a/hassio-google-drive-backup/README.md b/hassio-google-drive-backup/README.md index 94489ae5..ad005995 100644 --- a/hassio-google-drive-backup/README.md +++ b/hassio-google-drive-backup/README.md @@ -8,13 +8,13 @@ Quickly set up a backup strategy without much fuss. It doesn't require much fami >This project requires financial support to make the Google Drive integration work, but it is free for you to use. You can join those helping to keep the lights on at: > ->[](https://www.buymeacoffee.com/sabeechen) ->[](https://www.paypal.com/paypalme/stephenbeechen) ->[](https://www.patreon.com/bePatron?u=4064183) ->[](https://github.com/sponsors/sabeechen) ->[](https://github.com/sabeechen/hassio-google-drive-backup/blob/master/donate-crypto.md) ->[](https://github.com/sabeechen/hassio-google-drive-backup/blob/master/donate-crypto.md) ->[](https://github.com/sabeechen/hassio-google-drive-backup/blob/master/donate-crypto.md) +>[](https://www.buymeacoffee.com/sabeechen) +>[](https://www.paypal.com/paypalme/stephenbeechen) +>[](https://www.patreon.com/bePatron?u=4064183) +>[](https://github.com/sponsors/sabeechen) +>[](https://github.com/sabeechen/hassio-filenio-backup/blob/master/donate-crypto.md) +>[](https://github.com/sabeechen/hassio-filenio-backup/blob/master/donate-crypto.md) +>[](https://github.com/sabeechen/hassio-filenio-backup/blob/master/donate-crypto.md) ### Features @@ -30,5 +30,5 @@ Quickly set up a backup strategy without much fuss. It doesn't require much fami - Comprehensive documentation. - _Most certainly_ doesn't mine bitcoin on your home automation server. Definitely no. -See the [README on GitHub](https://github.com/sabeechen/hassio-google-drive-backup) for all the details, or just install the add-on and open the Web UI. +See the [README on GitHub](https://github.com/sabeechen/hassio-filenio-backup) for all the details, or just install the add-on and open the Web UI. The Web-UI explains everything you have to do. diff --git a/hassio-google-drive-backup/backup/config/config.py b/hassio-google-drive-backup/backup/config/config.py index c2ced2fb..2326beb0 100644 --- a/hassio-google-drive-backup/backup/config/config.py +++ b/hassio-google-drive-backup/backup/config/config.py @@ -14,7 +14,7 @@ ALWAYS_KEEP = { Setting.DAYS_BETWEEN_BACKUPS, Setting.MAX_BACKUPS_IN_HA, - Setting.MAX_BACKUPS_IN_GOOGLE_DRIVE, + Setting.MAX_BACKUPS_IN_FILENIO, } KEEP_DEFAULT = { @@ -50,7 +50,7 @@ UPGRADE_OPTIONS = { Setting.DEPRECTAED_MAX_BACKUPS_IN_HA: Setting.MAX_BACKUPS_IN_HA, - Setting.DEPRECTAED_MAX_BACKUPS_IN_GOOGLE_DRIVE: Setting.MAX_BACKUPS_IN_GOOGLE_DRIVE, + Setting.DEPRECTAED_MAX_BACKUPS_IN_FILENIO: Setting.MAX_BACKUPS_IN_FILENIO, Setting.DEPRECATED_DAYS_BETWEEN_BACKUPS: Setting.DAYS_BETWEEN_BACKUPS, Setting.DEPRECTAED_IGNORE_OTHER_BACKUPS: Setting.IGNORE_OTHER_BACKUPS, Setting.DEPRECTAED_IGNORE_UPGRADE_BACKUPS: Setting.IGNORE_UPGRADE_BACKUPS, diff --git a/hassio-google-drive-backup/backup/config/settings.py b/hassio-google-drive-backup/backup/config/settings.py index 6dbb56d3..1a456d55 100644 --- a/hassio-google-drive-backup/backup/config/settings.py +++ b/hassio-google-drive-backup/backup/config/settings.py @@ -18,7 +18,7 @@ @unique class Setting(Enum): MAX_BACKUPS_IN_HA = "max_backups_in_ha" - MAX_BACKUPS_IN_GOOGLE_DRIVE = "max_backups_in_google_drive" + MAX_BACKUPS_IN_FILENIO = "max_backups_in_filenio" DAYS_BETWEEN_BACKUPS = "days_between_backups" IGNORE_OTHER_BACKUPS = "ignore_other_backups" IGNORE_UPGRADE_BACKUPS = "ignore_upgrade_backups" @@ -82,8 +82,8 @@ class Setting(Enum): DRIVE_EXPERIMENTAL = "drive_experimental" DRIVE_IPV4 = "drive_ipv4" IGNORE_IPV6_ADDRESSES = "ignore_ipv6_addresses" - GOOGLE_DRIVE_TIMEOUT_SECONDS = "google_drive_timeout_seconds" - GOOGLE_DRIVE_PAGE_SIZE = "google_drive_page_size" + FILENIO_TIMEOUT_SECONDS = "filenio_timeout_seconds" + FILENIO_PAGE_SIZE = "filenio_page_size" ALTERNATE_DNS_SERVERS = "alternate_dns_servers" DEFAULT_DRIVE_CLIENT_ID = "default_drive_client_id" DEFAULT_DRIVE_CLIENT_SECRET = "default_drive_client_secret" @@ -139,7 +139,7 @@ class Setting(Enum): # Old, deprecated settings DEPRECTAED_MAX_BACKUPS_IN_HA = "max_snapshots_in_hassio" - DEPRECTAED_MAX_BACKUPS_IN_GOOGLE_DRIVE = "max_snapshots_in_google_drive" + DEPRECTAED_MAX_BACKUPS_IN_FILENIO = "max_snapshots_in_filenio" DEPRECATED_DAYS_BETWEEN_BACKUPS = "days_between_snapshots" DEPRECTAED_IGNORE_OTHER_BACKUPS = "ignore_other_snapshots" DEPRECTAED_IGNORE_UPGRADE_BACKUPS = "ignore_upgrade_snapshots" @@ -168,7 +168,7 @@ def key(self): _DEFAULTS = { Setting.MAX_BACKUPS_IN_HA: 4, - Setting.MAX_BACKUPS_IN_GOOGLE_DRIVE: 4, + Setting.MAX_BACKUPS_IN_FILENIO: 4, Setting.DAYS_BETWEEN_BACKUPS: 3, Setting.IGNORE_OTHER_BACKUPS: False, Setting.IGNORE_UPGRADE_BACKUPS: True, @@ -187,7 +187,7 @@ def key(self): # Basic backup settings Setting.DEPRECTAED_MAX_BACKUPS_IN_HA: 4, - Setting.DEPRECTAED_MAX_BACKUPS_IN_GOOGLE_DRIVE: 4, + Setting.DEPRECTAED_MAX_BACKUPS_IN_FILENIO: 4, Setting.DEPRECATED_DAYS_BETWEEN_BACKUPS: 3, Setting.DEPRECTAED_IGNORE_OTHER_BACKUPS: False, Setting.DEPRECTAED_IGNORE_UPGRADE_BACKUPS: False, @@ -247,8 +247,8 @@ def key(self): Setting.DRIVE_EXPERIMENTAL: False, Setting.DRIVE_IPV4: "", Setting.IGNORE_IPV6_ADDRESSES: False, - Setting.GOOGLE_DRIVE_TIMEOUT_SECONDS: 180, - Setting.GOOGLE_DRIVE_PAGE_SIZE: 100, + Setting.FILENIO_TIMEOUT_SECONDS: 180, + Setting.FILENIO_PAGE_SIZE: 100, Setting.MAXIMUM_UPLOAD_CHUNK_BYTES: 10 * 1024 * 1024, # Remote endpoints @@ -312,7 +312,7 @@ def key(self): _CONFIG = { Setting.MAX_BACKUPS_IN_HA: "int(0,)?", - Setting.MAX_BACKUPS_IN_GOOGLE_DRIVE: "int(0,)?", + Setting.MAX_BACKUPS_IN_FILENIO: "int(0,)?", Setting.DAYS_BETWEEN_BACKUPS: "float(0,)?", Setting.IGNORE_OTHER_BACKUPS: "bool?", Setting.IGNORE_UPGRADE_BACKUPS: "bool?", @@ -331,7 +331,7 @@ def key(self): # Basic backup settings Setting.DEPRECTAED_MAX_BACKUPS_IN_HA: "int(0,)?", - Setting.DEPRECTAED_MAX_BACKUPS_IN_GOOGLE_DRIVE: "int(0,)?", + Setting.DEPRECTAED_MAX_BACKUPS_IN_FILENIO: "int(0,)?", Setting.DEPRECATED_DAYS_BETWEEN_BACKUPS: "float(0,)?", Setting.DEPRECTAED_IGNORE_OTHER_BACKUPS: "bool?", Setting.DEPRECTAED_IGNORE_UPGRADE_BACKUPS: "bool?", @@ -390,8 +390,8 @@ def key(self): Setting.DRIVE_EXPERIMENTAL: "bool?", Setting.DRIVE_IPV4: "match(^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$)?", Setting.IGNORE_IPV6_ADDRESSES: "bool?", - Setting.GOOGLE_DRIVE_TIMEOUT_SECONDS: "float(1,)?", - Setting.GOOGLE_DRIVE_PAGE_SIZE: "int(1,)?", + Setting.FILENIO_TIMEOUT_SECONDS: "float(1,)?", + Setting.FILENIO_PAGE_SIZE: "int(1,)?", Setting.MAXIMUM_UPLOAD_CHUNK_BYTES: f"float({1024 * 256},)?", # Remote endpoints diff --git a/hassio-google-drive-backup/backup/const.py b/hassio-google-drive-backup/backup/const.py index 5b254f19..5e2ea4d6 100644 --- a/hassio-google-drive-backup/backup/const.py +++ b/hassio-google-drive-backup/backup/const.py @@ -1,5 +1,5 @@ -SOURCE_GOOGLE_DRIVE = "GoogleDrive" +SOURCE_FILENIO = "GoogleDrive" SOURCE_HA = "HomeAssistant" ERROR_PLEASE_WAIT = "please_wait" @@ -49,7 +49,7 @@ PROP_NOTE = "note" DRIVE_FOLDER_URL_FORMAT = "https://drive.google.com/drive/u/0/folders/{0}" -GITHUB_ISSUE_URL = "https://github.com/sabeechen/hassio-google-drive-backup/issues/new?labels[]=People%20Management&labels[]=[Type]%20Bug&title={title}&assignee=sabeechen&body={body}" +GITHUB_ISSUE_URL = "https://github.com/sabeechen/hassio-filenio-backup/issues/new?labels[]=People%20Management&labels[]=[Type]%20Bug&title={title}&assignee=sabeechen&body={body}" GITHUB_BUG_TEMPLATE = """ ###### Description: ``` diff --git a/hassio-google-drive-backup/backup/creds/driverequester.py b/hassio-google-drive-backup/backup/creds/driverequester.py index 9b03f85a..d7b8dbf9 100644 --- a/hassio-google-drive-backup/backup/creds/driverequester.py +++ b/hassio-google-drive-backup/backup/creds/driverequester.py @@ -86,8 +86,8 @@ async def request(self, method, url, headers={}, json=None, data=None) -> Client def buildTimeout(self): return ClientTimeout( sock_connect=self.config.get( - Setting.GOOGLE_DRIVE_TIMEOUT_SECONDS), - sock_read=self.config.get(Setting.GOOGLE_DRIVE_TIMEOUT_SECONDS)) + Setting.FILENIO_TIMEOUT_SECONDS), + sock_read=self.config.get(Setting.FILENIO_TIMEOUT_SECONDS)) async def raiseForKnownErrors(self, response): try: diff --git a/hassio-google-drive-backup/backup/drive/__init__.py b/hassio-google-drive-backup/backup/drive/__init__.py index 2524c3a0..c252b5e2 100644 --- a/hassio-google-drive-backup/backup/drive/__init__.py +++ b/hassio-google-drive-backup/backup/drive/__init__.py @@ -1,5 +1,5 @@ # flake8: noqa from .driverequests import DriveRequests, RETRY_SESSION_ATTEMPTS, UPLOAD_SESSION_EXPIRATION_DURATION, URL_START_UPLOAD, OOB_CRED_CUTOFF -from .drivesource import DriveSource, SOURCE_GOOGLE_DRIVE +from .drivesource import DriveSource, SOURCE_FILENIO from .folderfinder import FolderFinder from .authcodequery import AuthCodeQuery \ No newline at end of file diff --git a/hassio-google-drive-backup/backup/drive/driverequests.py b/hassio-google-drive-backup/backup/drive/driverequests.py index 35de1faf..65eb3949 100644 --- a/hassio-google-drive-backup/backup/drive/driverequests.py +++ b/hassio-google-drive-backup/backup/drive/driverequests.py @@ -185,7 +185,7 @@ async def query(self, query): q = { "q": query, "fields": QUERY_FIELDS, - "pageSize": self.config.get(Setting.GOOGLE_DRIVE_PAGE_SIZE), + "pageSize": self.config.get(Setting.FILENIO_PAGE_SIZE), "supportsAllDrives": "true", "includeItemsFromAllDrives": "true", "corpora": "allDrives" diff --git a/hassio-google-drive-backup/backup/drive/drivesource.py b/hassio-google-drive-backup/backup/drive/drivesource.py index b4410b86..716362f1 100644 --- a/hassio-google-drive-backup/backup/drive/drivesource.py +++ b/hassio-google-drive-backup/backup/drive/drivesource.py @@ -10,7 +10,7 @@ from ..util import AsyncHttpGetter, GlobalInfo from ..config import Config, Setting, CreateOptions from ..config.byteformatter import ByteFormatter -from ..const import SOURCE_GOOGLE_DRIVE +from ..const import SOURCE_FILENIO from ..exceptions import (BackupFolderInaccessible, ExistingBackupFolderError, GoogleDrivePermissionDenied, @@ -70,13 +70,13 @@ def might_be_oob_creds(self) -> bool: return self.drivebackend.might_be_oob_creds def name(self) -> str: - return SOURCE_GOOGLE_DRIVE + return SOURCE_FILENIO def title(self) -> str: return "Google Drive" def maxCount(self) -> None: - return self.config.get(Setting.MAX_BACKUPS_IN_GOOGLE_DRIVE) + return self.config.get(Setting.MAX_BACKUPS_IN_FILENIO) def upload(self) -> bool: return self.config.get(Setting.ENABLE_DRIVE_UPLOAD) @@ -106,7 +106,7 @@ def checkBeforeChanges(self): existing.get('id'), existing.get('name')) def icon(self) -> str: - return "google-drive" + return "filenio" def isWorking(self): return self._uploadedAtLeastOneChunk diff --git a/hassio-google-drive-backup/backup/exceptions/exceptions.py b/hassio-google-drive-backup/backup/exceptions/exceptions.py index 41ab0057..8a1733f8 100644 --- a/hassio-google-drive-backup/backup/exceptions/exceptions.py +++ b/hassio-google-drive-backup/backup/exceptions/exceptions.py @@ -308,7 +308,7 @@ def message(self): return "Google Drive denied the request due to permissions." def code(self): - return "google_drive_permissions" + return "filenio_permissions" class LowSpaceError(KnownError): diff --git a/hassio-google-drive-backup/backup/ha/haupdater.py b/hassio-google-drive-backup/backup/ha/haupdater.py index e1ff1b77..2426f0f3 100644 --- a/hassio-google-drive-backup/backup/ha/haupdater.py +++ b/hassio-google-drive-backup/backup/ha/haupdater.py @@ -9,7 +9,7 @@ from .harequests import HaRequests from ..time import Time from ..worker import Worker -from ..const import SOURCE_HA, SOURCE_GOOGLE_DRIVE +from ..const import SOURCE_HA, SOURCE_FILENIO from ..logger import getLogger logger = getLogger(__name__) @@ -144,7 +144,7 @@ def makeBackupData(backup: Backup): "slug": backup.slug() } ha_backups = list(filter(lambda s: s.getSource(SOURCE_HA) is not None, backups)) - drive_backups = list(filter(lambda s: s.getSource(SOURCE_GOOGLE_DRIVE) is not None, backups)) + drive_backups = list(filter(lambda s: s.getSource(SOURCE_FILENIO) is not None, backups)) last_uploaded = "Never" if len(drive_backups) > 0: @@ -155,10 +155,10 @@ def makeBackupData(backup: Backup): "attributes": { "friendly_name": "Snapshot State", "last_snapshot": last, # type: ignore - "snapshots_in_google_drive": len(drive_backups), + "snapshots_in_filenio": len(drive_backups), "snapshots_in_hassio": len(ha_backups), "snapshots_in_home_assistant": len(ha_backups), - "size_in_google_drive": Estimator.asSizeString(sum(map(lambda v: v.sizeInt(), drive_backups))), + "size_in_filenio": Estimator.asSizeString(sum(map(lambda v: v.sizeInt(), drive_backups))), "size_in_home_assistant": Estimator.asSizeString(sum(map(lambda v: v.sizeInt(), ha_backups))), "snapshots": list(map(makeBackupData, backups)) } @@ -173,16 +173,16 @@ def makeBackupData(backup: Backup): "last_backup": last, # type: ignore "next_backup": next, "last_uploaded": last_uploaded, - "backups_in_google_drive": len(drive_backups), + "backups_in_filenio": len(drive_backups), "backups_in_home_assistant": len(ha_backups), - "size_in_google_drive": Estimator.asSizeString(sum(map(lambda v: v.sizeInt(), drive_backups))), + "size_in_filenio": Estimator.asSizeString(sum(map(lambda v: v.sizeInt(), drive_backups))), "size_in_home_assistant": Estimator.asSizeString(sum(map(lambda v: v.sizeInt(), ha_backups))), "backups": list(map(makeBackupData, backups)) } - if SOURCE_GOOGLE_DRIVE in source_metrics and 'free_space' in source_metrics[SOURCE_GOOGLE_DRIVE]: - attr["free_space_in_google_drive"] = source_metrics[SOURCE_GOOGLE_DRIVE]['free_space'] + if SOURCE_FILENIO in source_metrics and 'free_space' in source_metrics[SOURCE_FILENIO]: + attr["free_space_in_filenio"] = source_metrics[SOURCE_FILENIO]['free_space'] else: - attr["free_space_in_google_drive"] = "" + attr["free_space_in_filenio"] = "" return { "state": self._state(), "attributes": attr diff --git a/hassio-google-drive-backup/backup/model/backups.py b/hassio-google-drive-backup/backup/model/backups.py index 4b3359dd..2950711a 100644 --- a/hassio-google-drive-backup/backup/model/backups.py +++ b/hassio-google-drive-backup/backup/model/backups.py @@ -4,7 +4,7 @@ from dateutil.tz import tzutc from ..util import Estimator -from ..const import SOURCE_GOOGLE_DRIVE, SOURCE_HA +from ..const import SOURCE_FILENIO, SOURCE_HA from ..logger import getLogger from ..config import CreateOptions @@ -266,7 +266,7 @@ def status(self) -> str: if status: return status - inDrive = self.getSource(SOURCE_GOOGLE_DRIVE) is not None + inDrive = self.getSource(SOURCE_FILENIO) is not None inHa = self.getSource(SOURCE_HA) is not None if inDrive and inHa: diff --git a/hassio-google-drive-backup/backup/model/drivebackup.py b/hassio-google-drive-backup/backup/model/drivebackup.py index 1e227047..22d1028a 100644 --- a/hassio-google-drive-backup/backup/model/drivebackup.py +++ b/hassio-google-drive-backup/backup/model/drivebackup.py @@ -1,7 +1,7 @@ from .backups import AbstractBackup from typing import Any, Dict -from ..const import SOURCE_GOOGLE_DRIVE, NECESSARY_PROP_KEY_SLUG, NECESSARY_PROP_KEY_DATE, NECESSARY_PROP_KEY_NAME, PROP_NOTE +from ..const import SOURCE_FILENIO, NECESSARY_PROP_KEY_SLUG, NECESSARY_PROP_KEY_DATE, NECESSARY_PROP_KEY_NAME, PROP_NOTE from ..exceptions import ensureKey from ..config import BoolValidator from ..time import Time @@ -35,7 +35,7 @@ def __init__(self, data: Dict[Any, Any]): date=Time.parse( ensureKey(NECESSARY_PROP_KEY_DATE, props, DRIVE_KEY_TEXT)), size=int(ensureKey("size", data, DRIVE_KEY_TEXT)), - source=SOURCE_GOOGLE_DRIVE, + source=SOURCE_FILENIO, backupType=props.get(PROP_TYPE, "?"), version=props.get(PROP_VERSION, None), protected=BoolValidator.strToBool(props.get(PROP_PROTECTED, "?")), diff --git a/hassio-google-drive-backup/backup/server/server.py b/hassio-google-drive-backup/backup/server/server.py index bad3bcaa..90b7029a 100644 --- a/hassio-google-drive-backup/backup/server/server.py +++ b/hassio-google-drive-backup/backup/server/server.py @@ -95,7 +95,7 @@ async def authorize(self, request: Request): raise self.logError(request, e) content = "The server encountered an error while processing this request: " + str(e) + "
" - content += "Please file an issue on Home Assistant Google Backup's GitHub page so I'm aware of this problem or attempt authorizing with Google Drive again." + content += "Please file an issue on Home Assistant Google Backup's GitHub page so I'm aware of this problem or attempt authorizing with Google Drive again." return Response(status=500, body=content) else: raise HTTPBadRequest() diff --git a/hassio-google-drive-backup/backup/static/index.jinja2 b/hassio-google-drive-backup/backup/static/index.jinja2 index e5f72a20..68bd7427 100644 --- a/hassio-google-drive-backup/backup/static/index.jinja2 +++ b/hassio-google-drive-backup/backup/static/index.jinja2 @@ -46,7 +46,7 @@ Clicking this link authenticates you with an external domain maintained by the developer of this add-on (habackup.io). -
  • You can read this to understand what this means and why it's necessary. +
  • You can read this to understand what this means and why it's necessary.
  • By doing this you must agree to the Privacy Policy and Terms of Service @@ -83,7 +83,7 @@
    Follow the instructions + href="https://github.com/sabeechen/hassio-filenio-backup/blob/master/LOCAL_AUTH.md">instructions here to get your own client ID and client secret from Google's Cloud Console. This is a much more complicated and time consuming approach but doesn't require you to authenticate yourself with an external domain.
    diff --git a/hassio-google-drive-backup/backup/static/js/about.js b/hassio-google-drive-backup/backup/static/js/about.js index 589eea8c..72bceee3 100644 --- a/hassio-google-drive-backup/backup/static/js/about.js +++ b/hassio-google-drive-backup/backup/static/js/about.js @@ -1,7 +1,7 @@ let contributorsLoaded = false; -const CONTRIBUTORS_API_URL = "https://api.github.com/repos/sabeechen/hassio-google-drive-backup/contributors"; -const CONTRIBUTOR_COMMIT_URL = "https://github.com/sabeechen/hassio-google-drive-backup/commits?author={AUTHOR}"; +const CONTRIBUTORS_API_URL = "https://api.github.com/repos/sabeechen/hassio-filenio-backup/contributors"; +const CONTRIBUTOR_COMMIT_URL = "https://github.com/sabeechen/hassio-filenio-backup/commits?author={AUTHOR}"; const CONTRIBUTORS_COUNT_TO_SHOW = 14; const EXTRA_CONTRIBUTORS = { diff --git a/hassio-google-drive-backup/backup/static/js/scripts.js b/hassio-google-drive-backup/backup/static/js/scripts.js index b1af89c3..afb4274a 100644 --- a/hassio-google-drive-backup/backup/static/js/scripts.js +++ b/hassio-google-drive-backup/backup/static/js/scripts.js @@ -819,7 +819,7 @@ function populateDnsInfo(target, data) { function populateGitHubInfo(target, error) { $('#generic_error_title', target).text(error.message); $('#generic_error_details', target).text(error.details); - $('#error_github_search', target).attr("href", "https://github.com/sabeechen/hassio-google-drive-backup/issues?q=" + encodeURIComponent("\"" + error.message.replace("\"", "\\\"") + "\"")); + $('#error_github_search', target).attr("href", "https://github.com/sabeechen/hassio-filenio-backup/issues?q=" + encodeURIComponent("\"" + error.message.replace("\"", "\\\"") + "\"")); } function simulateError() { diff --git a/hassio-google-drive-backup/backup/static/layouts/partials/error-messages.jinja2 b/hassio-google-drive-backup/backup/static/layouts/partials/error-messages.jinja2 index a6809501..74abb487 100644 --- a/hassio-google-drive-backup/backup/static/layouts/partials/error-messages.jinja2 +++ b/hassio-google-drive-backup/backup/static/layouts/partials/error-messages.jinja2 @@ -90,7 +90,7 @@
  • Make your backups smaller (see this + href="https://github.com/sabeechen/hassio-filenio-backup#will-this-fill-up-my-filenio-why-are-my-backups-so-big">this tip). You can also click the little info next to backups below to see which parts of them are taking up the most space. @@ -153,7 +153,7 @@
  • Make your backups smaller (see this tip)
  • {% endcall %} @@ -510,7 +510,7 @@

    Note: Google's authentication mechanisms require you to select your folder through an external domain, which is where the "Choose Folder" link will take you. - See here for details if you'd like to know more about why.

    {% endcall %} @@ -560,7 +560,7 @@

    Note: Google's authentication mechanisms require you to select your folder through an external domain, which is where the "choose folder" link below will take you. - See here for details if you'd like to know more about why.

    {% endcall %} @@ -602,7 +602,7 @@ @@ -222,7 +222,7 @@

    Google recently announced changes they're making to how their OAuth credentials are generated. You previously followed - these instructions to set up credentials + these instructions to set up credentials the add-on can use to upload to Google Drive. If you did that before March 16 2022, Google is going to make those credentials invalid in October of 2022. If you are affected this means that in October 2022 the add-on will be unable to authorize with Google Drive and your backups will not get uploaded.

    @@ -231,7 +231,7 @@

    If you are affected, you likely received an email from Google titled 'Migrate your OAuth out-of-band flow'. To make your credentials work, please follow the steps linked here to - make your credentials and reauthorize the addon. + make your credentials and reauthorize the addon. You don't need to follow all the steps exactly; you just need to modify what you have to match up with the instructions. In particular please ensure that: