Compare commits

...

4 Commits

Author SHA1 Message Date
Jonathan Miller 75c34345f9 refactor: rename src/ to source/ per moko-platform standards
Generic: Repo Health / Scripts governance (push) Blocked by required conditions
Generic: Repo Health / Repository health (push) Blocked by required conditions
Generic: Repo Health / Report Issues (push) Blocked by required conditions
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 1s
Rename root source directory from src/ to source/ and update all
references in Makefile, manifest.xml, .gitignore, CI workflows,
and wiki documentation. Internal Joomla namespace paths (src/Extension)
are unchanged as they are plugin-internal structure.

CI workflows updated to check source/ first with src/ fallback for
backward compatibility across repos.

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-06 08:11:29 -05:00
jmiller 48d49b3ee0 chore: sync .mokogitea/workflows/pre-release.yml from moko-platform [skip ci] 2026-06-06 12:32:21 +00:00
Jonathan Miller 3f63ec2e1d feat(licensing): add licensing block to manifest and pre-release step
Generic: Repo Health / Scripts governance (push) Blocked by required conditions
Generic: Repo Health / Repository health (push) Blocked by required conditions
Generic: Repo Health / Report Issues (push) Blocked by required conditions
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 1s
Add <licensing> section to manifest.xml with update-server URL
template and dlid flag. Add manifest_licensing.php step to
pre-release workflow to auto-ensure updateservers/dlid tags.

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-06 07:18:05 -05:00
Jonathan Miller 1894abcf90 security: add CSRF and ACL checks (#104, #105)
Generic: Repo Health / Scripts governance (push) Blocked by required conditions
Generic: Repo Health / Repository health (push) Blocked by required conditions
Generic: Repo Health / Report Issues (push) Blocked by required conditions
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 1s
- #104: Add checkToken('get') and core.manage ACL check to CSV export
- #105: Add checkToken() to migration action (ACL was already present)

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-06 06:40:19 -05:00
604 changed files with 55 additions and 31 deletions
+1 -1
View File
@@ -154,7 +154,7 @@ package-lock.json
# PHP / Composer tooling
# ============================================================
vendor/
!src/media/vendor/
!source/media/vendor/
composer.lock
*.phar
codeception.phar
+6 -1
View File
@@ -16,6 +16,11 @@
<build>
<language>PHP</language>
<package-type>joomla-extension</package-type>
<entry-point>src/</entry-point>
<entry-point>source/</entry-point>
</build>
<licensing>
<enabled>true</enabled>
<dlid>true</dlid>
<update-server>https://git.mokoconsulting.tech/{org}/{repo}/updates.xml</update-server>
</licensing>
</moko-platform>
+6 -6
View File
@@ -71,7 +71,7 @@ jobs:
- name: PHP syntax check
run: |
ERRORS=0
for DIR in src/ htdocs/; do
for DIR in source/ src/ htdocs/; do
if [ -d "$DIR" ]; then
FOUND=1
while IFS= read -r -d '' FILE; do
@@ -174,7 +174,7 @@ jobs:
fi
# Check in common locations
FOUND=0
for BASE in "." "src" "htdocs"; do
for BASE in "." "source" "src" "htdocs"; do
if [ -f "${BASE}/${LANG_FILE}" ]; then
FOUND=1
break
@@ -207,7 +207,7 @@ jobs:
MISSING=0
CHECKED=0
for DIR in src/ htdocs/; do
for DIR in source/ src/ htdocs/; do
if [ -d "$DIR" ]; then
while IFS= read -r -d '' SUBDIR; do
CHECKED=$((CHECKED + 1))
@@ -220,7 +220,7 @@ jobs:
done
if [ "${CHECKED}" -eq 0 ]; then
echo "No src/ or htdocs/ directories found — skipping." >> $GITHUB_STEP_SUMMARY
echo "No source/ or src/ or htdocs/ directories found — skipping." >> $GITHUB_STEP_SUMMARY
elif [ "${MISSING}" -gt 0 ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "**${MISSING} director(ies) missing index.html out of ${CHECKED} checked.**" >> $GITHUB_STEP_SUMMARY
@@ -427,7 +427,7 @@ jobs:
# Determine source directory
SRC_DIR=""
for DIR in src/ htdocs/ lib/; do
for DIR in source/ src/ htdocs/ lib/; do
if [ -d "$DIR" ]; then
SRC_DIR="$DIR"
break
@@ -435,7 +435,7 @@ jobs:
done
if [ -z "$SRC_DIR" ]; then
echo "No source directory found (src/, htdocs/, lib/) — skipping." >> $GITHUB_STEP_SUMMARY
echo "No source directory found (source/, src/, htdocs/, lib/) — skipping." >> $GITHUB_STEP_SUMMARY
exit 0
fi
+8 -6
View File
@@ -159,11 +159,11 @@ jobs:
echo "::error file=${file}::Missing JEXEC guard: ${file}"
ERRORS=$((ERRORS + 1))
fi
done < <(find . -name "*.php" -path "*/src/*" -not -path "./.git/*" -not -path "./vendor/*" -print0)
done < <(find . -name "*.php" \( -path "*/source/*" -o -path "*/src/*" \) -not -path "./.git/*" -not -path "./vendor/*" -print0)
if [ "$ERRORS" -gt 0 ]; then
echo "::error::${ERRORS} PHP file(s) missing defined('_JEXEC') or die guard"
echo "## JEXEC Guard Check: Failed" >> $GITHUB_STEP_SUMMARY
echo "${ERRORS} file(s) in src/ are missing the Joomla execution guard." >> $GITHUB_STEP_SUMMARY
echo "${ERRORS} file(s) are missing the Joomla execution guard." >> $GITHUB_STEP_SUMMARY
exit 1
fi
echo "JEXEC guard: OK"
@@ -172,7 +172,8 @@ jobs:
if: steps.platform.outputs.platform == 'joomla'
run: |
MISSING=0
SOURCE_DIR="src"
SOURCE_DIR="source"
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="src"
[ ! -d "$SOURCE_DIR" ] && exit 0
while IFS= read -r dir; do
if [ ! -f "${dir}/index.html" ]; then
@@ -220,7 +221,7 @@ jobs:
echo "joomla.asset.json: valid"
fi
# Validate all XML files in src/ are well-formed
# Validate all XML files in source/src are well-formed
XML_ERRORS=0
if command -v php &> /dev/null; then
while IFS= read -r -d '' xmlfile; do
@@ -451,10 +452,11 @@ jobs:
- name: Verify package source
run: |
SOURCE_DIR="src"
SOURCE_DIR="source"
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="src"
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
if [ ! -d "$SOURCE_DIR" ]; then
echo "::warning::No src/ or htdocs/ directory"
echo "::warning::No source/, src/, or htdocs/ directory"
exit 0
fi
FILE_COUNT=$(find "$SOURCE_DIR" -type f | wc -l)
+15 -8
View File
@@ -63,15 +63,22 @@ jobs:
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
run: |
if ! command -v composer &> /dev/null; then
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
# Use pre-installed /opt/moko-platform if available (updated by cron every 6h)
if [ -f “/opt/moko-platform/cli/version_bump.php” ] && [ -f “/opt/moko-platform/vendor/autoload.php” ]; then
echo “Using pre-installed /opt/moko-platform”
echo “MOKO_CLI=/opt/moko-platform/cli” >> “$GITHUB_ENV”
else
echo “Falling back to fresh clone”
if ! command -v composer &> /dev/null; then
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
fi
rm -rf /tmp/moko-platform-api
git clone --depth 1 --branch main --quiet \
“https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git” \
/tmp/moko-platform-api
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
echo “MOKO_CLI=/tmp/moko-platform-api/cli” >> “$GITHUB_ENV”
fi
rm -rf /tmp/moko-platform-api
git clone --depth 1 --branch main --quiet \
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
/tmp/moko-platform-api
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
echo "MOKO_CLI=/tmp/moko-platform-api/cli" >> "$GITHUB_ENV"
- name: Detect platform
id: platform
+6 -4
View File
@@ -296,17 +296,19 @@ jobs:
missing_required=()
missing_optional=()
# Source directory: src/ or htdocs/ (either is valid for extension repos)
# Source directory: source/, src/, or htdocs/ (any is valid for extension repos)
SOURCE_DIR=""
if [ -d "src" ]; then
if [ -d "source" ]; then
SOURCE_DIR="source"
elif [ -d "src" ]; then
SOURCE_DIR="src"
elif [ -d "htdocs" ]; then
SOURCE_DIR="htdocs"
elif [ -d "deploy" ] || [ -d "cli" ] || [ -d "monitoring" ]; then
# Platform/tooling repos don't need src/
# Platform/tooling repos don't need source/
SOURCE_DIR=""
else
missing_required+=("src/ or htdocs/ (source directory required)")
missing_required+=("source/ or src/ or htdocs/ (source directory required)")
fi
for item in "${required_artifacts[@]}"; do
+1 -1
View File
@@ -23,7 +23,7 @@ PLUGIN_GROUP := system
# Options: system, content, user, authentication, etc.
# Directories
SRC_DIR := src
SRC_DIR := source
BUILD_DIR := build
DIST_DIR := dist
DOCS_DIR := docs
@@ -27,6 +27,8 @@ class DashboardController extends BaseController
*/
public function migrate(): void
{
$this->checkToken();
// Check ACL
if (!$this->app->getIdentity()->authorise('mokojoomcross.migrate', 'com_mokojoomcross')) {
$this->setRedirect(
@@ -156,6 +156,12 @@ class PostsController extends AdminController
*/
public function exportCsv(): void
{
$this->checkToken('get');
if (!$this->app->getIdentity()->authorise('core.manage', 'com_mokojoomcross')) {
throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
}
$app = $this->app;
$db = Factory::getDbo();

Some files were not shown because too many files have changed in this diff Show More