Fetch_rain.ino carried the WiFi password and three ThingHTTP API keys as plaintext literals. The sketch now includes the non-versioned secrets.h, which defines WIFI_SSID, WIFI_PASSWORD and the three THINGHTTP_KEY_* symbols (one per scheduled channel: today, tmrw, aftmrw). secrets.h.example lists all five placeholders and .gitignore keeps secrets.h out of the repository. Why: credentials must not live in version control. The old values are still in the history and in clones, so they must be rotated and the API keys reissued.
22 lines
842 B
Markdown
22 lines
842 B
Markdown
https://youtu.be/7n7HcTeeHdM
|
|
|
|
## Configuration
|
|
|
|
The WiFi credentials are **not** stored in the repository. The sketch
|
|
`Fetch_rain/Fetch_rain.ino` includes a non-versioned header `secrets.h`
|
|
that defines `WIFI_SSID` and `WIFI_PASSWORD`:
|
|
|
|
```bash
|
|
cp Fetch_rain/secrets.h.example Fetch_rain/secrets.h
|
|
# edit Fetch_rain/secrets.h with your own network name and password
|
|
```
|
|
|
|
`secrets.h` is listed in `.gitignore`, so it is never committed. The
|
|
sketch does not compile without it. If the old password was ever
|
|
pushed, change it on the router as well as in `secrets.h`.
|
|
|
|
`secrets.h` also defines the three ThingHTTP API keys used by the daily
|
|
scheduled channels (`THINGHTTP_KEY_TODAY`, `THINGHTTP_KEY_TMRW`,
|
|
`THINGHTTP_KEY_AFTMRW`). They used to be hard-coded in the sketch; the old
|
|
values were committed, so they must be regenerated in ThingHTTP.
|