-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add social preview image with architectural diagram #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: aurelianware <194855645+aurelianware@users.noreply.github.com>
Co-authored-by: aurelianware <194855645+aurelianware@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a social preview image for the repository to improve its appearance when shared on social media platforms. The implementation includes a Python script to generate the image programmatically, comprehensive documentation for setup and maintenance, and the generated PNG image itself.
Changes:
- Added Python script to generate a 1280×640 social preview image with architectural diagram
- Created setup documentation with upload instructions and troubleshooting guide
- Updated README to reference the new documentation
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
scripts/generate_social_preview.py |
Python script using Pillow to generate architectural diagram image with GitHub dark theme styling |
.github/SOCIAL_PREVIEW_SETUP.md |
Comprehensive guide for uploading and maintaining the social preview image |
.github/assets/social-preview.png |
Generated 49KB PNG image (1280×640) showing system architecture |
README.md |
Added reference to social preview setup documentation in Development section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
scripts/generate_social_preview.py
Outdated
| title_font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", 72) | ||
| subtitle_font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 32) | ||
| text_font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 24) | ||
| small_font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 20) |
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded font path /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf is Linux-specific and will fail on macOS and Windows systems. While there is a fallback to default fonts, this limits cross-platform usability.
Consider implementing a more portable solution that checks multiple common font locations across different operating systems, or provide clearer documentation that the script is intended for Linux environments only. Alternatively, you could use the matplotlib font manager or bundle fonts with the script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in add338a. The script now checks multiple font paths across Linux, macOS, and Windows using a find_font() helper function. Font paths include DejaVu Sans (Linux), Arial (macOS), and Arial (Windows).
scripts/generate_social_preview.py
Outdated
| draw.text((50, 40), title, fill=hex_to_rgb(PRIMARY_COLOR), font=title_font) | ||
|
|
||
| # Subtitle | ||
| subtitle = "Real-Time iOS Threat Detection & Monitoring" | ||
| draw.text((50, 130), subtitle, fill=hex_to_rgb(TEXT_COLOR), font=subtitle_font) | ||
|
|
||
| # Architecture diagram | ||
| y_offset = 200 | ||
|
|
||
| # Top: CLI Interface | ||
| draw.rectangle([50, y_offset, 1230, y_offset + 60], | ||
| outline=hex_to_rgb(PRIMARY_COLOR), width=3) | ||
| draw.text((520, y_offset + 20), "CLI Interface", | ||
| fill=hex_to_rgb(PRIMARY_COLOR), font=text_font) | ||
|
|
||
| # Middle: Orchestrator | ||
| y_offset += 80 | ||
| draw.rectangle([400, y_offset, 880, y_offset + 50], | ||
| outline=hex_to_rgb(SECONDARY_COLOR), width=3) | ||
| draw.text((520, y_offset + 15), "Threat Orchestrator", | ||
| fill=hex_to_rgb(SECONDARY_COLOR), font=text_font) | ||
|
|
||
| # Bottom: Monitors (4 boxes) | ||
| y_offset += 70 | ||
| box_width = 250 | ||
| box_height = 60 | ||
| spacing = 50 | ||
|
|
||
| monitors = [ | ||
| ("VPN\nIntegrity", PRIMARY_COLOR), | ||
| ("API\nAbuse", PURPLE_COLOR), | ||
| ("Carrier\nCompromise", ACCENT_COLOR), | ||
| ("Backup\nMonitor", SECONDARY_COLOR) | ||
| ] | ||
|
|
||
| x_start = 80 | ||
| for i, (monitor, color) in enumerate(monitors): | ||
| x = x_start + i * (box_width + spacing) | ||
| draw.rectangle([x, y_offset, x + box_width, y_offset + box_height], | ||
| outline=hex_to_rgb(color), width=3) | ||
| lines = monitor.split('\n') | ||
| for j, line in enumerate(lines): | ||
| draw.text((x + 60, y_offset + 10 + j * 25), line, | ||
| fill=hex_to_rgb(color), font=small_font) | ||
|
|
||
| # Alert system at bottom | ||
| y_offset += 90 | ||
| draw.rectangle([400, y_offset, 880, y_offset + 50], | ||
| outline=hex_to_rgb(ACCENT_COLOR), width=3) | ||
| draw.text((520, y_offset + 15), "Telegram Alerter", | ||
| fill=hex_to_rgb(ACCENT_COLOR), font=text_font) | ||
|
|
||
| # Add arrows/connections (simplified) | ||
| # Arrow from CLI to Orchestrator | ||
| draw.line([(640, 260), (640, 280)], fill=hex_to_rgb(TEXT_COLOR), width=2) | ||
|
|
||
| # Arrows from Orchestrator to monitors | ||
| orch_center_x = 640 | ||
| orch_y = 330 | ||
| monitor_y = 350 | ||
|
|
||
| for i in range(4): | ||
| monitor_x = x_start + box_width // 2 + i * (box_width + spacing) | ||
| draw.line([(orch_center_x, orch_y), (monitor_x, monitor_y)], | ||
| fill=hex_to_rgb(TEXT_COLOR), width=2) | ||
|
|
||
| # Arrows from monitors to alerter | ||
| alert_y = 510 | ||
| for i in range(4): | ||
| monitor_x = x_start + box_width // 2 + i * (box_width + spacing) | ||
| draw.line([(monitor_x, y_offset - 30), (640, alert_y)], | ||
| fill=hex_to_rgb(TEXT_COLOR), width=2) | ||
|
|
||
| # Footer with key features | ||
| y_offset = 580 | ||
| features = "🛡️ Battle-Tested • 🔒 Privacy-First • ⚡ Real-Time • ✅ 196 Tests" | ||
| draw.text((180, y_offset), features, fill=hex_to_rgb(TEXT_COLOR), font=small_font) |
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script contains numerous magic numbers (coordinates, sizes, spacing values) that make it difficult to maintain and modify the layout. For example: 50, 40, 1230, 60, 80, 400, 880, 520, 15, 70, 250, 60, 50, 80, 640, 260, 280, etc.
Consider extracting these as named constants at the module level or within a configuration section, grouping them by purpose (e.g., MARGIN_LEFT, TITLE_Y, BOX_WIDTH, SPACING, etc.). This would improve code maintainability and make it easier to adjust the layout in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in add338a. Extracted all magic numbers as named constants at the module level, organized by purpose: MARGIN_LEFT, TITLE_Y, CLI_Y, ORCH_Y_SPACING, MONITOR_BOX_WIDTH, etc. This improves maintainability and makes layout adjustments easier.
| pip install Pillow | ||
|
|
||
| The generated image can be uploaded to GitHub as the repository's | ||
| social preview image (Settings > Social preview). | ||
| """ | ||
|
|
||
| import argparse | ||
| from pathlib import Path | ||
| from PIL import Image, ImageDraw, ImageFont | ||
|
|
||
|
|
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script requires the Pillow library (imported as PIL), but Pillow is not listed in requirements.txt. This means users will encounter an ImportError when running the script unless they manually install Pillow.
Since this is a utility script for generating assets (not core functionality), consider either:
- Adding Pillow to requirements-dev.txt since it's a development/maintenance tool
- Adding a clear note in the script's docstring that Pillow must be installed separately
- Adding proper dependency documentation in the README or SOCIAL_PREVIEW_SETUP.md
The script already mentions "pip install Pillow" in its docstring (line 12), but this could be more prominent or the dependency could be formalized in requirements-dev.txt.
| pip install Pillow | |
| The generated image can be uploaded to GitHub as the repository's | |
| social preview image (Settings > Social preview). | |
| """ | |
| import argparse | |
| from pathlib import Path | |
| from PIL import Image, ImageDraw, ImageFont | |
| This is a development/maintenance utility and requires the Pillow | |
| library (PIL), which is not installed by default. | |
| Install with: | |
| pip install Pillow | |
| The generated image can be uploaded to GitHub as the repository's | |
| social preview image (Settings > Social preview). | |
| """ | |
| import argparse | |
| from pathlib import Path | |
| import sys | |
| try: | |
| from PIL import Image, ImageDraw, ImageFont | |
| except ImportError as exc: | |
| sys.stderr.write( | |
| "Error: The Pillow library (PIL) is required to run this script.\n" | |
| "Install it with:\n" | |
| " pip install Pillow\n" | |
| ) | |
| raise SystemExit(1) from exc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in add338a. Added Pillow>=10.0.0 to requirements-dev.txt and implemented proper import error handling with a helpful message directing users to install Pillow.
|
@copilot apply changes based on the comments in this thread |
…or handling, extract constants, and add Pillow to dev dependencies Co-authored-by: aurelianware <194855645+aurelianware@users.noreply.github.com>
…failure Co-authored-by: aurelianware <194855645+aurelianware@users.noreply.github.com>
Social Preview Image Creation
Create a social preview image for the PrivaseeAI.Security repository, similar to the architectural diagram style used in the CloudHealthOffice repo.
Completed:
Files Added:
.github/assets/social-preview.png- The social preview image (49KB, 1280x640 PNG).github/SOCIAL_PREVIEW_SETUP.md- Complete setup instructionsscripts/generate_social_preview.py- Script to regenerate the imageFiles Modified:
README.md- Added reference to SOCIAL_PREVIEW_SETUP.md in Development sectionrequirements-dev.txt- Added Pillow>=10.0.0 for image generationCode Quality Improvements:
Next Steps (Manual - Requires Admin Access):
Repository administrator needs to upload the image to GitHub:
.github/assets/social-preview.png📖 For detailed instructions, see
.github/SOCIAL_PREVIEW_SETUP.mdOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.