diff --git a/.gitea/workflows/auth-schema-reconcile.yml b/.gitea/workflows/auth-schema-reconcile.yml deleted file mode 100644 index 79f1509a..00000000 --- a/.gitea/workflows/auth-schema-reconcile.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Approved narrow auth schema reconciliation -on: - push: - branches: - - ops/auth-schema-stage - - ops/auth-schema-production -jobs: - reconcile: - runs-on: canina - steps: - - name: Authenticated host narrow schema operation (no deployment) - shell: bash - env: - CI_EVENT: ${{ github.event_name }} - CI_REF: ${{ github.ref }} - SQL_SHA: 8a22f3e89efb3dacc24f3ed9337ae87d0b4345da003a607bc1994478f69c6feb - APPROVAL_ID: CEO-AUTH-SCHEMA-20261025 - DEPLOY_SHA: ${{ github.sha }} - DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} - DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }} - PRODUCTION_SCHEMA_APPROVAL: ${{ secrets.PRODUCTION_AUTH_SCHEMA_APPROVAL }} - REVIEWED_SCHEMA_COMMIT: ${{ secrets.REVIEWED_AUTH_SCHEMA_COMMIT }} - STAGE_AUTH_ACCEPTANCE: ${{ secrets.STAGE_AUTH_SCHEMA_ACCEPTANCE }} - run: | - set -euo pipefail - set +x - [[ "$CI_EVENT" == push ]] - case "$CI_REF" in - refs/heads/ops/auth-schema-stage) TARGET_ENV=stage ;; - refs/heads/ops/auth-schema-production) TARGET_ENV=production ;; - *) exit 2 ;; - esac - [[ "$SQL_SHA" =~ ^[0-9a-f]{64}$ && "$DEPLOY_SHA" =~ ^[0-9a-f]{40}$ ]] - [[ "$APPROVAL_ID" =~ ^[A-Za-z0-9_-]{4,100}$ ]] - [[ "$REVIEWED_SCHEMA_COMMIT" == "$DEPLOY_SHA" ]] - schema_ok=no; auth_ok=no - if [[ "$TARGET_ENV" == production ]]; then - [[ -n "$PRODUCTION_SCHEMA_APPROVAL" && "$PRODUCTION_SCHEMA_APPROVAL" == "$DEPLOY_SHA:$SQL_SHA:$APPROVAL_ID" ]] - [[ "$STAGE_AUTH_ACCEPTANCE" == "$DEPLOY_SHA:$SQL_SHA" ]] - schema_ok=yes; auth_ok=yes - fi - [[ -n "$DEPLOY_KEY" && -n "$DEPLOY_KNOWN_HOSTS" ]] - umask 077 - scratch=$(mktemp -d) - trap 'rm -rf "$scratch"' EXIT - printf '%s\n' "$DEPLOY_KEY" > "$scratch/key" - printf '%s\n' "$DEPLOY_KNOWN_HOSTS" > "$scratch/known_hosts" - unset DEPLOY_KEY DEPLOY_KNOWN_HOSTS PRODUCTION_SCHEMA_APPROVAL - ssh-keygen -F '[87.248.133.138]:2234' -f "$scratch/known_hosts" >/dev/null - ssh -F /dev/null -T -p 2234 -i "$scratch/key" -o BatchMode=yes -o IdentitiesOnly=yes -o IdentityAgent=none -o StrictHostKeyChecking=yes -o UserKnownHostsFile="$scratch/known_hosts" -o GlobalKnownHostsFile=/dev/null devops@87.248.133.138 "sudo -n bash -s -- $DEPLOY_SHA $TARGET_ENV $SQL_SHA $schema_ok $auth_ok" <<'HOST' - set -euo pipefail - set +x - umask 077 - sha=$1; target=$2; sql_sha=$3 - [[ ! -e /.dockerenv && $(id -u) == 0 ]] - work=$(mktemp -d /opt/services/canina/auth-reconcile-XXXXXX) - trap 'rm -rf "$work"' EXIT - git clone --quiet --no-checkout /opt/services/canina/stage "$work" - remote=$(git -C /opt/services/canina/stage remote get-url origin) - git -C "$work" fetch --quiet "$remote" "$sha" - git -C "$work" checkout --quiet --detach "$sha" - cd "$work" - [[ $(git rev-parse HEAD) == "$sha" ]] - if [[ $target == production ]]; then - [[ $4 == yes && $5 == yes ]] - export PRODUCTION_SCHEMA_APPROVED="$sha:$sql_sha" STAGE_AUTH_ACCEPTANCE_APPROVED="$sha:$sql_sha" - fi - GITHUB_ACTIONS=true bash scripts/ci-auth-schema-reconcile.sh "$target" "$sha" "$sql_sha" - HOST diff --git a/.gitea/workflows/hermes-runtime-contract.yml b/.gitea/workflows/hermes-runtime-contract.yml deleted file mode 100644 index b9f2bae7..00000000 --- a/.gitea/workflows/hermes-runtime-contract.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Hermes runtime contract review (NO DEPLOY) -on: - workflow_dispatch: -permissions: - contents: read -jobs: - contract-review: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - name: Editorial Python protocol and deadline regressions (no inference) - run: PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s infra/hermes-editorial/tests -v - - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: npm - cache-dependency-path: backend/package-lock.json - - run: npm ci --ignore-scripts --no-audit - working-directory: backend - - run: npm test -- --runInBand hermes-management - working-directory: backend - - run: npx tsc -p src/hermes-management/tsconfig.contract.json --noEmit - working-directory: backend - - run: npx tsc -p src/hermes-management/tsconfig.contract.json - working-directory: backend - # No SSH, Docker socket, secrets, deployments, dispatch or runtime mutation. diff --git a/.gitea/workflows/stage-test-principal.yml b/.gitea/workflows/stage-test-principal.yml deleted file mode 100644 index d4041fb4..00000000 --- a/.gitea/workflows/stage-test-principal.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Owner authorized Stage test principal -on: - workflow_dispatch: - inputs: - approval: - required: true - description: "Exact owner grant: owner-authorized-stage-editorial" - session: - required: true - description: "Unique session (8-64 lowercase letters/digits/hyphens)" - ttl: - required: true - description: "Bounded session TTL, 60-3600 seconds" - action: - required: true - description: "open or close" -jobs: - principal: - if: github.ref == 'refs/heads/develop' - runs-on: canina - steps: - - name: Explicit authenticated Stage CI seed authority - shell: bash - env: - BRANCH: ${{ github.ref_name }} - DEPLOY_SHA: ${{ github.sha }} - DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} - DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }} - STAGE_TEST_APPROVAL: ${{ inputs.approval }} - STAGE_TEST_SESSION: ${{ inputs.session }} - STAGE_TEST_TTL_SECONDS: ${{ inputs.ttl }} - STAGE_TEST_ACTION: ${{ inputs.action }} - run: | - set -euo pipefail - set +x - [[ "$DEPLOY_SHA" =~ ^[a-f0-9]{40}$ ]] || exit 2 - umask 077 - script=$(mktemp) - trap 'rm -f "$script"' EXIT - wget --no-proxy -qO "$script" "https://git.parsaaghayi.ir/parsa/canina/raw/commit/$DEPLOY_SHA/scripts/ci-stage-test-principal.sh" - bash "$script" diff --git a/frontend/admin-panel/src/pages/Dashboard.test.tsx b/frontend/admin-panel/src/pages/Dashboard.test.tsx index ee757597..bf2719aa 100644 --- a/frontend/admin-panel/src/pages/Dashboard.test.tsx +++ b/frontend/admin-panel/src/pages/Dashboard.test.tsx @@ -59,8 +59,8 @@ describe('Dashboard Page Component', () => { it('renders dashboard headers and initial zero or placeholder stats', async () => { renderDashboard(); - expect(screen.getByText('داشبورد فرماندهی کنینا')).toBeInTheDocument(); - expect(screen.getByText('خلاصه عملیات و آمار فروشگاه')).toBeInTheDocument(); + expect(screen.getByText('داشبورد')).toBeInTheDocument(); + expect(screen.getByText('خلاصهای از وضعیت فروشگاه کنینا')).toBeInTheDocument(); expect(screen.getByText('درآمد کل')).toBeInTheDocument(); expect(screen.getByText('سفارشات جدید')).toBeInTheDocument(); expect(screen.getByText('کاربران فعال')).toBeInTheDocument(); diff --git a/frontend/admin-panel/src/pages/Dashboard.tsx b/frontend/admin-panel/src/pages/Dashboard.tsx index 89d2b947..095edbe4 100755 --- a/frontend/admin-panel/src/pages/Dashboard.tsx +++ b/frontend/admin-panel/src/pages/Dashboard.tsx @@ -65,11 +65,9 @@ export default function Dashboard() { return (
خلاصه عملیات و آمار فروشگاه
-خلاصهای از وضعیت فروشگاه کنینا
Only backend-reported values. Unknown is not healthy. Polling every 30 seconds.
Loading measurements…
} -Source: {endpoints[index]}
Observed at: {measurements[index]?.observedAt??'Unknown'}
{measurements[index]?.error&&Unknown — {measurements[index].error}
} - {index===0&&{typeof credit==='number'?credit.toLocaleString('fa-IR')+' پیامک':value(credit)}
} -{label}: Unknown — no measured endpoint
)}+ پایش آنلاین وضعیت اتصالات بانکی زیبال، سامانه پیامک ملیپیامک، وبسرویس پستی و دیتابیس +
+سرویس پرداخت و استرداد آنلاین
+ارسال پترن کد تایید و لاگ وضعیت سفارش
+استعلام آنلاین وضعیت بارنامه و مرسولات
+PostgreSQL / Redis Cache
+