feat: integrate MokoGitea license system for update checks

Update server now points to MokoGitea's dynamic endpoint which
validates license keys (dlid) and generates update XML from git
releases. Users enter the download key via Joomla's native
System → Update Sites interface. Legacy static URLs are auto-migrated
on install/update.

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-05-31 10:36:53 -05:00
parent 7ba7337054
commit 1b6747d9f9
8 changed files with 82 additions and 59 deletions
+17 -5
View File
@@ -219,11 +219,12 @@ class Pkg_MokowaasInstallerScript
}
/**
* Ensure the MokoWaaS update server entry stays enabled.
* Ensure the MokoWaaS update server entry stays enabled and points
* to the correct dynamic endpoint with the license key attached.
*
* Joomla stores update server records in #__update_sites. If a tenant
* or automation disables it, the site stops receiving updates. This
* re-enables it on every install/update.
* Migrates legacy static URLs (raw/branch/main/updates.xml) to the
* dynamic MokoGitea update feed, and syncs the license key from
* plugin params into extra_query so Joomla sends it as dlid.
*
* @return void
*
@@ -235,7 +236,18 @@ class Pkg_MokowaasInstallerScript
{
$db = Factory::getDbo();
// Find update site by name or URL pattern
// Migrate legacy static URL to dynamic MokoGitea endpoint
$db->setQuery(
$db->getQuery(true)
->update($db->quoteName('#__update_sites'))
->set($db->quoteName('location') . ' = '
. $db->quote('https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/updates.xml'))
->where($db->quoteName('location') . ' LIKE '
. $db->quote('%MokoWaaS/raw/branch/%updates.xml%'))
);
$db->execute();
// Enable all MokoWaaS update sites
$query = $db->getQuery(true)
->update($db->quoteName('#__update_sites'))
->set($db->quoteName('enabled') . ' = 1')