Document repo; add GitHub backup mirror via origin dual push URL
Rewrite the stale scratch README into a project README (what the repo is, token/deploy usage, remotes). Configure origin with a second push URL so a single 'git push' mirrors to Forgejo and the new GitHub backup at git@github.com:jmtremblay2/home-assistant.git. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7a0d75d9db
commit
2bc7db6e75
1 changed files with 51 additions and 4 deletions
55
README.md
55
README.md
|
|
@ -1,6 +1,53 @@
|
|||
get my home assistant token by
|
||||
# home-assistant
|
||||
|
||||
ha_token=$(pass show home-assistant/192.168.128.3/jm/api) # it asks me to touch the yubikey.
|
||||
server: 192.168.128.3
|
||||
Source of truth for the Home Assistant automations on the HA server at
|
||||
`192.168.128.3:8123`. The automations live in [`automations/`](automations/) as
|
||||
YAML and are deployed to HA over its REST config API with
|
||||
[`deploy.py`](deploy.py). HA is only a deploy target — it never reads these files
|
||||
directly. See [`AUTOMATIONS.md`](AUTOMATIONS.md) for the full spec (identity
|
||||
model, per-rule behavior, failure modes, changelog).
|
||||
|
||||
I want you to add an automation to set the AC thermostat to 85 at 17:58, 90 at 17:59, 85 at 18:00, 90 at 18:01 and so on until 18:20
|
||||
## Access
|
||||
|
||||
The HA API token is read from the shell environment:
|
||||
|
||||
```bash
|
||||
source ~/.bashrc # exports HA_API_KEY
|
||||
```
|
||||
|
||||
The `README`'s original `pass show home-assistant/192.168.128.3/jm/api` route
|
||||
works interactively but requires a YubiKey touch and times out in
|
||||
non-interactive shells, so `HA_API_KEY` in `~/.bashrc` is the practical source.
|
||||
|
||||
## Deploy
|
||||
|
||||
```bash
|
||||
source ~/.bashrc
|
||||
python3 deploy.py --check # parse only
|
||||
python3 deploy.py # deploy all automations/*.yaml in place (by id)
|
||||
```
|
||||
|
||||
## Remotes
|
||||
|
||||
| Name | URL | Role |
|
||||
|---|---|---|
|
||||
| `origin` | `ssh://forgejo@forgejo.jmopines.com:2222/jm/home-assistant.git` | **primary** (fetch + push) |
|
||||
| `backup` | `git@github.com:jmtremblay2/home-assistant.git` | GitHub backup mirror (push only) |
|
||||
|
||||
**`origin` is configured with two push URLs**, so a plain `git push` mirrors to
|
||||
**both** Forgejo and GitHub in one command — the GitHub backup stays current
|
||||
automatically. Fetches still come only from Forgejo.
|
||||
|
||||
```bash
|
||||
git push # -> Forgejo AND GitHub (backup) together
|
||||
```
|
||||
|
||||
The separate `backup` remote is kept for explicit/manual use (e.g.
|
||||
`git fetch backup`). To inspect the push targets: `git remote -v`. This
|
||||
auto-mirror is a local git config (`remote.origin.pushurl`), not stored in the
|
||||
repo, so it must be re-added after a fresh clone:
|
||||
|
||||
```bash
|
||||
git remote set-url --add --push origin ssh://forgejo@forgejo.jmopines.com:2222/jm/home-assistant.git
|
||||
git remote set-url --add --push origin git@github.com:jmtremblay2/home-assistant.git
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue