Skip to content

Commit

Permalink
replaced mentions to "google drive" with filenio
Browse files Browse the repository at this point in the history
  • Loading branch information
juskalalie committed Feb 25, 2025
1 parent 64cdcd0 commit e2e1c8b
Show file tree
Hide file tree
Showing 55 changed files with 261 additions and 261 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/test_staging_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## About the project

The project is mostly maintained by [email protected], and is a fork from [the original Google Drive backup add-on](https://github.com/sabeechen/hassio-google-drive-backup) from Stephen Beechen ([email protected]). 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 [email protected], and is a fork from [the original Google Drive backup add-on](https://github.com/sabeechen/hassio-filenio-backup) from Stephen Beechen ([email protected]). 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.
Expand All @@ -12,11 +12,11 @@ The project is mostly maintained by [email protected], 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: [email protected]
- 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).
Expand All @@ -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. <kbd>File</kbd> > <kbd>Open Folder</kbd> to open the cloned repository folder.
Expand All @@ -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:

Expand All @@ -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 <kbd>Supervisor</kbd> -> <kbd>Addon-Store</kbd>, <kbd>Reload</kbd>, 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 <kbd>Supervisor</kbd> -> <kbd>Addon-Store</kbd>, <kbd>Reload</kbd>, 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"
}
```
Expand All @@ -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.
2 changes: 1 addition & 1 deletion LOCAL_AUTH.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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 <kbd>Settings</kbd> -> <kbd>Add-ons</kbd> -> <kbd>Add-on Store (Bottom Right)</kbd>.

2. Click the 3-dots menu at upper right <kbd>...</kbd> > <kbd>Repositories</kbd> 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 <kbd>...</kbd> > <kbd>Repositories</kbd> and add this repository's URL: [https://github.com/sabeechen/hassio-filenio-backup](https://github.com/sabeechen/hassio-filenio-backup)

<img src="images/add_ss.png" width="300"/>

Expand All @@ -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?
Expand Down Expand Up @@ -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...
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion donate-crypto.md
Original file line number Diff line number Diff line change
@@ -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
<br><br>
### <img src="images/monero-button.svg" width="200" /><br>
<img src="images/monero-qr.svg" width="200" />
Expand Down
Loading

0 comments on commit e2e1c8b

Please sign in to comment.