Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f5b93d5d9b | |||
| 55ec926fdc | |||
| b4f916addb | |||
| a51f04c841 | |||
| db2ed26e65 |
@@ -54,7 +54,7 @@ Joomla **package** (`pkg_mokowaas`) with 17 sub-extensions:
|
||||
|
||||
### Update Server
|
||||
|
||||
`updates.xml` is stored in the repo root and maintained manually. Points to ZIP assets on Gitea releases.
|
||||
MokoGitea generates update feeds dynamically from releases — no static `updates.xml` needed.
|
||||
|
||||
## Source Directory
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<display-name>Package - MokoWaaS</display-name>
|
||||
<org>MokoConsulting</org>
|
||||
<description>White-label identity, security hardening, and tenant restriction layer for WaaS-managed Joomla environments</description>
|
||||
<version>02.34.16</version>
|
||||
<version>02.35.00</version>
|
||||
<license spdx="GPL-3.0-or-later">GNU General Public License v3</license>
|
||||
</identity>
|
||||
<governance>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: moko-platform.Automation
|
||||
# VERSION: 02.34.16
|
||||
# VERSION: 02.35.00
|
||||
# BRIEF: Auto-create feature branch when an issue is opened
|
||||
|
||||
name: "Universal: Issue Branch"
|
||||
|
||||
+4
-1
@@ -14,7 +14,7 @@
|
||||
INGROUP: MokoWaaS.Documentation
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
PATH: ./CHANGELOG.md
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
BRIEF: Version history using `Keep a Changelog`
|
||||
-->
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
|
||||
## [02.35.00] --- 2026-06-06
|
||||
|
||||
### Added
|
||||
- Database Tools view — table status, optimize, repair, session purge (#127)
|
||||
- Cache Cleanup view — directory size reporting and one-click cleanup (#128)
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS.Documentation
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: ./CODE_OF_CONDUCT.md
|
||||
BRIEF: Reference + packaging repo for Moko Consulting Developer GPT Other Default
|
||||
-->
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
DEFGROUP: mokoconsulting-tech.MokoWaaSBrand
|
||||
INGROUP: MokoStandards.Governance
|
||||
REPO: https://github.com/mokoconsulting-tech/MokoWaaSBrand
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /GOVERNANCE.md
|
||||
BRIEF: Project governance rules, roles, and decision process for MokoWaaSBrand
|
||||
-->
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
INGROUP: MokoWaaS.Documentation
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
PATH: ./LICENSE.md
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
BRIEF: Project license (GPL-3.0-or-later)
|
||||
-->
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /README.md
|
||||
BRIEF: MokoWaaS platform plugin for Joomla
|
||||
-->
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ DEFGROUP: [PROJECT_NAME]
|
||||
INGROUP: [PROJECT_NAME].Documentation
|
||||
REPO: [REPOSITORY_URL]
|
||||
PATH: /SECURITY.md
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
BRIEF: Security vulnerability reporting and handling policy
|
||||
-->
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
INGROUP: MokoWaaS.Build
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
FILE: build-guide.md
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /docs/guides/
|
||||
BRIEF: Build and packaging guide for the MokoWaaS system plugin
|
||||
NOTE: Defines environment setup, repository layout, packaging rules, and release preparation
|
||||
-->
|
||||
|
||||
# MokoWaaS Build Guide (VERSION: 02.34.16)
|
||||
# MokoWaaS Build Guide (VERSION: 02.35.00)
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS.Guides
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /docs/guides/configuration-guide.md
|
||||
BRIEF: Configuration guide for the MokoWaaS system plugin
|
||||
NOTE: Defines plugin parameters, expected behaviors, and recommended defaults
|
||||
-->
|
||||
|
||||
# MokoWaaS Configuration Guide (VERSION: 02.34.16)
|
||||
# MokoWaaS Configuration Guide (VERSION: 02.35.00)
|
||||
|
||||
## 1. Objective
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS.Guides
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /docs/guides/installation-guide.md
|
||||
BRIEF: Installation guide for the MokoWaaS system plugin
|
||||
NOTE: First document in the guide set
|
||||
-->
|
||||
|
||||
# MokoWaaS Installation Guide (VERSION: 02.34.16)
|
||||
# MokoWaaS Installation Guide (VERSION: 02.35.00)
|
||||
|
||||
## Introduction
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS.Guides
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /docs/guides/operations-guide.md
|
||||
BRIEF: Operational guide for administering and managing the MokoWaaS system plugin
|
||||
NOTE: Defines lifecycle, responsibilities, and operational behaviors
|
||||
-->
|
||||
|
||||
# MokoWaaS Operations Guide (VERSION: 02.34.16)
|
||||
# MokoWaaS Operations Guide (VERSION: 02.35.00)
|
||||
|
||||
## Introduction
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS.Guides
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /docs/guides/rollback-and-recovery-guide.md
|
||||
BRIEF: Rollback and recovery guide for restoring stable operation after plugin related incidents
|
||||
NOTE: Completes the core guide set for WaaS plugin governance
|
||||
-->
|
||||
|
||||
# MokoWaaS Rollback and Recovery Guide (VERSION: 02.34.16)
|
||||
# MokoWaaS Rollback and Recovery Guide (VERSION: 02.35.00)
|
||||
|
||||
## Introduction
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS.Guides
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /docs/guides/testing-guide.md
|
||||
BRIEF: Testing guide for MokoWaaS v02.01.08
|
||||
NOTE: Covers manual test procedures for language overrides, install/uninstall, and configuration
|
||||
-->
|
||||
|
||||
# MokoWaaS Testing Guide (VERSION: 02.34.16)
|
||||
# MokoWaaS Testing Guide (VERSION: 02.35.00)
|
||||
|
||||
## 1. Prerequisites
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS.Guides
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /docs/guides/troubleshooting-guide.md
|
||||
BRIEF: Troubleshooting guide for diagnosing and resolving issues related to the MokoWaaS plugin
|
||||
NOTE: Designed for administrators and WaaS operations teams
|
||||
-->
|
||||
|
||||
# MokoWaaS Troubleshooting Guide (VERSION: 02.34.16)
|
||||
# MokoWaaS Troubleshooting Guide (VERSION: 02.35.00)
|
||||
|
||||
## Introduction
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS.Guides
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /docs/guides/upgrade-and-versioning-guide.md
|
||||
BRIEF: Guide for updating, versioning, and maintaining the MokoWaaS plugin
|
||||
NOTE: Defines release flow, version rules, and upgrade validation
|
||||
-->
|
||||
|
||||
# MokoWaaS Upgrade and Versioning Guide (VERSION: 02.34.16)
|
||||
# MokoWaaS Upgrade and Versioning Guide (VERSION: 02.35.00)
|
||||
|
||||
## Introduction
|
||||
|
||||
|
||||
+2
-2
@@ -10,13 +10,13 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS.Documentation
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /docs/index.md
|
||||
BRIEF: Master index of all documentation for the MokoWaaS plugin
|
||||
NOTE: Automatically maintained index for all guide canvases
|
||||
-->
|
||||
|
||||
# MokoWaaS Documentation Index (VERSION: 02.34.16)
|
||||
# MokoWaaS Documentation Index (VERSION: 02.35.00)
|
||||
|
||||
## Introduction
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
INGROUP: MokoWaaS
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
PATH: /docs/plugin-basic.md
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
BRIEF: Baseline documentation for the MokoWaaS system plugin
|
||||
NOTE: Foundational reference for internal and external stakeholders
|
||||
-->
|
||||
|
||||
# MokoWaaS Plugin Overview (VERSION: 02.34.16)
|
||||
# MokoWaaS Plugin Overview (VERSION: 02.35.00)
|
||||
|
||||
## Introduction
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ DEFGROUP: MokoWaaS.Documentation
|
||||
INGROUP: MokoStandards.Templates
|
||||
REPO: https://github.com/mokoconsulting-tech/MokoWaaS
|
||||
PATH: /docs/update-server.md
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
BRIEF: How this extension's Joomla update server file (update.xml) is managed
|
||||
-->
|
||||
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
/**
|
||||
* @package MokoWaaS
|
||||
* @subpackage com_mokowaas
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
*/
|
||||
|
||||
namespace Moko\Component\MokoWaaS\Api\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
|
||||
/**
|
||||
* Provision reset API controller.
|
||||
*
|
||||
* POST /api/index.php/v1/mokowaas/provision-reset
|
||||
*
|
||||
* Resets a site for new client provisioning: clears hits, versions,
|
||||
* download keys, and flags the site for fresh client info collection.
|
||||
* Used after copying a demo site to create a new client install.
|
||||
*
|
||||
* @since 02.35.00
|
||||
*/
|
||||
class ProvisionController extends BaseController
|
||||
{
|
||||
/**
|
||||
* Reset the site for new client provisioning.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute($task = 'provision'): void
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$user = $app->getIdentity();
|
||||
|
||||
if (!$user->authorise('core.manage', 'com_mokowaas'))
|
||||
{
|
||||
$this->sendJson(403, ['error' => 'Not authorized']);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($app->input->getMethod() !== 'POST')
|
||||
{
|
||||
$this->sendJson(405, ['error' => 'POST required']);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$db = Factory::getDbo();
|
||||
$results = [];
|
||||
|
||||
// 1. Reset article hit counters
|
||||
try
|
||||
{
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__content'))
|
||||
->set($db->quoteName('hits') . ' = 0')
|
||||
)->execute();
|
||||
$results['hits_reset'] = $db->getAffectedRows();
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
$results['hits_reset'] = 'error: ' . $e->getMessage();
|
||||
}
|
||||
|
||||
// 2. Delete content version history
|
||||
try
|
||||
{
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)->delete($db->quoteName('#__history'))
|
||||
)->execute();
|
||||
$results['versions_deleted'] = $db->getAffectedRows();
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
$results['versions_deleted'] = 'error: ' . $e->getMessage();
|
||||
}
|
||||
|
||||
// 3. Regenerate heartbeat token if requested
|
||||
$input = $app->getInput()->json;
|
||||
$resetToken = (bool) ($input->get('reset_token', false, 'BOOLEAN'));
|
||||
|
||||
if ($resetToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
$newToken = bin2hex(random_bytes(32));
|
||||
|
||||
$plugin = \Joomla\CMS\Plugin\PluginHelper::getPlugin('system', 'mokowaas');
|
||||
|
||||
if ($plugin)
|
||||
{
|
||||
$pluginParams = new \Joomla\Registry\Registry($plugin->params);
|
||||
$pluginParams->set('health_api_token', $newToken);
|
||||
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('params') . ' = ' . $db->quote($pluginParams->toString()))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokowaas'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
|
||||
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
|
||||
)->execute();
|
||||
|
||||
$results['token_regenerated'] = true;
|
||||
$results['new_token'] = $newToken;
|
||||
}
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
$results['token_regenerated'] = 'error: ' . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Reset all user API tokens if requested
|
||||
$resetApiTokens = (bool) ($input->get('reset_api_tokens', false, 'BOOLEAN'));
|
||||
|
||||
if ($resetApiTokens)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Get users who have API tokens before deleting
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->select('DISTINCT ' . $db->quoteName('user_id'))
|
||||
->from($db->quoteName('#__user_keys'))
|
||||
->where($db->quoteName('series') . ' LIKE ' . $db->quote('api-%'))
|
||||
);
|
||||
$affectedUserIds = $db->loadColumn() ?: [];
|
||||
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)->delete($db->quoteName('#__user_keys'))
|
||||
->where($db->quoteName('series') . ' LIKE ' . $db->quote('api-%'))
|
||||
)->execute();
|
||||
$results['api_tokens_revoked'] = $db->getAffectedRows();
|
||||
|
||||
// Notify affected users
|
||||
if (!empty($affectedUserIds))
|
||||
{
|
||||
$this->notifyTokenReset($db, $affectedUserIds);
|
||||
$results['users_notified'] = \count($affectedUserIds);
|
||||
}
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
$results['api_tokens_revoked'] = 'error: ' . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Flag site for fresh client info setup
|
||||
try
|
||||
{
|
||||
// Write a flag file that the core plugin checks on next admin load
|
||||
$flagFile = JPATH_ADMINISTRATOR . '/cache/mokowaas_setup_required.flag';
|
||||
file_put_contents($flagFile, json_encode([
|
||||
'created' => gmdate('Y-m-d\TH:i:s\Z'),
|
||||
'reason' => 'provision-reset',
|
||||
'remote_ip' => $_SERVER['REMOTE_ADDR'] ?? '',
|
||||
]));
|
||||
$results['setup_flag'] = true;
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
$results['setup_flag'] = 'error: ' . $e->getMessage();
|
||||
}
|
||||
|
||||
$this->sendJson(200, [
|
||||
'status' => 'ok',
|
||||
'message' => 'Site provisioned for new client.',
|
||||
'results' => $results,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify users that their API tokens have been revoked.
|
||||
*/
|
||||
private function notifyTokenReset($db, array $userIds): void
|
||||
{
|
||||
try
|
||||
{
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->select([$db->quoteName('name'), $db->quoteName('email')])
|
||||
->from($db->quoteName('#__users'))
|
||||
->whereIn($db->quoteName('id'), $userIds)
|
||||
->where($db->quoteName('block') . ' = 0')
|
||||
);
|
||||
$users = $db->loadObjectList() ?: [];
|
||||
|
||||
$config = Factory::getConfig();
|
||||
$siteName = $config->get('sitename', 'Joomla');
|
||||
$siteUrl = rtrim(\Joomla\CMS\Uri\Uri::root(), '/');
|
||||
|
||||
$mailer = Factory::getMailer();
|
||||
|
||||
foreach ($users as $u)
|
||||
{
|
||||
try
|
||||
{
|
||||
$mailer->clearAllRecipients();
|
||||
$mailer->addRecipient($u->email, $u->name);
|
||||
$mailer->setSubject($siteName . ' — API tokens have been reset');
|
||||
$mailer->setBody(
|
||||
"Hello {$u->name},\n\n"
|
||||
. "Your API access tokens on {$siteName} have been revoked by an administrator.\n\n"
|
||||
. "If you use API integrations, please log in and generate a new token:\n"
|
||||
. "{$siteUrl}/administrator/\n\n"
|
||||
. "— {$siteName}"
|
||||
);
|
||||
$mailer->send();
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
// Non-critical
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
// Non-critical
|
||||
}
|
||||
}
|
||||
|
||||
private function sendJson(int $code, array $data): void
|
||||
{
|
||||
http_response_code($code);
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode($data, JSON_UNESCAPED_SLASHES);
|
||||
Factory::getApplication()->close();
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
DEFGROUP: Joomla.Component
|
||||
INGROUP: MokoWaaS
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /mokowaas.xml
|
||||
BRIEF: Component manifest for MokoWaaS admin dashboard and REST API
|
||||
-->
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* DEFGROUP: Joomla.Plugin
|
||||
* INGROUP: MokoWaaS
|
||||
* REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
* VERSION: 02.34.16
|
||||
* VERSION: 02.35.00
|
||||
* PATH: /src/Extension/MokoWaaS.php
|
||||
* NOTE: Core system plugin for MokoWaaS admin tools suite
|
||||
*/
|
||||
@@ -167,10 +167,11 @@ class MokoWaaS extends CMSPlugin implements BootableExtensionInterface
|
||||
$this->handleMokoApi($mokoAction);
|
||||
}
|
||||
|
||||
// One-time remote login (admin only)
|
||||
// Admin-only features
|
||||
if ($this->app->isClient('administrator'))
|
||||
{
|
||||
$this->handleOneTimeLogin();
|
||||
$this->checkSetupRequired();
|
||||
$this->preserveDownloadKeys();
|
||||
}
|
||||
}
|
||||
@@ -242,7 +243,14 @@ class MokoWaaS extends CMSPlugin implements BootableExtensionInterface
|
||||
// Grafana auto-provisioning
|
||||
$this->handleGrafanaProvisioning($params, $app);
|
||||
|
||||
// NOTE: reset_hits and delete_versions now handled by devtools plugin
|
||||
// Clear setup-required flag on save (new client setup complete)
|
||||
$flagFile = JPATH_ADMINISTRATOR . '/cache/mokowaas_setup_required.flag';
|
||||
|
||||
if (file_exists($flagFile))
|
||||
{
|
||||
@unlink($flagFile);
|
||||
$app->enqueueMessage('Client setup complete — setup flag cleared.', 'message');
|
||||
}
|
||||
|
||||
if ($changed)
|
||||
{
|
||||
@@ -2053,6 +2061,72 @@ class MokoWaaS extends CMSPlugin implements BootableExtensionInterface
|
||||
return $this->masterNames;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Setup Required Check
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Check if the site has been provisioned for a new client and needs
|
||||
* fresh setup information (company name, contact details).
|
||||
*
|
||||
* Shows a persistent admin banner until the setup flag is cleared
|
||||
* by saving the core plugin settings.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 02.35.00
|
||||
*/
|
||||
protected function checkSetupRequired(): void
|
||||
{
|
||||
$flagFile = JPATH_ADMINISTRATOR . '/cache/mokowaas_setup_required.flag';
|
||||
|
||||
if (!file_exists($flagFile))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->app->enqueueMessage(
|
||||
'<strong>New client setup required.</strong> This site has been provisioned for a new client. '
|
||||
. 'Please update the site name, contact details, and save the MokoWaaS plugin settings to complete setup. '
|
||||
. '<a href="index.php?option=com_plugins&task=plugin.edit&extension_id='
|
||||
. $this->getPluginExtensionId() . '" class="btn btn-sm btn-warning ms-2">Open Settings</a>',
|
||||
'warning'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this plugin's extension_id.
|
||||
*/
|
||||
private function getPluginExtensionId(): int
|
||||
{
|
||||
static $id = null;
|
||||
|
||||
if ($id !== null)
|
||||
{
|
||||
return $id;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->select($db->quoteName('extension_id'))
|
||||
->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'))
|
||||
);
|
||||
$id = (int) $db->loadResult();
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
$id = 0;
|
||||
}
|
||||
|
||||
return $id;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// One-Time Remote Login
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* FILE INFORMATION
|
||||
* DEFGROUP: Joomla.Plugin
|
||||
* INGROUP: MokoWaaS
|
||||
* VERSION: 02.34.16
|
||||
* VERSION: 02.35.00
|
||||
* PATH: /src/Field/CopyableTokenField.php
|
||||
* BRIEF: Read-only token field with a copy-to-clipboard button
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
DEFGROUP: Joomla.Plugin
|
||||
INGROUP: MokoWaaS
|
||||
REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
VERSION: 02.34.16
|
||||
VERSION: 02.35.00
|
||||
PATH: /source/mokowaas.xml
|
||||
BRIEF: Plugin manifest for MokoWaaS system plugin
|
||||
NOTE: Defines installation metadata, files, and configuration for Joomla
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* DEFGROUP: Joomla.Plugin
|
||||
* INGROUP: MokoWaaS
|
||||
* REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
* VERSION: 02.34.16
|
||||
* VERSION: 02.35.00
|
||||
* PATH: /src/script.php
|
||||
* BRIEF: Installation script for MokoWaaS plugin
|
||||
* NOTE: Handles installation, update, and uninstallation tasks including language override deployment
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* DEFGROUP: Joomla.Plugin
|
||||
* INGROUP: MokoWaaS
|
||||
* REPO: https://github.com/mokoconsulting-tech/mokowaas
|
||||
* VERSION: 02.34.16
|
||||
* VERSION: 02.35.00
|
||||
* PATH: /src/services/provider.php
|
||||
* BRIEF: Service provider for dependency injection in Joomla 5.x
|
||||
* NOTE: Registers the plugin with Joomla's DI container
|
||||
|
||||
@@ -109,16 +109,30 @@ class Monitor extends CMSPlugin implements SubscriberInterface
|
||||
|
||||
$app = $this->getApplication();
|
||||
|
||||
$config = Factory::getConfig();
|
||||
|
||||
$payload = [
|
||||
'token' => $healthToken,
|
||||
'domain' => $domain,
|
||||
'site_name' => Factory::getConfig()->get('sitename', 'Joomla'),
|
||||
'site_url' => $siteUrl,
|
||||
'joomla_version' => (new Version())->getShortVersion(),
|
||||
'php_version' => PHP_VERSION,
|
||||
'token' => $healthToken,
|
||||
'domain' => $domain,
|
||||
'site_name' => $config->get('sitename', 'Joomla'),
|
||||
'site_url' => $siteUrl,
|
||||
'joomla_version' => (new Version())->getShortVersion(),
|
||||
'php_version' => PHP_VERSION,
|
||||
'mokowaas_version' => $this->getMokoWaaSVersion(),
|
||||
'client_info' => [
|
||||
'company' => $config->get('sitename', ''),
|
||||
'email' => $config->get('mailfrom', ''),
|
||||
],
|
||||
];
|
||||
|
||||
// Include live health data by calling the local health endpoint
|
||||
$healthData = $this->fetchLocalHealth($siteUrl, $healthToken);
|
||||
|
||||
if ($healthData !== null)
|
||||
{
|
||||
$payload['health'] = $healthData;
|
||||
}
|
||||
|
||||
$endpoint = $baseUrl . '/api/index.php/v1/mokowaasbase/heartbeat';
|
||||
$json = json_encode($payload, JSON_UNESCAPED_SLASHES);
|
||||
|
||||
@@ -165,6 +179,42 @@ class Monitor extends CMSPlugin implements SubscriberInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch health data from the local site's health endpoint.
|
||||
*
|
||||
* @param string $siteUrl Local site URL.
|
||||
* @param string $healthToken Health API token.
|
||||
*
|
||||
* @return array|null Parsed health data or null on failure.
|
||||
*/
|
||||
private function fetchLocalHealth(string $siteUrl, string $healthToken): ?array
|
||||
{
|
||||
$url = $siteUrl . '/?mokowaas=health';
|
||||
|
||||
$ch = curl_init($url);
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_TIMEOUT => 10,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_SSL_VERIFYPEER => false,
|
||||
CURLOPT_HTTPHEADER => [
|
||||
'Authorization: Bearer ' . $healthToken,
|
||||
'Accept: application/json',
|
||||
],
|
||||
]);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
$code = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
||||
if ($code !== 200 || empty($response))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return json_decode($response, true) ?: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the installed MokoWaaS package version.
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: MokoWaaS
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS
|
||||
* PATH: /src/packages/plg_system_mokowaas/Service/DemoResetService.php
|
||||
* VERSION: 02.34.08
|
||||
* VERSION: 02.35.00
|
||||
* BRIEF: Content-only snapshot/restore for demo site reset
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: MokoWaaS
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS
|
||||
* PATH: /src/packages/plg_system_mokowaas/Service/ContentSyncReceiver.php
|
||||
* VERSION: 02.34.08
|
||||
* VERSION: 02.35.00
|
||||
* BRIEF: Receiver-side content sync — applies incoming payload to local DB
|
||||
*/
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* INGROUP: MokoWaaS
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS
|
||||
* PATH: /src/packages/plg_system_mokowaas/Service/ContentSyncService.php
|
||||
* VERSION: 02.34.08
|
||||
* VERSION: 02.35.00
|
||||
* BRIEF: Sender-side content sync — builds payload and pushes to remote sites
|
||||
*/
|
||||
|
||||
|
||||
@@ -118,5 +118,11 @@ final class MokoWaaSApi extends CMSPlugin implements SubscriberInterface
|
||||
'remotelogin',
|
||||
['component' => 'com_mokowaas']
|
||||
);
|
||||
|
||||
$router->createCRUDRoutes(
|
||||
'v1/mokowaas/provision-reset',
|
||||
'provision',
|
||||
['component' => 'com_mokowaas']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* INGROUP: MokoWaaS
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS
|
||||
* PATH: /source/packages/plg_webservices_perfectpublisher/services/provider.php
|
||||
* VERSION: 02.34.16
|
||||
* VERSION: 02.35.00
|
||||
* BRIEF: DI service provider for Perfect Publisher Web Services plugin
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* INGROUP: MokoWaaS
|
||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS
|
||||
* PATH: /source/packages/plg_webservices_perfectpublisher/src/Extension/PerfectPublisherApi.php
|
||||
* VERSION: 02.34.16
|
||||
* VERSION: 02.35.00
|
||||
* BRIEF: Web Services API plugin for Perfect Publisher (com_autotweet)
|
||||
*/
|
||||
|
||||
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
VERSION: 02.34.16-dev
|
||||
-->
|
||||
|
||||
<updates>
|
||||
<update>
|
||||
<name>Package - MokoWaaS</name>
|
||||
<description>Package - MokoWaaS development build.</description>
|
||||
<element>pkg_mokowaas</element>
|
||||
<type>package</type>
|
||||
<client>site</client>
|
||||
<version>02.34.16-dev</version>
|
||||
<creationDate>2026-06-06</creationDate>
|
||||
<infourl title='Package - MokoWaaS'>https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/development</infourl>
|
||||
<downloads>
|
||||
<downloadurl type='full' format='zip'>https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/development/pkg_mokowaas-02.34.16-dev.zip</downloadurl>
|
||||
</downloads>
|
||||
<tags><tag>dev</tag></tags>
|
||||
<changelogurl>https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/raw/branch/main/CHANGELOG.md</changelogurl>
|
||||
<maintainer>Moko Consulting</maintainer>
|
||||
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||
</update>
|
||||
<update>
|
||||
<name>Package - MokoWaaS</name>
|
||||
<description>Package - MokoWaaS: admin dashboard, security firewall, helpdesk, privacy guard, database tools, and more.</description>
|
||||
<element>pkg_mokowaas</element>
|
||||
<type>package</type>
|
||||
<client>site</client>
|
||||
<version>02.33.00</version>
|
||||
<creationDate>2026-06-04</creationDate>
|
||||
<infourl title="Package - MokoWaaS">https://mokoconsulting.tech/products/mokowaas</infourl>
|
||||
<downloads>
|
||||
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/stable/pkg_mokowaas-02.33.00.zip</downloadurl>
|
||||
</downloads>
|
||||
<tags><tag>stable</tag></tags>
|
||||
<changelogurl>https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/raw/branch/main/CHANGELOG.md</changelogurl>
|
||||
<maintainer>Moko Consulting</maintainer>
|
||||
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||
<targetplatform name="joomla" version="(5|6)\..*"/>
|
||||
<php_minimum>8.1</php_minimum>
|
||||
</update>
|
||||
</updates>
|
||||
Reference in New Issue
Block a user