Skip to content

remove Qodana, disable XML-RPC#39

Merged
mambax7 merged 3 commits into
XOOPS:masterfrom
mambax7:master
May 3, 2026
Merged

remove Qodana, disable XML-RPC#39
mambax7 merged 3 commits into
XOOPS:masterfrom
mambax7:master

Conversation

@mambax7
Copy link
Copy Markdown
Contributor

@mambax7 mambax7 commented May 3, 2026

Summary by CodeRabbit

  • Security

    • XML-RPC endpoint now includes a security check requiring explicit enablement in configuration. When disabled, the endpoint returns HTTP 403 Forbidden. Configuration documentation added for enabling XML-RPC support.
  • Chores

    • Removed Qodana code quality automation workflow and configuration.

Copilot AI review requested due to automatic review settings May 3, 2026 16:50
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Warning

Rate limit exceeded

@mambax7 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 44 minutes and 26 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 10dd5c85-75b3-4116-84f5-18892f253933

📥 Commits

Reviewing files that changed from the base of the PR and between 8041425 and 7fea058.

📒 Files selected for processing (2)
  • htdocs/xmlrpc.php
  • htdocs/xoops_data/configs/xoopsconfig.dist.php

Walkthrough

The PR removes the Qodana static analysis CI workflow and configuration while simultaneously adding a security gate to the XML-RPC endpoint that requires an explicit configuration flag to enable it. The endpoint remains disabled by default.

Changes

Qodana CI Removal

Layer / File(s) Summary
CI Workflow
.github/workflows/qodana.yml
GitHub Actions workflow for Qodana code quality checks on pull requests and pushes to master is removed entirely.
Linting Configuration
qodana.yaml
Qodana configuration specifying PHP 8.2 linter, recommended profile, and exclusion paths is removed.

XML-RPC Security Gate

Layer / File(s) Summary
Configuration
htdocs/xoops_data/configs/xoopsconfig.dist.php
New commented documentation and configuration line 'xmlrpc_enabled' => true, are added; feature remains disabled by default.
Endpoint Authorization
htdocs/xmlrpc.php
Early-return security check added (lines 22–33): if $xoopsConfig['xmlrpc_enabled'] is empty, endpoint returns HTTP 403 with plaintext error message and exits before any XML-RPC processing occurs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: removing the Qodana workflow/configuration and disabling XML-RPC by default through configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 44 minutes and 26 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.12%. Comparing base (9c78ad2) to head (7fea058).
⚠️ Report is 31 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #39      +/-   ##
============================================
- Coverage     19.23%   18.12%   -1.11%     
- Complexity     7584     7840     +256     
============================================
  Files           621      665      +44     
  Lines         40085    42897    +2812     
============================================
+ Hits           7709     7774      +65     
- Misses        32376    35123    +2747     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes Qodana-related configuration from the repository and makes the legacy XML-RPC endpoint opt-in (disabled by default) via a new xoopsconfig.php flag, improving the default security posture.

Changes:

  • Removed Qodana configuration (qodana.yaml) and the GitHub Actions Qodana workflow.
  • Documented a new xmlrpc_enabled config flag in the default xoopsconfig.dist.php template.
  • Added a guard in htdocs/xmlrpc.php to return HTTP 403 unless xmlrpc_enabled is explicitly enabled.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
qodana.yaml Removes repository-level Qodana linter configuration.
.github/workflows/qodana.yml Removes the Qodana GitHub Actions workflow job.
htdocs/xoops_data/configs/xoopsconfig.dist.php Documents the new opt-in xmlrpc_enabled setting in the distributed config template.
htdocs/xmlrpc.php Blocks XML-RPC requests unless enabled via config.

*
* To enable, uncomment this line in XOOPS_VAR_PATH . '/configs/xoopsconfig.php':
*/
// 'xmlrpc_enabled' => true,
Comment thread htdocs/xmlrpc.php Outdated
Comment on lines +29 to +31
header('HTTP/1.1 403 Forbidden');
header('Content-type: text/plain');
exit('XML-RPC is disabled. To enable it, set \'xmlrpc_enabled\' => true in your xoopsconfig.php');
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@htdocs/xmlrpc.php`:
- Around line 20-32: The PHP gate that checks $xoopsConfig['xmlrpc_enabled']
runs after including mainfile.php (causing full bootstrap); to prevent expensive
work for disabled endpoints move the gate to the very top of xmlrpc.php before
the include __DIR__ . '/mainfile.php' and implement a lightweight check (either
read XOOPS_VAR_PATH/configs/xoopsconfig.php with a simple `@include` to inspect
the 'xmlrpc_enabled' value or consult an environment variable/flag file) and
exit with the same 403 headers if disabled; keep the existing $xoopsConfig-based
check as a fallback after mainfile.php for defense-in-depth and preserve the
same header/exit behavior.
- Around line 29-30: Replace the raw status header and plain content-type
header: remove the manual header('HTTP/1.1 403 Forbidden') and instead call
http_response_code(403), and change header('Content-type: text/plain') to
include a charset (e.g., header('Content-Type: text/plain; charset=utf-8')) so
SAPI differences are handled and the response declares its encoding; update the
code around the existing header('HTTP/1.1 403 Forbidden') and
header('Content-type: text/plain') occurrences accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c18c45a7-d3a4-4534-b913-e9f7724e69cb

📥 Commits

Reviewing files that changed from the base of the PR and between d4bd6fb and 8041425.

📒 Files selected for processing (4)
  • .github/workflows/qodana.yml
  • htdocs/xmlrpc.php
  • htdocs/xoops_data/configs/xoopsconfig.dist.php
  • qodana.yaml
💤 Files with no reviewable changes (2)
  • qodana.yaml
  • .github/workflows/qodana.yml

Comment thread htdocs/xmlrpc.php
Comment on lines 20 to +32
include __DIR__ . '/mainfile.php';

/**
* XML-RPC is disabled by default for security.
*
* To enable it, add the following to XOOPS_VAR_PATH/configs/xoopsconfig.php:
* 'xmlrpc_enabled' => true,
*/
if (empty($xoopsConfig['xmlrpc_enabled'])) {
header('HTTP/1.1 403 Forbidden');
header('Content-type: text/plain');
exit('XML-RPC is disabled. To enable it, set \'xmlrpc_enabled\' => true in your xoopsconfig.php');
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Gate fires after full XOOPS bootstrap — consider web-server-level blocking for hostile traffic.

The security check (line 28) executes only after mainfile.php completes, which includes database queries, session setup, and config loading. A flood of requests to this endpoint — even when disabled — will incur the full bootstrap cost per request.

If xmlrpc.php remains disabled in production, consider blocking it entirely at the web server layer (e.g., an <Files xmlrpc.php> deny rule in Apache or an location = /xmlrpc.php { deny all; } block in nginx). The PHP gate is a sound defence-in-depth fallback, but the web server rule eliminates bootstrap overhead entirely.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@htdocs/xmlrpc.php` around lines 20 - 32, The PHP gate that checks
$xoopsConfig['xmlrpc_enabled'] runs after including mainfile.php (causing full
bootstrap); to prevent expensive work for disabled endpoints move the gate to
the very top of xmlrpc.php before the include __DIR__ . '/mainfile.php' and
implement a lightweight check (either read
XOOPS_VAR_PATH/configs/xoopsconfig.php with a simple `@include` to inspect the
'xmlrpc_enabled' value or consult an environment variable/flag file) and exit
with the same 403 headers if disabled; keep the existing $xoopsConfig-based
check as a fallback after mainfile.php for defense-in-depth and preserve the
same header/exit behavior.

Comment thread htdocs/xmlrpc.php Outdated
  use http_response_code, declare charset, clarify config path" -m "Address PR XOOPS#39 review feedback:`n- Replace raw 'HTTP/1.1
  403 Forbidden' header with http_response_code(403) for SAPI portability (module/CGI/FPM)`n- Add charset=UTF-8 to Content-Type`n- Point disabled-message
  to XOOPS_VAR_PATH/configs/xoopsconfig.php for unambiguous remediation`n- Align xmlrpc_enabled comment style with surrounding entries (no space after //)
   in xoopsconfig.dist.php
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@mambax7 mambax7 merged commit 80d9a80 into XOOPS:master May 3, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants