Skip to content

v0.2.0: Discord-friendly markdown, User/Group merge, expanded redaction#12

Merged
bakerboy448 merged 11 commits intomainfrom
fix/clipboard-and-discord-markdown
May 2, 2026
Merged

v0.2.0: Discord-friendly markdown, User/Group merge, expanded redaction#12
bakerboy448 merged 11 commits intomainfrom
fix/clipboard-and-discord-markdown

Conversation

@bakerboy448
Copy link
Copy Markdown
Collaborator

@bakerboy448 bakerboy448 commented May 2, 2026

Summary

Eight focused commits — fixes user-reported bugs and adds the most-requested workflow improvements for the *arr / homelab support use-case.

Bugs fixed

  • Copy to Clipboard could silently fail. Added an execCommand('copy') fallback path so the modern navigator.clipboard.writeText failures (focus loss, browsers that expose the API but throw) no longer leave the user staring at a "Copied!" label that didn't actually copy.
  • Open PrivateBin / Gist / logs.notifiarr buttons now call window.open synchronously inside the click handler, then await the clipboard write. Previously the await ate the user-activation token in Safari and the popup was blocked.
  • Copy as Markdown was not Discord-compatible. Discord doesn't render pipe-table markdown — | shows literally and _ / * chars in volume paths trigger inline formatting. Added a dedicated Copy MD (Discord) button that wraps each table in a fenced code block; the existing GitHub markdown button is preserved as Copy MD (GitHub).

Features

  • User / Group comparison table sits next to the Volume comparison. Rows: user: directive, PUID, PGID, group_add, UMASK. The single biggest *arr support question is "why can't service X read files written by service Y?" — a UID/GID mismatch is now obvious in one glance instead of buried in env dumps.
  • Derived user extra in the service overview merges the user: directive with PUID/PGID env vars, collapsing to a single value when they match and annotating the directive when they conflict.
  • Default tab switched from YAML to Table. Most users want the structured overview first; YAML stays one click away.
  • Case-insensitive PUID / PGID / UMASK lookup so a typo'd Puid still surfaces.

Redaction expansion

Closes the gaps identified in the redaction audit:

  • Connection-string keys (*_URL, *_URI, *_DSN, DATABASE_*, REDIS_*, MONGO_*, POSTGRES_*, etc.).
  • Vendor token keys: AWS access/secret, Tailscale auth keys, GitHub PATs, any *webhook*.
  • _FILE suffix stripping for the Docker-secrets convention.
  • Value-side scan: basic-auth credentials in URLs (scheme://user:pass@host), ghp_… / gho_… etc., AWS access key IDs (AKIA…), Tailscale (tskey-…-…), Discord/Slack webhook URLs, JWT-shaped tokens.

CI / Dependabot

  • New dependabot-automerge.yml uses gh pr merge --auto --squash for minor + patch updates, gated on CI green.
  • Dependabot config now splits dev-deps from prod-deps so dev-only churn auto-merges without dragging runtime deps along.
  • ci.yml gets permissions: contents: read for least-privilege.
  • prerelease.yml paths-ignore skips docs/config-only commits so README edits stop spamming pre-release tags.

Tests

231 tests pass (was 191). New coverage:

  • Discord vs GitHub markdown formatters (fence count, section omission, no ### in Discord output for older clients).
  • User-group derivation across all combinations (directive only, PUID/PGID only, both matching, both conflicting, partial, empty).
  • Case-insensitive env lookup.
  • 22 new redaction tests for connection strings, basic-auth URLs, vendor tokens, webhook URLs, JWT, and _FILE suffix.

Build

Single-file output is 82 KB / 26 KB gzipped — well under the 150 KB CI gate.

Test plan

  • npm test — 231 tests pass
  • npx tsc --noEmit — clean
  • npm run build — 82 KB output
  • Smoke test on the deployed Pages URL after merge
  • Verify Discord paste renders with monospace alignment
  • Verify GitHub paste renders as a real markdown table
  • Confirm Dependabot auto-merge fires on the next minor PR

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Table, Cards, and YAML as independent output tabs.
    • GitHub and Discord markdown export formats now available.
    • User/Group comparison table displaying PUID, PGID, and UMASK details.
    • Enhanced redaction for environment variables, URLs, and vendor credentials.
  • Improvements

    • Improved clipboard compatibility across browsers.
  • Chores

    • Version updated to 0.2.0.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

Warning

Rate limit exceeded

@bakerboy448 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 47 minutes and 50 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: 2db793a4-135a-4542-8f81-1cf2e6dba533

📥 Commits

Reviewing files that changed from the base of the PR and between daf7b50 and da92496.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (21)
  • .github/dependabot.yml
  • .github/workflows/ci.yml
  • .github/workflows/dependabot-automerge.yml
  • .github/workflows/prerelease.yml
  • README.md
  • package.json
  • src/clipboard.ts
  • src/config.ts
  • src/extract.ts
  • src/main.ts
  • src/markdown.ts
  • src/patterns.ts
  • src/redact.ts
  • src/services.ts
  • src/volume-table.ts
  • tests/cards.test.ts
  • tests/extract.test.ts
  • tests/markdown.test.ts
  • tests/patterns.test.ts
  • tests/services.test.ts
  • tests/volume-table.test.ts

Walkthrough

This PR introduces v0.2.0 with three major feature areas: a new user/group information extraction and display system, enhanced sensitive data redaction patterns, and multi-format markdown output (GitHub vs. Discord). It also updates CI/CD workflows for automated dependency management and adds clipboard fallback support. All user-facing changes integrate via refactored UI tabs and dual-format markdown copy buttons.

Changes

User/Group Information & Display

Layer / File(s) Summary
Data Model
src/services.ts
New UserGroupInfo interface with user, puid, pgid, groupAdd, umask. Extended ServiceInfo with userGroup field. Added helpers (extractUserGroup, deriveUser) to extract and format user/group from service directives and environment, supporting PUID/PGID lookups and case-insensitive environment access. Updated parseService to compute and populate userGroup.
Rendering
src/volume-table.ts
Added renderUserGroupTable() to generate a <table> with "User / Group" row-header and per-service columns. Uses em-dash placeholders for missing values and filters empty rows. Applies vol-empty CSS styling to dash cells.
Markdown Generation
src/markdown.ts
Added generateUserGroupComparisonMarkdown() to produce a pipe-table for user/group fields, filtering empty columns and returning '' when no rows are visible.
Combined Output & Formatting
src/markdown.ts
Added CombinedMarkdown interface and buildCombinedMarkdown() to aggregate services, user/group, and volume tables. Added formatForGitHub() (titled sections) and formatForDiscord() (fenced code blocks with Discord-safe labels).
UI Integration
src/main.ts
Refactored tab bar to default to "Table" view with separate "Table", "Cards", "YAML" tabs. Added makeMarkdownButton() to render GitHub/Discord format copy buttons using buildCombinedMarkdown() and respective formatters. Added conditional rendering for "User / Group comparison" and "Volume comparison" labeled sections. Updated markdown preview label to GitHub format.
Tests
tests/services.test.ts, tests/markdown.test.ts, tests/volume-table.test.ts
Extended service parsing tests to validate user/group extraction, PUID/PGID matching/annotation, case-insensitive environment lookups, and userGroup field population. Added formatForGitHub and formatForDiscord tests verifying section rendering, fence formatting, and conditional volume omission. Updated test helpers (makeService) to include default userGroup.

Sensitive Data Redaction Enhancements

Layer / File(s) Summary
Pattern Definitions
src/patterns.ts, src/config.ts
Extended DEFAULT_SENSITIVE_PATTERNS with regexes for URL/URI/DSN fields, database/cache URLs (*_URL, *_URI), AWS/Tailscale keys, webhook formats, and GitHub token/PAT suffixes. Added new SENSITIVE_VALUE_PATTERNS set for inline credentials (basic-auth in URLs, GitHub PATs, AWS access keys, Tailscale keys, Discord/Slack webhooks, JWT-like tokens).
Detection & Matching
src/patterns.ts
Added containsSensitiveValue() to detect sensitive credentials within value strings. Updated isSensitiveKey() to strip trailing _FILE suffix before pattern matching (supporting Docker secrets convention).
Redaction Application
src/redact.ts
Updated redactEnvDict and redactEnvArray to check values via containsSensitiveValue() and fully redact matching entries, tracking redactedEnvVars and redactedKeys.
Tests
tests/patterns.test.ts
Expanded isSensitiveKey test cases for connection-string and vendor-key patterns, including _FILE suffix stripping verification. Added comprehensive containsSensitiveValue suite covering URL credentials, GitHub PATs, AWS/Tailscale keys, webhooks, and JWT detection plus negative cases.

Infrastructure & Polish

Layer / File(s) Summary
Clipboard Fallback
src/clipboard.ts
Refactored copyToClipboard() to check isSecureClipboardAvailable() and attempt navigator.clipboard.writeText first; falls back to new legacyCopy() helper using document.execCommand('copy') with textarea selection and element restoration on any failure.
CI/CD Automation
.github/workflows/ci.yml, .github/dependabot.yml
Added top-level permissions: { contents: read } to CI workflow. Enhanced Dependabot config: added open-pull-requests-limit: 10 to both github-actions and npm entries; refactored npm groups into dev-deps-minor and prod-deps-minor (semver minor/patch only) with updated commit messages and labels; added ignore rule blocking @types/node major updates.
Dependabot Auto-Merge
.github/workflows/dependabot-automerge.yml
New workflow listening for pull_request_target events (opened, synchronize, reopened, ready_for_review). Runs automerge job gated to dependabot[bot] with 5-minute timeout. Fetches Dependabot metadata and conditionally auto-merges (gh pr merge --auto --squash) only for semver minor/patch updates.
Pre-Release Filtering
.github/workflows/prerelease.yml
Added paths-ignore filter to skip pre-release runs for changes limited to documentation, GitHub templates/metadata, dotfiles, and repository config. Added shellcheck disable comment for version-extraction sed command.
Documentation & Version
README.md, package.json
Rewrote "Features" section documenting three output modes (Table, Cards, YAML) and dual markdown formats (GitHub vs Discord). Expanded "User / Group merging" explanation with derivation rules. Updated "Redaction" table with sensitive categories and new example/result pairs. Updated "Architecture" module listing to include new files. Bumped version 0.1.00.2.0.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: version bump to 0.2.0, Discord-friendly markdown support, User/Group merge feature, and expanded redaction patterns.
Description check ✅ Passed The description is comprehensive and well-structured with Summary, Changes (organized by category), and Test plan sections matching the template structure.
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
  • Commit unit tests in branch fix/clipboard-and-discord-markdown

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 47 minutes and 50 seconds.

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

coderabbitai[bot]
coderabbitai Bot previously requested changes May 2, 2026
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: 3

Caution

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

⚠️ Outside diff range comments (1)
src/main.ts (1)

485-503: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Preview output diverges from actual GitHub copy output.

At Line 485-Line 503, the preview is built from service + volume tables only, while copy uses buildCombinedMarkdown + formatForGitHub (which also includes User/Group and headings). This can mislead users comparing preview vs copied output.

Suggested fix
-            const svcMd = generateMarkdownTable(services)
-            const volMd = generateVolumeComparisonMarkdown(services)
-            const mdParts: string[] = []
-            if (svcMd) mdParts.push(svcMd)
-            if (volMd) mdParts.push(volMd)
-            if (mdParts.length > 0) {
-              const combinedMd = mdParts.join('\n\n')
+            const combinedMd = formatForGitHub(buildCombinedMarkdown(services))
+            if (combinedMd) {
               const mdLabel = el('label')
               mdLabel.textContent = 'Markdown preview (GitHub format) — use the buttons above to copy GitHub or Discord variants:'
               mdLabel.style.marginTop = '0.75rem'
               volumesContainer.appendChild(mdLabel)
               const mdPreview = el('textarea', {
                 className: 'code-textarea',
                 rows: String(Math.min(combinedMd.split('\n').length + 1, 18)),
                 readonly: 'true',
                 spellcheck: 'false',
               })
               mdPreview.value = combinedMd
               volumesContainer.appendChild(mdPreview)
             }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main.ts` around lines 485 - 503, The preview textarea currently builds
markdown from generateMarkdownTable(services) +
generateVolumeComparisonMarkdown(services) which differs from the copy pipeline;
change the preview to use the same pipeline as the copy buttons by calling
buildCombinedMarkdown(services) and then passing that result to formatForGitHub
(or the same formatter used by the copy action) and use that formatted string
for mdPreview.value and rows; update references around
generateMarkdownTable/generateVolumeComparisonMarkdown and ensure mdPreview and
volumesContainer get the formatted output so preview and copy are identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/patterns.ts`:
- Line 45: The regex literal /\bgh[pousr]_[A-Za-z0-9]{30,}\b/ in src/patterns.ts
only matches classic GH PAT prefixes (ghp_, gho_, etc.) — update that entry (or
add a new one) to also detect fine‑grained tokens that start with the
github_pat_ prefix by including an alternative for "github_pat_" and allowing
the appropriate alphanumeric/URL-safe characters and length used by fine‑grained
tokens; keep the change scoped to the existing patterns array entry so detection
covers both classic and fine‑grained GitHub PAT formats.

In `@src/services.ts`:
- Line 137: The code currently only accepts string service['user'] and drops
numeric YAML scalars; update the user extraction logic (the occurrences using
service['user'] such as the line with user: typeof service['user'] === 'string'
? service['user'].trim() : '') to also accept numbers by converting them to
strings (e.g., if typeof service['user'] === 'number' then
String(service['user']) ) and preserve trimming for strings; also add a unit
test that parses an unquoted numeric YAML entry like user: 1000 to ensure the
numeric value is preserved as "1000".

In `@tests/markdown.test.ts`:
- Around line 197-259: Tests for formatForGitHub/formatForDiscord are missing a
positive-path assertion that the User/Group markdown section appears when
service data includes userGroup; add one test case for each formatter that
constructs a service via makeService with a userGroup field (e.g., makeService({
name: 'app', image: 'nginx', userGroup: '1000:1000' })), calls
buildCombinedMarkdown and then formatForGitHub/formatForDiscord, and asserts the
output contains the expected User/Group section heading and table content (for
GitHub expect "### User/Group" and the pipe-table rows; for Discord expect
"**User/Group**" wrapped appropriately and the raw table lines), ensuring the
section is present rather than omitted.

---

Outside diff comments:
In `@src/main.ts`:
- Around line 485-503: The preview textarea currently builds markdown from
generateMarkdownTable(services) + generateVolumeComparisonMarkdown(services)
which differs from the copy pipeline; change the preview to use the same
pipeline as the copy buttons by calling buildCombinedMarkdown(services) and then
passing that result to formatForGitHub (or the same formatter used by the copy
action) and use that formatted string for mdPreview.value and rows; update
references around generateMarkdownTable/generateVolumeComparisonMarkdown and
ensure mdPreview and volumesContainer get the formatted output so preview and
copy are identical.
🪄 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: 2f666c47-8434-4a52-9c96-a838cd083779

📥 Commits

Reviewing files that changed from the base of the PR and between 83d7ba8 and daf7b50.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (19)
  • .github/dependabot.yml
  • .github/workflows/ci.yml
  • .github/workflows/dependabot-automerge.yml
  • .github/workflows/prerelease.yml
  • README.md
  • package.json
  • src/clipboard.ts
  • src/config.ts
  • src/main.ts
  • src/markdown.ts
  • src/patterns.ts
  • src/redact.ts
  • src/services.ts
  • src/volume-table.ts
  • tests/cards.test.ts
  • tests/markdown.test.ts
  • tests/patterns.test.ts
  • tests/services.test.ts
  • tests/volume-table.test.ts

Comment thread src/patterns.ts
Comment thread src/services.ts Outdated
Comment thread tests/markdown.test.ts
@bakerboy448
Copy link
Copy Markdown
Collaborator Author

Pushed 3 follow-up commits addressing CodeRabbit review:

  • 0fa94f4 — issue Add: GUILD_ID #10 (chat-platform ID redaction) + fine-grained GitHub PAT (github_pat_…) value pattern.
  • 78c4028 — HTML entity + percent-encoded paste support in extract.ts (handles paste from rendered HTML / forum / wiki / autocompose web demo). 8 new tests.
  • 4cd7347 — CodeRabbit fixes:
    • services.ts now accepts numeric user: YAML scalars (unquoted user: 1000 was previously dropped).
    • Markdown preview shares the exact pipeline used by the copy buttons via buildCombinedMarkdown + formatForGitHub so preview = copy.
    • Added positive User/Group section assertions for both formatters.

255 tests passing (was 231). Build still 82 KB / 26 KB gzipped.

Side admin: GitHub Projects (classic) disabled on the repo (was deprecation-noisy).

bakerboy448 added 11 commits May 2, 2026 14:56
navigator.clipboard.writeText fails silently in several real-world
contexts (no transient user-activation, focus on a different document,
permission denied, browsers that expose the API but throw at call time).
The page is HTTPS so the fallback rarely fires, but its absence meant
"Copy" buttons reported success on a no-op or failed outright.

Add a hidden-textarea + document.execCommand('copy') fallback that runs
when the modern API throws or is unavailable, and tighten the secure-
context check.
Discord does not render pipe-table markdown; the | separators show
literally and any *_~ chars in volume paths trigger inline formatting.
Wrapping each table in a triple-backtick code fence preserves alignment
in Discord's monospace renderer and blocks inline-format parsing.

- buildCombinedMarkdown(services) returns the per-section pieces.
- formatForGitHub: existing ### headings + bare tables.
- formatForDiscord: **bold** labels + fenced code blocks per section.

Tests cover empty inputs, fence count, section omission when a source
table is empty, and that the Discord formatter does not use ### so it
renders consistently across Discord clients.
The single biggest support question for *arr-style stacks is "why can't
service X read files written by service Y?" That's almost always a
UID/GID mismatch hiding in PUID/PGID env, an explicit user: directive,
or group_add. Surface them in one place so mismatches are obvious.

- ServiceInfo gains a userGroup field with user, puid, pgid, groupAdd,
  and umask. Lookups for PUID/PGID/UMASK are case-insensitive so a
  typo'd `Puid` still surfaces.
- A derived `user` row is added to extras (and the service overview
  table). Combines the user: directive with PUID/PGID; collapses to a
  single value when they match, annotates when they conflict.
- New User/Group comparison table (DOM + markdown) renders alongside
  the volume comparison. Rows that are empty across all services are
  hidden so the table only shows fields that exist somewhere.
- Discord and GitHub markdown exports include the new section.
- Switch the post-sanitize default tab from YAML to Table. Most users
  reach for this view first to scan services, ports, user/group, and
  volume comparison; YAML is the fallback when the structured view
  isn't enough.
- Replace the single "Copy as Markdown" button with two:
  "Copy MD (GitHub)" (existing format) and "Copy MD (Discord)"
  (fenced-code variant). The previous output was unreadable when
  pasted into Discord support channels.
- Render the User/Group comparison and Volume comparison tables under
  labelled headings so the Table tab presents them as distinct sections.
- Open* buttons (PrivateBin, logs.notifiarr, Gist) now call window.open
  synchronously inside the click handler before the clipboard write.
  Awaiting first drops the user-activation token in Safari and triggers
  the popup blocker.
Add coverage in three places:

Key patterns:
- *_URL / *_URI / *_DSN / *_CONNECTION_STRING tail suffixes.
- DATABASE/REDIS/MONGO/AMQP/RABBIT/CELERY/POSTGRES/MYSQL/ELASTIC
  prefixes (catches DATABASE_URL etc. without a password-y substring).
- AWS access/secret keys, Tailscale auth keys, GitHub PATs/tokens,
  any *webhook* key.
- Strip a trailing _FILE suffix before matching so the Docker-secrets
  convention (POSTGRES_PASSWORD_FILE, DATABASE_URL_FILE) is covered.

Value patterns (redact regardless of key name):
- Basic-auth credentials embedded in any URL value.
- GitHub PATs (ghp_/gho_/ghu_/ghs_/ghr_).
- AWS access key IDs (AKIA/ASIA/AROA/AIPA/AGPA/AIDA + 16 chars).
- Tailscale auth keys.
- Discord and Slack incoming-webhook URLs.
- JWT-shaped values (three base64url segments separated by dots).

config.ts default sensitivePatterns updated to match. Tests cover the
new key/value matchers; fake test fixtures get pragma allowlist comments.
- Add dependabot-automerge.yml: auto-merge minor/patch Dependabot PRs
  via gh pr merge --auto --squash, gated on CI green. Keeps the human
  review queue focused on majors. Uses dependabot/fetch-metadata to
  classify update type.
- Refine .github/dependabot.yml: split npm group into dev-deps-minor
  vs prod-deps-minor (so dev-only churn auto-merges without dragging
  runtime deps along), set open-pull-requests-limit, ignore @types/node
  major bumps so Node versioning stays deliberate.
- ci.yml: add top-level permissions: contents: read so the workflow
  defaults to least-privilege.
- prerelease.yml: paths-ignore docs / config-only changes so README,
  pre-commit, dependabot, and similar commits don't spam pre-release
  tags + GitHub releases. Also suppress a pre-existing SC2001
  shellcheck warning on the capture-group sed (shellcheck false
  positive — parameter expansion can't replicate the regex).
…ction

- Three-tab UI with Table as default; per-tab purpose documented.
- Two copy buttons (GitHub vs Discord) with the rationale for the
  Discord fenced-code variant.
- User/Group merging behaviour (directive + PUID/PGID + group_add
  + UMASK) and case-insensitive env lookup.
- Expanded redaction coverage: connection-string keys, embedded URL
  basic-auth, vendor token formats, and Docker-secrets _FILE suffix.
- Architecture file list updated to include volume-table / volume-utils.
…ub PATs

Issue #10 (TRaSH): Discord/Slack/Telegram identifiers leak who you
are and which servers/channels you operate in. Add key patterns for
discord_*, slack_*, telegram_*, matrix_*, teams_* prefixes and the
common *_id suffixes (guild_id, channel_id, server_id, workspace_id,
tenant_id, application_id, bot_id, client_id). Tests confirm the
common compose IDs (CONTAINER_ID, IMAGE_ID, USER_ID, PROCESS_ID) are
not over-matched.

Also fix a value-side gap: the ghp_/gho_/ghu_/ghs_/ghr_ regex only
matched classic GitHub PATs, not fine-grained tokens which use the
github_pat_<base62>_… prefix and underscore-bearing payload. Add a
dedicated alt pattern.
When users paste from a rendered HTML source (forum thread, wiki,
GitHub diff preview, or the autocompose web demo), the input arrives
with &amp;/&lt;/&quot; entities and %20-style percent encoding instead
of literal characters. YAML rejects these so the previous error path
was misleading — the input was correct but the encoding wasn't.

Add normalizeEncodedInput() called from extractYaml:
- Decode HTML entities (named, decimal, hex) via the textarea trick
  when at least one entity is present.
- Decode percent-encoding only when there are >= 2 percent-sequences,
  so a literal "100%" stays literal but "/path/My%20Files" decodes.
- Malformed sequences (%ZZ) are left in place rather than throwing.

8 new tests cover plain-text passthrough, named/numeric/hex entities,
percent paths, the literal-% guard, mixed encoding, and malformed
input.
- services.ts: accept numeric user: scalars. Unquoted YAML user: 1000
  parses to a number, not a string, so the previous typeof === 'string'
  guard silently dropped it. Centralize the coercion in
  readUserDirective() and use it from both extractUserGroup and
  deriveUser. Test added.
- main.ts: collapse the markdown-preview pipeline onto the same code
  path the copy buttons use (buildCombinedMarkdown + formatForGitHub).
  Previously the preview composed its own bare table sections without
  the ### headings, so what users saw differed from what they copied.
  Drops two now-unused imports.
- markdown.test.ts: add positive-path assertions that the User / Group
  section appears in both formatForGitHub (### heading + pipe table)
  and formatForDiscord (**bold** label + fenced code) when userGroup
  data is present. The existing tests only covered Services and
  Volume Comparison sections.
@bakerboy448 bakerboy448 force-pushed the fix/clipboard-and-discord-markdown branch from 4cd7347 to da92496 Compare May 2, 2026 19:57
@bakerboy448
Copy link
Copy Markdown
Collaborator Author

Rebased onto current main (resolved conflict in prerelease.yml — kept the upstream parameter-expansion fix and dropped my redundant # shellcheck disable workaround). All 11 commits preserved with new SHAs. 255 tests pass, build is 83 KB / 26 KB gzipped.

@coderabbitai full review please — the previous review was on the pre-rebase tip and the three follow-up commits address all three inline comments and the outside-diff main.ts comment.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

Tip

For best results, initiate chat on the files or code changes.

@bakerboy448 Understood! Triggering a fresh full review on the rebased tip (11 commits, 255 tests, 83 KB build). I'll go through all the changes — including the three follow-up commits addressing the previous inline comments — and post updated findings shortly.

[full_review]

@bakerboy448 bakerboy448 dismissed coderabbitai[bot]’s stale review May 2, 2026 19:59

Stale review against pre-rebase commit daf7b50. All four findings addressed in commits 6d26d0d (fine-grained PAT + chat IDs, also issue #10), 777dc97 (HTML/percent paste decode), and da92496 (numeric user scalar coercion + preview/copy pipeline alignment + missing User/Group test assertions). CodeRabbit status check on the rebased tip da92496 is PASS.

@bakerboy448 bakerboy448 merged commit b3adf5c into main May 2, 2026
5 checks passed
@bakerboy448 bakerboy448 deleted the fix/clipboard-and-discord-markdown branch May 2, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant