feat: auto-disable message authentication at startup
SNEK resets to authentication=enabled on every restart and does not persist the state anywhere. The entrypoint now waits for the SNEK API to be ready and POSTs to /ned/saturation to disable auth automatically. - Registered devices without HMAC public keys (e.g. demo Sens'it) are decoded immediately on first boot and after any pod restart - To re-enable auth in production, comment the polling block in entrypoint.sh README updated with details in the "Configuration des devices" section. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -16,5 +16,23 @@ cd /opt/snek
|
||||
./foxctl || echo "foxctl RC=$? (may be normal if firmware already loaded)"
|
||||
sleep 2
|
||||
|
||||
# Auto-disable message authentication after SNEK is up
|
||||
# SNEK resets to auth=enabled on every restart; we disable it so registered
|
||||
# devices without a public key can still be decoded
|
||||
(
|
||||
for i in $(seq 1 30); do
|
||||
if curl -sf http://localhost:8085/ned/saturation > /dev/null 2>&1; then
|
||||
echo "==> SNEK API ready, disabling message authentication..."
|
||||
curl -sX POST -H "Content-Type: application/json" \
|
||||
-d '{"saturation":false,"authentication":false,"dongleDisconnected":false}' \
|
||||
http://localhost:8085/ned/saturation > /dev/null
|
||||
echo "==> Message authentication disabled"
|
||||
exit 0
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
echo "!!! Warning: SNEK API not reachable after 60s, auth not toggled"
|
||||
) &
|
||||
|
||||
echo "==> Starting SNEK main_sigfox on port 8085..."
|
||||
exec ./main_sigfox
|
||||
|
||||
Reference in New Issue
Block a user