qr/README.md

59 lines
1.1 KiB
Markdown

# qr
QR-code webpage intended to be hosted at:
```text
192.168.0.226:/var/www/html/qr
```
Open QR codes with:
```text
http://192.168.0.226/qr?what=wifi
http://192.168.0.226/qr?what=haguest
```
If `what` is not defined in `what.json`, the page returns `404 Not Found`.
## QR data
Copy the example on the web server:
```bash
cp what.example.json what.json
```
Edit `what.json` on the server. It is ignored by git and excluded from deploys because it may contain secrets like Wi-Fi passwords.
Supported entries:
```json
{
"wifi": {
"type": "wifi",
"label": "Home Wi-Fi",
"ssid": "Your WiFi name",
"password": "Your WiFi password",
"security": "WPA",
"hidden": false
},
"haguest": {
"type": "url",
"label": "HA Guest",
"url": "http://192.168.0.226/haguest"
}
}
```
The key name, such as `wifi` or `haguest`, is shown in the centre of the QR code.
## Deploy
```bash
./deploy.sh
```
The deployment helper uses `rsync` and can be overridden with:
- `QR_DEPLOY_HOST` (default: `192.168.0.226`)
- `QR_DEPLOY_DEST` (default: `/var/www/html/qr`)