fix: authenticate device config sync like upload client
- send X-Device-Name and X-Api-Key to /api/device-config - require YARIS_DEVICE_NAME alongside shared upload creds - fix server create_device output to match actual Pi env names - document shared upload/config sync credential requirements Co-authored-by: Copilot <[email protected]>
This commit is contained in:
+2
-2
@@ -97,8 +97,8 @@ Run this once per device (e.g. once for the Pi) after the stack is up:
|
||||
docker compose exec api python3 scripts/create_device.py yaris-2013
|
||||
```
|
||||
|
||||
This prints a one-time API key — copy the `YARIS_UPLOAD_DEVICE_NAME` /
|
||||
`YARIS_UPLOAD_API_KEY` values into the Pi's upload-client config. Only the
|
||||
This prints a one-time API key — copy the `YARIS_DEVICE_NAME` /
|
||||
`YARIS_API_KEY` values into the Pi's upload-client config. Only the
|
||||
key's sha256 hash is stored server-side; the raw key is never shown again
|
||||
(re-run the script with the same device name to rotate/replace the key).
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ def main():
|
||||
|
||||
print(f"Device '{device_name}' registered (id={device_id}).")
|
||||
print()
|
||||
print("Save these on the Pi (e.g. in server/.env-style local config, gitignored):")
|
||||
print(f" YARIS_UPLOAD_DEVICE_NAME={device_name}")
|
||||
print(f" YARIS_UPLOAD_API_KEY={raw_key}")
|
||||
print("Save these on the Pi (e.g. in db/upload_creds.env, gitignored):")
|
||||
print(f" YARIS_DEVICE_NAME={device_name}")
|
||||
print(f" YARIS_API_KEY={raw_key}")
|
||||
print()
|
||||
print("This key will not be shown again - only its hash is stored server-side.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user