This document explains how to set up and use the GitHub bug reporting feature in ManagerOS.
The bug reporting feature allows users to submit bug reports directly from the ManagerOS UI to the GitHub repository kshehadeh/manageros. When a user submits a bug report, it creates a new GitHub issue with the label user-submitted.
To enable the GitHub integration, you need to create a GitHub Personal Access Token:
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give it a descriptive name like "ManagerOS Bug Reports"
- Select the
reposcope (full control of private repositories) - Click "Generate token"
- Copy the token (you won't be able to see it again)
Add the GitHub token to your environment variables:
# In your .env.local file
GITHUB_TOKEN=your_github_token_hereFor image uploads, you'll also need to set up Cloudflare R2:
# In your .env.local file
CLOUDFLARE_R2_ACCOUNT_ID=your_account_id_here
CLOUDFLARE_R2_ACCESS_KEY_ID=your_api_token_here
CLOUDFLARE_R2_SECRET_ACCESS_KEY=your_api_token_here
CLOUDFLARE_R2_BUCKET_NAME=your_bucket_name_here
CLOUDFLARE_R2_PUBLIC_URL=https://your-bucket.your-domain.comSee Cloudflare R2 Setup Guide for detailed instructions.
Make sure the GitHub token has access to the kshehadeh/manageros repository. The token needs to be able to create issues in this repository.
- Click the "Report Bug" button in the top-right corner of the application
- Fill in the bug report form:
- Title: Brief description of the issue
- Description: Detailed description including steps to reproduce, expected behavior, and actual behavior
- Images: Optional images to help illustrate the issue (drag & drop or browse files)
- Include Email: Checkbox to optionally include your email address in the issue description (unchecked by default)
- Click "Submit Bug Report"
- A success toast will appear with a link to the created GitHub issue
The bug reports will appear in the GitHub repository with:
- The
user-submittedlabel - The user's email in the issue body (if they chose to include it) or "Anonymous user"
- The detailed description provided by the user
- Images attached to the issue (if provided) with inline display
BugReportButton: The button component in the top barBugSubmissionModal: The modal form for submitting bug reports with image upload and email inclusion optionssubmitGitHubIssue: Server action that handles the GitHub API call with optional image uploads and email inclusionuploadImageToR2: Server action that uploads images to Cloudflare R2 and returns URLs for inclusion in issues
The feature uses the GitHub Issues API:
- Endpoint:
https://api.github.com/repos/kshehadeh/manageros/issues - Method: POST
- Authentication: GitHub Personal Access Token
- Labels: Automatically adds
user-submittedlabel
Images are uploaded using Cloudflare R2's S3-compatible API:
- SDK: AWS SDK (
@aws-sdk/client-s3) for reliable S3-compatible operations - Supported Formats: JPEG, PNG, GIF, WebP
- Maximum Size: 10MB per image
- Upload Process: Images are uploaded to Cloudflare R2 first, then URLs are included in the issue description
- Storage: Images are stored on Cloudflare R2 with global CDN
- Display: Images appear inline in GitHub issues using Markdown syntax
- Cost: Free tier includes 10GB storage and 1M requests per month
- API: Uses S3-compatible API for better reliability and error handling
The system handles various error scenarios:
- Missing or invalid GitHub token
- Empty title or description
- GitHub API errors (rate limits, permissions, etc.)
- Network connectivity issues
Run the GitHub integration tests:
bun test tests/actions/github.test.tsThe tests cover:
- Successful issue submission
- Validation of required fields
- Error handling for missing configuration
- GitHub API error handling
- The GitHub token should be kept secure and not committed to version control
- The token only needs
reposcope for creating issues - User emails are included in issue bodies for contact purposes
- No sensitive application data is sent to GitHub
- Server-only enforcement: All GitHub API calls and token usage occur on the server via the
submitGitHubIssueserver action and the server-onlysrc/lib/github-api.tsmodule. No GitHub credentials or tokens are ever used on the client.
-
"GitHub integration is not configured"
- Check that
GITHUB_TOKENenvironment variable is set - Verify the token is valid and not expired
- Check that
-
"GitHub API error: 401 Unauthorized"
- Token may be invalid or expired
- Check token permissions (needs
reposcope)
-
"GitHub API error: 403 Forbidden"
- Token doesn't have access to the repository
- Repository may be private and token lacks access
-
"GitHub API error: 422 Unprocessable Entity"
- Issue title or body may be too long
- Invalid characters in the issue data
To debug issues, check the browser console and server logs for detailed error messages.