# Daily licence entitlement refresh (customer builds only).
#
# ⚠️ WHY THIS MATTERS: lic_client_cache_valid() treats a cached entitlement as
# stale once it is older than grace_days (14 by default). With nothing refreshing
# it, a PAYING customer's add-ons all lock themselves 14 days after activation
# and the only cure is pressing Refresh by hand. The client was written to be
# refreshed daily; this is the thing that does it.
#
# Runs as www-data on purpose: the client rewrites
# /var/www/alpha-private/license-client.json, and a root-owned copy of that file
# is unreadable by the panel — which shows up as "Not licensed" on a licence that
# is perfectly valid.
#
# The guard keeps this harmless on the VENDOR's own panel, where bin/license-cron.php
# does not exist (the licence client is applied by Distribution/build.sh, so only
# customer builds have it) — provisioning installs every file in cron/ unconditionally.
17 4 * * * www-data [ -f /var/www/alpha/bin/license-cron.php ] && /usr/bin/php /var/www/alpha/bin/license-cron.php >/dev/null 2>&1
