Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .cpanel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
deployment:
tasks:
- export DEPLOYPATH=/home/sfxglllk/algo.zengfy.top/
- /bin/cp -R . $DEPLOYPATH
Comment on lines +4 to +5

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== tracked deployment files =="
git ls-files | rg '(^\.cpanel\.yml$|\.github/workflows/deploy\.yml$|cpanel|deploy|README|package)' || true

echo
echo "== .cpanel.yml =="
if [ -f .cpanel.yml ]; then cat -n .cpanel.yml; else echo "missing"; fi

echo
echo "== workflow deploy.yml =="
if [ -f .github/workflows/deploy.yml ]; then cat -n .github/workflows/deploy.yml; else echo "missing"; fi

echo
echo "== relevant references to cPanel/workflows/dist =="
rg -n "DEPLOYPATH|algorithms|algo\.zengfy|server-dir|local-dir|dist|dist/|github\.cpanel|cpanel|deploy" . -g '!node_modules' -g '!dist' -g '!build' || true

echo
echo "== package/build config =="
for f in package.json .gitignore README.md; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    sed -n '1,220p' "$f"
  fi
done

Repository: diusazzad/algorithms_visualization

Length of output: 6361


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== build scripts summary =="
if [ -f package.json ]; then node - <<'JS'
const fs=require('fs');
const pkg=JSON.parse(fs.readFileSync('package.json','utf8'));
console.log(JSON.stringify({scripts: pkg.scripts, build: pkg.config?.build}, null, 2));
JS
fi

Repository: diusazzad/algorithms_visualization

Length of output: 321


Use one production artifact and one deployment owner.

Both deploy mechanisms target algo.zengfy.top/, but .cpanel.yml copies the repository root and the workflow syncs ./dist/. If both run, they can overwrite each other and leave stale files in production. Build/copy dist in .cpanel.yml if this hook is intended, or remove it and keep the workflow as the only publisher.

📍 Affects 2 files
  • .cpanel.yml#L4-L5 (this comment)
  • .github/workflows/deploy.yml#L27-L28
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.cpanel.yml around lines 4 - 5, The deployment configuration has two
publishers targeting the same production directory, with .cpanel.yml copying the
repository root while .github/workflows/deploy.yml syncs dist/. Make one
mechanism authoritative: preferably remove the root-copy commands from
.cpanel.yml and retain the workflow’s dist/ deployment; no direct change is
required in .github/workflows/deploy.yml.

33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to cPanel

on:
push:
branches:
- main

jobs:
deploy:
name: FTP Deploy
runs-on: ubuntu-latest
Comment on lines +3 to +11

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow files =="
git ls-files '.github/workflows/*' || true

echo
echo "== deploy.yml =="
if [ -f .github/workflows/deploy.yml ]; then
  nl -ba .github/workflows/deploy.yml | sed -n '1,160p'
else
  echo "missing .github/workflows/deploy.yml"
fi

echo
echo "== find concurrency declarations in workflows =="
rg -n "concurrency:|cancel-in-progress:" .github/workflows || true

echo
echo "== package scripts =="
if [ -f package.json ]; then
  node -e "const p=require('./package.json'); console.log(JSON.stringify({scripts:p.scripts, devDependencies:p.devDependencies, dependencies:p.dependencies}, null, 2))"
fi

Repository: diusazzad/algorithms_visualization

Length of output: 281


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== deploy.yml =="
awk '{printf "%6d\t%s\n", NR, $0}' .github/workflows/deploy.yml

echo
echo "== concurrency declarations in workflows =="
awk 'BEGIN{pat="concurrency:|cancel-in-progress:"} $0 ~ pat{printf "%6d\t%s\n", NR, $0}' .github/workflows/deploy.yml || true

echo
echo "== package scripts =="
if [ -f package.json ]; then
  node -e "const p=require('./package.json'); console.log(JSON.stringify({scripts:p.scripts, devDependencies:p.devDependencies, dependencies:p.dependencies}, null, 2))"
fi

Repository: diusazzad/algorithms_visualization

Length of output: 1737


Serialize production deployments.

GitHub Actions runs workflows concurrently by default, so multiple main pushes can start deploy jobs at the same time. FTP syncs can overwrite newer files with older output if an older run finishes after a newer run. Add a workflow/ref concurrency group and choose cancel-in-progress: false for FTP uploads.

Suggested fix
 on:
   push:
     branches:
       - main

+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: false
+
 jobs:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
on:
push:
branches:
- main
jobs:
deploy:
name: FTP Deploy
runs-on: ubuntu-latest
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
deploy:
name: FTP Deploy
runs-on: ubuntu-latest
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml around lines 3 - 11, Add workflow-level
concurrency for the production deployment workflow, using a stable
workflow/ref-based group and setting cancel-in-progress to false so queued
main-branch runs execute sequentially. Apply this near the existing on and jobs
configuration without changing the deploy job behavior.

Source: MCP tools

steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4

- name: 🔨 Install dependencies and build
run: |
npm install
npm run build

- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
server-dir: algo.zengfy.top/
local-dir: ./dist/
Comment on lines +21 to +28

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow excerpt =="
if [ -f .github/workflows/deploy.yml ]; then
  nl -ba .github/workflows/deploy.yml | sed -n '1,80p'
else
  echo "missing .github/workflows/deploy.yml"
fi

echo
echo "== repository action checkout/config references =="
rg -n "SamKirkland/FTP-Deploy-Action|protocol:|ftp(s)?|FTP_USERNAME|FTP_PASSWORD|secrets\.FTP" .github/workflows . 2>/dev/null | head -200

echo
echo "== fetch v4.3.5 action metadata/readme protocol defaults =="
python3 - <<'PY'
import urllib.request
urls = [
    "https://raw.githubusercontent.com/SamKirkland/FTP-Deploy-Action/v4.3.5/action.yml",
    "https://raw.githubusercontent.com/SamKirkland/FTP-Deploy-Action/v4.3.5/README.md",
]
for url in urls:
    print(f"\n-- {url} --")
    try:
        data = urllib.request.urlopen(url, timeout=20).read().decode("utf-8", "replace")
        lines = data.splitlines()
        for i, line in enumerate(lines[:260], 1):
            if "protocol" in line.lower() or "default:" in line.lower() or "FTP_PASSWORD" in line or "FTP_USERNAME" in line:
                print(f"{i}: {line}")
    except Exception as e:
        print(f"ERROR: {e}")
PY

Repository: diusazzad/algorithms_visualization

Length of output: 235


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow excerpt =="
if [ -f .github/workflows/deploy.yml ]; then
  awk '{printf "%6d\t%s\n", NR, $0}' .github/workflows/deploy.yml | sed -n '1,80p'
else
  echo "missing .github/workflows/deploy.yml"
fi

echo
echo "== repository action checkout/config references =="
grep -RIn --exclude-dir=.git --exclude-dir=node_modules \
  -e 'SamKirkland/FTP-Deploy-Action' \
  -e 'protocol:' \
  -e 'ftp[s]?' \
  -e 'FTP_USERNAME' \
  -e 'FTP_PASSWORD' \
  -e 'secrets\.FTP' \
  . 2>/dev/null | head -200 || true

echo
echo "== fetch v4.3.5 action metadata/readme protocol defaults =="
python3 - <<'PY'
import urllib.request
urls = [
    "https://raw.githubusercontent.com/SamKirkland/FTP-Deploy-Action/v4.3.5/action.yml",
    "https://raw.githubusercontent.com/SamKirkland/FTP-Deploy-Action/v4.3.5/README.md",
]
for url in urls:
    print(f"\n-- {url} --")
    try:
        data = urllib.request.urlopen(url, timeout=20).read().decode("utf-8", "replace")
        lines = data.splitlines()
        for i, line in enumerate(lines[:260], 1):
            if "protocol" in line.lower() or "default:" in line.lower() or "FTP_PASSWORD" in line or "FTP_USERNAME" in line:
                print(f"{i}: {line}")
    except Exception as e:
        print(f"ERROR: {e}")
PY

Repository: diusazzad/algorithms_visualization

Length of output: 2070


🌐 Web query:

SamKirkland FTP-Deploy-Action v4.3.5 protocol default ftp ftps README

💡 Result:

For the SamKirkland FTP-Deploy-Action GitHub action (including version 4.3.5), the default protocol is ftp [1][2]. According to the official project documentation [1][3], the protocol input accepts the following options: - ftp: Provides no encryption [1][2]. - ftps: Full encryption using the newest standard (also known as "explicit" FTPS) [1][2]. - ftps-legacy: Full encryption using the legacy standard (also known as "implicit" FTPS) [1][2]. If you do not specify a protocol in your GitHub Actions workflow configuration, the action defaults to using ftp [1][3].

Citations:


Sensitive Data Exposure (CWE-319): Cleartext Transmission of Sensitive Information

Reachability: External

Use FTPS for the credentialed upload.

This workflow passes FTP_USERNAME and FTP_PASSWORD to SamKirkland/FTP-Deploy-Action, but does not set protocol, so it uses unencrypted ftp. Set protocol: ftps and verify the cPanel FTPS port.

Suggested fix
           password: ${{ secrets.FTP_PASSWORD }}
+          protocol: ftps
           server-dir: algo.zengfy.top/
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
server-dir: algo.zengfy.top/
local-dir: ./dist/
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
protocol: ftps
server-dir: algo.zengfy.top/
local-dir: ./dist/
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml around lines 21 - 28, Update the “📂 Sync
files” FTP-Deploy-Action configuration to set protocol to ftps for the
credentialed upload, and configure or verify its port against the cPanel FTPS
port while preserving the existing server, credentials, directories, and action
version.

Source: MCP tools

exclude: |
**/.git*
**/.git*/**
**/node_modules/**
**/tests/**
44 changes: 44 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"lucide-react": "^1.28.0",
"prop-types": "^15.8.1",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"react-router-dom": "^7.18.2",
Expand Down
Loading