Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c1ce2bd44 | |||
| 2b36fa47e3 | |||
| c21e237c38 | |||
| 0b21c61578 | |||
| 433eb6a967 | |||
| 611d9588f4 | |||
| 7303d363f2 | |||
| c6c6000d53 | |||
| bed685e203 | |||
| 35fd11cde9 | |||
| 6e731f2bca | |||
| 438a2fdaec | |||
| 27a2008675 |
+2
-12
@@ -29,7 +29,6 @@ secrets/
|
|||||||
*.pid
|
*.pid
|
||||||
*.seed
|
*.seed
|
||||||
|
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# OS / Editor / IDE cruft
|
# OS / Editor / IDE cruft
|
||||||
# ============================================================
|
# ============================================================
|
||||||
@@ -46,7 +45,6 @@ Icon?
|
|||||||
.idea/
|
.idea/
|
||||||
.settings/
|
.settings/
|
||||||
.claude/
|
.claude/
|
||||||
.gemini/
|
|
||||||
.vscode/*
|
.vscode/*
|
||||||
!.vscode/tasks.json
|
!.vscode/tasks.json
|
||||||
!.vscode/settings.json.example
|
!.vscode/settings.json.example
|
||||||
@@ -118,8 +116,6 @@ out/
|
|||||||
*.map
|
*.map
|
||||||
*.css.map
|
*.css.map
|
||||||
*.js.map
|
*.js.map
|
||||||
*.min.css
|
|
||||||
*.min.js
|
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
@@ -155,7 +151,7 @@ package-lock.json
|
|||||||
# PHP / Composer tooling
|
# PHP / Composer tooling
|
||||||
# ============================================================
|
# ============================================================
|
||||||
vendor/
|
vendor/
|
||||||
!src/media/vendor/
|
!source/media/vendor/
|
||||||
composer.lock
|
composer.lock
|
||||||
*.phar
|
*.phar
|
||||||
codeception.phar
|
codeception.phar
|
||||||
@@ -181,7 +177,7 @@ __pycache__/
|
|||||||
*.egg
|
*.egg
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
.installed.cfg
|
.installed.cfg
|
||||||
/MANIFEST
|
MANIFEST
|
||||||
develop-eggs/
|
develop-eggs/
|
||||||
downloads/
|
downloads/
|
||||||
eggs/
|
eggs/
|
||||||
@@ -205,9 +201,3 @@ hypothesis/
|
|||||||
|
|
||||||
profile.ps1
|
profile.ps1
|
||||||
.mcp.json
|
.mcp.json
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
# Local wiki clone (not version controlled)
|
|
||||||
# ============================================================
|
|
||||||
wiki/
|
|
||||||
docs/
|
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ Joomla **package** with four sub-extensions:
|
|||||||
- **Attribution**: `Authored-by: Moko Consulting`
|
- **Attribution**: `Authored-by: Moko Consulting`
|
||||||
- **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`)
|
- **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`)
|
||||||
- **Minification**: handled at build time (CI)
|
- **Minification**: handled at build time (CI)
|
||||||
- **Wiki**: documentation lives in the MokoGitea wiki, not `docs/` files
|
- **Wiki**: documentation lives in the Gitea wiki, not `docs/` files
|
||||||
- **Standards**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/.mokogitea/wiki)
|
- **Standards**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/mokoplatform/wiki/Home)
|
||||||
|
|
||||||
## Coding Standards
|
## Coding Standards
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: mokocli.Release
|
# INGROUP: mokocli.Release
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
# PATH: /.mokogitea/workflows/auto-bump.yml
|
# PATH: /.mokogitea/workflows/auto-bump.yml
|
||||||
# VERSION: 09.02.00
|
# VERSION: 09.02.00
|
||||||
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
|
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
|
||||||
@@ -34,8 +34,7 @@ jobs:
|
|||||||
if: >-
|
if: >-
|
||||||
!contains(github.event.head_commit.message, '[skip ci]') &&
|
!contains(github.event.head_commit.message, '[skip ci]') &&
|
||||||
!contains(github.event.head_commit.message, '[skip bump]') &&
|
!contains(github.event.head_commit.message, '[skip bump]') &&
|
||||||
!startsWith(github.event.head_commit.message, 'Merge pull request') &&
|
!startsWith(github.event.head_commit.message, 'Merge pull request')
|
||||||
!startsWith(github.event.repository.name, 'Template-')
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -53,7 +52,7 @@ jobs:
|
|||||||
echo "MOKO_CLI=/opt/mokocli/cli" >> "$GITHUB_ENV"
|
echo "MOKO_CLI=/opt/mokocli/cli" >> "$GITHUB_ENV"
|
||||||
else
|
else
|
||||||
git clone --depth 1 --branch main --quiet \
|
git clone --depth 1 --branch main --quiet \
|
||||||
"https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/MokoCLI.git" \
|
"https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/mokocli.git" \
|
||||||
/tmp/mokocli
|
/tmp/mokocli
|
||||||
cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet
|
cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet
|
||||||
echo "MOKO_CLI=/tmp/mokocli/cli" >> "$GITHUB_ENV"
|
echo "MOKO_CLI=/tmp/mokocli/cli" >> "$GITHUB_ENV"
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: mokocli.Release
|
# INGROUP: mokocli.Release
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/mokocli
|
||||||
# PATH: /.mokogitea/workflows/auto-release.yml
|
# PATH: /templates/workflows/universal/auto-release.yml.template
|
||||||
# VERSION: 05.01.00
|
# VERSION: 05.00.00
|
||||||
# BRIEF: Universal build & release � detects platform from manifest.xml
|
# BRIEF: Universal build & release � detects platform from manifest.xml
|
||||||
#
|
#
|
||||||
# +=======================================================================+
|
# +=======================================================================+
|
||||||
@@ -64,14 +64,10 @@ jobs:
|
|||||||
promote-rc:
|
promote-rc:
|
||||||
name: Promote to RC
|
name: Promote to RC
|
||||||
runs-on: release
|
runs-on: release
|
||||||
# Skip on template repos (Template-*) — they scaffold other repos and do not release.
|
|
||||||
if: >-
|
if: >-
|
||||||
!startsWith(github.event.repository.name, 'Template-') &&
|
|
||||||
(
|
|
||||||
(github.event.action == 'opened' && github.event.pull_request.merged != true) ||
|
(github.event.action == 'opened' && github.event.pull_request.merged != true) ||
|
||||||
(github.event.action == 'synchronize' && github.event.pull_request.merged != true) ||
|
(github.event.action == 'synchronize' && github.event.pull_request.merged != true) ||
|
||||||
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
||||||
)
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -79,7 +75,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Setup mokocli tools
|
- name: Setup mokocli tools
|
||||||
env:
|
env:
|
||||||
@@ -95,7 +90,7 @@ jobs:
|
|||||||
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
|
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
|
fi
|
||||||
rm -rf /tmp/mokocli
|
rm -rf /tmp/mokocli
|
||||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoCLI.git
|
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git
|
||||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
||||||
cd /tmp/mokocli
|
cd /tmp/mokocli
|
||||||
composer install --no-dev --no-interaction --quiet
|
composer install --no-dev --no-interaction --quiet
|
||||||
@@ -104,46 +99,18 @@ jobs:
|
|||||||
|
|
||||||
- name: Rename branch to rc
|
- name: Rename branch to rc
|
||||||
run: |
|
run: |
|
||||||
API_BASE="${MOKOGITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
php ${MOKO_CLI}/branch_rename.php \
|
||||||
AUTH="Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}"
|
--from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \
|
||||||
FROM="${{ github.event.pull_request.head.ref || 'dev' }}"
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||||
PR="${{ github.event.pull_request.number }}"
|
--api-base "${MOKOGITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \
|
||||||
|
--pr "${{ github.event.pull_request.number }}"
|
||||||
# Resolve the source branch HEAD commit.
|
|
||||||
SRC_JSON=$(curl -sf -H "$AUTH" "${API_BASE}/branches/${FROM}") \
|
|
||||||
|| { echo "::error::Source branch ${FROM} not found"; exit 1; }
|
|
||||||
SRC_SHA=$(printf '%s' "$SRC_JSON" | python3 -c "import sys, json; print(json.load(sys.stdin)['commit']['id'])" 2>/dev/null || true)
|
|
||||||
[ -n "$SRC_SHA" ] || { echo "::error::Could not resolve HEAD of ${FROM}"; exit 1; }
|
|
||||||
|
|
||||||
# Point rc at the source commit. If rc already exists (a protected branch that
|
|
||||||
# cannot be deleted), force-update its ref in place instead of delete+recreate:
|
|
||||||
# deleting a protected branch fails, which then makes the recreate return HTTP 409.
|
|
||||||
if curl -sf -o /dev/null -H "$AUTH" "${API_BASE}/branches/rc"; then
|
|
||||||
echo "rc exists - force-updating to ${FROM} (${SRC_SHA})"
|
|
||||||
curl -sf -X PATCH -H "$AUTH" -H "Content-Type: application/json" \
|
|
||||||
"${API_BASE}/git/refs/heads/rc" -d "{\"sha\":\"${SRC_SHA}\",\"force\":true}" \
|
|
||||||
|| { echo "::error::Failed to force-update rc (CI token needs force-push on the protected rc branch)"; exit 1; }
|
|
||||||
else
|
|
||||||
echo "Creating rc from ${FROM}"
|
|
||||||
curl -sf -X POST -H "$AUTH" -H "Content-Type: application/json" \
|
|
||||||
"${API_BASE}/branches" -d "{\"new_branch_name\":\"rc\",\"old_branch_name\":\"${FROM}\"}" \
|
|
||||||
|| { echo "::error::Failed to create rc from ${FROM}"; exit 1; }
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Repoint the PR at rc, then delete the old source branch (non-fatal).
|
|
||||||
if [ -n "$PR" ]; then
|
|
||||||
curl -s -X PATCH -H "$AUTH" -H "Content-Type: application/json" \
|
|
||||||
"${API_BASE}/pulls/${PR}" -d '{"head":"rc"}' >/dev/null || true
|
|
||||||
fi
|
|
||||||
curl -s -X DELETE -H "$AUTH" "${API_BASE}/branches/${FROM}" >/dev/null || true
|
|
||||||
echo "Renamed ${FROM} -> rc"
|
|
||||||
|
|
||||||
- name: Checkout rc and configure git
|
- name: Checkout rc and configure git
|
||||||
run: |
|
run: |
|
||||||
git fetch origin rc
|
git fetch origin rc
|
||||||
git checkout rc
|
git checkout rc
|
||||||
git config --local user.email "mokogitea-actions[bot]@mokoconsulting.tech"
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
git config --local user.name "mokogitea-actions[bot]"
|
git config --local user.name "gitea-actions[bot]"
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||||
|
|
||||||
- name: Publish RC release
|
- name: Publish RC release
|
||||||
@@ -196,13 +163,9 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
name: Build & Release Pipeline
|
name: Build & Release Pipeline
|
||||||
runs-on: release
|
runs-on: release
|
||||||
# Skip on template repos (Template-*) — they scaffold other repos and do not release.
|
|
||||||
if: >-
|
if: >-
|
||||||
!startsWith(github.event.repository.name, 'Template-') &&
|
|
||||||
(
|
|
||||||
github.event.pull_request.merged == true ||
|
github.event.pull_request.merged == true ||
|
||||||
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
||||||
)
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -210,12 +173,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Configure git for bot pushes
|
- name: Configure git for bot pushes
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "mokogitea-actions[bot]@mokoconsulting.tech"
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
git config --local user.name "mokogitea-actions[bot]"
|
git config --local user.name "gitea-actions[bot]"
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||||
|
|
||||||
- name: Check for merge conflict markers
|
- name: Check for merge conflict markers
|
||||||
@@ -246,7 +208,7 @@ jobs:
|
|||||||
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
|
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
|
fi
|
||||||
rm -rf /tmp/mokocli
|
rm -rf /tmp/mokocli
|
||||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoCLI.git
|
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git
|
||||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
||||||
cd /tmp/mokocli
|
cd /tmp/mokocli
|
||||||
composer install --no-dev --no-interaction --quiet
|
composer install --no-dev --no-interaction --quiet
|
||||||
@@ -380,12 +342,9 @@ jobs:
|
|||||||
import sys
|
import sys
|
||||||
version, date = sys.argv[1], sys.argv[2]
|
version, date = sys.argv[1], sys.argv[2]
|
||||||
content = open('CHANGELOG.md').read()
|
content = open('CHANGELOG.md').read()
|
||||||
marker = f'## [{version}]'
|
old = '## [Unreleased]'
|
||||||
# Idempotent: only promote when this version header isn't already present,
|
new = f'## [Unreleased]\n\n## [{version}] --- {date}'
|
||||||
# otherwise re-runs (or same-version builds) create empty duplicate headers.
|
content = content.replace(old, new, 1)
|
||||||
if marker not in content:
|
|
||||||
new = f'## [Unreleased]\n\n{marker} --- {date}'
|
|
||||||
content = content.replace('## [Unreleased]', new, 1)
|
|
||||||
open('CHANGELOG.md', 'w').write(content)
|
open('CHANGELOG.md', 'w').write(content)
|
||||||
" "$VERSION" "$DATE"
|
" "$VERSION" "$DATE"
|
||||||
git add CHANGELOG.md
|
git add CHANGELOG.md
|
||||||
@@ -429,7 +388,7 @@ jobs:
|
|||||||
&& echo "main branch pushed to GitHub mirror" \
|
&& echo "main branch pushed to GitHub mirror" \
|
||||||
|| echo "WARNING: GitHub mirror push failed"
|
|| echo "WARNING: GitHub mirror push failed"
|
||||||
|
|
||||||
- name: "Step 11: Delete rc branch (dev reset moved to cascade-dev.yml)"
|
- name: "Step 11: Delete rc branch and recreate dev from main"
|
||||||
if: steps.version.outputs.skip != 'true'
|
if: steps.version.outputs.skip != 'true'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
@@ -441,9 +400,17 @@ jobs:
|
|||||||
"${API_BASE}/branches/rc" 2>/dev/null \
|
"${API_BASE}/branches/rc" 2>/dev/null \
|
||||||
&& echo "Deleted rc branch" || echo "rc branch not found"
|
&& echo "Deleted rc branch" || echo "rc branch not found"
|
||||||
|
|
||||||
# dev is reset from main by the dedicated "Cascade Main -> Dev" workflow
|
# Delete dev branch
|
||||||
# (cascade-dev.yml), which runs after this release completes.
|
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
||||||
echo "rc cleaned; dev reset handled by cascade-dev.yml" >> $GITHUB_STEP_SUMMARY
|
"${API_BASE}/branches/dev" 2>/dev/null && echo "Deleted dev branch"
|
||||||
|
|
||||||
|
# Recreate dev from main (now includes version bump + changelog promotion)
|
||||||
|
curl -sf -X POST -H "Authorization: token ${TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API_BASE}/branches" \
|
||||||
|
-d '{"new_branch_name":"dev","old_branch_name":"main"}' 2>/dev/null && echo "Recreated dev from main"
|
||||||
|
|
||||||
|
echo "Pre-release branches cleaned, dev reset from main" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
- name: "Step 12: Create version branch from main"
|
- name: "Step 12: Create version branch from main"
|
||||||
if: steps.version.outputs.skip != 'true'
|
if: steps.version.outputs.skip != 'true'
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: MokoStandards.Universal
|
# INGROUP: MokoStandards.Universal
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
# PATH: /.mokogitea/workflows/branch-cleanup.yml
|
# PATH: /.mokogitea/workflows/branch-cleanup.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Delete feature branches after PR merge
|
# BRIEF: Delete feature branches after PR merge
|
||||||
@@ -33,8 +33,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
BRANCH="${{ github.event.pull_request.head.ref }}"
|
BRANCH="${{ github.event.pull_request.head.ref }}"
|
||||||
API="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}/api/v1/repos/${{ github.repository }}/branches"
|
API="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}/api/v1/repos/${{ github.repository }}/branches"
|
||||||
# URL-encode the branch name's slashes (no PHP dependency on the runner)
|
ENCODED=$(php -r "echo rawurlencode('${BRANCH}');")
|
||||||
ENCODED=$(printf '%s' "${BRANCH}" | sed 's|/|%2F|g')
|
|
||||||
|
|
||||||
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X DELETE \
|
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X DELETE \
|
||||||
-H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||||
|
|||||||
@@ -1,106 +1,10 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
# DISABLED — auto-release Step 11 recreates dev from main after every release.
|
||||||
#
|
# Cascade-dev is redundant and causes version conflicts when both main and dev
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# have different version numbers in templateDetails.xml / manifest.xml.
|
||||||
#
|
name: "Cascade Main → Dev (DISABLED)"
|
||||||
# FILE INFORMATION
|
on: workflow_dispatch
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
|
||||||
# INGROUP: MokoStandards.Cascade
|
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
|
||||||
# PATH: /.mokogitea/workflows/cascade-dev.yml
|
|
||||||
# VERSION: 02.00.00
|
|
||||||
# BRIEF: Cascade main -> dev via PR; auto-merge only if conflict-free, else notify
|
|
||||||
|
|
||||||
name: "Cascade Main -> Dev"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
env:
|
|
||||||
MOKOGITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
||||||
# ntfy destination is configured via repo or org variables (org vars are inherited).
|
|
||||||
NTFY_URL: ${{ vars.NTFY_URL || 'https://ntfy.mokoconsulting.tech' }}
|
|
||||||
NTFY_TOPIC: ${{ vars.CASCADE_NTFY_TOPIC || vars.NTFY_TOPIC || 'gitea-releases' }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cascade:
|
noop:
|
||||||
name: Cascade main -> dev
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Open main -> dev PR (auto-merge if clean, else notify)
|
- run: echo "Cascade disabled — auto-release handles dev recreation"
|
||||||
env:
|
|
||||||
TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
REPO: ${{ github.repository }}
|
|
||||||
run: |
|
|
||||||
set -uo pipefail
|
|
||||||
API="${MOKOGITEA_URL}/api/v1/repos/${REPO}"
|
|
||||||
AUTH="Authorization: token ${TOKEN}"
|
|
||||||
jqnum() { python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('$1',''))" 2>/dev/null; }
|
|
||||||
|
|
||||||
# 0. dev must exist
|
|
||||||
if ! curl -sf -H "$AUTH" "${API}/branches/dev" >/dev/null 2>&1; then
|
|
||||||
echo "No dev branch - nothing to cascade."; exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 1. is main ahead of dev?
|
|
||||||
AHEAD=$(curl -sf -H "$AUTH" "${API}/compare/dev...main" \
|
|
||||||
| python3 -c "import sys,json; print(json.load(sys.stdin).get('total_commits',0))" 2>/dev/null || echo 0)
|
|
||||||
if [ "${AHEAD:-0}" -eq 0 ]; then
|
|
||||||
echo "dev already up to date with main."; exit 0
|
|
||||||
fi
|
|
||||||
echo "main is ${AHEAD} commit(s) ahead of dev."
|
|
||||||
|
|
||||||
# 2. reuse an open main->dev PR, else create one
|
|
||||||
PR=$(curl -sf -H "$AUTH" "${API}/pulls?state=open&base=dev" \
|
|
||||||
| python3 -c "import sys,json; d=json.load(sys.stdin); print(next((str(p['number']) for p in d if p.get('head',{}).get('ref')=='main'), ''))" 2>/dev/null || echo "")
|
|
||||||
if [ -z "$PR" ]; then
|
|
||||||
RESP=$(curl -s -H "$AUTH" -H "Content-Type: application/json" -X POST "${API}/pulls" \
|
|
||||||
-d '{"head":"main","base":"dev","title":"chore(sync): cascade main -> dev","body":"Automated cascade of main into dev. Auto-merges only if conflict-free; otherwise left open for manual resolution."}')
|
|
||||||
PR=$(printf '%s' "$RESP" | jqnum number)
|
|
||||||
if [ -z "$PR" ]; then
|
|
||||||
echo "::warning::Could not open cascade PR: $RESP"; exit 0
|
|
||||||
fi
|
|
||||||
echo "Opened cascade PR #${PR}"
|
|
||||||
else
|
|
||||||
echo "Reusing open cascade PR #${PR}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 3. wait for MokoGitea to compute mergeability (conflict detection)
|
|
||||||
MERGEABLE=""
|
|
||||||
for _ in 1 2 3 4 5 6; do
|
|
||||||
MERGEABLE=$(curl -sf -H "$AUTH" "${API}/pulls/${PR}" | jqnum mergeable)
|
|
||||||
case "$MERGEABLE" in True|False) break ;; esac
|
|
||||||
sleep 3
|
|
||||||
done
|
|
||||||
echo "mergeable=${MERGEABLE}"
|
|
||||||
|
|
||||||
notify() {
|
|
||||||
curl -sS \
|
|
||||||
-H "Title: ${REPO}: dev cascade needs manual merge" \
|
|
||||||
-H "Tags: warning,twisted_rightwards_arrows" \
|
|
||||||
-H "Priority: high" \
|
|
||||||
-H "Click: ${MOKOGITEA_URL}/${REPO}/pulls/${PR}" \
|
|
||||||
-d "main -> dev cascade PR #${PR} $1 It was NOT auto-merged; resolve it manually." \
|
|
||||||
"${NTFY_URL}/${NTFY_TOPIC}" || true
|
|
||||||
}
|
|
||||||
|
|
||||||
# 4. auto-merge only if conflict-free; otherwise notify
|
|
||||||
if [ "$MERGEABLE" = "True" ]; then
|
|
||||||
CODE=$(curl -s -o /tmp/merge.json -w "%{http_code}" -H "$AUTH" -H "Content-Type: application/json" \
|
|
||||||
-X POST "${API}/pulls/${PR}/merge" -d '{"Do":"merge","merge_when_checks_succeed":true}')
|
|
||||||
if [ "$CODE" -ge 200 ] && [ "$CODE" -lt 300 ]; then
|
|
||||||
echo "Cascade PR #${PR} merged (or scheduled to merge when checks pass)."
|
|
||||||
else
|
|
||||||
echo "::warning::Auto-merge returned HTTP ${CODE}: $(cat /tmp/merge.json)"
|
|
||||||
notify "could not be auto-merged (HTTP ${CODE})."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "::warning::Cascade PR #${PR} has conflicts (mergeable=${MERGEABLE}); sending notification."
|
|
||||||
notify "has conflicts and cannot be merged automatically."
|
|
||||||
fi
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: MokoStandards.CI
|
# INGROUP: MokoStandards.CI
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
# PATH: /.mokogitea/workflows/ci-generic.yml
|
# PATH: /.gitea/workflows/ci-generic.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: CI pipeline — lint, validate, and test for generic projects (PHP + Node.js)
|
# BRIEF: CI pipeline — lint, validate, and test for generic projects (PHP + Node.js)
|
||||||
|
|
||||||
@@ -32,8 +32,6 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
name: Lint & Validate
|
name: Lint & Validate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# Skip on template repos (Template-*) — they hold placeholder scaffolding, not buildable source.
|
|
||||||
if: ${{ !startsWith(github.event.repository.name, 'Template-') }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -132,9 +130,6 @@ jobs:
|
|||||||
name: Tests
|
name: Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: lint
|
needs: lint
|
||||||
# Run only when lint succeeded; always() forces evaluation so a skipped
|
|
||||||
# lint (e.g. template repos) skips this job cleanly instead of hanging.
|
|
||||||
if: ${{ always() && needs.lint.result == 'success' }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: mokocli.Universal
|
# INGROUP: mokocli.Universal
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
# PATH: /.mokogitea/workflows/ci-issue-reporter.yml
|
# PATH: /.mokogitea/workflows/ci-issue-reporter.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Reusable workflow — creates/updates a MokoGitea issue when a CI gate fails.
|
# BRIEF: Reusable workflow — creates/updates a Gitea issue when a CI gate fails.
|
||||||
# Clones MokoCLI and runs cli/ci_issue_reporter.sh.
|
# Clones MokoCLI and runs cli/ci_issue_reporter.sh.
|
||||||
|
|
||||||
name: "Universal: CI Issue Reporter"
|
name: "Universal: CI Issue Reporter"
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: MokoStandards.Maintenance
|
# INGROUP: MokoStandards.Maintenance
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards
|
||||||
# PATH: /.mokogitea/workflows/cleanup.yml
|
# PATH: /.gitea/workflows/cleanup.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Scheduled cleanup — delete merged branches and old workflow runs
|
# BRIEF: Scheduled cleanup — delete merged branches and old workflow runs
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
for BRANCH in $BRANCHES; do
|
for BRANCH in $BRANCHES; do
|
||||||
# Skip protected branches
|
# Skip protected branches
|
||||||
case "$BRANCH" in
|
case "$BRANCH" in
|
||||||
main|master|dev|develop|rc|beta|alpha|release|release/*|production|stable|staging|hotfix/*|version/*) continue ;;
|
main|master|develop|release/*|hotfix/*) continue ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if branch is merged into main
|
# Check if branch is merged into main
|
||||||
|
|||||||
@@ -0,0 +1,126 @@
|
|||||||
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# FILE INFORMATION
|
||||||
|
# DEFGROUP: Gitea.Workflow
|
||||||
|
# INGROUP: MokoStandards.Deploy
|
||||||
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API
|
||||||
|
# PATH: /templates/workflows/joomla/deploy-manual.yml.template
|
||||||
|
# VERSION: 04.07.00
|
||||||
|
# BRIEF: Manual SFTP deploy to dev server for Joomla repos
|
||||||
|
|
||||||
|
name: "Universal: Deploy to Dev (Manual)"
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
clear_remote:
|
||||||
|
description: 'Delete all remote files before uploading'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
name: SFTP Deploy to Dev
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
run: |
|
||||||
|
php -v && composer --version
|
||||||
|
|
||||||
|
- name: Setup MokoStandards tools
|
||||||
|
env:
|
||||||
|
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN || github.token }}
|
||||||
|
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN || github.token }}
|
||||||
|
MOKO_CLONE_HOST: ${{ secrets.MOKOGITEA_TOKEN && 'git.mokoconsulting.tech/MokoConsulting' || 'github.com/mokoconsulting-tech' }}
|
||||||
|
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.MOKOGITEA_TOKEN || github.token }}"}}'
|
||||||
|
run: |
|
||||||
|
git clone --depth 1 --branch main --quiet \
|
||||||
|
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoStandards-API.git" \
|
||||||
|
/tmp/mokostandards-api 2>/dev/null || true
|
||||||
|
if [ -d "/tmp/mokostandards-api" ] && [ -f "/tmp/mokostandards-api/composer.json" ]; then
|
||||||
|
cd /tmp/mokostandards-api && composer install --no-dev --no-interaction --quiet 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Check FTP configuration
|
||||||
|
id: check
|
||||||
|
env:
|
||||||
|
HOST: ${{ vars.DEV_FTP_HOST }}
|
||||||
|
PATH_VAR: ${{ vars.DEV_FTP_PATH }}
|
||||||
|
PORT: ${{ vars.DEV_FTP_PORT }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$HOST" ] || [ -z "$PATH_VAR" ]; then
|
||||||
|
echo "DEV_FTP_HOST or DEV_FTP_PATH not configured -- cannot deploy"
|
||||||
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "host=$HOST" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
REMOTE="${PATH_VAR%/}"
|
||||||
|
echo "remote=$REMOTE" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
[ -z "$PORT" ] && PORT="22"
|
||||||
|
echo "port=$PORT" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Deploy via SFTP
|
||||||
|
if: steps.check.outputs.skip != 'true'
|
||||||
|
env:
|
||||||
|
SFTP_KEY: ${{ secrets.DEV_FTP_KEY }}
|
||||||
|
SFTP_PASS: ${{ secrets.DEV_FTP_PASSWORD }}
|
||||||
|
SFTP_USER: ${{ vars.DEV_FTP_USERNAME }}
|
||||||
|
run: |
|
||||||
|
SOURCE_DIR="src"
|
||||||
|
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
|
||||||
|
[ ! -d "$SOURCE_DIR" ] && { echo "No src/ or htdocs/ -- nothing to deploy"; exit 0; }
|
||||||
|
|
||||||
|
printf '{"host":"%s","port":%s,"username":"%s","remotePath":"%s"' \
|
||||||
|
"${{ steps.check.outputs.host }}" "${{ steps.check.outputs.port }}" "$SFTP_USER" "${{ steps.check.outputs.remote }}" \
|
||||||
|
> /tmp/sftp-config.json
|
||||||
|
|
||||||
|
if [ -n "$SFTP_KEY" ]; then
|
||||||
|
echo "$SFTP_KEY" > /tmp/deploy_key
|
||||||
|
chmod 600 /tmp/deploy_key
|
||||||
|
printf ',"privateKeyPath":"/tmp/deploy_key"}' >> /tmp/sftp-config.json
|
||||||
|
else
|
||||||
|
printf ',"password":"%s"}' "$SFTP_PASS" >> /tmp/sftp-config.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
DEPLOY_ARGS=(--path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json)
|
||||||
|
[ "${{ inputs.clear_remote }}" = "true" ] && DEPLOY_ARGS+=(--clear-remote)
|
||||||
|
|
||||||
|
PLATFORM=$(php /tmp/mokostandards-api/cli/platform_detect.php --path . 2>/dev/null || true)
|
||||||
|
if [ "$PLATFORM" = "waas-component" ] && [ -f "/tmp/mokostandards-api/deploy/deploy-joomla.php" ]; then
|
||||||
|
php /tmp/mokostandards-api/deploy/deploy-joomla.php "${DEPLOY_ARGS[@]}"
|
||||||
|
else
|
||||||
|
php /tmp/mokostandards-api/deploy/deploy-sftp.php "${DEPLOY_ARGS[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f /tmp/deploy_key /tmp/sftp-config.json
|
||||||
|
|
||||||
|
- name: Summary
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if [ "${{ steps.check.outputs.skip }}" = "true" ]; then
|
||||||
|
echo "### Deploy Skipped -- FTP not configured" >> $GITHUB_STEP_SUMMARY
|
||||||
|
else
|
||||||
|
echo "### Manual Dev Deploy Complete" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Host | \`${{ steps.check.outputs.host }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Remote | \`${{ steps.check.outputs.remote }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Clear | ${{ inputs.clear_remote }} |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
@@ -3,10 +3,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: MokoStandards.Security
|
# INGROUP: MokoStandards.Security
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API
|
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards-API
|
||||||
# PATH: /.mokogitea/workflows/gitleaks.yml
|
# PATH: /templates/workflows/gitleaks.yml.template
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Secret scanning — detect leaked credentials, API keys, and tokens
|
# BRIEF: Secret scanning — detect leaked credentials, API keys, and tokens
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: mokocli.Automation
|
# INGROUP: mokocli.Automation
|
||||||
# VERSION: 02.58.17
|
# VERSION: 01.45.07
|
||||||
# BRIEF: Auto-create feature branch when an issue is opened
|
# BRIEF: Auto-create feature branch when an issue is opened
|
||||||
|
|
||||||
name: "Universal: Issue Branch"
|
name: "Universal: Issue Branch"
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: MokoStandards.Notifications
|
# INGROUP: MokoStandards.Notifications
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards
|
||||||
# PATH: /.mokogitea/workflows/notify.yml
|
# PATH: /.gitea/workflows/notify.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Push notifications via ntfy on release success or workflow failure
|
# BRIEF: Push notifications via ntfy on release success or workflow failure
|
||||||
|
|
||||||
@@ -15,9 +15,9 @@ name: "Universal: Notifications"
|
|||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows:
|
workflows:
|
||||||
- "Universal: Build & Release"
|
- "Joomla Build & Release"
|
||||||
- "Joomla: Extension CI"
|
- "Joomla Extension CI"
|
||||||
- "Generic: Project CI"
|
- "Deploy"
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: mokocli.CI
|
# INGROUP: moko-platform.CI
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
||||||
# PATH: /.mokogitea/workflows/pr-check.yml
|
# PATH: /templates/workflows/universal/pr-check.yml.template
|
||||||
# VERSION: 09.23.00
|
# VERSION: 09.23.00
|
||||||
# BRIEF: PR gate — branch policy + code validation before merge
|
# BRIEF: PR gate — branch policy + code validation before merge
|
||||||
|
|
||||||
@@ -47,15 +47,15 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
fix/*|bugfix/*)
|
fix/*|bugfix/*)
|
||||||
if [ "$BASE" != "dev" ] && [ "$BASE" != "main" ]; then
|
if [ "$BASE" != "dev" ]; then
|
||||||
ALLOWED=false
|
ALLOWED=false
|
||||||
REASON="Fix branches must target 'dev' or 'main', not '${BASE}'"
|
REASON="Fix branches must target 'dev', not '${BASE}'"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
patch/*)
|
patch/*)
|
||||||
if [ "$BASE" != "dev" ] && [ "$BASE" != "rc" ] && [ "$BASE" != "main" ]; then
|
if [ "$BASE" != "dev" ] && [ "$BASE" != "rc" ]; then
|
||||||
ALLOWED=false
|
ALLOWED=false
|
||||||
REASON="Patch branches must target 'dev', 'rc', or 'main', not '${BASE}'"
|
REASON="Patch branches must target 'dev' or 'rc', not '${BASE}'"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
hotfix/*)
|
hotfix/*)
|
||||||
@@ -86,8 +86,7 @@ jobs:
|
|||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "### Allowed merge paths:" >> $GITHUB_STEP_SUMMARY
|
echo "### Allowed merge paths:" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`feature/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`feature/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`fix/*\` → \`dev\` or \`main\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`fix/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`patch/*\` → \`dev\`, \`rc\`, or \`main\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "- \`hotfix/*\` → \`dev\` or \`main\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`hotfix/*\` → \`dev\` or \`main\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`dev\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`dev\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`rc/*\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`rc/*\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
||||||
@@ -97,80 +96,6 @@ jobs:
|
|||||||
echo "Branch policy: OK (${HEAD} → ${BASE})"
|
echo "Branch policy: OK (${HEAD} → ${BASE})"
|
||||||
echo "## Branch Policy: Passed" >> $GITHUB_STEP_SUMMARY
|
echo "## Branch Policy: Passed" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
# ── Docs Update Gate (main PRs) ─────────────────────────────────────────
|
|
||||||
require-docs:
|
|
||||||
name: Require Docs Update
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
# Enforce only on PRs merging into main: README.md + CHANGELOG.md must both be updated.
|
|
||||||
if: ${{ github.base_ref == 'main' }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Require README.md and CHANGELOG.md in the PR diff
|
|
||||||
run: |
|
|
||||||
BASE="${{ github.event.pull_request.base.sha }}"
|
|
||||||
HEAD="${{ github.event.pull_request.head.sha }}"
|
|
||||||
CHANGED="$(git diff --name-only "$BASE" "$HEAD" 2>/dev/null || true)"
|
|
||||||
if [ -z "$CHANGED" ]; then
|
|
||||||
git fetch -q origin "${{ github.base_ref }}" 2>/dev/null || true
|
|
||||||
CHANGED="$(git diff --name-only "origin/${{ github.base_ref }}...HEAD" 2>/dev/null || true)"
|
|
||||||
fi
|
|
||||||
echo "Changed files in PR:"
|
|
||||||
echo "$CHANGED"
|
|
||||||
MISSING=""
|
|
||||||
echo "$CHANGED" | grep -qxE 'README\.md' || MISSING="README.md"
|
|
||||||
echo "$CHANGED" | grep -qxE 'CHANGELOG\.md' || MISSING="${MISSING:+$MISSING, }CHANGELOG.md"
|
|
||||||
if [ -n "$MISSING" ]; then
|
|
||||||
echo "::error::PRs into main must update: ${MISSING}"
|
|
||||||
{
|
|
||||||
echo "## Docs Update Required"
|
|
||||||
echo ""
|
|
||||||
echo "PRs merging into \`main\` must update both **README.md** and **CHANGELOG.md**."
|
|
||||||
echo ""
|
|
||||||
echo "Not updated in this PR: **${MISSING}**"
|
|
||||||
} >> "$GITHUB_STEP_SUMMARY"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Docs update present (README.md + CHANGELOG.md)"
|
|
||||||
echo "## Docs Update: Passed" >> "$GITHUB_STEP_SUMMARY"
|
|
||||||
|
|
||||||
# ── Wiki Update Reminder (main PRs, non-blocking) ───────────────────────
|
|
||||||
wiki-reminder:
|
|
||||||
name: Wiki Update Reminder
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.base_ref == 'main' }}
|
|
||||||
steps:
|
|
||||||
- name: Remind to update the wiki
|
|
||||||
env:
|
|
||||||
TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
SERVER: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
||||||
REPO: ${{ github.repository }}
|
|
||||||
PR: ${{ github.event.pull_request.number }}
|
|
||||||
run: |
|
|
||||||
set -uo pipefail
|
|
||||||
{
|
|
||||||
echo "## Wiki Update Reminder"
|
|
||||||
echo ""
|
|
||||||
echo "Docs are **wiki-first** at MokoConsulting. If this change affects behavior, usage, configuration, or standards, update the repo wiki:"
|
|
||||||
echo ""
|
|
||||||
echo "- ${SERVER}/${REPO}/wiki"
|
|
||||||
echo ""
|
|
||||||
echo "_Non-blocking reminder._"
|
|
||||||
} >> "$GITHUB_STEP_SUMMARY"
|
|
||||||
# Post a single PR comment (idempotent via hidden marker); best-effort, never fails.
|
|
||||||
API="${SERVER}/api/v1/repos/${REPO}/issues/${PR}/comments"
|
|
||||||
if [ -n "${TOKEN:-}" ] && [ -n "${PR:-}" ]; then
|
|
||||||
existing="$(curl -sf -H "Authorization: token ${TOKEN}" "$API" 2>/dev/null | grep -c 'wiki-reminder' || true)"
|
|
||||||
if [ "${existing:-0}" -eq 0 ]; then
|
|
||||||
curl -sf -H "Authorization: token ${TOKEN}" -H "Content-Type: application/json" -X POST "$API" \
|
|
||||||
-d '{"body":"<!-- wiki-reminder -->\n\n**Wiki reminder:** docs are wiki-first -- if this PR changes behavior, usage, config, or standards, please update the repo wiki before/after merge. _(non-blocking)_"}' >/dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo "Wiki reminder emitted (non-blocking)."
|
|
||||||
|
|
||||||
# ── Secret Scanning ──────────────────────────────────────────────────
|
# ── Secret Scanning ──────────────────────────────────────────────────
|
||||||
gitleaks:
|
gitleaks:
|
||||||
name: Secret Scan
|
name: Secret Scan
|
||||||
@@ -201,8 +126,6 @@ jobs:
|
|||||||
validate:
|
validate:
|
||||||
name: Validate PR
|
name: Validate PR
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# Skip on template repos (Template-*) — no real manifest/source/changelog to validate.
|
|
||||||
if: ${{ !startsWith(github.event.repository.name, 'Template-') }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -224,12 +147,11 @@ jobs:
|
|||||||
- name: Detect platform
|
- name: Detect platform
|
||||||
id: platform
|
id: platform
|
||||||
run: |
|
run: |
|
||||||
# Platform comes from the MokoGitea metadata API (public GET); manifest.xml is no longer used.
|
# Read platform from XML manifest (<platform> tag) or plain text fallback
|
||||||
API="${GITHUB_SERVER_URL:-https://git.mokoconsulting.tech}/api/v1/repos/${GITHUB_REPOSITORY}/metadata"
|
PLATFORM=$(sed -n 's/.*<platform>\([^<]*\)<\/platform>.*/\1/p' .mokogitea/manifest.xml 2>/dev/null | head -1)
|
||||||
PLATFORM="$(curl -sf "$API" 2>/dev/null | python3 -c "import sys, json; print(json.load(sys.stdin).get('platform') or '')" 2>/dev/null || true)"
|
[ -z "$PLATFORM" ] && PLATFORM=$(cat .mokogitea/manifest.xml 2>/dev/null | tr -d '[:space:]')
|
||||||
[ -z "$PLATFORM" ] && PLATFORM="generic"
|
[ -z "$PLATFORM" ] && PLATFORM="generic"
|
||||||
echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT"
|
echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT"
|
||||||
echo "Detected platform: $PLATFORM"
|
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
if: steps.platform.outputs.platform == 'joomla' || steps.platform.outputs.platform == 'dolibarr'
|
if: steps.platform.outputs.platform == 'joomla' || steps.platform.outputs.platform == 'dolibarr'
|
||||||
@@ -350,7 +272,7 @@ jobs:
|
|||||||
joomla)
|
joomla)
|
||||||
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
|
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
|
||||||
if [ -z "$MANIFEST" ]; then
|
if [ -z "$MANIFEST" ]; then
|
||||||
echo "::warning::No Joomla manifest found (MokoSuite site)"
|
echo "::warning::No Joomla manifest found (WaaS site)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "Manifest: ${MANIFEST}"
|
echo "Manifest: ${MANIFEST}"
|
||||||
@@ -363,7 +285,7 @@ jobs:
|
|||||||
# Block legacy raw/branch update server URLs on MokoGitea
|
# Block legacy raw/branch update server URLs on MokoGitea
|
||||||
RAW_URLS=$(grep -n 'raw/branch' "$MANIFEST" | grep -i 'mokoconsulting\|mokogitea\|git\.mokoconsulting\.tech' || true)
|
RAW_URLS=$(grep -n 'raw/branch' "$MANIFEST" | grep -i 'mokoconsulting\|mokogitea\|git\.mokoconsulting\.tech' || true)
|
||||||
if [ -n "$RAW_URLS" ]; then
|
if [ -n "$RAW_URLS" ]; then
|
||||||
echo "::error::Manifest contains legacy raw/branch update server URL on MokoGitea. Use the MokoGitea Pages URL instead (e.g. /{REPO}/updates.xml not /{REPO}/raw/branch/main/updates.xml)"
|
echo "::error::Manifest contains legacy raw/branch update server URL on MokoGitea. Use the Gitea Pages URL instead (e.g. /{REPO}/updates.xml not /{REPO}/raw/branch/main/updates.xml)"
|
||||||
echo "$RAW_URLS"
|
echo "$RAW_URLS"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -570,9 +492,6 @@ jobs:
|
|||||||
name: Build RC Package
|
name: Build RC Package
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [branch-policy, validate]
|
needs: [branch-policy, validate]
|
||||||
# Run only when both gates succeeded; always() forces evaluation so a skipped
|
|
||||||
# validate (e.g. template repos) skips this job cleanly instead of hanging.
|
|
||||||
if: ${{ always() && needs.branch-policy.result == 'success' && needs.validate.result == 'success' }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger RC pre-release
|
- name: Trigger RC pre-release
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: mokocli.Release
|
# INGROUP: mokocli.Release
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
# PATH: /.mokogitea/workflows/pre-release.yml
|
# PATH: /templates/workflows/universal/pre-release.yml.template
|
||||||
# VERSION: 05.02.00
|
# VERSION: 05.02.00
|
||||||
# BRIEF: Auto pre-release on push to dev/alpha/beta/rc branches
|
# BRIEF: Auto pre-release on push to dev/alpha/beta/rc branches
|
||||||
|
|
||||||
@@ -48,13 +48,9 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: "Build Pre-Release (${{ inputs.stability || github.ref_name }})"
|
name: "Build Pre-Release (${{ inputs.stability || github.ref_name }})"
|
||||||
runs-on: release
|
runs-on: release
|
||||||
# Skip on template repos (Template-*) — they scaffold other repos and do not release.
|
|
||||||
if: >-
|
if: >-
|
||||||
!startsWith(github.event.repository.name, 'Template-') &&
|
|
||||||
(
|
|
||||||
github.event_name == 'workflow_dispatch' ||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
github.event_name == 'push'
|
github.event_name == 'push'
|
||||||
)
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -84,7 +80,7 @@ jobs:
|
|||||||
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
|
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
|
fi
|
||||||
rm -rf /tmp/mokocli
|
rm -rf /tmp/mokocli
|
||||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoCLI.git
|
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git
|
||||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
||||||
cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet
|
cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet
|
||||||
echo MOKO_CLI=/tmp/mokocli/cli >> $GITHUB_ENV
|
echo MOKO_CLI=/tmp/mokocli/cli >> $GITHUB_ENV
|
||||||
@@ -156,8 +152,8 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Commit version bump
|
# Commit version bump
|
||||||
git config --local user.email "mokogitea-actions[bot]@mokoconsulting.tech"
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
git config --local user.name "mokogitea-actions[bot]"
|
git config --local user.name "gitea-actions[bot]"
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||||
git add -A
|
git add -A
|
||||||
git diff --cached --quiet || {
|
git diff --cached --quiet || {
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: mokocli.Universal
|
# INGROUP: mokocli.Universal
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
# PATH: /.mokogitea/workflows/rc-revert.yml
|
# PATH: /.mokogitea/workflows/rc-revert.yml
|
||||||
# VERSION: 09.23.00
|
# VERSION: 09.23.00
|
||||||
# BRIEF: Rename rc/ branch back to dev/ when PR is closed without merge
|
# BRIEF: Rename rc/ branch back to dev/ when PR is closed without merge
|
||||||
@@ -25,8 +25,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: >-
|
if: >-
|
||||||
github.event.pull_request.merged == false &&
|
github.event.pull_request.merged == false &&
|
||||||
startsWith(github.event.pull_request.head.ref, 'rc/') &&
|
startsWith(github.event.pull_request.head.ref, 'rc/')
|
||||||
!startsWith(github.event.repository.name, 'Template-')
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Rename branch
|
- name: Rename branch
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: mokocli.Validation
|
# INGROUP: mokocli.Validation
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/mokocli
|
||||||
# PATH: /.mokogitea/workflows/repo-health.yml
|
# PATH: /templates/workflows/joomla/repo_health.yml.template
|
||||||
# VERSION: 09.23.00
|
# VERSION: 09.23.00
|
||||||
# BRIEF: Enforces repository guardrails by validating scripts governance, tooling availability, and core repository health artifacts.
|
# BRIEF: Enforces repository guardrails by validating scripts governance, tooling availability, and core repository health artifacts.
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
@@ -88,7 +88,7 @@ jobs:
|
|||||||
|
|
||||||
# Hardcoded authorized users — always allowed
|
# Hardcoded authorized users — always allowed
|
||||||
case "$ACTOR" in
|
case "$ACTOR" in
|
||||||
jmiller|mokogitea-actions[bot])
|
jmiller|gitea-actions[bot])
|
||||||
ALLOWED=true
|
ALLOWED=true
|
||||||
PERMISSION=admin
|
PERMISSION=admin
|
||||||
METHOD="hardcoded allowlist"
|
METHOD="hardcoded allowlist"
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
name: Sync Workflows to Repos
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- '.mokogitea/workflows/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sync:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ startsWith(github.event.repository.name, 'Template-') }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout mokocli
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
repository: MokoConsulting/MokoCLI
|
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
|
|
||||||
- name: Setup PHP
|
|
||||||
uses: https://git.mokoconsulting.tech/MokoConsulting/.mokogitea/raw/branch/main/actions/setup-php@v1
|
|
||||||
with:
|
|
||||||
php-version: '8.1'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: composer install --no-dev --no-interaction
|
|
||||||
|
|
||||||
- name: Sync workflows to generic repos
|
|
||||||
run: php automation/bulk_sync.php --platform generic --org MokoConsulting --workflows-only --auto-merge --token "${{ secrets.MOKOGITEA_TOKEN }}"
|
|
||||||
env:
|
|
||||||
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow.Template
|
# DEFGROUP: Gitea.Workflow.Template
|
||||||
# INGROUP: MokoStandards.CI
|
# INGROUP: MokoStandards.CI
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla
|
||||||
# PATH: /.mokogitea/workflows/version-set.yml
|
# PATH: /.mokogitea/workflows/version-set.yml
|
||||||
@@ -34,7 +34,6 @@ jobs:
|
|||||||
set-version:
|
set-version:
|
||||||
name: Set Version to ${{ inputs.version }}
|
name: Set Version to ${{ inputs.version }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ !startsWith(github.event.repository.name, 'Template-') }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Validate version format
|
- name: Validate version format
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: MokoGitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: mokocli.Universal
|
# INGROUP: mokocli.Universal
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
# PATH: /.mokogitea/workflows/workflow-sync-trigger.yml
|
# PATH: /.mokogitea/workflows/workflow-sync-trigger.yml
|
||||||
# VERSION: 01.01.00
|
# VERSION: 01.01.00
|
||||||
# BRIEF: Trigger workflow sync to live repos when a PR is merged to main
|
# BRIEF: Trigger workflow sync to live repos when a PR is merged to main
|
||||||
@@ -27,10 +27,9 @@ jobs:
|
|||||||
name: Sync workflows to live repos
|
name: Sync workflows to live repos
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: >-
|
if: >-
|
||||||
startsWith(github.event.repository.name, 'Template-') &&
|
github.event_name == 'workflow_dispatch' ||
|
||||||
(github.event_name == 'workflow_dispatch' ||
|
|
||||||
(github.event.pull_request.merged == true &&
|
(github.event.pull_request.merged == true &&
|
||||||
!contains(github.event.pull_request.title, '[skip sync]')))
|
!contains(github.event.pull_request.title, '[skip sync]'))
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Determine platform from repo name
|
- name: Determine platform from repo name
|
||||||
@@ -53,7 +52,7 @@ jobs:
|
|||||||
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
MOKOGITEA_URL="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}"
|
MOKOGITEA_URL="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}"
|
||||||
git clone --depth 1 "${MOKOGITEA_URL}/MokoConsulting/MokoCLI.git" /tmp/mokocli
|
git clone --depth 1 "${MOKOGITEA_URL}/MokoConsulting/mokocli.git" /tmp/mokocli
|
||||||
|
|
||||||
- name: Install PHP
|
- name: Install PHP
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+146
-61
@@ -3,71 +3,156 @@
|
|||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- **Full-screen backup screen** (`view=runbackup`) for both pre-update and manual backups, modelled on Akeeba's Backup-on-Update — replaces the earlier popup-modal approach. Clicking Joomla's **Install the update** now redirects (server-side, Akeeba-style) to a dedicated full-page backup screen that runs the stepped backup with a real progress bar and then **automatically continues the update** via a validated `returnurl` (flagged `is_backed_up=1` so the backup isn't repeated). Crucially, **no backup runs synchronously inside the update request** — which is what white-screened large sites. The dashboard **Backup Now** now opens the same full-screen screen instead of an inline modal. (#196)
|
- Customizable restore script filename per backup profile (reduces discoverability on remote servers)
|
||||||
- Retention now prunes **remote** copies too: when a backup is pruned by age/count, its archive is deleted from every enabled remote destination (SFTP / FTP / S3 / Google Drive), not just the local copy. Each uploader gained an idempotent `delete()` method (already-absent file = success), and removal is best-effort — a failing destination is logged but never blocks local pruning. The shared standalone `restore.php` is intentionally left in place (every backup overwrites it, so newer backups still depend on it). (#229)
|
- MokoRestore standalone mode: multi-ZIP selector when multiple backup archives are present
|
||||||
|
- MokoRestore preflight: Joomla installation detection warning before overwriting an existing site
|
||||||
|
- MokoRestore error handling: try/catch on fetch calls, HTTP status checks, JSON parse recovery
|
||||||
|
- Download button on individual backup record detail toolbar
|
||||||
|
- Profile column in backup records list links to the profile edit view
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Consolidated backup plumbing into shared helpers (#230):
|
- Moved download, browse archive, and view log actions from backup list rows into the individual backup record view
|
||||||
- New `RemoteUploaderFactory` replaces the `createUploaderFromParams()` copy that was duplicated in `BackupEngine` and `SteppedBackupEngine`.
|
- Removed "Run Backup" / "Backup Now" buttons from profiles list, profile edit toolbar, and backup records view (backups are triggered from the dashboard only)
|
||||||
- `RetentionManager` is now the single retention authority — it takes the global `max_age_days`/`max_backups` fallback and gained `pruneOrphans()`; the system plugin's hourly cleanup delegates to it and its duplicate `deleteBackupRecord()` logic is removed.
|
- Removed ordering field from profiles; default sort is now by ID ascending
|
||||||
- The backend controller, Web Services API controller, and legacy `cli/mokosuitebackup.php` now run backups through the shared `BackupRunner` (gaining the normalized complete/warning/fail status) instead of instantiating `BackupEngine` directly.
|
- MokoRestore cleanup and security messages now reference the actual script filename instead of hardcoded "restore.php"
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Package installer is now **honest about success**: the postflight no longer prints "installed successfully" / next-steps when the install actually failed or only partially completed. Joomla logs a failed child extension but still runs the package postflight, so the postflight now (a) verifies every bundled child declared in the manifest actually registered in `#__extensions` (matched by element + type, and folder/group for plugins) and (b) verifies the component's schema tables — derived dynamically from the installed `install.mysql.sql` — actually exist. If anything is missing it enqueues an error listing what's missing and stops before the success message. Fail-open: any manifest/DB/IO glitch is treated as "nothing missing" so a transient error never turns a good install into a false failure. Unconditional housekeeping (e.g. download-key restore) still runs regardless.
|
- Bootstrap 5 modal conversion for snapshots view (data-bs-dismiss, modal-footer, getOrCreateInstance)
|
||||||
- Pre-update/uninstall backup no longer **white-screens** the update on large sites. The synchronous backup that runs inside the extension update/uninstall request now raises `max_execution_time`/`memory_limit` (and `ignore_user_abort`) like the web-cron path, so it can't exhaust the request's default limits mid-backup. (Core Joomla updates additionally get a full-screen backup screen — see below.)
|
- ntfy default URL changed from ntfy.sh to ntfy.mokoconsulting.tech
|
||||||
- Archive names for **CLI/console-triggered backups** no longer come out as `joomla.invalid_…`. The `[HOST]` placeholder took `$_SERVER['HTTP_HOST']` verbatim, but Joomla's console fills that with the reserved sentinel host `joomla.invalid`; the resolver now treats that (like empty/`localhost`) as unusable and falls back to the configured `live_site` host, then the system hostname. (Set the site's *live_site* to get the exact domain in CLI-built names.)
|
- Untranslated JFIELD_ORDERING_ASC / JFIELD_ORDERING_LABEL language keys replaced with component-specific keys
|
||||||
- Standalone restore script generation no longer aborts backups with `str_replace() expects at least 3 arguments, 2 given`. `MokoRestore::generateStandaloneScript()` had a `str_replace()` call (the "Backup Archive" pre-check rewrite) that was missing its `$php` subject argument, so **every** standalone-mode backup fatally errored while "Generating standalone restore.php…" — the archive still finalized and uploaded, but no `restore.php` was ever produced (the true root cause behind #226). (#226)
|
- Options page title now shows "MokoSuiteBackup Options" instead of raw language key
|
||||||
- Remote upload: the standalone restore script upload is no longer silent — its result is now checked and logged, and a failed restore-script upload marks the backup as `warning` (previously the result was discarded, so a missing restore script on the remote went unreported while the archive still showed success). (#226)
|
- Profile dropdown IDs in backup records and dashboard show "#ID — Title (type)" format
|
||||||
|
- MokoRestore stalling: unhandled promise rejections from network errors or non-JSON responses left UI in loading state
|
||||||
|
|
||||||
## [02.58.00] --- 2026-07-06
|
## [01.43.00] --- 2026-06-24
|
||||||
|
|
||||||
|
|
||||||
|
## [01.43.00] --- 2026-06-24
|
||||||
|
|
||||||
|
## [01.42.00] --- 2026-06-23
|
||||||
|
|
||||||
|
|
||||||
|
## [01.42.00] --- 2026-06-23
|
||||||
|
|
||||||
|
## [01.41.00] — 2026-06-23
|
||||||
|
|
||||||
|
### Added — Multi-Remote Storage
|
||||||
|
- New `#__mokosuitebackup_remotes` table for multiple destinations per profile
|
||||||
|
- Remote destinations UI: AJAX-driven add/edit/delete/toggle modal on profile edit
|
||||||
|
- Engine uploads to ALL enabled destinations (BackupEngine + SteppedBackupEngine)
|
||||||
|
- Migration auto-converts existing SFTP/S3/GDrive/FTP profile columns to new table
|
||||||
|
- Backward compatibility: falls back to legacy single-remote columns if table empty
|
||||||
|
- Secrets masked in API responses, merged from DB on save
|
||||||
|
|
||||||
|
### Added — Content Snapshots
|
||||||
|
- Lightweight JSON snapshots of articles, categories, and modules
|
||||||
|
- Includes tags, custom fields, workflow associations, field values
|
||||||
|
- Restore modes: Replace (clean slate), Merge (upsert), Selective (per-article)
|
||||||
|
- Snapshot retention: max count + max age with automatic cleanup
|
||||||
|
- Scheduled snapshot task via com_scheduler
|
||||||
|
- CLI: `mokosuitebackup:snapshot create|restore|list|delete`
|
||||||
|
- REST API: create, list, restore, delete, download snapshots
|
||||||
|
- Tabbed browse modal: Articles / Categories / Modules with item counts
|
||||||
|
|
||||||
|
### Added — SFTP Remote Storage
|
||||||
|
- SFTP support with SSH key file authentication (key stored base64 in database)
|
||||||
|
- Auth type dropdown: Password / Key File / Key File + Passphrase
|
||||||
|
- SshKeyField: file upload via FileReader, key never exposed in HTML
|
||||||
|
- SFTP remote directory browser for path selection
|
||||||
|
- `__KEEP_EXISTING__` sentinel preserves key on profile re-save
|
||||||
|
|
||||||
|
### Added — MokoRestore Wizard (9 steps)
|
||||||
|
- Per-table conflict resolution: Replace / Skip / Merge / Data Only
|
||||||
|
- Preset buttons: "All Replace", "All Skip", "Everything except users"
|
||||||
|
- Post-restore actions: reset passwords, hits, versions, sessions, cache
|
||||||
|
- Auto-detect sanitized passwords and prompt for reset (random temp password)
|
||||||
|
- Standalone mode: restore.php scans directory for ZIP files
|
||||||
|
- Wrapped mode: restore.php bundled inside backup ZIP
|
||||||
|
- Security gate with filesystem verification + path traversal protection
|
||||||
|
|
||||||
|
### Added — Data Sanitization
|
||||||
|
- Sanitize user passwords: replace hashes with invalid sentinel
|
||||||
|
- Sanitize user emails: replace with dummy values
|
||||||
|
- Clear session data: exclude `#__session` table
|
||||||
|
- Preserve super admin credentials (optional)
|
||||||
|
- GDPR-friendly backup sharing for demos and staging sites
|
||||||
|
|
||||||
|
### Added — Backup Engine
|
||||||
|
- Pre-flight validation: directory, disk space, extensions, credentials, running backups
|
||||||
|
- Auto-verify archive integrity after creation (ZIP, tar.gz, 7z)
|
||||||
|
- 7z archive format via system 7za/7z CLI binary with native encryption
|
||||||
|
- Streaming database dump to temp file (prevents OOM on large sites)
|
||||||
|
- S3 streaming upload via CURLOPT_PUT (prevents OOM)
|
||||||
|
- Graceful remote degradation: local backup preserved if upload fails
|
||||||
|
- DatabaseDumper::dumpToFile() for memory-efficient operation
|
||||||
|
|
||||||
|
### Added — Admin UI
|
||||||
|
- Dashboard: snapshot widget, 30-day backup trend chart, per-profile storage breakdown
|
||||||
|
- CPanel admin dashboard module (mod_mokosuitebackup_cpanel) with quick actions
|
||||||
|
- Backup type filter dropdown in backups list
|
||||||
|
- Backup comparison: select two backups for side-by-side diff
|
||||||
|
- Archive browser: view files inside backup without extracting
|
||||||
|
- Manual purge: delete backups older than a date with count preview
|
||||||
|
- Backup count badges on profile list
|
||||||
|
- "Do not navigate away" warning in backup/restore progress modals
|
||||||
|
- Clickable placeholder pills for backup directory and archive name fields
|
||||||
|
- Comprehensive help modal with absolute/relative/placeholder path documentation
|
||||||
|
- Placeholder resolution display with EXAMPLE prefix
|
||||||
|
- All placeholders UPPERCASE: [HOST], [SITE_NAME], [DATE], [DATETIME], etc.
|
||||||
|
|
||||||
|
### Added — CLI & API
|
||||||
|
- `mokosuitebackup:restore` with --files-only, --db-only, --password options
|
||||||
|
- `mokosuitebackup:snapshot` with create, restore, list, delete actions
|
||||||
|
- REST API for snapshots: create, list, restore, delete, download
|
||||||
|
- Profile credentials masked in API responses
|
||||||
|
|
||||||
|
### Added — Notifications & Logging
|
||||||
|
- Email/ntfy notifications for site restore, snapshot create/restore
|
||||||
|
- Joomla Action Logs for restore, snapshot, and snapshot restore events
|
||||||
|
- Global ntfy server/topic/token settings (fallback for profiles)
|
||||||
|
|
||||||
|
### Added — Security & Configuration
|
||||||
|
- Webcron secret field with CSPRNG generator + strength meter
|
||||||
|
- IP whitelist field with current IP detection + one-click "Add my IP"
|
||||||
|
- 10 ACL permissions with full enforcement audit across all controllers
|
||||||
|
- Config defaults: archive format, MokoRestore mode, sanitization settings
|
||||||
|
- Path traversal protection on all archive extraction (ZIP, tar.gz, JPA)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- CLI RestoreCommand passed wrong arguments (filepath instead of record ID)
|
||||||
|
- JPA path traversal: reject `../` in archive entry paths
|
||||||
|
- S3Uploader OOM: streaming upload instead of file_get_contents
|
||||||
|
- DatabaseDumper OOM: streaming to file instead of in-memory string
|
||||||
|
- AkeebaImporter: removed unserialize() (PHP object injection risk)
|
||||||
|
- BackupTable: delete DB row before file (prevents data loss)
|
||||||
|
- RestoreEngine: staging path sanitized with preg_replace
|
||||||
|
- API profiles: sensitive fields masked with `***`
|
||||||
|
- Webcron: missing return after sendJsonResponse on auth failure
|
||||||
|
- loadFormData(): cast array to object (PHP 8.x TypeError fix)
|
||||||
|
- MokoRestore data-only mode: uses REPLACE INTO for existing rows
|
||||||
|
- Plaintext archive deleted on encryption failure
|
||||||
|
- TarGzArchiver: intermediate .tar cleaned in finally block
|
||||||
|
- Install script: single-line comments converted to block comments
|
||||||
|
- Orphaned root-level webservices plugin files removed
|
||||||
|
- include_mokorestore column: TINYINT changed to VARCHAR(20)
|
||||||
|
- Snapshot fields_values: scoped dump and restore to com_content.article (previously destroyed values for contacts, users, etc.)
|
||||||
|
- Run Backup button: accept CSRF token from GET (fixes "token did not match" on profile edit)
|
||||||
|
- SFTP fields: moved into remote fieldset for showon visibility; removed required attr that blocked non-SFTP saves
|
||||||
|
- Script.php merge conflict markers resolved
|
||||||
|
|
||||||
|
## [01.24.00] — 2026-06-02
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- SFTP destinations: **upload an SSH private key file** in the Add/Edit Destination modal instead of pasting it (reads the file into the key field client-side; pasting still works).
|
- Initial release: full-site backup and restore for Joomla 6
|
||||||
|
- Database, files, and configuration backup
|
||||||
### Changed
|
- ZIP and tar.gz archive formats with AES-256 encryption
|
||||||
- Add/Edit Destination modal: wrap the content in a Bootstrap `.container-fluid` and give it a 1rem padding frame via the WAM stylesheet (Bootstrap's `.modal-content` has no padding of its own).
|
- Differential backups based on file manifests
|
||||||
|
- FTP/FTPS, S3, Google Drive remote storage
|
||||||
### Fixed
|
- MokoRestore standalone restore wizard
|
||||||
- Pre-update backup now shows an admin notification on **every** outcome (success / warning / failure) — previously a *successful* pre-update backup fired nothing, so it looked like the notification wasn't working. (#192)
|
- CLI backup and restore commands
|
||||||
|
- REST API for remote management
|
||||||
### Changed
|
- Scheduled tasks via com_scheduler
|
||||||
- Component admin CSS now loads via the Joomla **Web Asset Manager** (`media/com_mokosuitebackup/` + `joomla.asset.json`) instead of an inline `<style>` block.
|
- Email and ntfy push notifications
|
||||||
- "Keep local copy" is configured **per remote destination** (in the Add/Edit Destination modal); the redundant profile-level field and its "Remote" tab are removed.
|
- Per-profile retention, exclusions, and notifications
|
||||||
- Add/Edit Destination modal: cleaned up the cramped padding/margins.
|
- Akeeba Backup migration tool
|
||||||
|
- Admin dashboard with system health checks
|
||||||
### Fixed
|
|
||||||
- Admin menu / duplicate-component fallout: (a) the orphaned `com_component-mokosuitebackup` is now removed in **preflight** too, so its "Backup" menu no longer collides on install ("The alias backup is already being used"); (b) `ensureSubmenuItems()` **recreates the top-level "Backup" menu** if it was deleted, instead of giving up — so Backup no longer disappears from the admin menu (and the cPanel module / MokoSuiteClient can find it again); (c) the component menu label now uses the short constant `COM_MOKOJOOMBACKUP_SHORT`. (#213 fallout)
|
|
||||||
- Installer no longer aborts on MySQL 8 with "This command is not supported in the prepared statement protocol yet" (error 1295). The legacy remote-column purge migration (`02.56.01.sql`) used `PREPARE`/`EXECUTE`/`DEALLOCATE`, which Joomla's installer rejects; the drop now runs in the package installer script via an INFORMATION_SCHEMA-gated plain `ALTER` (portable across MariaDB and MySQL 8). (#213 update path)
|
|
||||||
|
|
||||||
## [02.57.00] --- 2026-07-05
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- `BackupRunner` service — a single synchronous entry point for backups that unifies final status and notification gating across the pre-update, web-cron, pre-install, scheduled-task and CLI triggers (delegates to `BackupEngine`; no double-notify). Returns a normalized result including the real complete/warning/fail status. Dashboard "Backup Now" (AJAX) unchanged; installer progress popup deferred to #196. (#214)
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Release automation: the changelog-promote step is now idempotent — it only inserts a `## [version]` header when that version isn't already present, preventing the empty, duplicated version headers that repeated/same-version builds were producing. (workflow)
|
|
||||||
|
|
||||||
## [02.56.11] --- 2026-07-05
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Package `postflight` now removes the orphaned `com_component-mokosuitebackup` registration (stray extension record, admin menu items, schema rows, and `administrator/` folder) left behind by the old "Type - Name" component `<name>` — self-healing on update so affected sites reconcile to the real `com_mokosuitebackup`. (#213 follow-up)
|
|
||||||
|
|
||||||
## [02.56.08] --- 2026-07-05
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Component manifest `<name>` reverted to the element-safe `MokoSuiteBackup`. The "Type - Name" convention derived element `com_component-mokosuitebackup`, registering a duplicate component and leaving the real `com_mokosuitebackup` orphaned on the old version. (#213)
|
|
||||||
|
|
||||||
## [02.56.07] --- 2026-07-05
|
|
||||||
|
|
||||||
### Security
|
|
||||||
- Mask the FTP password in `AjaxController::maskSecrets()`/`mergeExistingSecrets()` — stored FTP remotes no longer leak their password via `listRemotes`. (#169)
|
|
||||||
- Stop the API single-item view (`Backups/JsonapiView`) leaking the server `absolute_path`. (#187)
|
|
||||||
- SFTP uploader uses `StrictHostKeyChecking=accept-new` instead of `no`. (#182)
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- `DatabaseDumper` writes a real newline after `DROP TABLE` (was a literal `\n`). (#179)
|
|
||||||
- Profile-picker forms order by `id` instead of the dropped `ordering` column. (#180)
|
|
||||||
- `uninstall.mysql.sql` now drops the snapshots table. (#181)
|
|
||||||
- CLI snapshot delete uses the `data_file` column (was non-existent `file_path`). (#184)
|
|
||||||
- Remove the duplicate pre-update backup (content plugin no longer subscribes to `onExtensionBeforeUpdate`). (#186)
|
|
||||||
- `DatabaseImporter` collects non-fatal statement errors (`getErrors()`/`hasErrors()`). (#188)
|
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ Thank you for your interest in contributing to MokoSuiteBackup.
|
|||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
1. Fork the repository on MokoGitea
|
1. Fork the repository on Gitea
|
||||||
2. Create a feature branch from `dev` (`feature/your-feature`)
|
2. Create a feature branch from `dev` (`feature/your-feature`)
|
||||||
3. Make your changes following the coding standards below
|
3. Make your changes following the coding standards below
|
||||||
4. Submit a pull request targeting `dev`
|
4. Submit a pull request targeting `dev`
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ DEFGROUP: Template-Joomla
|
|||||||
INGROUP: Template-Joomla.Documentation
|
INGROUP: Template-Joomla.Documentation
|
||||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla
|
REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla
|
||||||
PATH: /SECURITY.md
|
PATH: /SECURITY.md
|
||||||
VERSION: 02.58.17
|
VERSION: 01.45.07
|
||||||
BRIEF: Security vulnerability reporting and handling policy
|
BRIEF: Security vulnerability reporting and handling policy
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package MokoSuiteBackup
|
||||||
|
* @subpackage plg_webservices_mokosuitebackup
|
||||||
|
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||||
|
* @license GNU General Public License version 3 or later; see LICENSE
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\CMS\Extension\PluginInterface;
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Plugin\PluginHelper;
|
||||||
|
use Joomla\DI\Container;
|
||||||
|
use Joomla\DI\ServiceProviderInterface;
|
||||||
|
use Joomla\Event\DispatcherInterface;
|
||||||
|
use Joomla\Plugin\WebServices\MokoSuiteBackup\Extension\MokoSuiteBackupWebServices;
|
||||||
|
|
||||||
|
return new class () implements ServiceProviderInterface {
|
||||||
|
public function register(Container $container): void
|
||||||
|
{
|
||||||
|
$container->set(
|
||||||
|
PluginInterface::class,
|
||||||
|
function (Container $container) {
|
||||||
|
$plugin = new MokoSuiteBackupWebServices(
|
||||||
|
$container->get(DispatcherInterface::class),
|
||||||
|
(array) PluginHelper::getPlugin('webservices', 'mokosuitebackup')
|
||||||
|
);
|
||||||
|
$plugin->setApplication(Factory::getApplication());
|
||||||
|
|
||||||
|
return $plugin;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
Submodule source/packages/MokoSuiteClient updated: 246f7bb10c...67e9cc6b38
@@ -15,6 +15,5 @@
|
|||||||
<action name="mokosuitebackup.backup.purge" title="COM_MOKOSUITEBACKUP_ACTION_BACKUP_PURGE" />
|
<action name="mokosuitebackup.backup.purge" title="COM_MOKOSUITEBACKUP_ACTION_BACKUP_PURGE" />
|
||||||
<action name="mokosuitebackup.backup.compare" title="COM_MOKOSUITEBACKUP_ACTION_BACKUP_COMPARE" />
|
<action name="mokosuitebackup.backup.compare" title="COM_MOKOSUITEBACKUP_ACTION_BACKUP_COMPARE" />
|
||||||
<action name="mokosuitebackup.backup.browse" title="COM_MOKOSUITEBACKUP_ACTION_BACKUP_BROWSE" />
|
<action name="mokosuitebackup.backup.browse" title="COM_MOKOSUITEBACKUP_ACTION_BACKUP_BROWSE" />
|
||||||
<action name="mokosuitebackup.backup.cancel" title="COM_MOKOSUITEBACKUP_ACTION_BACKUP_CANCEL" />
|
|
||||||
</section>
|
</section>
|
||||||
</access>
|
</access>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Joomla\Component\MokoSuiteBackup\Api\Controller;
|
|||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
use Joomla\CMS\MVC\Controller\ApiController;
|
use Joomla\CMS\MVC\Controller\ApiController;
|
||||||
use Joomla\Component\MokoSuiteBackup\Administrator\Service\BackupRunner;
|
use Joomla\Component\MokoSuiteBackup\Administrator\Engine\BackupEngine;
|
||||||
|
|
||||||
class BackupsController extends ApiController
|
class BackupsController extends ApiController
|
||||||
{
|
{
|
||||||
@@ -38,7 +38,8 @@ class BackupsController extends ApiController
|
|||||||
$profileId = (int) ($data['profile'] ?? 1);
|
$profileId = (int) ($data['profile'] ?? 1);
|
||||||
$description = $data['description'] ?? 'API backup ' . date('Y-m-d H:i:s');
|
$description = $data['description'] ?? 'API backup ' . date('Y-m-d H:i:s');
|
||||||
|
|
||||||
$result = (new BackupRunner())->run($profileId, $description, 'api');
|
$engine = new BackupEngine();
|
||||||
|
$result = $engine->run($profileId, $description, 'api');
|
||||||
|
|
||||||
if ($result['success']) {
|
if ($result['success']) {
|
||||||
$this->app->setHeader('status', 200);
|
$this->app->setHeader('status', 200);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class JsonapiView extends BaseApiView
|
|||||||
'origin',
|
'origin',
|
||||||
'backup_type',
|
'backup_type',
|
||||||
'archivename',
|
'archivename',
|
||||||
|
'absolute_path',
|
||||||
'total_size',
|
'total_size',
|
||||||
'db_size',
|
'db_size',
|
||||||
'files_count',
|
'files_count',
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ if (!defined('JPATH_BASE')) {
|
|||||||
require_once JPATH_BASE . '/includes/framework.php';
|
require_once JPATH_BASE . '/includes/framework.php';
|
||||||
|
|
||||||
use Joomla\CMS\Factory;
|
use Joomla\CMS\Factory;
|
||||||
use Joomla\Component\MokoSuiteBackup\Administrator\Service\BackupRunner;
|
use Joomla\Component\MokoSuiteBackup\Administrator\Engine\BackupEngine;
|
||||||
|
|
||||||
// Parse CLI arguments
|
// Parse CLI arguments
|
||||||
$profileId = 1;
|
$profileId = 1;
|
||||||
@@ -56,7 +56,8 @@ echo "Profile: {$profileId}\n";
|
|||||||
echo "Description: {$description}\n";
|
echo "Description: {$description}\n";
|
||||||
echo "Starting backup...\n\n";
|
echo "Starting backup...\n\n";
|
||||||
|
|
||||||
$result = (new BackupRunner())->run($profileId, $description, 'cli');
|
$engine = new BackupEngine();
|
||||||
|
$result = $engine->run($profileId, $description, 'cli');
|
||||||
|
|
||||||
if ($result['success']) {
|
if ($result['success']) {
|
||||||
echo "SUCCESS: " . $result['message'] . "\n";
|
echo "SUCCESS: " . $result['message'] . "\n";
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
>
|
>
|
||||||
<option value="">COM_MOKOJOOMBACKUP_FILTER_STATUS_ALL</option>
|
<option value="">COM_MOKOJOOMBACKUP_FILTER_STATUS_ALL</option>
|
||||||
<option value="complete">COM_MOKOJOOMBACKUP_STATUS_COMPLETE</option>
|
<option value="complete">COM_MOKOJOOMBACKUP_STATUS_COMPLETE</option>
|
||||||
<option value="warning">COM_MOKOJOOMBACKUP_STATUS_WARNING</option>
|
|
||||||
<option value="running">COM_MOKOJOOMBACKUP_STATUS_RUNNING</option>
|
<option value="running">COM_MOKOJOOMBACKUP_STATUS_RUNNING</option>
|
||||||
<option value="fail">COM_MOKOJOOMBACKUP_STATUS_FAIL</option>
|
<option value="fail">COM_MOKOJOOMBACKUP_STATUS_FAIL</option>
|
||||||
<option value="pending">COM_MOKOJOOMBACKUP_STATUS_PENDING</option>
|
<option value="pending">COM_MOKOJOOMBACKUP_STATUS_PENDING</option>
|
||||||
|
|||||||
@@ -205,9 +205,113 @@
|
|||||||
/>
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<!-- The "Keep local copy" setting is now configured per remote destination
|
<fieldset name="remote" label="COM_MOKOJOOMBACKUP_FIELDSET_REMOTE">
|
||||||
(in the Add/Edit Destination modal), so the profile-level field and its
|
<field
|
||||||
"Remote" tab have been removed. -->
|
name="remote_legacy_note"
|
||||||
|
type="note"
|
||||||
|
label=""
|
||||||
|
description="COM_MOKOJOOMBACKUP_REMOTE_LEGACY_NOTE"
|
||||||
|
class="alert alert-info small"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="remote_storage"
|
||||||
|
type="list"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_REMOTE_STORAGE"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_REMOTE_STORAGE_DESC"
|
||||||
|
default="none"
|
||||||
|
>
|
||||||
|
<option value="none">COM_MOKOJOOMBACKUP_REMOTE_NONE</option>
|
||||||
|
<option value="sftp">COM_MOKOJOOMBACKUP_REMOTE_SFTP</option>
|
||||||
|
<option value="google_drive">COM_MOKOJOOMBACKUP_REMOTE_GDRIVE</option>
|
||||||
|
<option value="s3">COM_MOKOJOOMBACKUP_REMOTE_S3</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="remote_keep_local"
|
||||||
|
type="radio"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_KEEP_LOCAL"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_KEEP_LOCAL_DESC"
|
||||||
|
default="1"
|
||||||
|
class="btn-group"
|
||||||
|
>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<!-- SFTP fields (shown when remote_storage = sftp) -->
|
||||||
|
<field
|
||||||
|
name="sftp_host"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_SFTP_HOST"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_SFTP_HOST_DESC"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:sftp"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="sftp_port"
|
||||||
|
type="number"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_SFTP_PORT"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_SFTP_PORT_DESC"
|
||||||
|
default="22"
|
||||||
|
min="1"
|
||||||
|
max="65535"
|
||||||
|
showon="remote_storage:sftp"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="sftp_username"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_SFTP_USERNAME"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_SFTP_USERNAME_DESC"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:sftp"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="sftp_auth_type"
|
||||||
|
type="list"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_SFTP_AUTH_TYPE"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_SFTP_AUTH_TYPE_DESC"
|
||||||
|
default="key"
|
||||||
|
showon="remote_storage:sftp"
|
||||||
|
>
|
||||||
|
<option value="password">COM_MOKOJOOMBACKUP_SFTP_AUTH_PASSWORD</option>
|
||||||
|
<option value="key">COM_MOKOJOOMBACKUP_SFTP_AUTH_KEY</option>
|
||||||
|
<option value="key_passphrase">COM_MOKOJOOMBACKUP_SFTP_AUTH_KEY_PASSPHRASE</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="sftp_password"
|
||||||
|
type="password"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_SFTP_PASSWORD"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_SFTP_PASSWORD_DESC"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:sftp[AND]sftp_auth_type:password"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="sftp_key_data"
|
||||||
|
type="SshKey"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_SFTP_KEY"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_SFTP_KEY_DESC"
|
||||||
|
filter="raw"
|
||||||
|
showon="remote_storage:sftp[AND]sftp_auth_type:key,key_passphrase"
|
||||||
|
addfieldprefix="Joomla\Component\MokoSuiteBackup\Administrator\Field"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="sftp_passphrase"
|
||||||
|
type="password"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_SFTP_PASSPHRASE"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_SFTP_PASSPHRASE_DESC"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:sftp[AND]sftp_auth_type:key_passphrase"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="sftp_path"
|
||||||
|
type="SftpPath"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_SFTP_PATH"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_SFTP_PATH_DESC"
|
||||||
|
default="/backups"
|
||||||
|
maxlength="512"
|
||||||
|
showon="remote_storage:sftp"
|
||||||
|
addfieldprefix="Joomla\Component\MokoSuiteBackup\Administrator\Field"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
<fieldset name="retention" label="COM_MOKOJOOMBACKUP_FIELDSET_RETENTION">
|
<fieldset name="retention" label="COM_MOKOJOOMBACKUP_FIELDSET_RETENTION">
|
||||||
<field
|
<field
|
||||||
@@ -304,4 +408,157 @@
|
|||||||
/>
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset name="ftp" label="COM_MOKOJOOMBACKUP_FIELDSET_FTP">
|
||||||
|
<field
|
||||||
|
name="ftp_host"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_FTP_HOST"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_FTP_HOST_DESC"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:ftp"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="ftp_port"
|
||||||
|
type="number"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_FTP_PORT"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_FTP_PORT_DESC"
|
||||||
|
default="21"
|
||||||
|
min="1"
|
||||||
|
max="65535"
|
||||||
|
showon="remote_storage:ftp"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="ftp_username"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_FTP_USERNAME"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:ftp"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="ftp_password"
|
||||||
|
type="password"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_FTP_PASSWORD"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:ftp"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="ftp_path"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_FTP_PATH"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_FTP_PATH_DESC"
|
||||||
|
default="/backups"
|
||||||
|
maxlength="512"
|
||||||
|
showon="remote_storage:ftp"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="ftp_passive"
|
||||||
|
type="radio"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_FTP_PASSIVE"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_FTP_PASSIVE_DESC"
|
||||||
|
default="1"
|
||||||
|
class="btn-group"
|
||||||
|
showon="remote_storage:ftp"
|
||||||
|
>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="ftp_ssl"
|
||||||
|
type="radio"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_FTP_SSL"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_FTP_SSL_DESC"
|
||||||
|
default="0"
|
||||||
|
class="btn-group"
|
||||||
|
showon="remote_storage:ftp"
|
||||||
|
>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset name="google_drive" label="COM_MOKOJOOMBACKUP_FIELDSET_GDRIVE">
|
||||||
|
<field
|
||||||
|
name="gdrive_client_id"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_CLIENT_ID"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_CLIENT_ID_DESC"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:google_drive"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="gdrive_client_secret"
|
||||||
|
type="password"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_CLIENT_SECRET"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:google_drive"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="gdrive_refresh_token"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_REFRESH_TOKEN"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_REFRESH_TOKEN_DESC"
|
||||||
|
maxlength="512"
|
||||||
|
showon="remote_storage:google_drive"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="gdrive_folder_id"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_FOLDER_ID"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_GDRIVE_FOLDER_ID_DESC"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:google_drive"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset name="s3" label="COM_MOKOJOOMBACKUP_FIELDSET_S3">
|
||||||
|
<field
|
||||||
|
name="s3_endpoint"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_S3_ENDPOINT"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_S3_ENDPOINT_DESC"
|
||||||
|
maxlength="512"
|
||||||
|
hint="https://s3.amazonaws.com"
|
||||||
|
showon="remote_storage:s3"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="s3_region"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_S3_REGION"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_S3_REGION_DESC"
|
||||||
|
default="us-east-1"
|
||||||
|
maxlength="50"
|
||||||
|
showon="remote_storage:s3"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="s3_access_key"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_S3_ACCESS_KEY"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:s3"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="s3_secret_key"
|
||||||
|
type="password"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_S3_SECRET_KEY"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:s3"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="s3_bucket"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_S3_BUCKET"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_S3_BUCKET_DESC"
|
||||||
|
maxlength="255"
|
||||||
|
showon="remote_storage:s3"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="s3_path"
|
||||||
|
type="text"
|
||||||
|
label="COM_MOKOJOOMBACKUP_FIELD_S3_PATH"
|
||||||
|
description="COM_MOKOJOOMBACKUP_FIELD_S3_PATH_DESC"
|
||||||
|
default="/backups"
|
||||||
|
maxlength="512"
|
||||||
|
showon="remote_storage:s3"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
; @license GPL-3.0-or-later
|
; @license GPL-3.0-or-later
|
||||||
|
|
||||||
COM_MOKOJOOMBACKUP="MokoSuiteBackup"
|
COM_MOKOJOOMBACKUP="MokoSuiteBackup"
|
||||||
COM_MOKOJOOMBACKUP_SHORT="Backup"
|
|
||||||
COM_MOKOJOOMBACKUP_CONFIGURATION="MokoSuiteBackup Options"
|
COM_MOKOJOOMBACKUP_CONFIGURATION="MokoSuiteBackup Options"
|
||||||
COM_MOKOJOOMBACKUP_DESCRIPTION="Full-site backup and restore for Joomla"
|
COM_MOKOJOOMBACKUP_DESCRIPTION="Full-site backup and restore for Joomla"
|
||||||
|
|
||||||
@@ -23,7 +22,7 @@ COM_MOKOSUITEBACKUP_ACTION_BACKUP_RESTORE="Restore Backup"
|
|||||||
COM_MOKOSUITEBACKUP_ACTION_BACKUP_RESTORE_DESC="Allows users in this group to restore the site from a backup archive. This is a destructive operation that overwrites the current site."
|
COM_MOKOSUITEBACKUP_ACTION_BACKUP_RESTORE_DESC="Allows users in this group to restore the site from a backup archive. This is a destructive operation that overwrites the current site."
|
||||||
|
|
||||||
; Dashboard view
|
; Dashboard view
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_TITLE="Dashboard"
|
COM_MOKOJOOMBACKUP_DASHBOARD_TITLE="MokoSuiteBackup Dashboard"
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_LAST_BACKUP="Last Backup"
|
COM_MOKOJOOMBACKUP_DASHBOARD_LAST_BACKUP="Last Backup"
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_NO_BACKUPS="No backups yet"
|
COM_MOKOJOOMBACKUP_DASHBOARD_NO_BACKUPS="No backups yet"
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_NEXT_SCHEDULED="Next Scheduled"
|
COM_MOKOJOOMBACKUP_DASHBOARD_NEXT_SCHEDULED="Next Scheduled"
|
||||||
@@ -45,14 +44,14 @@ COM_MOKOJOOMBACKUP_DASHBOARD_BACKUP_TREND="Backup Trend (30 days)"
|
|||||||
; Backups view
|
; Backups view
|
||||||
COM_MOKOJOOMBACKUP_BACKUPS_N_ITEMS_DELETED="%d backup records deleted."
|
COM_MOKOJOOMBACKUP_BACKUPS_N_ITEMS_DELETED="%d backup records deleted."
|
||||||
COM_MOKOJOOMBACKUP_BACKUPS_N_ITEMS_DELETED_1="%d backup record deleted."
|
COM_MOKOJOOMBACKUP_BACKUPS_N_ITEMS_DELETED_1="%d backup record deleted."
|
||||||
COM_MOKOJOOMBACKUP_BACKUPS_TITLE="Records"
|
COM_MOKOJOOMBACKUP_BACKUPS_TITLE="Backup Records"
|
||||||
COM_MOKOJOOMBACKUP_BACKUPS_TABLE_CAPTION="Table of backup records"
|
COM_MOKOJOOMBACKUP_BACKUPS_TABLE_CAPTION="Table of backup records"
|
||||||
COM_MOKOJOOMBACKUP_NO_BACKUPS="No backups found. Click 'Backup Now' to create your first backup."
|
COM_MOKOJOOMBACKUP_NO_BACKUPS="No backups found. Click 'Backup Now' to create your first backup."
|
||||||
COM_MOKOJOOMBACKUP_TOOLBAR_BACKUP_NOW="Backup Now"
|
COM_MOKOJOOMBACKUP_TOOLBAR_BACKUP_NOW="Backup Now"
|
||||||
COM_MOKOJOOMBACKUP_DOWNLOAD="Download"
|
COM_MOKOJOOMBACKUP_DOWNLOAD="Download"
|
||||||
|
|
||||||
; Backup detail view
|
; Backup detail view
|
||||||
COM_MOKOJOOMBACKUP_BACKUP_DETAIL="Detail"
|
COM_MOKOJOOMBACKUP_BACKUP_DETAIL="Backup Detail"
|
||||||
COM_MOKOJOOMBACKUP_VIEW_LOG="Backup Log"
|
COM_MOKOJOOMBACKUP_VIEW_LOG="Backup Log"
|
||||||
COM_MOKOJOOMBACKUP_BROWSE_ARCHIVE="Browse Archive Contents"
|
COM_MOKOJOOMBACKUP_BROWSE_ARCHIVE="Browse Archive Contents"
|
||||||
COM_MOKOJOOMBACKUP_BROWSE_COL_NAME="Name"
|
COM_MOKOJOOMBACKUP_BROWSE_COL_NAME="Name"
|
||||||
@@ -76,7 +75,7 @@ COM_MOKOJOOMBACKUP_FIELD_DB_SIZE="DB Size"
|
|||||||
COM_MOKOJOOMBACKUP_FIELD_REMOTE="Remote Path"
|
COM_MOKOJOOMBACKUP_FIELD_REMOTE="Remote Path"
|
||||||
|
|
||||||
; Profiles view
|
; Profiles view
|
||||||
COM_MOKOJOOMBACKUP_PROFILES_TITLE="Profiles"
|
COM_MOKOJOOMBACKUP_PROFILES_TITLE="Backup Profiles"
|
||||||
COM_MOKOJOOMBACKUP_PROFILES_TABLE_CAPTION="Table of backup profiles"
|
COM_MOKOJOOMBACKUP_PROFILES_TABLE_CAPTION="Table of backup profiles"
|
||||||
COM_MOKOJOOMBACKUP_NO_PROFILES="No backup profiles found."
|
COM_MOKOJOOMBACKUP_NO_PROFILES="No backup profiles found."
|
||||||
COM_MOKOJOOMBACKUP_PROFILE_NEW="New Profile"
|
COM_MOKOJOOMBACKUP_PROFILE_NEW="New Profile"
|
||||||
@@ -208,7 +207,6 @@ COM_MOKOJOOMBACKUP_TYPE_DIFFERENTIAL="Differential (changed files + full DB)"
|
|||||||
|
|
||||||
; Status labels
|
; Status labels
|
||||||
COM_MOKOJOOMBACKUP_STATUS_COMPLETE="Complete"
|
COM_MOKOJOOMBACKUP_STATUS_COMPLETE="Complete"
|
||||||
COM_MOKOJOOMBACKUP_STATUS_WARNING="Warning"
|
|
||||||
COM_MOKOJOOMBACKUP_STATUS_RUNNING="Running"
|
COM_MOKOJOOMBACKUP_STATUS_RUNNING="Running"
|
||||||
COM_MOKOJOOMBACKUP_STATUS_FAIL="Failed"
|
COM_MOKOJOOMBACKUP_STATUS_FAIL="Failed"
|
||||||
COM_MOKOJOOMBACKUP_STATUS_PENDING="Pending"
|
COM_MOKOJOOMBACKUP_STATUS_PENDING="Pending"
|
||||||
@@ -251,9 +249,9 @@ COM_MOKOJOOMBACKUP_FIELD_NOTIFY_FAILURE_DESC="Send an email when a backup fails.
|
|||||||
; Retention
|
; Retention
|
||||||
COM_MOKOJOOMBACKUP_FIELDSET_RETENTION="Retention"
|
COM_MOKOJOOMBACKUP_FIELDSET_RETENTION="Retention"
|
||||||
COM_MOKOJOOMBACKUP_FIELD_RETENTION_DAYS="Keep Backups (days)"
|
COM_MOKOJOOMBACKUP_FIELD_RETENTION_DAYS="Keep Backups (days)"
|
||||||
COM_MOKOJOOMBACKUP_FIELD_RETENTION_DAYS_DESC="Delete completed backups from this profile older than this many days. Set to 0 for unlimited (keep by age disabled)."
|
COM_MOKOJOOMBACKUP_FIELD_RETENTION_DAYS_DESC="Delete completed backups from this profile older than this many days. Set to 0 to use the global default from component options."
|
||||||
COM_MOKOJOOMBACKUP_FIELD_RETENTION_COUNT="Keep Backups (count)"
|
COM_MOKOJOOMBACKUP_FIELD_RETENTION_COUNT="Keep Backups (count)"
|
||||||
COM_MOKOJOOMBACKUP_FIELD_RETENTION_COUNT_DESC="Maximum number of completed backups to keep for this profile. Oldest are removed first. Set to 0 for unlimited (keep by count disabled)."
|
COM_MOKOJOOMBACKUP_FIELD_RETENTION_COUNT_DESC="Maximum number of completed backups to keep for this profile. Oldest are removed first. Set to 0 to use the global default from component options."
|
||||||
|
|
||||||
COM_MOKOJOOMBACKUP_FIELD_NTFY_SPACER_DESC="<strong>Push Notifications (ntfy)</strong> — Send instant push notifications to your phone or desktop via <a href='https://ntfy.sh' target='_blank'>ntfy.sh</a> or a self-hosted ntfy server."
|
COM_MOKOJOOMBACKUP_FIELD_NTFY_SPACER_DESC="<strong>Push Notifications (ntfy)</strong> — Send instant push notifications to your phone or desktop via <a href='https://ntfy.sh' target='_blank'>ntfy.sh</a> or a self-hosted ntfy server."
|
||||||
COM_MOKOJOOMBACKUP_FIELD_NTFY_TOPIC="ntfy Topic"
|
COM_MOKOJOOMBACKUP_FIELD_NTFY_TOPIC="ntfy Topic"
|
||||||
@@ -331,24 +329,9 @@ COM_MOKOJOOMBACKUP_CONFIG_SHOW_UPDATE_NOTICE_DESC="Display the update site confi
|
|||||||
COM_MOKOJOOMBACKUP_CONFIG_PREACTION="Pre-action Backups"
|
COM_MOKOJOOMBACKUP_CONFIG_PREACTION="Pre-action Backups"
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UPDATE="Backup Before Extension Update"
|
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UPDATE="Backup Before Extension Update"
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UPDATE_DESC="Automatically run a full backup before any extension is updated. Uses the default profile. Throttled to once per 10 minutes to prevent duplicate backups during batch updates."
|
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UPDATE_DESC="Automatically run a full backup before any extension is updated. Uses the default profile. Throttled to once per 10 minutes to prevent duplicate backups during batch updates."
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_PREUPDATE_AUTO_INTERCEPT="Auto-run on Update click"
|
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_PREUPDATE_AUTO_INTERCEPT_DESC="When enabled, clicking the Update button on the Joomla Update or Extensions update page first pops the backup progress modal, runs the pre-update backup, then automatically continues the update. When disabled, a notice with a manual 'Back up now' button is shown instead."
|
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UNINSTALL="Backup Before Extension Uninstall"
|
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UNINSTALL="Backup Before Extension Uninstall"
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UNINSTALL_DESC="Automatically run a full backup before any extension is uninstalled. Uses the default profile. Throttled to once per 10 minutes."
|
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UNINSTALL_DESC="Automatically run a full backup before any extension is uninstalled. Uses the default profile. Throttled to once per 10 minutes."
|
||||||
|
|
||||||
; Full-screen backup progress view (runbackup)
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_TITLE="Backing Up"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_PROFILE="Profile: %s"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_STARTING="Starting backup…"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_RUNNING="Backing up…"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_COMPLETE="Backup complete"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUING="Backup complete — continuing…"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_FAILED="Backup failed"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_RETRY="Retry backup"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUE_ANYWAY="Continue without backup"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_BACK_TO_DASHBOARD="Back to dashboard"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_LEAVE_WARNING="A backup is in progress. Leaving now will cancel it."
|
|
||||||
|
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_CLEANUP="Cleanup Defaults"
|
COM_MOKOJOOMBACKUP_CONFIG_CLEANUP="Cleanup Defaults"
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE="Max Backup Age (days)"
|
COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE="Max Backup Age (days)"
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE_DESC="Default maximum age for backup records. Used by the system plugin and CLI cleanup command."
|
COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE_DESC="Default maximum age for backup records. Used by the system plugin and CLI cleanup command."
|
||||||
@@ -397,8 +380,6 @@ COM_MOKOJOOMBACKUP_FIELD_NOTIFY_USER_GROUPS_DESC="Select Joomla user groups whos
|
|||||||
; Dashboard warnings
|
; Dashboard warnings
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_DEFAULT_DIR_WARNING_TITLE="Backup directory is inside the web root"
|
COM_MOKOJOOMBACKUP_DASHBOARD_DEFAULT_DIR_WARNING_TITLE="Backup directory is inside the web root"
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_DEFAULT_DIR_WARNING="One or more profiles store backups in the default directory inside the web root. This may expose backup archives if .htaccess is not supported. Move backups to a directory outside the web root for better security."
|
COM_MOKOJOOMBACKUP_DASHBOARD_DEFAULT_DIR_WARNING="One or more profiles store backups in the default directory inside the web root. This may expose backup archives if .htaccess is not supported. Move backups to a directory outside the web root for better security."
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_LIVESITE_WARNING_TITLE="Site URL (live_site) is not set"
|
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_LIVESITE_WARNING="Your Global Configuration has no Site URL (live_site). CLI and scheduled backups can't reliably determine the site's domain (archive names fall back to the server hostname), and some URLs may be generated incorrectly. Set Site URL in System → Global Configuration to your full site address including https://."
|
|
||||||
|
|
||||||
COM_MOKOJOOMBACKUP_WEB_ACCESSIBLE_WARNING="This backup is stored inside the web root and may be directly downloadable if .htaccess is not supported."
|
COM_MOKOJOOMBACKUP_WEB_ACCESSIBLE_WARNING="This backup is stored inside the web root and may be directly downloadable if .htaccess is not supported."
|
||||||
|
|
||||||
@@ -469,8 +450,6 @@ COM_MOKOSUITEBACKUP_ACTION_BACKUP_COMPARE="Compare Backups"
|
|||||||
COM_MOKOSUITEBACKUP_ACTION_BACKUP_COMPARE_DESC="Allows users to compare two backup records side-by-side."
|
COM_MOKOSUITEBACKUP_ACTION_BACKUP_COMPARE_DESC="Allows users to compare two backup records side-by-side."
|
||||||
COM_MOKOSUITEBACKUP_ACTION_BACKUP_BROWSE="Browse Archives"
|
COM_MOKOSUITEBACKUP_ACTION_BACKUP_BROWSE="Browse Archives"
|
||||||
COM_MOKOSUITEBACKUP_ACTION_BACKUP_BROWSE_DESC="Allows users to view file listings inside backup archives without extracting."
|
COM_MOKOSUITEBACKUP_ACTION_BACKUP_BROWSE_DESC="Allows users to view file listings inside backup archives without extracting."
|
||||||
COM_MOKOSUITEBACKUP_ACTION_BACKUP_CANCEL="Cancel Stalled Backup"
|
|
||||||
COM_MOKOSUITEBACKUP_ACTION_BACKUP_CANCEL_DESC="Allows users to cancel backup records stuck in running status and clean up partial archive files."
|
|
||||||
|
|
||||||
; Snapshot ACL
|
; Snapshot ACL
|
||||||
COM_MOKOSUITEBACKUP_ACTION_SNAPSHOT_MANAGE="Manage Snapshots"
|
COM_MOKOSUITEBACKUP_ACTION_SNAPSHOT_MANAGE="Manage Snapshots"
|
||||||
@@ -521,12 +500,6 @@ COM_MOKOJOOMBACKUP_PURGE_INVALID_DATE="Invalid date. Please select a valid date.
|
|||||||
COM_MOKOJOOMBACKUP_PURGE_SUCCESS="%d backup(s) purged successfully."
|
COM_MOKOJOOMBACKUP_PURGE_SUCCESS="%d backup(s) purged successfully."
|
||||||
COM_MOKOJOOMBACKUP_PURGE_PARTIAL="%d backup(s) purged, but %d could not be deleted."
|
COM_MOKOJOOMBACKUP_PURGE_PARTIAL="%d backup(s) purged, but %d could not be deleted."
|
||||||
|
|
||||||
; Cancel Stalled Backup
|
|
||||||
COM_MOKOJOOMBACKUP_TOOLBAR_CANCEL_STALLED="Cancel Stalled"
|
|
||||||
COM_MOKOJOOMBACKUP_CANCEL_NONE_SELECTED="No backup records selected."
|
|
||||||
COM_MOKOJOOMBACKUP_CANCEL_NONE_RUNNING="None of the selected backups are in running status."
|
|
||||||
COM_MOKOJOOMBACKUP_CANCEL_SUCCESS="%d stalled backup(s) cancelled."
|
|
||||||
|
|
||||||
; Remote Destinations (multi-remote)
|
; Remote Destinations (multi-remote)
|
||||||
COM_MOKOJOOMBACKUP_REMOTE_DESTINATIONS="Remote Destinations"
|
COM_MOKOJOOMBACKUP_REMOTE_DESTINATIONS="Remote Destinations"
|
||||||
COM_MOKOJOOMBACKUP_REMOTE_ADD="Add Destination"
|
COM_MOKOJOOMBACKUP_REMOTE_ADD="Add Destination"
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
; @license GPL-3.0-or-later
|
; @license GPL-3.0-or-later
|
||||||
|
|
||||||
COM_MOKOJOOMBACKUP="MokoSuiteBackup"
|
COM_MOKOJOOMBACKUP="MokoSuiteBackup"
|
||||||
COM_MOKOJOOMBACKUP_SHORT="Backup"
|
|
||||||
COM_MOKOJOOMBACKUP_DESCRIPTION="Full-site backup and restore for Joomla — database, files, and configuration."
|
COM_MOKOJOOMBACKUP_DESCRIPTION="Full-site backup and restore for Joomla — database, files, and configuration."
|
||||||
COM_MOKOJOOMBACKUP_SUBMENU_DASHBOARD="Dashboard"
|
COM_MOKOJOOMBACKUP_SUBMENU_DASHBOARD="Dashboard"
|
||||||
COM_MOKOJOOMBACKUP_SUBMENU_BACKUPS="Backup Records"
|
COM_MOKOJOOMBACKUP_SUBMENU_BACKUPS="Backup Records"
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
; @license GPL-3.0-or-later
|
; @license GPL-3.0-or-later
|
||||||
|
|
||||||
COM_MOKOJOOMBACKUP="MokoSuiteBackup"
|
COM_MOKOJOOMBACKUP="MokoSuiteBackup"
|
||||||
COM_MOKOJOOMBACKUP_SHORT="Backup"
|
|
||||||
COM_MOKOJOOMBACKUP_DESCRIPTION="Full-site backup and restore for Joomla"
|
COM_MOKOJOOMBACKUP_DESCRIPTION="Full-site backup and restore for Joomla"
|
||||||
COM_MOKOJOOMBACKUP_SUBMENU_DASHBOARD="Dashboard"
|
COM_MOKOJOOMBACKUP_SUBMENU_DASHBOARD="Dashboard"
|
||||||
COM_MOKOJOOMBACKUP_SUBMENU_BACKUPS="Backup Records"
|
COM_MOKOJOOMBACKUP_SUBMENU_BACKUPS="Backup Records"
|
||||||
@@ -19,7 +18,7 @@ COM_MOKOSUITEBACKUP_ACTION_BACKUP_DOWNLOAD_DESC="Allows users in this group to d
|
|||||||
COM_MOKOSUITEBACKUP_ACTION_BACKUP_RESTORE="Restore Backup"
|
COM_MOKOSUITEBACKUP_ACTION_BACKUP_RESTORE="Restore Backup"
|
||||||
COM_MOKOSUITEBACKUP_ACTION_BACKUP_RESTORE_DESC="Allows users in this group to restore the site from a backup archive. This is a destructive operation that overwrites the current site."
|
COM_MOKOSUITEBACKUP_ACTION_BACKUP_RESTORE_DESC="Allows users in this group to restore the site from a backup archive. This is a destructive operation that overwrites the current site."
|
||||||
|
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_TITLE="Dashboard"
|
COM_MOKOJOOMBACKUP_DASHBOARD_TITLE="MokoSuiteBackup Dashboard"
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_LAST_BACKUP="Last Backup"
|
COM_MOKOJOOMBACKUP_DASHBOARD_LAST_BACKUP="Last Backup"
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_NO_BACKUPS="No backups yet"
|
COM_MOKOJOOMBACKUP_DASHBOARD_NO_BACKUPS="No backups yet"
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_NEXT_SCHEDULED="Next Scheduled"
|
COM_MOKOJOOMBACKUP_DASHBOARD_NEXT_SCHEDULED="Next Scheduled"
|
||||||
@@ -31,8 +30,8 @@ COM_MOKOJOOMBACKUP_DASHBOARD_QUICK_ACTIONS="Quick Actions"
|
|||||||
COM_MOKOJOOMBACKUP_DASHBOARD_SCHEDULED_TASKS="Scheduled Tasks"
|
COM_MOKOJOOMBACKUP_DASHBOARD_SCHEDULED_TASKS="Scheduled Tasks"
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_UPDATE_SITE="Update Site"
|
COM_MOKOJOOMBACKUP_DASHBOARD_UPDATE_SITE="Update Site"
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_SYSTEM_HEALTH="System Health"
|
COM_MOKOJOOMBACKUP_DASHBOARD_SYSTEM_HEALTH="System Health"
|
||||||
COM_MOKOJOOMBACKUP_BACKUPS_TITLE="Records"
|
COM_MOKOJOOMBACKUP_BACKUPS_TITLE="Backup Records"
|
||||||
COM_MOKOJOOMBACKUP_PROFILES_TITLE="Profiles"
|
COM_MOKOJOOMBACKUP_PROFILES_TITLE="Backup Profiles"
|
||||||
COM_MOKOJOOMBACKUP_TOOLBAR_BACKUP_NOW="Backup Now"
|
COM_MOKOJOOMBACKUP_TOOLBAR_BACKUP_NOW="Backup Now"
|
||||||
COM_MOKOJOOMBACKUP_NO_BACKUPS="No backups found. Click 'Backup Now' to create your first backup."
|
COM_MOKOJOOMBACKUP_NO_BACKUPS="No backups found. Click 'Backup Now' to create your first backup."
|
||||||
COM_MOKOJOOMBACKUP_NO_PROFILES="No backup profiles found."
|
COM_MOKOJOOMBACKUP_NO_PROFILES="No backup profiles found."
|
||||||
@@ -53,24 +52,9 @@ COM_MOKOJOOMBACKUP_CONFIG_SHOW_UPDATE_NOTICE_DESC="Display the update site confi
|
|||||||
COM_MOKOJOOMBACKUP_CONFIG_PREACTION="Pre-action Backups"
|
COM_MOKOJOOMBACKUP_CONFIG_PREACTION="Pre-action Backups"
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UPDATE="Backup Before Extension Update"
|
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UPDATE="Backup Before Extension Update"
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UPDATE_DESC="Automatically run a full backup before any extension is updated. Uses the default profile. Throttled to once per 10 minutes to prevent duplicate backups during batch updates."
|
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UPDATE_DESC="Automatically run a full backup before any extension is updated. Uses the default profile. Throttled to once per 10 minutes to prevent duplicate backups during batch updates."
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_PREUPDATE_AUTO_INTERCEPT="Auto-run on Update click"
|
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_PREUPDATE_AUTO_INTERCEPT_DESC="When enabled, clicking the Update button on the Joomla Update or Extensions update page first pops the backup progress modal, runs the pre-update backup, then automatically continues the update. When disabled, a notice with a manual 'Back up now' button is shown instead."
|
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UNINSTALL="Backup Before Extension Uninstall"
|
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UNINSTALL="Backup Before Extension Uninstall"
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UNINSTALL_DESC="Automatically run a full backup before any extension is uninstalled. Uses the default profile. Throttled to once per 10 minutes."
|
COM_MOKOJOOMBACKUP_CONFIG_BACKUP_BEFORE_UNINSTALL_DESC="Automatically run a full backup before any extension is uninstalled. Uses the default profile. Throttled to once per 10 minutes."
|
||||||
|
|
||||||
; Full-screen backup progress view (runbackup)
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_TITLE="Backing Up"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_PROFILE="Profile: %s"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_STARTING="Starting backup…"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_RUNNING="Backing up…"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_COMPLETE="Backup complete"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUING="Backup complete — continuing…"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_FAILED="Backup failed"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_RETRY="Retry backup"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUE_ANYWAY="Continue without backup"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_BACK_TO_DASHBOARD="Back to dashboard"
|
|
||||||
COM_MOKOJOOMBACKUP_RUNBACKUP_LEAVE_WARNING="A backup is in progress. Leaving now will cancel it."
|
|
||||||
|
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_CLEANUP="Cleanup Defaults"
|
COM_MOKOJOOMBACKUP_CONFIG_CLEANUP="Cleanup Defaults"
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE="Max Backup Age (days)"
|
COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE="Max Backup Age (days)"
|
||||||
COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE_DESC="Default maximum age for backup records. Used by the system plugin and CLI cleanup command."
|
COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE_DESC="Default maximum age for backup records. Used by the system plugin and CLI cleanup command."
|
||||||
@@ -88,8 +72,6 @@ COM_MOKOJOOMBACKUP_FOLDER_NOT_FOUND="Directory not found"
|
|||||||
COM_MOKOJOOMBACKUP_BACKUP_DIR_DEFAULT="Default (inside web root)"
|
COM_MOKOJOOMBACKUP_BACKUP_DIR_DEFAULT="Default (inside web root)"
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_DEFAULT_DIR_WARNING_TITLE="Backup directory is inside the web root"
|
COM_MOKOJOOMBACKUP_DASHBOARD_DEFAULT_DIR_WARNING_TITLE="Backup directory is inside the web root"
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_DEFAULT_DIR_WARNING="One or more profiles store backups in the default directory inside the web root. This may expose backup archives if .htaccess is not supported. Move backups to a directory outside the web root for better security."
|
COM_MOKOJOOMBACKUP_DASHBOARD_DEFAULT_DIR_WARNING="One or more profiles store backups in the default directory inside the web root. This may expose backup archives if .htaccess is not supported. Move backups to a directory outside the web root for better security."
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_LIVESITE_WARNING_TITLE="Site URL (live_site) is not set"
|
|
||||||
COM_MOKOJOOMBACKUP_DASHBOARD_LIVESITE_WARNING="Your Global Configuration has no Site URL (live_site). CLI and scheduled backups can't reliably determine the site's domain (archive names fall back to the server hostname), and some URLs may be generated incorrectly. Set Site URL in System → Global Configuration to your full site address including https://."
|
|
||||||
COM_MOKOJOOMBACKUP_WEB_ACCESSIBLE_WARNING="This backup is stored inside the web root and may be directly downloadable if .htaccess is not supported."
|
COM_MOKOJOOMBACKUP_WEB_ACCESSIBLE_WARNING="This backup is stored inside the web root and may be directly downloadable if .htaccess is not supported."
|
||||||
COM_MOKOJOOMBACKUP_FOLDER_EXISTS="Directory exists"
|
COM_MOKOJOOMBACKUP_FOLDER_EXISTS="Directory exists"
|
||||||
COM_MOKOJOOMBACKUP_FOLDER_NOT_FOUND="Directory not found"
|
COM_MOKOJOOMBACKUP_FOLDER_NOT_FOUND="Directory not found"
|
||||||
@@ -134,27 +116,3 @@ COM_MOKOJOOMBACKUP_PURGE_NONE_FOUND="No completed backups found before the selec
|
|||||||
COM_MOKOJOOMBACKUP_PURGE_INVALID_DATE="Invalid date. Please select a valid date."
|
COM_MOKOJOOMBACKUP_PURGE_INVALID_DATE="Invalid date. Please select a valid date."
|
||||||
COM_MOKOJOOMBACKUP_PURGE_SUCCESS="%d backup(s) purged successfully."
|
COM_MOKOJOOMBACKUP_PURGE_SUCCESS="%d backup(s) purged successfully."
|
||||||
COM_MOKOJOOMBACKUP_PURGE_PARTIAL="%d backup(s) purged, but %d could not be deleted."
|
COM_MOKOJOOMBACKUP_PURGE_PARTIAL="%d backup(s) purged, but %d could not be deleted."
|
||||||
|
|
||||||
; Cancel Stalled Backup
|
|
||||||
COM_MOKOJOOMBACKUP_TOOLBAR_CANCEL_STALLED="Cancel Stalled"
|
|
||||||
COM_MOKOJOOMBACKUP_CANCEL_NONE_SELECTED="No backup records selected."
|
|
||||||
COM_MOKOJOOMBACKUP_CANCEL_NONE_RUNNING="None of the selected backups are in running status."
|
|
||||||
COM_MOKOJOOMBACKUP_CANCEL_SUCCESS="%d stalled backup(s) cancelled."
|
|
||||||
|
|
||||||
; Backup status
|
|
||||||
COM_MOKOJOOMBACKUP_STATUS_WARNING="Warning"
|
|
||||||
|
|
||||||
; Delete feedback
|
|
||||||
COM_MOKOJOOMBACKUP_BACKUPS_N_ITEMS_DELETED="%d backup records deleted."
|
|
||||||
COM_MOKOJOOMBACKUP_BACKUPS_N_ITEMS_DELETED_1="%d backup record deleted."
|
|
||||||
|
|
||||||
; ACL - Cancel
|
|
||||||
COM_MOKOSUITEBACKUP_ACTION_BACKUP_CANCEL="Cancel Stalled Backup"
|
|
||||||
COM_MOKOSUITEBACKUP_ACTION_BACKUP_CANCEL_DESC="Allows users to cancel backup records stuck in running status and clean up partial archive files."
|
|
||||||
|
|
||||||
; Retention (per-profile)
|
|
||||||
COM_MOKOJOOMBACKUP_FIELDSET_RETENTION="Retention"
|
|
||||||
COM_MOKOJOOMBACKUP_FIELD_RETENTION_DAYS="Keep Backups (days)"
|
|
||||||
COM_MOKOJOOMBACKUP_FIELD_RETENTION_DAYS_DESC="Delete completed backups from this profile older than this many days. Set to 0 for unlimited (keep by age disabled)."
|
|
||||||
COM_MOKOJOOMBACKUP_FIELD_RETENTION_COUNT="Keep Backups (count)"
|
|
||||||
COM_MOKOJOOMBACKUP_FIELD_RETENTION_COUNT_DESC="Maximum number of completed backups to keep for this profile. Oldest are removed first. Set to 0 for unlimited (keep by count disabled)."
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
; @license GPL-3.0-or-later
|
; @license GPL-3.0-or-later
|
||||||
|
|
||||||
COM_MOKOJOOMBACKUP="MokoSuiteBackup"
|
COM_MOKOJOOMBACKUP="MokoSuiteBackup"
|
||||||
COM_MOKOJOOMBACKUP_SHORT="Backup"
|
|
||||||
COM_MOKOJOOMBACKUP_DESCRIPTION="Full-site backup and restore for Joomla — database, files, and configuration."
|
COM_MOKOJOOMBACKUP_DESCRIPTION="Full-site backup and restore for Joomla — database, files, and configuration."
|
||||||
COM_MOKOJOOMBACKUP_SUBMENU_DASHBOARD="Dashboard"
|
COM_MOKOJOOMBACKUP_SUBMENU_DASHBOARD="Dashboard"
|
||||||
COM_MOKOJOOMBACKUP_SUBMENU_BACKUPS="Backup Records"
|
COM_MOKOJOOMBACKUP_SUBMENU_BACKUPS="Backup Records"
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
/**
|
|
||||||
* MokoSuiteBackup — admin styles (loaded via the Joomla Web Asset Manager).
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Add/Edit Destination modal.
|
|
||||||
* The modal content is wrapped in a Bootstrap .container-fluid because
|
|
||||||
* Bootstrap's .modal-content has no padding of its own. Give that container a
|
|
||||||
* single, comfortable 1rem frame and drop the inner sections' horizontal padding
|
|
||||||
* so it isn't doubled. */
|
|
||||||
#remoteModal .modal-content > .container-fluid {
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#remoteModal .modal-header,
|
|
||||||
#remoteModal .modal-body,
|
|
||||||
#remoteModal .modal-footer {
|
|
||||||
padding-left: 0;
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#remoteModal .modal-body .row + .row,
|
|
||||||
#remoteModal .remote-type-fields {
|
|
||||||
margin-top: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#remoteModal hr {
|
|
||||||
margin: 1rem 0;
|
|
||||||
opacity: 0.12;
|
|
||||||
}
|
|
||||||
|
|
||||||
#remoteModal .form-label {
|
|
||||||
margin-bottom: 0.35rem;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
|
|
||||||
"name": "com_mokosuitebackup",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "MokoSuiteBackup web assets",
|
|
||||||
"license": "GPL-3.0-or-later",
|
|
||||||
"assets": [
|
|
||||||
{
|
|
||||||
"name": "com_mokosuitebackup.admin",
|
|
||||||
"type": "style",
|
|
||||||
"uri": "com_mokosuitebackup/css/admin.css"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -6,25 +6,15 @@
|
|||||||
* @license GNU General Public License version 3 or later; see LICENSE
|
* @license GNU General Public License version 3 or later; see LICENSE
|
||||||
-->
|
-->
|
||||||
<extension type="component" method="upgrade">
|
<extension type="component" method="upgrade">
|
||||||
<!--
|
|
||||||
IMPORTANT: a component's <name> drives the Joomla-derived extension
|
|
||||||
element (com_ + sanitized name), so it MUST stay element-safe:
|
|
||||||
"MokoSuiteBackup" -> com_mokosuitebackup. Do NOT apply the "Type - Name"
|
|
||||||
display convention here — "Component - MokoSuiteBackup" derives
|
|
||||||
com_component-mokosuitebackup, which registers a duplicate component and
|
|
||||||
orphans the real one. Packages are exempt because they set the element
|
|
||||||
via <packagename>; plugins/modules are exempt because <name> is only a
|
|
||||||
display label there.
|
|
||||||
-->
|
|
||||||
<name>MokoSuiteBackup</name>
|
<name>MokoSuiteBackup</name>
|
||||||
<version>02.58.17</version>
|
<version>01.45.07</version>
|
||||||
<creationDate>2026-06-02</creationDate>
|
<creationDate>2026-06-02</creationDate>
|
||||||
<author>Moko Consulting</author>
|
<author>Moko Consulting</author>
|
||||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||||
<authorUrl>https://mokoconsulting.tech</authorUrl>
|
<authorUrl>https://mokoconsulting.tech</authorUrl>
|
||||||
<copyright>Copyright (C) 2026 Moko Consulting. All rights reserved.</copyright>
|
<copyright>Copyright (C) 2026 Moko Consulting. All rights reserved.</copyright>
|
||||||
<license>GPL-3.0-or-later</license>
|
<license>GPL-3.0-or-later</license>
|
||||||
<description>Full-site backup and restore for Joomla — database, files, and configuration.</description>
|
<description>COM_MOKOJOOMBACKUP_DESCRIPTION</description>
|
||||||
|
|
||||||
<namespace path="src">Joomla\Component\MokoSuiteBackup</namespace>
|
<namespace path="src">Joomla\Component\MokoSuiteBackup</namespace>
|
||||||
|
|
||||||
@@ -47,20 +37,20 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<administration>
|
<administration>
|
||||||
<menu img="class:archive">COM_MOKOJOOMBACKUP_SHORT</menu>
|
<menu img="class:archive">COM_MOKOJOOMBACKUP</menu>
|
||||||
<submenu>
|
<submenu>
|
||||||
<menu link="option=com_mokosuitebackup&view=dashboard"
|
<menu link="option=com_mokosuitebackup&view=dashboard"
|
||||||
img="class:home"
|
img="class:home"
|
||||||
alt="Dashboard">Dashboard</menu>
|
alt="Dashboard">COM_MOKOJOOMBACKUP_SUBMENU_DASHBOARD</menu>
|
||||||
<menu link="option=com_mokosuitebackup&view=backups"
|
<menu link="option=com_mokosuitebackup&view=backups"
|
||||||
img="class:database"
|
img="class:database"
|
||||||
alt="Backups">Backup Records</menu>
|
alt="Backups">COM_MOKOJOOMBACKUP_SUBMENU_BACKUPS</menu>
|
||||||
<menu link="option=com_mokosuitebackup&view=snapshots"
|
<menu link="option=com_mokosuitebackup&view=snapshots"
|
||||||
img="class:camera"
|
img="class:camera"
|
||||||
alt="Snapshots">Content Snapshots</menu>
|
alt="Snapshots">COM_MOKOJOOMBACKUP_SUBMENU_SNAPSHOTS</menu>
|
||||||
<menu link="option=com_mokosuitebackup&view=profiles"
|
<menu link="option=com_mokosuitebackup&view=profiles"
|
||||||
img="class:cog"
|
img="class:cog"
|
||||||
alt="Profiles">Backup Profiles</menu>
|
alt="Profiles">COM_MOKOJOOMBACKUP_SUBMENU_PROFILES</menu>
|
||||||
</submenu>
|
</submenu>
|
||||||
<files folder=".">
|
<files folder=".">
|
||||||
<filename>access.xml</filename>
|
<filename>access.xml</filename>
|
||||||
@@ -78,11 +68,6 @@
|
|||||||
</languages>
|
</languages>
|
||||||
</administration>
|
</administration>
|
||||||
|
|
||||||
<media destination="com_mokosuitebackup" folder="media">
|
|
||||||
<folder>css</folder>
|
|
||||||
<filename>joomla.asset.json</filename>
|
|
||||||
</media>
|
|
||||||
|
|
||||||
<api>
|
<api>
|
||||||
<files folder="api">
|
<files folder="api">
|
||||||
<folder>src</folder>
|
<folder>src</folder>
|
||||||
|
|||||||
@@ -11,6 +11,32 @@ CREATE TABLE IF NOT EXISTS `#__mokosuitebackup_profiles` (
|
|||||||
`exclude_dirs` TEXT NOT NULL COMMENT 'Newline-separated directory paths to exclude',
|
`exclude_dirs` TEXT NOT NULL COMMENT 'Newline-separated directory paths to exclude',
|
||||||
`exclude_files` TEXT NOT NULL COMMENT 'Newline-separated filename patterns to exclude',
|
`exclude_files` TEXT NOT NULL COMMENT 'Newline-separated filename patterns to exclude',
|
||||||
`exclude_tables` TEXT NOT NULL COMMENT 'Newline-separated table names to exclude',
|
`exclude_tables` TEXT NOT NULL COMMENT 'Newline-separated table names to exclude',
|
||||||
|
`remote_storage` VARCHAR(20) NOT NULL DEFAULT 'none' COMMENT 'none, ftp, google_drive, s3',
|
||||||
|
`ftp_host` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`ftp_port` INT(5) UNSIGNED NOT NULL DEFAULT 21,
|
||||||
|
`ftp_username` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`ftp_password` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`ftp_path` VARCHAR(512) NOT NULL DEFAULT '/backups',
|
||||||
|
`ftp_passive` TINYINT(1) NOT NULL DEFAULT 1,
|
||||||
|
`ftp_ssl` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
|
`sftp_host` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`sftp_port` INT(5) UNSIGNED NOT NULL DEFAULT 22,
|
||||||
|
`sftp_username` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`sftp_auth_type` VARCHAR(20) NOT NULL DEFAULT 'key',
|
||||||
|
`sftp_password` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`sftp_key_data` MEDIUMTEXT,
|
||||||
|
`sftp_passphrase` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`sftp_path` VARCHAR(512) NOT NULL DEFAULT '/backups',
|
||||||
|
`gdrive_client_id` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`gdrive_client_secret` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`gdrive_refresh_token` VARCHAR(512) NOT NULL DEFAULT '',
|
||||||
|
`gdrive_folder_id` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`s3_endpoint` VARCHAR(512) NOT NULL DEFAULT '' COMMENT 'S3 endpoint URL (blank = AWS default)',
|
||||||
|
`s3_region` VARCHAR(50) NOT NULL DEFAULT 'us-east-1',
|
||||||
|
`s3_access_key` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`s3_secret_key` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`s3_bucket` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
`s3_path` VARCHAR(512) NOT NULL DEFAULT '/backups',
|
||||||
`remote_keep_local` TINYINT(1) NOT NULL DEFAULT 1 COMMENT 'Keep local copy after upload',
|
`remote_keep_local` TINYINT(1) NOT NULL DEFAULT 1 COMMENT 'Keep local copy after upload',
|
||||||
`encryption_password` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'AES-256 archive encryption password (blank = no encryption)',
|
`encryption_password` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'AES-256 archive encryption password (blank = no encryption)',
|
||||||
`include_mokorestore` VARCHAR(20) NOT NULL DEFAULT '0' COMMENT 'MokoRestore mode: 0=none, 1=wrapped, standalone',
|
`include_mokorestore` VARCHAR(20) NOT NULL DEFAULT '0' COMMENT 'MokoRestore mode: 0=none, 1=wrapped, standalone',
|
||||||
@@ -23,8 +49,8 @@ CREATE TABLE IF NOT EXISTS `#__mokosuitebackup_profiles` (
|
|||||||
`notify_user_groups` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Comma-separated Joomla user group IDs',
|
`notify_user_groups` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Comma-separated Joomla user group IDs',
|
||||||
`notify_on_success` TINYINT(1) NOT NULL DEFAULT 0,
|
`notify_on_success` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
`notify_on_failure` TINYINT(1) NOT NULL DEFAULT 1,
|
`notify_on_failure` TINYINT(1) NOT NULL DEFAULT 1,
|
||||||
`retention_days` INT(11) NOT NULL DEFAULT 0 COMMENT 'Delete backups older than N days; 0 = unlimited',
|
`retention_days` INT(11) NOT NULL DEFAULT 0 COMMENT '0 = use global default',
|
||||||
`retention_count` INT(11) NOT NULL DEFAULT 0 COMMENT 'Keep newest N backups; 0 = unlimited',
|
`retention_count` INT(11) NOT NULL DEFAULT 0 COMMENT '0 = use global default',
|
||||||
`ntfy_topic` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'ntfy topic name',
|
`ntfy_topic` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'ntfy topic name',
|
||||||
`ntfy_server` VARCHAR(512) NOT NULL DEFAULT 'https://ntfy.sh' COMMENT 'ntfy server URL',
|
`ntfy_server` VARCHAR(512) NOT NULL DEFAULT 'https://ntfy.sh' COMMENT 'ntfy server URL',
|
||||||
`ntfy_token` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'ntfy access token (optional)',
|
`ntfy_token` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'ntfy access token (optional)',
|
||||||
@@ -39,7 +65,7 @@ CREATE TABLE IF NOT EXISTS `#__mokosuitebackup_records` (
|
|||||||
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`profile_id` INT(11) UNSIGNED NOT NULL DEFAULT 1,
|
`profile_id` INT(11) UNSIGNED NOT NULL DEFAULT 1,
|
||||||
`description` VARCHAR(255) NOT NULL DEFAULT '',
|
`description` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`status` VARCHAR(20) NOT NULL DEFAULT 'pending' COMMENT 'pending, running, complete, warning, fail',
|
`status` VARCHAR(20) NOT NULL DEFAULT 'pending' COMMENT 'pending, running, complete, fail',
|
||||||
`origin` VARCHAR(20) NOT NULL DEFAULT 'backend' COMMENT 'backend, cli, api, scheduled',
|
`origin` VARCHAR(20) NOT NULL DEFAULT 'backend' COMMENT 'backend, cli, api, scheduled',
|
||||||
`backup_type` VARCHAR(20) NOT NULL DEFAULT 'full' COMMENT 'full, database, files',
|
`backup_type` VARCHAR(20) NOT NULL DEFAULT 'full' COMMENT 'full, database, files',
|
||||||
`archivename` VARCHAR(512) NOT NULL DEFAULT '',
|
`archivename` VARCHAR(512) NOT NULL DEFAULT '',
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
DROP TABLE IF EXISTS `#__mokosuitebackup_remotes`;
|
DROP TABLE IF EXISTS `#__mokosuitebackup_remotes`;
|
||||||
DROP TABLE IF EXISTS `#__mokosuitebackup_records`;
|
DROP TABLE IF EXISTS `#__mokosuitebackup_records`;
|
||||||
DROP TABLE IF EXISTS `#__mokosuitebackup_snapshots`;
|
|
||||||
DROP TABLE IF EXISTS `#__mokosuitebackup_profiles`;
|
DROP TABLE IF EXISTS `#__mokosuitebackup_profiles`;
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
/* 01.44.02 — no schema changes */
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* 01.44.03 — no schema changes */
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 01.45.00 — no schema changes */
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* 01.45.02 — no schema changes */
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* 01.45.03 — no schema changes */
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* 01.45.05 — no schema changes */
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* 01.45.06 — no schema changes */
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* 01.45.07 — no schema changes */
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.52.16 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.52.17 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.52.18 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.52.20 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.52.21 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.52.22 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.52.23 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.52.24 — no schema changes */
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
-- Remove legacy single-remote storage columns (superseded by #__mokosuitebackup_remotes).
|
|
||||||
-- Plain DROP COLUMN (no IF EXISTS): all columns are created by install.mysql.sql and
|
|
||||||
-- earlier updates, so they always exist here. `DROP COLUMN IF EXISTS` is a MariaDB-only
|
|
||||||
-- extension and errors on Oracle MySQL 8.x, which Joomla also supports.
|
|
||||||
ALTER TABLE `#__mokosuitebackup_profiles`
|
|
||||||
DROP COLUMN `remote_storage`,
|
|
||||||
DROP COLUMN `ftp_host`,
|
|
||||||
DROP COLUMN `ftp_port`,
|
|
||||||
DROP COLUMN `ftp_username`,
|
|
||||||
DROP COLUMN `ftp_password`,
|
|
||||||
DROP COLUMN `ftp_path`,
|
|
||||||
DROP COLUMN `ftp_passive`,
|
|
||||||
DROP COLUMN `ftp_ssl`,
|
|
||||||
DROP COLUMN `sftp_host`,
|
|
||||||
DROP COLUMN `sftp_port`,
|
|
||||||
DROP COLUMN `sftp_username`,
|
|
||||||
DROP COLUMN `sftp_auth_type`,
|
|
||||||
DROP COLUMN `sftp_password`,
|
|
||||||
DROP COLUMN `sftp_key_data`,
|
|
||||||
DROP COLUMN `sftp_passphrase`,
|
|
||||||
DROP COLUMN `sftp_path`,
|
|
||||||
DROP COLUMN `gdrive_client_id`,
|
|
||||||
DROP COLUMN `gdrive_client_secret`,
|
|
||||||
DROP COLUMN `gdrive_refresh_token`,
|
|
||||||
DROP COLUMN `gdrive_folder_id`,
|
|
||||||
DROP COLUMN `s3_endpoint`,
|
|
||||||
DROP COLUMN `s3_region`,
|
|
||||||
DROP COLUMN `s3_access_key`,
|
|
||||||
DROP COLUMN `s3_secret_key`,
|
|
||||||
DROP COLUMN `s3_bucket`,
|
|
||||||
DROP COLUMN `s3_path`;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.52.27 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.53.00 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.54.00 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.55.00 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.55.03 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.56.00 — no schema changes */
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
-- Legacy single-remote storage columns are now purged by the package installer
|
|
||||||
-- script (Pkg_MokoSuiteBackupInstallerScript::dropLegacyRemoteColumns()), NOT here.
|
|
||||||
--
|
|
||||||
-- The 26 legacy remote_storage/ftp_*/sftp_*/gdrive_*/s3_* columns must be removed
|
|
||||||
-- portably across MariaDB and MySQL 8. `DROP COLUMN IF EXISTS` is MariaDB-only
|
|
||||||
-- (errors on MySQL 8); plain `DROP COLUMN` errors when a column is absent. The
|
|
||||||
-- previous version gated the ALTER on INFORMATION_SCHEMA and ran it via
|
|
||||||
-- PREPARE/EXECUTE/DEALLOCATE — but those statements are rejected by Joomla's
|
|
||||||
-- installer SQL path (MySQL error 1295: "This command is not supported in the
|
|
||||||
-- prepared statement protocol yet"), which ABORTED the whole component install.
|
|
||||||
--
|
|
||||||
-- The drop is now done in PHP (INFORMATION_SCHEMA gate + a plain ALTER for only the
|
|
||||||
-- columns that still exist), so this migration is intentionally a no-op.
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.56.05 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.56.07 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.56.08 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.56.11 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.00 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.01 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.02 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.04 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.05 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.06 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.07 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.08 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.09 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.10 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.11 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.12 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.57.13 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.00 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.01 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.02 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.03 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.04 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.05 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.06 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.07 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.08 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.09 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.10 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.11 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.12 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.13 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.14 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.15 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.16 — no schema changes */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/* 02.58.17 — no schema changes */
|
|
||||||
@@ -84,96 +84,6 @@ class AjaxController extends BaseController
|
|||||||
$this->sendJson($result);
|
$this->sendJson($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Mark the pre-update backup as satisfied for this session.
|
|
||||||
*
|
|
||||||
* Called by the update-page modal after a successful on-demand backup so the
|
|
||||||
* imminent server-side onExtensionBeforeUpdate backup is skipped — it sets
|
|
||||||
* the same 10-minute throttle key the system plugin checks, preventing a
|
|
||||||
* duplicate backup when the admin then clicks Joomla's Update button.
|
|
||||||
* POST: task=ajax.preupdateAck
|
|
||||||
*/
|
|
||||||
public function preupdateAck(): void
|
|
||||||
{
|
|
||||||
if (!Session::checkToken('get') && !Session::checkToken('post')) {
|
|
||||||
$this->sendJson(['error' => true, 'message' => 'Invalid token'], 403);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$this->app->getIdentity()->authorise('mokosuitebackup.backup.run', 'com_mokosuitebackup')) {
|
|
||||||
$this->sendJson(['error' => true, 'message' => 'Access denied'], 403);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Same key + semantics as plg_system_mokosuitebackup::runPreActionBackup().
|
|
||||||
Factory::getSession()->set('mokosuitebackup.preaction_backup_before_update', time());
|
|
||||||
|
|
||||||
$this->sendJson(['error' => false, 'message' => 'Pre-update backup acknowledged']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cancel a backup record stuck in "running" status.
|
|
||||||
* POST: task=ajax.cancelBackup&id=123
|
|
||||||
*/
|
|
||||||
public function cancelBackup(): void
|
|
||||||
{
|
|
||||||
if (!Session::checkToken('get') && !Session::checkToken('post')) {
|
|
||||||
$this->sendJson(['error' => true, 'message' => 'Invalid token'], 403);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$this->app->getIdentity()->authorise('mokosuitebackup.backup.cancel', 'com_mokosuitebackup')) {
|
|
||||||
$this->sendJson(['error' => true, 'message' => 'Access denied'], 403);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$id = $this->input->getInt('id', 0);
|
|
||||||
|
|
||||||
if (!$id) {
|
|
||||||
$this->sendJson(['error' => true, 'message' => 'Missing record ID']);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$db = Factory::getDbo();
|
|
||||||
$query = $db->getQuery(true)
|
|
||||||
->select($db->quoteName(['id', 'status', 'absolute_path']))
|
|
||||||
->from($db->quoteName('#__mokosuitebackup_records'))
|
|
||||||
->where($db->quoteName('id') . ' = ' . $id);
|
|
||||||
$db->setQuery($query);
|
|
||||||
$record = $db->loadObject();
|
|
||||||
|
|
||||||
if (!$record) {
|
|
||||||
$this->sendJson(['error' => true, 'message' => 'Record not found'], 404);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($record->status !== 'running') {
|
|
||||||
$this->sendJson(['error' => true, 'message' => 'Backup is not in running status']);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$update = $db->getQuery(true)
|
|
||||||
->update($db->quoteName('#__mokosuitebackup_records'))
|
|
||||||
->set($db->quoteName('status') . ' = ' . $db->quote('fail'))
|
|
||||||
->set($db->quoteName('backupend') . ' = ' . $db->quote(date('Y-m-d H:i:s')))
|
|
||||||
->where($db->quoteName('id') . ' = ' . $id);
|
|
||||||
$db->setQuery($update);
|
|
||||||
$db->execute();
|
|
||||||
|
|
||||||
if (!empty($record->absolute_path) && is_file($record->absolute_path)) {
|
|
||||||
@unlink($record->absolute_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->sendJson(['error' => false, 'message' => 'Backup cancelled']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Browse server directories for the folder picker field.
|
* Browse server directories for the folder picker field.
|
||||||
* POST: task=ajax.browseDir&path=/some/path
|
* POST: task=ajax.browseDir&path=/some/path
|
||||||
@@ -541,7 +451,7 @@ class AjaxController extends BaseController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!\in_array($record->status, ['complete', 'warning'], true) || !$record->filesexist) {
|
if ($record->status !== 'complete' || !$record->filesexist) {
|
||||||
$this->sendJson(['error' => true, 'message' => 'Archive not available']);
|
$this->sendJson(['error' => true, 'message' => 'Archive not available']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -837,7 +747,7 @@ class AjaxController extends BaseController
|
|||||||
->select('COUNT(*)')
|
->select('COUNT(*)')
|
||||||
->from($db->quoteName('#__mokosuitebackup_records'))
|
->from($db->quoteName('#__mokosuitebackup_records'))
|
||||||
->where($db->quoteName('backupstart') . ' < ' . $db->quote($cutoff))
|
->where($db->quoteName('backupstart') . ' < ' . $db->quote($cutoff))
|
||||||
->where($db->quoteName('status') . ' IN (' . implode(',', array_map([$db, 'quote'], ['complete', 'warning'])) . ')');
|
->where($db->quoteName('status') . ' = ' . $db->quote('complete'));
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$count = (int) $db->loadResult();
|
$count = (int) $db->loadResult();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@@ -1230,7 +1140,6 @@ class AjaxController extends BaseController
|
|||||||
private function maskSecrets(array $config, string $type): array
|
private function maskSecrets(array $config, string $type): array
|
||||||
{
|
{
|
||||||
$secrets = [
|
$secrets = [
|
||||||
'ftp' => ['password'],
|
|
||||||
'sftp' => ['password', 'passphrase', 'key_data'],
|
'sftp' => ['password', 'passphrase', 'key_data'],
|
||||||
's3' => ['secret_key'],
|
's3' => ['secret_key'],
|
||||||
'google_drive' => ['client_secret', 'refresh_token'],
|
'google_drive' => ['client_secret', 'refresh_token'],
|
||||||
@@ -1253,7 +1162,6 @@ class AjaxController extends BaseController
|
|||||||
private function mergeExistingSecrets(int $id, array $config, string $type): array
|
private function mergeExistingSecrets(int $id, array $config, string $type): array
|
||||||
{
|
{
|
||||||
$secrets = [
|
$secrets = [
|
||||||
'ftp' => ['password'],
|
|
||||||
'sftp' => ['password', 'passphrase', 'key_data'],
|
'sftp' => ['password', 'passphrase', 'key_data'],
|
||||||
's3' => ['secret_key'],
|
's3' => ['secret_key'],
|
||||||
'google_drive' => ['client_secret', 'refresh_token'],
|
'google_drive' => ['client_secret', 'refresh_token'],
|
||||||
@@ -1296,6 +1204,184 @@ class AjaxController extends BaseController
|
|||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Browse directories on a remote SFTP server for the path picker.
|
||||||
|
* POST: task=ajax.browseSftpDir&profile_id=1&path=/some/path
|
||||||
|
*/
|
||||||
|
public function browseSftpDir(): void
|
||||||
|
{
|
||||||
|
if (!Session::checkToken('get') && !Session::checkToken('post')) {
|
||||||
|
$this->sendJson(['error' => true, 'message' => 'Invalid token'], 403);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$this->app->getIdentity()->authorise('core.manage', 'com_mokosuitebackup')) {
|
||||||
|
$this->sendJson(['error' => true, 'message' => 'Access denied'], 403);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$profileId = $this->input->getInt('profile_id', 0);
|
||||||
|
|
||||||
|
if (!$profileId) {
|
||||||
|
$this->sendJson(['error' => true, 'message' => 'Missing profile_id']);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Load the profile to get SFTP credentials */
|
||||||
|
try {
|
||||||
|
$db = Factory::getDbo();
|
||||||
|
$query = $db->getQuery(true)
|
||||||
|
->select('*')
|
||||||
|
->from($db->quoteName('#__mokosuitebackup_profiles'))
|
||||||
|
->where($db->quoteName('id') . ' = ' . $profileId);
|
||||||
|
$db->setQuery($query);
|
||||||
|
$profile = $db->loadObject();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->sendJson(['error' => true, 'message' => 'Failed to load profile'], 500);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$profile) {
|
||||||
|
$this->sendJson(['error' => true, 'message' => 'Profile not found'], 404);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$host = $profile->sftp_host ?? '';
|
||||||
|
$port = (int) ($profile->sftp_port ?? 22);
|
||||||
|
$username = $profile->sftp_username ?? '';
|
||||||
|
$keyData = $profile->sftp_key_data ?? '';
|
||||||
|
$password = $profile->sftp_password ?? '';
|
||||||
|
|
||||||
|
if (empty($host) || empty($username)) {
|
||||||
|
$this->sendJson(['error' => true, 'message' => 'SFTP host and username must be configured and saved before browsing']);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($keyData) && empty($password)) {
|
||||||
|
$this->sendJson(['error' => true, 'message' => 'SFTP credentials (key or password) must be configured and saved before browsing']);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$requestPath = $this->input->getString('path', '/');
|
||||||
|
|
||||||
|
/* Sanitize: must start with / and not contain shell meta-characters */
|
||||||
|
$requestPath = '/' . ltrim($requestPath, '/');
|
||||||
|
|
||||||
|
if (preg_match('/[;&|`$<>]/', $requestPath)) {
|
||||||
|
$this->sendJson(['error' => true, 'message' => 'Invalid path characters']);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$keyFile = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
/* Write temp key if using key auth (same pattern as SftpUploader) */
|
||||||
|
if (!empty($keyData)) {
|
||||||
|
$keyContent = base64_decode($keyData, true);
|
||||||
|
|
||||||
|
if ($keyContent === false) {
|
||||||
|
$keyContent = $keyData;
|
||||||
|
}
|
||||||
|
|
||||||
|
$keyFile = sys_get_temp_dir() . '/mokobackup-sftp-browse-' . bin2hex(random_bytes(8)) . '.key';
|
||||||
|
|
||||||
|
if (file_put_contents($keyFile, $keyContent) === false) {
|
||||||
|
throw new \RuntimeException('Cannot write temporary SSH key file');
|
||||||
|
}
|
||||||
|
|
||||||
|
chmod($keyFile, 0600);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Build SSH command to list directories */
|
||||||
|
$escapedPath = escapeshellarg($requestPath);
|
||||||
|
$remoteCmd = 'ls -1pa ' . $escapedPath . ' 2>/dev/null | grep "/$"';
|
||||||
|
|
||||||
|
$parts = ['ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'BatchMode=yes', '-o', 'ConnectTimeout=10'];
|
||||||
|
|
||||||
|
if ($port !== 22) {
|
||||||
|
$parts[] = '-p';
|
||||||
|
$parts[] = (string) $port;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($keyFile !== null) {
|
||||||
|
$parts[] = '-i';
|
||||||
|
$parts[] = escapeshellarg($keyFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
$parts[] = escapeshellarg($username . '@' . $host);
|
||||||
|
$parts[] = escapeshellarg($remoteCmd);
|
||||||
|
|
||||||
|
$cmd = implode(' ', $parts);
|
||||||
|
|
||||||
|
$output = [];
|
||||||
|
$exitCode = 0;
|
||||||
|
exec($cmd . ' 2>&1', $output, $exitCode);
|
||||||
|
|
||||||
|
/* exitCode 1 from grep means no matches (empty dir), which is OK */
|
||||||
|
if ($exitCode !== 0 && $exitCode !== 1) {
|
||||||
|
throw new \RuntimeException('SSH command failed (exit ' . $exitCode . '): ' . implode(' ', $output));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Parse output: each line is a directory name ending with / */
|
||||||
|
$dirs = [];
|
||||||
|
|
||||||
|
foreach ($output as $line) {
|
||||||
|
$line = trim($line);
|
||||||
|
|
||||||
|
if ($line === '' || $line === './' || $line === '../') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$dirName = rtrim($line, '/');
|
||||||
|
|
||||||
|
if ($dirName === '' || $dirName === '.' || $dirName === '..') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fullPath = rtrim($requestPath, '/') . '/' . $dirName;
|
||||||
|
|
||||||
|
$dirs[] = [
|
||||||
|
'name' => $dirName,
|
||||||
|
'path' => $fullPath,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
usort($dirs, fn($a, $b) => strcasecmp($a['name'], $b['name']));
|
||||||
|
|
||||||
|
/* Parent path */
|
||||||
|
$parent = null;
|
||||||
|
|
||||||
|
if ($requestPath !== '/') {
|
||||||
|
$parent = \dirname($requestPath);
|
||||||
|
|
||||||
|
if ($parent === '') {
|
||||||
|
$parent = '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->sendJson([
|
||||||
|
'error' => false,
|
||||||
|
'current' => $requestPath,
|
||||||
|
'parent' => $parent,
|
||||||
|
'dirs' => $dirs,
|
||||||
|
]);
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
$this->sendJson(['error' => true, 'message' => 'SFTP browse failed: ' . $e->getMessage()]);
|
||||||
|
} finally {
|
||||||
|
if ($keyFile !== null && is_file($keyFile)) {
|
||||||
|
unlink($keyFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a JSON response and close the application.
|
* Send a JSON response and close the application.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user