From 448d1d14481ba42b5fbd8211ab231627c485e92a Mon Sep 17 00:00:00 2001 From: Eaven Kimura Date: Sat, 24 Oct 2026 06:51:57 +0000 Subject: [PATCH 1/4] Add Pelican Panel API key support: accept pacc_ (client) and papp_ (application) prefixes alongside Pterodactyl's ptlc_ and ptla_ --- README.md | 6 +++--- pterodisbot.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6988e6e..34b1ed7 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ Before installing the bot software, you need to create a Discord application and 1. Clone the repository: ```bash - git clone https://git.serendipity.systems/k.eaven/pterodactyl-discord-bot.git + git clone https://git.serendipity.systems/k.eaven/pterodisbot.git cd pterodactyl-discord-bot ``` @@ -194,7 +194,7 @@ Before installing the bot software, you need to create a Discord application and 1. Clone the repository: ```bash - git clone https://git.serendipity.systems/k.eaven/pterodactyl-discord-bot.git + git clone https://git.serendipity.systems/k.eaven/pterodisbot.git cd pterodactyl-discord-bot ``` @@ -249,7 +249,7 @@ Before installing the bot software, you need to create a Discord application and 1. Clone the repository: ```bash - git clone https://git.serendipity.systems/k.eaven/pterodactyl-discord-bot.git + git clone https://git.serendipity.systems/k.eaven/pterodisbot.git cd pterodactyl-discord-bot ``` diff --git a/pterodisbot.py b/pterodisbot.py index fe00b25..b16bb30 100644 --- a/pterodisbot.py +++ b/pterodisbot.py @@ -119,12 +119,12 @@ def validate_config(): # Validate API keys have correct prefixes client_key = config.get("Pterodactyl", "ClientAPIKey", fallback="") - if client_key and not client_key.startswith("ptlc_"): - errors.append("ClientAPIKey should start with 'ptlc_'") + if client_key and not (client_key.startswith("ptlc_") or client_key.startswith("pacc_")): + errors.append("ClientAPIKey should start with 'ptlc_' or 'pacc_'") app_key = config.get("Pterodactyl", "ApplicationAPIKey", fallback="") - if app_key and not app_key.startswith("ptla_"): - errors.append("ApplicationAPIKey should start with 'ptla_'") + if app_key and not (app_key.startswith("ptla_") or app_key.startswith("papp_")): + errors.append("ApplicationAPIKey should start with 'ptla_' or 'papp_'") # Validate PanelURL is a valid URL panel_url = config.get("Pterodactyl", "PanelURL", fallback="") From ec73053ac96c11baba54e49b97a5a1e96e816b02 Mon Sep 17 00:00:00 2001 From: Eaven Kimura Date: Sat, 24 Oct 2026 06:56:43 +0000 Subject: [PATCH 2/4] Update CI/CD to run a matrix of unit tests for compatible Python versions --- .gitea/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 882a25b..ef561ce 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -31,7 +31,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.12'] + python-version: ['3.11', '3.12', '3.13'] steps: - name: Checkout code From d830033b8f659035618d021d9ffec9fd1d30a885 Mon Sep 17 00:00:00 2001 From: Eaven Kimura Date: Sat, 24 Oct 2026 07:29:19 +0000 Subject: [PATCH 3/4] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34b1ed7..d4c601b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Pterodactyl Discord Bot +# Pterodisbot the Pterodactyl Discord Bot ![Pterodactyl X Discord](md_images/Pterodisbot_README_Header.png) From d891b21ffd844b68118569b31155b2ad9a48e357 Mon Sep 17 00:00:00 2001 From: Eaven Kimura Date: Sat, 24 Oct 2026 07:46:22 +0000 Subject: [PATCH 4/4] Resolve CI/CD branch conflicts --- .gitea/workflows/ci-cd.yml | 90 +++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index ef561ce..ca9170e 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -23,7 +23,7 @@ jobs: # ========================================== # TESTING STAGE # ========================================== - + unit-tests: name: Unit Tests (Python ${{ matrix.python-version }}) runs-on: ubuntu-latest @@ -32,7 +32,7 @@ jobs: fail-fast: false matrix: python-version: ['3.11', '3.12', '3.13'] - + steps: - name: Checkout code uses: actions/checkout@v3 @@ -46,24 +46,21 @@ jobs: git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedTime 999999 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Set up uv & Python ${{ matrix.python-version }} + uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - - - name: Cache pip dependencies - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt', 'requirements-test.txt') }} - restore-keys: | - ${{ runner.os }}-py${{ matrix.python-version }}-pip- + activate-environment: true + enable-cache: true + cache-dependency-glob: | + requirements.txt + requirements-test.txt - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools wheel - pip install -r requirements.txt - pip install -r requirements-test.txt + uv pip install --upgrade setuptools wheel + uv pip install -r requirements.txt + uv pip install -r requirements-test.txt - name: Create test configuration run: | @@ -81,7 +78,7 @@ jobs: - name: Run unit tests with coverage run: | - pytest test_pterodisbot.py \ + python -m pytest test_pterodisbot.py \ -v \ --tb=short \ --cov=pterodisbot \ @@ -104,7 +101,7 @@ jobs: name: Code Quality & Linting runs-on: ubuntu-latest if: ${{ !inputs.skip_tests }} - + steps: - name: Checkout code uses: actions/checkout@v3 @@ -118,15 +115,17 @@ jobs: git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedTime 999999 - - name: Set up Python - uses: actions/setup-python@v4 + - name: Set up uv & Python + uses: astral-sh/setup-uv@v5 with: python-version: '3.12' + activate-environment: true + enable-cache: true - name: Install linting tools run: | - python -m pip install --upgrade pip - pip install flake8 pylint black isort mypy + uv pip install --upgrade setuptools wheel + uv pip install flake8 pylint black isort mypy - name: Run flake8 run: | @@ -176,7 +175,7 @@ jobs: name: Security Scanning runs-on: ubuntu-latest if: ${{ !inputs.skip_tests }} - + steps: - name: Checkout code uses: actions/checkout@v3 @@ -190,15 +189,17 @@ jobs: git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedTime 999999 - - name: Set up Python - uses: actions/setup-python@v4 + - name: Set up uv & Python + uses: astral-sh/setup-uv@v5 with: python-version: '3.12' + activate-environment: true + enable-cache: true - name: Install security tools run: | - python -m pip install --upgrade pip - pip install bandit safety pip-audit + uv pip install --upgrade setuptools wheel + uv pip install bandit safety pip-audit - name: Run bandit security scan run: | @@ -211,7 +212,7 @@ jobs: - name: Run safety dependency check run: | - pip install -r requirements.txt + uv pip install -r requirements.txt safety check --json --output safety-report.json || true continue-on-error: true @@ -234,7 +235,7 @@ jobs: runs-on: ubuntu-latest needs: [unit-tests] if: ${{ !inputs.skip_tests }} - + steps: - name: Checkout code uses: actions/checkout@v3 @@ -248,22 +249,21 @@ jobs: git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedTime 999999 - - name: Set up Python - uses: actions/setup-python@v4 + - name: Set up uv & Python + uses: astral-sh/setup-uv@v5 with: python-version: '3.12' - - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-integration-${{ hashFiles('requirements.txt') }} + activate-environment: true + enable-cache: true + cache-dependency-glob: | + requirements.txt + requirements-test.txt - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-test.txt + uv pip install --upgrade setuptools wheel + uv pip install -r requirements.txt + uv pip install -r requirements-test.txt - name: Create test configuration run: | @@ -281,7 +281,7 @@ jobs: - name: Run integration tests run: | - pytest test_pterodisbot.py::TestIntegration \ + python -m pytest test_pterodisbot.py::TestIntegration \ -v \ --tb=short \ --timeout=60 @@ -289,7 +289,7 @@ jobs: # ========================================== # BUILD STAGE # ========================================== - + docker-build: name: Build Docker Image runs-on: ubuntu-latest @@ -298,7 +298,7 @@ jobs: always() && (needs.unit-tests.result == 'success' || inputs.skip_tests) && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') - + steps: - name: Checkout code uses: actions/checkout@v3 @@ -384,13 +384,13 @@ jobs: # ========================================== # REPORTING STAGE # ========================================== - + test-report: name: Generate Test Report runs-on: ubuntu-latest needs: [unit-tests, code-quality, security-scan, integration-tests] if: always() && !inputs.skip_tests - + steps: - name: Download all artifacts uses: actions/download-artifact@v3 @@ -419,7 +419,7 @@ jobs: runs-on: ubuntu-latest needs: [test-report, docker-build] if: always() - + steps: - name: Check pipeline status run: |