Skip to content

Report an Issue feature with optional zip upload #65

Open
adithya1012 wants to merge 3 commits intomieweb:mainfrom
adithya1012:issue_report
Open

Report an Issue feature with optional zip upload #65
adithya1012 wants to merge 3 commits intomieweb:mainfrom
adithya1012:issue_report

Conversation

@adithya1012
Copy link
Copy Markdown

@adithya1012 adithya1012 commented Mar 20, 2026

What this PR does

This PR adds backend support for reporting issues directly through Pulse Vault and creating GitHub issues automatically, with optional diagnostic zip upload.

Demo

LINK

New endpoints

  • POST /api/report_issue

    • Accepts multipart form-data:
      • summary (required)
      • description (required)
      • zip (optional)
    • Creates a GitHub issue using the provided summary/description.
    • If zip is provided, stores it under a UUID folder and appends a public download link in the GitHub issue body.
  • GET /api/report_issue/download/:uuid

    • Serves uploaded zip from <REPORT_ISSUE_UPLOAD_DIR>/<uuid>/report.zip.
    • Public endpoint (UUID-based access), returns application/zip with download disposition.

Implementation details

  • Added new route module for report issue flow.
  • Registered multipart parsing (scoped to the new route module).
  • Added upload storage convention:
    • UUID generated per upload
    • Fixed filename report.zip
  • Integrated GitHub issue creation via GitHub REST API:
    • POST /repos/{owner}/{repo}/issues
    • Auth via PAT from environment variables.
  • Added robust error handling and cleanup when upload/GitHub creation fails.

Security & validation

  • Enforces multipart content type for submission endpoint.
  • Validates required text fields and max lengths.
  • Limits uploads to a single file and configurable max size.
  • Validates .zip extension, accepted zip MIME types, and zip magic header.
  • Prevents path traversal on download route.
  • Cleans up temporary upload directories on failure paths.

Config changes

New environment variables:

  • GITHUB_TOKEN
  • GITHUB_REPO_OWNER
  • GITHUB_REPO_NAME
  • REPORT_ISSUE_UPLOAD_DIR (default: /mnt/media/report-issues)
  • REPORT_ISSUE_MAX_ZIP_BYTES (default: 26214400)
  • REPORT_ISSUE_TIMEOUT_MS (default: 10000)

Infra / routing changes

  • Added Nginx location rule for /api/report_issue to proxy directly to Pulse Vault backend.

Notes

  • Current behavior is GitHub-only reporting (no local-file fallback mode in this scope).
  • Endpoint is intentionally unauthenticated as decided during implementation; abuse controls rely on validation/limits and can be extended with rate limiting in a follow-up.

@adithya1012 adithya1012 marked this pull request as ready for review April 14, 2026 16:47
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