Skip to content

fix: production-readiness overhaul — boot fix, security hardening, CI, /wipe rewrite - #28

Merged
DysektAI merged 16 commits into
mainfrom
fix/production-readiness-overhaul
Jul 8, 2026
Merged

fix: production-readiness overhaul — boot fix, security hardening, CI, /wipe rewrite#28
DysektAI merged 16 commits into
mainfrom
fix/production-readiness-overhaul

Conversation

@DysektAI

@DysektAI DysektAI commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

A full production-readiness review found that main was not bootable (PR #27 introduced syntax errors), had no CI (deployment was deleted in a "styles" refactor), and had an unauthenticated, unrate-limited GitHub-issue-creation endpoint with a token-leak path in error logs. This PR fixes all of it, organized so each concern is independently reviewable.

Note on deployment: Niv moved the bot to Coolify, which auto-deploys on push to main. The deploy-prod.yml, deploy-prod.sh, and ecosystem.config.cjs files that were restored in earlier commits have since been removed — Coolify makes them unnecessary.

Commit breakdown

Commit Area What
36877e6 Hotfix Revert PR #27 — broken /wipe prevented bot startup
c0811c9 CI Add ci.yml: node --check on all JS + npm ci + tests on every PR/push to main
9363f40 Security Harden webserver (see below)
41ca926 Crash resilience DM crash fix, error boundary (deployment files in this commit were later removed)
0da4702 Feature /wipe done right — proper module, confirmation, batched deletion
c6d72be Polish Code consistency, metadata, tests, docs
1145e14 + 79b7947 Review fixes Address CR/CA feedback: origin exact-match, deferred-reply recovery, timeouts, split rate limiters, test cleanup, CI hardening
075763f02c9251 Cleanup Remove deploy-prod.yml, deploy-prod.sh, ecosystem.config.cjs (superseded by Coolify)

Critical fixes

  • Bot won't boot — PR feat: add wipe command #27 deleted the ]; array terminator in registerSlashCommands.js and added an invalid wipeCommand.js (bare async execute() with no export). Reverted; /wipe re-added cleanly.
  • No CI — this is why PR feat: add wipe command #27 merged broken. Added ci.yml with node --check on every JS file + npm test. This would have caught the SyntaxError before merge.

Security hardening (webserver)

  • Rate limitingexpress-rate-limit (5 req/min/IP) on POST /issue and POST /data with separate limiter instances so each endpoint has an independent quota; trust proxy configured for reverse-proxy environments
  • Token leak fix — error logging was console.error(err.response?.data || err); the full axios error object contains err.config.headers.Authorization (the raw GitHub token). Now logs only status + message
  • Honeypot field — hidden company field in both forms; bots fill it, real users don't; hits are silently dropped
  • Origin allowlist — optional ALLOWED_ORIGINS env var; uses exact match (or origin + "/" path prefix) — blocks https://tarkovtracker.org.evil.com-style bypasses
  • Length caps — title 200, description 8KB, etc. to prevent oversized submissions
  • Env validationGITHUB_TOKEN, REPO_DEV, REPO_DATA_REPORT validated at startup (fail fast instead of silent 500s)
  • GitHub API timeouttimeout: 10_000 on both axios.post calls
  • Fixed data-repo defaulttarkov-data-overlay (hyphenated, verified via GitHub API)

Crash resilience

  • DM slash-command crashinteraction.member is null in DMs → TypeError → unhandled rejection → Node process exit. Added inGuild() guard + try/catch error boundary in interactionHandler.js.
  • Error boundary — any handler throw is now caught, logged, and replied to with a generic ephemeral error. Deferred interactions use editReply() correctly.

/wipe rewrite

The original was an invalid module with no handler wiring. The new version:

  • Proper exported executeWipe function, wired into slashHandlers.js
  • Admin check via ADMIN_IDS env var (guarded against unset/empty)
  • Confirmation dialog with Confirm + Cancel buttons (ButtonBuilder, awaitMessageComponent)
  • Batched deletion: loops fetch(100) + bulkDelete(fetched, true) until empty or cap reached; filterOld=true skips >14-day messages instead of throwing
  • Honest description: "Bulk-delete recent messages (14-day Discord API limit)"
  • Uses MessageFlags.Ephemeral (named constant, not deprecated ephemeral: true)

Deployment

Coolify handles deployment automatically — it deploys on every push to main. The SSH-based deploy workflow and PM2 config files that were added earlier in this branch have been removed as they are no longer needed.

Polish

  • Removed unused PermissionFlagsBits import from slashHandlers.js
  • Standardized flags: 64MessageFlags.Ephemeral across all handlers
  • Translated French comments to English in slashHandlers.js
  • allowedCommandRoles now env-configurable via ALLOWED_COMMAND_ROLE_IDS
  • Filled in package.json metadata (description, keywords, author, engines)
  • Added smoke tests for env.js validation (4 tests, passing)
  • Fixed update-license-year.yml sed regex to handle year ranges (2025-2026)
  • README: added /wipe to command table, markdown H1, labeled code fence, updated env var docs

Still needs Niv's sign-off

  • GITHUB_TOKEN scope — recommend downscoping to a fine-grained PAT with issues:write on the two target repos only
  • REPO_DEV value — verify the production env var points to the correct repo in Coolify
  • ALLOWED_ORIGINS — set to the production domain(s) in Coolify env
  • Stale global /wipe — if PR feat: add wipe command #27 ever registered /wipe globally, it may need manual unregistering. New code re-registers correctly on next boot.

Test plan

  • All JS files pass node --check
  • 4/4 tests pass (node --test)
  • webserver.js env validation tested (fails fast on missing vars)
  • discord.js v14.26.4 API usage verified (awaitMessageComponent on InteractionResponse, MessageFlags.Ephemeral === 64)
  • CI workflow passes on this PR
  • Niv verifies REPO_DEV and ALLOWED_ORIGINS env values in Coolify
  • Smoke test after Coolify deploys: bot logs in, webserver responds on /health, /issue and /data forms work

DysektAI added 6 commits July 8, 2026 00:49
This reverts commit 6229e42, reversing
changes made to 2430d64.
Reverts PR #27 (broken /wipe command that prevented bot startup) and adds a
minimal CI workflow that runs `node --check` on every JS file plus `npm ci`
on all pushes to main and on pull requests. This would have caught the
SyntaxError introduced in PR #27 before merge.
- Add express-rate-limit (5 req/min/IP) on POST /issue and POST /data
- Set trust proxy so rate limiting keys on real client IPs behind a reverse proxy
- Add per-field length caps (title 200, description 8KB, etc.)
- Add hidden honeypot field ("company") to both report forms; silently drop hits
- Add optional ALLOWED_ORIGINS allowlist for origin/referer checking
- Validate GITHUB_TOKEN, REPO_DEV, REPO_DATA_REPORT at startup (fail fast)
- Fix DATA_REPO default: tarkov-data-overlay (hyphenated), not tarkov-data/overlay
- Remove undocumented GITHUB_REPO fallback
- Sanitize error logging: log only status + message, never the full axios error
  object (which contains the raw Authorization header with the GitHub token)
- Fix .env.example: typo (YOUR_DICORD_TOKEN), remove unused GUILD_ID/SUPPORT_CHANNEL,
  add ADMIN_IDS and ALLOWED_ORIGINS, add comments and grouping
Deployment (restored from 5e84a83, rewritten for main branch):
- New ecosystem.config.cjs with TWO separate PM2 apps (bot.js, webserver.js)
  instead of the old single "npm start" app — this fixes the production
  dependency on concurrently (devDependency) that broke npm start under
  npm ci --omit=dev
- New deploy-prod.sh targeting main (not the deleted prod branch) with
  npm ci --omit=dev for production installs
- New deploy-prod.yml triggered on push to main + workflow_dispatch, with a
  concurrency group to prevent overlapping deploys; uses ubuntu-latest + SSH
  (safer than self-hosted runner for a public repo)

Crash resilience:
- Add try/catch error boundary in interactionHandler.js: unhandled rejections
  no longer crash the process (Node default is process exit); user gets a
  generic ephemeral error reply
- Add inGuild() guard: slash commands and buttons require a guild context;
  interaction.member is null in DMs and would throw TypeError. A stranger
  DM-ing /faq1 could previously crash the bot

Cleanup:
- Import REST from discord.js instead of @discordjs/rest (was an undeclared
  transitive dependency)
- Remove unused multer dependency
Replaces the broken /wipe from PR #27 (which was an invalid module with no
handler wiring) with a proper implementation:

- Valid exported module (executeWipe), wired into slashHandlers.js
- Admin check via ADMIN_IDS env var (guarded against unset/empty values)
- Confirmation dialog with Confirm + Cancel buttons using ButtonBuilder
- Uses awaitMessageComponent on the reply (one-shot, no cross-file state)
- Batched deletion: loops fetch(100) + bulkDelete(fetched, true) until empty
  or MAX_DELETE_BATCHES reached; filterOld=true skips >14-day messages
  instead of throwing
- Honest description: "Bulk-delete recent messages (14-day limit)"
- Uses MessageFlags.Ephemeral (named constant, not deprecated ephemeral:true)
- Channel type guard (GuildText only)
- Timeout and error handling with sanitized editReply fallbacks
Code consistency:
- Standardize ephemeral flags: replace flags: 64 with MessageFlags.Ephemeral
  across slashHandlers.js and buttonHandlers.js for readability
- Translate French comments to English in slashHandlers.js (put-member-role)
- Make allowedCommandRoles env-configurable via ALLOWED_COMMAND_ROLE_IDS
  (falls back to the existing hardcoded role ID)
- Document the in-memory welcomeMessages Map limitation in memberHandlers.js

Metadata:
- Fill in package.json description, keywords, author, engines (node >=18)
- Change npm test from no-op to "node --test"

Tests:
- Add test/env.test.js: smoke tests for env.js validation (getRequiredEnv,
  ensureEnvVars pass/fail cases). 4 tests, all passing.
- Add "Run tests" step to ci.yml so tests run on PRs and pushes

Docs:
- README: add /wipe to command table, add markdown H1 above the HTML banner,
  label the project-structure code fence as text, update env var list to
  include ADMIN_IDS and ALLOWED_ORIGINS, recommend fine-grained PAT

CI:
- Fix update-license-year.yml sed regex to handle year ranges (2025-2026)
  in addition to single years
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds CI and package metadata updates, reworks /wipe with confirmation and bounded deletion, updates interaction and ephemeral reply handling, hardens web issue submission and forms, and refreshes environment and README configuration docs.

Changes

CI and Package Infrastructure

Layer / File(s) Summary
CI workflow and license-year update
.github/workflows/ci.yml, .github/workflows/update-license-year.yml
Adds the CI workflow and updates the LICENSE year replacement step to handle single years and year ranges.
Package metadata and runtime dependencies
package.json
Updates the test script, package metadata, Node engine constraint, dependency set, overrides, and devDependencies.

Wipe Command and Environment Configuration

Layer / File(s) Summary
Environment variables and role resolution
.env.example, src/config/constants.js, src/config/env.js, src/handlers/memberHandlers.js
Reorganizes environment examples, adds ADMIN_ROLE_ID, derives role sets from environment variables, and updates the welcome-message map comments.
Wipe command execution
src/commands/wipeCommand.js, src/commands/registerSlashCommands.js, src/interactions/slashHandlers.js, test/env.test.js, README.md
Adds the admin-gated confirm/cancel wipe flow, command registration/routing, env validation tests, and matching README command/config updates.

Interaction Routing and Ephemeral Replies

Layer / File(s) Summary
Interaction guard and recovery
src/handlers/interactionHandler.js
Adds guild-only guarding, interaction error recovery, and early routing returns.
Button reply flags
src/interactions/buttonHandlers.js
Switches ticket and reaction-role replies to MessageFlags.Ephemeral.
Slash reply flags
src/interactions/slashHandlers.js
Switches command replies and deferred responses to MessageFlags.Ephemeral and updates related comments.

Webserver Security Hardening

Layer / File(s) Summary
Request filtering and issue submission
webserver.js
Adds rate limiting, origin checks, honeypot detection, request sanitization, and sanitized GitHub error logging for both issue routes.
Hidden form fields
web/data/index.html, web/issue/index.html
Adds hidden company honeypot inputs to the data and issue forms.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers: Nivmizz7

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: boot fix, security hardening, CI, and the /wipe rewrite.
Description check ✅ Passed The description is directly related to the code changes and explains the production-readiness fixes in detail.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/production-readiness-overhaul

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

@socket-security

socket-security Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedexpress-rate-limit@​8.5.210010010090100

View full report

@codeant-ai codeant-ai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Jul 8, 2026
Comment thread webserver.js Outdated
Comment thread src/commands/wipeCommand.js
Comment thread src/handlers/interactionHandler.js Outdated
@DysektAI DysektAI self-assigned this Jul 8, 2026
@DysektAI
DysektAI requested a review from Nivmizz7 July 8, 2026 05:07
coderabbitai[bot]

This comment was marked as resolved.

@DysektAI DysektAI added bug Something isn't working enhancement New feature or request labels Jul 8, 2026
@DysektAI DysektAI linked an issue Jul 8, 2026 that may be closed by this pull request
DysektAI added 2 commits July 8, 2026 01:53
Addresses CodeRabbit and CodeAnt review comments on PR #28:

Security:
- webserver: fix origin allowlist bypass — was using startsWith (prefix
  match) which let https://tarkovtracker.org.evil.com through; now uses
  exact match + trailing-slash boundary. Also normalizes trailing slashes
  on allowlist entries at config time. (CR11/CA3)
- webserver: split rate limiter into separate dataLimiter and issueLimiter
  instances so /data and /issue have independent per-IP quotas. (CR12)
- webserver: add 10s timeout to both GitHub API axios.post calls to
  prevent indefinite hangs. (CR13)

Correctness:
- interactionHandler: handle deferred interactions in error recovery —
  was calling interaction.reply() after deferReply() which throws
  InteractionAlreadyReplied; now branches on interaction.deferred to use
  editReply() instead. No flags on editReply (ephemerality is fixed at
  defer time). (CR10/CA2)
- wipeCommand: report partial wipes when MAX_DELETE_BATCHES cap is hit,
  instead of always saying "Channel Wiped". (CR8)
- wipeCommand: remove overly broad err.message.includes("time") fallback
  in timeout check — rely only on err.code === "InteractionCollectorError"
  as verified empirically on discord.js 14.26.4. (CR9)

Config:
- ecosystem.config.cjs: set NODE_ENV=production on both PM2 apps so
  Express runs in production mode (no stack traces in error responses).
  (CR5)

Tests:
- test/env.test.js: add afterEach cleanup to delete all env vars set
  during tests, preventing state leakage. (CR14)

Docs:
- README: document comma-separated format for ADMIN_IDS and ALLOWED_ORIGINS,
  note ALLOWED_ORIGINS uses exact match. (CR6)
- README: /wipe description now says "Confirmed bulk-delete" to indicate
  the confirmation step. (CR7)
- ci.yml: add concurrency group to cancel superseded runs on rapid pushes
  and PRs (mirrors the pattern in deploy-prod.yml). (CR1)
- ci.yml: add persist-credentials: false to actions/checkout to prevent
  git credential persistence before npm ci runs third-party postinstall
  scripts. SHA pinning of actions deferred to a future PR with
  Dependabot/Renovate setup. (CR2)
- deploy-prod.yml: move SSH secrets out of inline shell interpolation into
  env: blocks, reducing template-injection risk (flagged by zizmor).
  Multi-line SSH key is double-quoted to preserve newlines. (CR3)
@DysektAI

DysektAI commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Review feedback addressed — commits 1145e14 + 79b7947

All review comments have been resolved. Here's the per-comment status:

Fixed (13 comments)

Comment Reviewer Resolution
Origin allowlist bypassable (CR11/CA3) CodeRabbit + CodeAnt Fixed: exact match + trailing-slash boundary, with trailing-slash normalization on allowlist entries at config time. Blocks https://tarkovtracker.org.evil.com.
Deferred interaction error recovery (CR10/CA2) CodeRabbit + CodeAnt Fixed: catch block now branches on interaction.deferred → uses editReply() (no flags, since ephemerality is fixed at defer time).
No timeout on GitHub API calls (CR13) CodeRabbit Fixed: timeout: 10_000 on both axios.post calls.
Shared rate limiter (CR12) CodeRabbit Fixed: split into dataLimiter + issueLimiter with independent per-IP quotas.
Partial wipe not reported (CR8) CodeRabbit Fixed: hitCap flag appended to success message when MAX_DELETE_BATCHES is reached.
Timeout check too broad (CR9) CodeRabbit Fixed: removed err.message?.includes("time") fallback; relies only on err.code === "InteractionCollectorError".
NODE_ENV not set (CR5) CodeRabbit Fixed: env: { NODE_ENV: "production" } on both PM2 apps.
Test env var cleanup (CR14) CodeRabbit Fixed: afterEach hook deletes all env vars set during tests.
README env var format (CR6) CodeRabbit Fixed: documented comma-separated format for ADMIN_IDS and ALLOWED_ORIGINS (exact match).
README /wipe confirmation (CR7) CodeRabbit Fixed: "Confirmed bulk-delete" in command table.
CI concurrency (CR1) CodeRabbit Fixed: added concurrency block with cancel-in-progress: true.
Checkout persist-credentials (CR2) CodeRabbit Fixed: persist-credentials: false on checkout step.
Deploy secrets via env (CR3) CodeRabbit Fixed: all SSH secrets moved to env: blocks; multi-line key double-quoted.

Deferred (2 comments — not blocking this PR)

Comment Reason
SHA pinning of actions (CR2 partial) Needs Dependabot/Renovate setup to keep SHAs updated. Stale SHA pins are worse than moving tags for a single-maintainer repo. Will address in a separate PR with the tooling.
Deploy atomicity / symlink release (CR4) Needs server-side testing and Niv's involvement. Current set -e + PM2 autorestart is adequate at this scale. Future PR.

False positive (1 comment — no change needed)

Comment Reason
awaitMessageComponent on interaction.reply() return value (CA1) Verified empirically on discord.js 14.26.4: interaction.reply() returns an InteractionResponse by default (not void), and InteractionResponse.prototype.awaitMessageComponent is a function. Adding withResponse: true would actually break the code (returns InteractionCallbackResponse, which lacks awaitMessageComponent). The current code is the idiomatic v14 pattern.

All CI checks, syntax checks, and tests pass on the updated branch.

Comment thread src/interactions/slashHandlers.js Fixed
@Nivmizz7

Nivmizz7 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Removing deploy-prod because there is already Coolify who auto deploy it when there is a commit on main

@DysektAI DysektAI changed the title fix: production-readiness overhaul — boot fix, security hardening, restored CI/CD, /wipe rewrite fix: production-readiness overhaul — boot fix, security hardening, CI, /wipe rewrite Jul 8, 2026
Flagged by github-code-quality reviewer. PermissionFlagsBits was
imported but never referenced in slashHandlers.js.
@DysektAI

DysektAI commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Post-review fixup (commit e31a9a5)

Fixed:

  • Removed unused PermissionFlagsBits import from src/interactions/slashHandlers.js (flagged by github-code-quality)

False positive addressed:

  • CodeAnt flagged awaitMessageComponent on the reply object as an API mismatch. This is not an issue in discord.js v14.26.4 — interaction.reply() returns an InteractionResponse which has awaitMessageComponent built-in as a first-class method (verified in node_modules/discord.js/src/structures/InteractionResponse.js). No change needed.

PR description updated:

  • Removed references to SSH/PM2 deployment pipeline (Coolify now handles all deploys on push to main — Niv removed those files)
  • Updated commit breakdown and test plan to reflect current state

@coderabbitai
coderabbitai Bot requested a review from Nivmizz7 July 8, 2026 06:48
@DysektAI

DysektAI commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Final production-readiness check — PR #28

@Nivmizz7 — final pass complete. Everything previously flagged is now fixed, verified, or resolved:

Verified fixed (threads resolved):

  • Origin allowlist bypass (webserver.js) — now exact match + / boundary; suffix attacks like https://tarkovtracker.org.evil.com are blocked. ✅
  • Deferred-interaction error fallback (src/handlers/interactionHandler.js) — branches on interaction.deferred and uses editReply. ✅
  • /wipe awaitMessageComponent claim — verified false positive: on discord.js 14.26.4, InteractionResponse.prototype.awaitMessageComponent exists and is the documented v14 pattern. ✅
  • deploy-prod.sh rollback concern — moot; file removed since Coolify auto-deploys from main. ✅
  • README /wipe wording — already updated to mention the confirmation step. ✅

Small fixup pushed (9c5526d): removed unused GUILD_ID from .env.example/README (commands are registered globally, nothing reads it) and documented the optional ALLOWED_COMMAND_ROLE_IDS override.

Checks: CI, CodeQL, CodeRabbit, Socket, and both Snyk checks are all green; tests pass locally (4/4).

Three things I'd like you to confirm before merge:

  1. Coolify process setupnpm start runs both the bot and the web server via concurrently. Is Coolify configured to run npm start (one service running both), or are bot/web split into two services? Since the PM2 config was removed, restart-on-crash now depends entirely on Coolify's restart policy — is that enabled?
  2. Coolify env vars — before merging, please make sure production has all required vars set: DISCORD_TOKEN, ADMIN_IDS, GITHUB_TOKEN, REPO_DEV, REPO_DATA_REPORT, BUG_REPORT_CHANNEL_ID, TICKET_CHANNEL_ID, WELCOME_CHANNEL_ID, PANEL_ADMIN_ROLE_ID, AUTO_ROLE_ID_1..4, and importantly a non-empty ALLOWED_ORIGINS (blank disables the origin check). GUILD_ID can be deleted.
  3. Hardcoded default role IDsrc/config/constants.js falls back to role ID 1433391726051197020 when ALLOWED_COMMAND_ROLE_IDS is unset. Is that the correct production role, or would you prefer it required via env?

The stale CodeRabbit "changes requested" review may still show on the PR — all its comments are addressed and its status check is green, so a dismissal or re-review should clear it if branch protection counts it.


Disclaimer: this review and comment were made with the help of Claude Fable 5.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

48-53: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Clarify ALLOWED_ORIGINS matching semantics.

The webserver does not use exact-match-only checking here; it trims trailing slashes and also accepts the configured origin with a /-bounded path. Please update the README wording so admins configure this correctly.

Suggested wording
-- **Web server:** `PORT`, `ALLOWED_ORIGINS` (comma-separated origins, exact match)
+- **Web server:** `PORT`, `ALLOWED_ORIGINS` (comma-separated URL prefixes; trailing slashes are ignored)
🤖 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 `@README.md` around lines 48 - 53, The README description for ALLOWED_ORIGINS
is inaccurate because the web server does not enforce exact-match-only origin
checks. Update the wording in the configuration section to reflect the actual
matching behavior: origins are normalized by trimming trailing slashes and may
also match the configured origin with a path segment bounded by “/”. Refer to
the ALLOWED_ORIGINS entry in the Web server settings so admins know how to
format allowed origins correctly.
🤖 Prompt for all review comments with 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.

Outside diff comments:
In `@README.md`:
- Around line 48-53: The README description for ALLOWED_ORIGINS is inaccurate
because the web server does not enforce exact-match-only origin checks. Update
the wording in the configuration section to reflect the actual matching
behavior: origins are normalized by trimming trailing slashes and may also match
the configured origin with a path segment bounded by “/”. Refer to the
ALLOWED_ORIGINS entry in the Web server settings so admins know how to format
allowed origins correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d4434f6f-60d1-46b7-abd1-dcedc506ab64

📥 Commits

Reviewing files that changed from the base of the PR and between e31a9a5 and 9c5526d.

📒 Files selected for processing (2)
  • .env.example
  • README.md

…N_ROLE_ID)

Replace the per-user ADMIN_IDS list with a reusable ADMIN_ROLE_ID env var
(comma-separated Discord role IDs). /wipe now checks role membership via a
shared hasAdminRole() helper in constants.js, so future admin-only commands
can reuse the same gate without maintaining a user list or requiring full
Discord server admin privileges.
@coderabbitai
coderabbitai Bot requested a review from Nivmizz7 July 8, 2026 08:02

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/commands/wipeCommand.js (1)

62-76: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Hardcoded hex color instead of shared constant.

The confirmation embed uses a raw 0xffb347 while other embeds in this file use colors.error/colors.success/colors.info. If a colors.warning (or similar) exists, use it for consistency.

🤖 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 `@src/commands/wipeCommand.js` around lines 62 - 76, The confirm embed in
wipeCommand uses a hardcoded hex color instead of the shared color palette.
Update the createCardEmbed call in wipeCommand to use the existing colors
constant pattern (for example colors.warning if available, matching the other
colors.error/colors.success/colors.info usages) so the confirmation card stays
consistent with the rest of the file.
🤖 Prompt for all review comments with 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.

Outside diff comments:
In `@src/commands/wipeCommand.js`:
- Around line 62-76: The confirm embed in wipeCommand uses a hardcoded hex color
instead of the shared color palette. Update the createCardEmbed call in
wipeCommand to use the existing colors constant pattern (for example
colors.warning if available, matching the other
colors.error/colors.success/colors.info usages) so the confirmation card stays
consistent with the rest of the file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4e9432a3-e690-4590-812b-5668e5d3cce2

📥 Commits

Reviewing files that changed from the base of the PR and between 9c5526d and 68f8e71.

📒 Files selected for processing (6)
  • .env.example
  • README.md
  • src/commands/wipeCommand.js
  • src/config/constants.js
  • src/config/env.js
  • test/env.test.js

Replace inline 0xffb347 with colors.warning in the shared colors constant,
matching the pattern used by colors.error/success/info elsewhere in the file.
@DysektAI
DysektAI merged commit 2b6d8ef into main Jul 8, 2026
11 checks passed
@DysektAI
DysektAI deleted the fix/production-readiness-overhaul branch July 8, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add wipe command

2 participants