Skip to content

Commit

Permalink
Merge pull request #463 from sabeechen/dev
Browse files Browse the repository at this point in the history
Release 0.105.1
  • Loading branch information
sabeechen committed Sep 7, 2021
2 parents a53450c + e536f02 commit 60f153d
Show file tree
Hide file tree
Showing 105 changed files with 10,690 additions and 9,934 deletions.
7 changes: 7 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.9-buster

WORKDIR /usr/src/install
RUN apt-get update
RUN apt-get install fping
COPY requirements-dev.txt ./
RUN pip install --no-cache-dir -r requirements-dev.txt
5 changes: 5 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"build": { "dockerfile": "Dockerfile" },
"extensions": ["ms-python.python", "wholroyd.jinja","ms-python.vscode-pylance"],
"forwardPorts": [3000]
}
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r hassio-google-drive-backup/dev/requirements-dev.txt
pip install -r .devcontainer/requirements-dev.txt
- name: Install fping
run: sudo apt-get install fping
- name: Lint with flake8
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ hassio-google-drive-backup/dev/data/retained.json
junit/test-results.xml
.coverage
coverage.xml
hassio-google-drive-backup/dev/data/data_cache.json
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"label": "Install development dependencies",
"type": "process",
"command": "${config:python.pythonPath}",
"args": ["-m", "pip", "install", "-r", "hassio-google-drive-backup/dev/requirements-dev.txt"],
"args": ["-m", "pip", "install", "-r", ".devcontainer/requirements-dev.txt"],
"problemMatcher": [],
"group": {
"kind": "build",
Expand Down
12 changes: 8 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ The project is mostly maintained by Stephen Beechen (stephen@beechens.com) whom
- Releases of the addon are made as-needed for bug fixes and new features. If you've made a signifigant change to the addon, you can expect me to communicate to you when you can expect to see it released. Important fixes will often demand an out-of-schedule rushed release.
## Setting up a Development Environment

### Easy: Using the Dev Container
If the you open the repository folder in Visual Studio code with docker installed, it will notice that it provides a devcontainer configuration and ask you to open it. This is the easiest method to use, sets up all the necessary plugins and dependencies, and its how I (the primary maintainer of the project) develop the addon.

### Harder but also works: Manual Setup
1. Install [Visual Studio Code](https://code.visualstudio.com/)
2. Install [Python 3.8](https://www.python.org/downloads/) for your platform.
3. Install a git client. I like [GitHub Desktop](https://desktop.github.com/)
Expand All @@ -34,7 +38,7 @@ The project is mostly maintained by Stephen Beechen (stephen@beechens.com) whom
6. <kbd>File</kbd> > <kbd>Open Folder</kbd> to open the cloned repository folder.
7. Open the terminal (`Ctrl` + `Shift` + <code>`</code>) and install the Python packages required for development:
```
> python3.8 -m pip install -r hassio-google-drive-backup/dev/requirements-dev.txt
> python3.8 -m pip install -r .devcontainer/requirements-dev.txt
```
That should set you up!

Expand All @@ -53,14 +57,14 @@ To try out changes locally during development, I've written a server that simula

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:

- `Run Addons (Dev Backends)` - This starts up the addon web server and connects it to the simulated Home Assistant, Supervisor, and Google Drive. All of the functionality of the addon is supported (creating/deleting snapshot, authenticating with Google drive, etc.).
- `Run Addons (Dev Backends)` - This starts up the addon web server and connects it to the simulated Home Assistant, Supervisor, and Google Drive. All of the functionality of the addon is supported (creating/deleting backups, authenticating with Google drive, etc.).
- `Run Addons (Dev Drive)` - This should be unused by contributors, as its only used for testing prior to a release by @sabeechen.
- `Run Addons (Real Drive)` - This uses a simulated Home Assistant and Supervisor, but connects to the real Google Drive. You'll have to use a real Google account to work with this configuration.

## The Staging Addon
Any submissions made to the dev branch (including PR's) get automatically built and deployed to a staging version of the addon. You can install this by adding the repository [https://github.com/sabeechen/hgdb-dev-staging](https://github.com/sabeechen/hgdb-dev-staging) to your home assistant machine. This addon is identical to what will be released with the next version of the addon but:
- It is a separate "App" in Google's perspective, so it can't see any snapshots created by the "Production" addon.
- Its not reocmmended to run it along side the "Production" addon on the same machine (it see's the same snapshots).
- It is a separate "App" in Google's perspective, so it can't see any backups created by the "Production" addon.
- Its not reocmmended to run it along side the "Production" addon on the same machine (it see's the same backups).
- It talks to [https://dev.habackup.io](https://dev.habackup.io) instead of [https://habackup.io](https://habackup.io) to authenticate with Google Drive.
- If you submit code to the dev branch, you should see an update to the addon show up in Home Assistant ~25 minutes later.
- It is the "bleeding edge" of changes, so it might have bugs. Be warned!
Expand Down
2 changes: 1 addition & 1 deletion LOCAL_AUTH.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Local Authentication
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 serveral 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 me. The typical authentication workflow never sees your Google account password, but it does recieve a token from Google that, if I were malicious, I could use to see the snapshots you've backed up to Drive. I don't store this token anywhere and instead just pass it back to you, but becase 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 :)
* You'd like to avoid having your account's credentials go through a server maintained by me. The typical authentication workflow never sees your Google account password, but it does recieve 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 becase 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 applogogies if things fall into disrepair.

These instructions are current as of March 2021. If you do this and notice they're out of date, Please file an issue on this project's issue page so I can be made aware of it. Thanks!
Expand Down
Loading

0 comments on commit 60f153d

Please sign in to comment.