Files
radiantwave/src/db/db_keys.h
T
NeilClack c3b3d6774a Warning screen, smarter license re-validation, version reporting
Warning screen
- New reusable WarningPage (word-wrapped message, ENTER acknowledges and
  continues to the screen you were about to enter).
- First use: pressing Play while the selected audio is still downloading.
  Dynamic Audio requires every file; a fixed track requires its own file.

License re-validation
- No longer re-verifies on every Home render. Checks now run only when the
  email/license key is entered or changed, on the manual option, at startup
  when already due, and hourly while valid.
- Invalid + unchanged credentials are never re-checked (persisted pair).
- Valid re-checks at most once per hour, anchored on a DB timestamp so an
  overdue check runs immediately after a power cycle.
- New system_kv keys track the checked pair, outcome, and last-check time.
- Added a System Settings row "Manually Validate License Key OK|Invalid"
  (OK green, Invalid red, label white) that runs a check immediately.

Portal / local integration
- License validation request now sends the app version as `appVersion`.
- The entered license key is mirrored to ~/.local/radiantwave/license.txt.

Misc
- "Please connect to WiFi" only shows when no WiFi is joined AND the internet
  is unreachable (fixes the NetworkManager-missing and Ethernet cases).
- Added unit tests for the audio-download warning, license scheduling policy,
  license request shape, and the new settings-menu entry.
2026-10-14 10:58:40 -05:00

44 lines
2.1 KiB
C++

#pragma once
namespace radiantwave::db {
// Canonical system_kv keys. These are the single source of truth for where
// device configuration lives in the local database.
constexpr const char* KV_EMAIL_ADDRESS = "email_address";
constexpr const char* KV_LICENSE_KEY = "license_key";
// Unix epoch seconds of the last successful license validation against the
// portal. Used to grant a 7-day offline grace window so transient network
// outages do not revoke a known-good license.
constexpr const char* KV_LICENSE_LAST_VERIFIED = "license_last_verified";
// The license key/email pair the most recent completed check used, and its
// outcome ("valid"/"invalid"). An invalid pair is not re-checked until one of
// the two stored values changes, so a slow device does not hammer the portal.
constexpr const char* KV_LICENSE_CHECKED_KEY = "license_checked_key";
constexpr const char* KV_LICENSE_CHECKED_EMAIL = "license_checked_email";
constexpr const char* KV_LICENSE_CHECK_STATUS = "license_check_status";
// Unix epoch seconds of the last license check attempt (success or failure).
// Anchors the hourly re-check of a valid license; an overdue check runs
// immediately on the next boot instead of waiting a fresh hour.
constexpr const char* KV_LICENSE_LAST_CHECK = "license_last_check";
// The System Name the user typed on the Kiosk (trimmed). A human-readable label
// set only here; never a reference or key.
constexpr const char* KV_SYSTEM_NAME = "system_name";
// The last System Name the server accepted. Used to revert a local change when
// the server reports a conflict or invalid value.
constexpr const char* KV_SYSTEM_NAME_SYNCED = "system_name_synced";
// "1" while the local System Name still needs to be sent to the portal (e.g.
// the license is not validated yet, or a previous sync failed).
constexpr const char* KV_SYSTEM_NAME_PENDING = "system_name_pending_sync";
// The most recent System Name status message to show the user (e.g. a conflict
// message after a background sync). Cleared once consumed/acknowledged.
constexpr const char* KV_SYSTEM_NAME_MESSAGE = "system_name_message";
} // namespace radiantwave::db