feat: add admin control panel, feature plugin architecture, and universal workflows
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 2s
Universal: Auto Version Bump / Version Bump (push) Failing after 4s
Update Server / Update Server (push) Failing after 9s
Platform: moko-platform CI / Gate 1: Code Quality (push) Failing after 25s
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Generic: Repo Health / Release configuration (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 2s
Universal: Auto Version Bump / Version Bump (push) Failing after 4s
Update Server / Update Server (push) Failing after 9s
Platform: moko-platform CI / Gate 1: Code Quality (push) Failing after 25s
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Generic: Repo Health / Release configuration (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
- Add admin dashboard to com_mokowaas with site info bar, feature plugin grid with AJAX toggles, and quick actions (clear cache, check updates) - Split monolithic system plugin into 4 toggleable feature plugins: Firewall, Tenant Restrictions, DevTools, and Health Monitor - Add MokoWaaSHelper utility class for shared master-user detection - Add static updates.xml (licensing system deferred) - Restore universal moko-platform workflows - Add param migration in package script for existing sites - Fix license key warning to show once per session - Rename license key messages to "Moko Consulting License Key" Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+134
-6
@@ -38,10 +38,17 @@ class Pkg_MokowaasInstallerScript
|
||||
$this->cleanupLegacyExtensions();
|
||||
|
||||
$this->enablePlugin('system', 'mokowaas');
|
||||
$this->enablePlugin('system', 'mokowaas_firewall');
|
||||
$this->enablePlugin('system', 'mokowaas_tenant');
|
||||
$this->enablePlugin('system', 'mokowaas_devtools');
|
||||
$this->enablePlugin('system', 'mokowaas_monitor');
|
||||
$this->enablePlugin('webservices', 'mokowaas');
|
||||
$this->enablePlugin('task', 'mokowaasdemo');
|
||||
$this->enablePlugin('task', 'mokowaassync');
|
||||
|
||||
// Migrate params from core plugin to feature plugins (one-time)
|
||||
$this->migrateFeatureParams();
|
||||
|
||||
// Mark MokoWaaS extensions as protected (prevents disable/uninstall at framework level)
|
||||
$this->protectExtensions();
|
||||
|
||||
@@ -198,6 +205,10 @@ class Pkg_MokowaasInstallerScript
|
||||
$elements = [
|
||||
$db->quote('pkg_mokowaas'),
|
||||
$db->quote('mokowaas'),
|
||||
$db->quote('mokowaas_firewall'),
|
||||
$db->quote('mokowaas_tenant'),
|
||||
$db->quote('mokowaas_devtools'),
|
||||
$db->quote('mokowaas_monitor'),
|
||||
$db->quote('com_mokowaas'),
|
||||
$db->quote('mokowaasdemo'),
|
||||
$db->quote('mokowaassync'),
|
||||
@@ -237,7 +248,7 @@ class Pkg_MokowaasInstallerScript
|
||||
try
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
$dynamicUrl = 'https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/updates.xml';
|
||||
$dynamicUrl = 'https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/raw/branch/main/updates.xml';
|
||||
|
||||
// Find all MokoWaaS update sites
|
||||
$query = $db->getQuery(true)
|
||||
@@ -325,14 +336,16 @@ class Pkg_MokowaasInstallerScript
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
|
||||
// Migrate legacy static URL to dynamic MokoGitea endpoint
|
||||
$staticUrl = 'https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/raw/branch/main/updates.xml';
|
||||
|
||||
// Migrate old dynamic URL to static raw file URL
|
||||
$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%'))
|
||||
->set($db->quoteName('location') . ' = ' . $db->quote($staticUrl))
|
||||
->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoWaaS%')
|
||||
. ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoWaaS%') . ')')
|
||||
->where($db->quoteName('location') . ' != ' . $db->quote($staticUrl))
|
||||
);
|
||||
$db->execute();
|
||||
|
||||
@@ -414,4 +427,119 @@ class Pkg_MokowaasInstallerScript
|
||||
// Silent failure — heartbeat is non-critical
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* One-time migration of params from the monolithic core plugin to
|
||||
* the new feature plugins. Copies security, tenant, and dev params.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 02.32.00
|
||||
*/
|
||||
private function migrateFeatureParams(): void
|
||||
{
|
||||
try
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
|
||||
// Read core plugin params
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('params'))
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokowaas'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
|
||||
->where($db->quoteName('folder') . ' = ' . $db->quote('system'));
|
||||
$db->setQuery($query);
|
||||
$coreParamsJson = (string) $db->loadResult();
|
||||
|
||||
if (empty($coreParamsJson) || $coreParamsJson === '{}')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$core = json_decode($coreParamsJson, true);
|
||||
|
||||
if (empty($core))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Check migration marker
|
||||
if (!empty($core['_params_migrated_032']))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Firewall params
|
||||
$firewallKeys = [
|
||||
'force_https', 'admin_session_timeout', 'trusted_ips',
|
||||
'password_min_length', 'password_require_uppercase',
|
||||
'password_require_number', 'password_require_special',
|
||||
'upload_allowed_types', 'upload_max_size_mb',
|
||||
];
|
||||
|
||||
// Tenant params
|
||||
$tenantKeys = [
|
||||
'restrict_installer', 'allow_extension_updates', 'hide_sysinfo',
|
||||
'restrict_global_config', 'restrict_template_editing',
|
||||
'disable_install_url', 'hidden_menu_items',
|
||||
];
|
||||
|
||||
// DevTools params
|
||||
$devtoolsKeys = ['dev_mode', 'reset_hits', 'delete_versions'];
|
||||
|
||||
$migrations = [
|
||||
'mokowaas_firewall' => $firewallKeys,
|
||||
'mokowaas_tenant' => $tenantKeys,
|
||||
'mokowaas_devtools' => $devtoolsKeys,
|
||||
];
|
||||
|
||||
foreach ($migrations as $element => $keys)
|
||||
{
|
||||
$featureParams = [];
|
||||
|
||||
foreach ($keys as $key)
|
||||
{
|
||||
if (isset($core[$key]))
|
||||
{
|
||||
$featureParams[$key] = $core[$key];
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($featureParams))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('params') . ' = ' . $db->quote(json_encode($featureParams)))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote($element))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
|
||||
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
|
||||
)->execute();
|
||||
}
|
||||
|
||||
// Set migration marker on core plugin
|
||||
$core['_params_migrated_032'] = 1;
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('params') . ' = ' . $db->quote(json_encode($core)))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokowaas'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
|
||||
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
|
||||
)->execute();
|
||||
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
'MokoWaaS: migrated settings to feature plugins (Firewall, Tenant, DevTools).',
|
||||
'message'
|
||||
);
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Feature param migration error: ' . $e->getMessage(), Log::WARNING, 'mokowaas');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user