Skip to content

fix: Cross-platform compatibility and security improvements#27

Open
Joshua7792 wants to merge 6 commits into
FatihMakes:mainfrom
Joshua7792:fix/cross-platform-security
Open

fix: Cross-platform compatibility and security improvements#27
Joshua7792 wants to merge 6 commits into
FatihMakes:mainfrom
Joshua7792:fix/cross-platform-security

Conversation

@Joshua7792
Copy link
Copy Markdown

🎯 Overview

This pull request addresses critical cross-platform compatibility issues and security vulnerabilities identified in the repository. It makes MARK XXXIX accessible and functional on Windows, macOS, and Linux while improving API key security.

🐛 Issues Fixed

Directly addresses:

✨ Changes

1. requirements.txt - Platform-Aware Dependencies

  • Added environment markers for Windows-only packages (comtypes, pycaw, win10toast, pywinauto)
  • Added python-dotenv for secure .env file support
  • Syntax: package; sys_platform == 'win32' ensures conditional installation

Impact: Installation now succeeds on macOS and Linux without trying to install Windows-specific packages.

2. setup.py - Enhanced Platform Detection

  • Added platform detection to inform users about their OS
  • Improved error messages and completion messages

3. .gitignore - Protect Sensitive Data

  • Created comprehensive .gitignore file
  • Protects .env files (API keys)
  • Protects config/api_keys.json (legacy API storage)
  • Standard Python, IDE, and build artifact exclusions

Impact: API keys will never be accidentally committed to git.

4. main.py - Security & Platform Improvements

  • Added .env file support via python-dotenv
  • Platform-aware imports with try/except for Windows packages
  • Updated _get_api_key() to check .env first
  • Improved error messages

5. SECURITY.md - New Security & Setup Guide

Comprehensive guide covering:

  • API key management best practices
  • .env file setup (recommended)
  • Headless setup for accessibility
  • Platform-specific installation instructions
  • Troubleshooting guide

6. readme.md - Improved Documentation

  • Clear setup instructions with .env support
  • Links to SECURITY.md for detailed guidance
  • Troubleshooting section

🔒 Security Improvements

Vulnerability Before After
API Key Storage Plain text JSON Environment variables (.env)
Git Accidents API keys could be committed .gitignore prevents this
Cross-platform Fails on Linux/macOS Works on all platforms
Accessibility GUI-only setup .env supports headless setup

📚 Documentation

See SECURITY.md for comprehensive security and setup guide.

Joshua7792 and others added 6 commits May 17, 2026 21:30
- Move Windows-only packages (comtypes, pycaw, win10toast, pywinauto) to conditional installation using environment markers
- Add python-dotenv for .env file support (security feature)
- Fixes cross-platform installation issues on macOS and Linux (issues FatihMakes#15, FatihMakes#21)
- Users on non-Windows platforms will no longer fail on Windows-specific dependency installation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add platform detection to inform user about OS
- Update completion message to reference MARK XXXIX (not XXV)
- Prepare for platform-aware configuration in future updates

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Protect .env files containing API keys
- Exclude config/api_keys.json (sensitive data)
- Standard Python and IDE exclusions
- Protect browser data and sensitive directories

This ensures sensitive API keys and credentials are never accidentally committed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…m compatibility

- Replace plain-text JSON API key storage with .env file support
- Add python-dotenv import to load GOOGLE_API_KEY from .env
- Add graceful fallback to config/api_keys.json for backward compatibility
- Add platform-aware imports with try/except for Windows-only packages
- Update documentation in code comments
- Fixes security vulnerability (issue FatihMakes#2) by avoiding plain-text credential storage

Security improvements:
- API keys now stored in .env files (which are .gitignored)
- Fallback mechanism preserves backward compatibility
- Documentation guides users to use .env for new installations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Covers:
- API key management using .env files (recommended security practice)
- Headless setup for accessibility (addresses issue FatihMakes#11)
- Platform-specific installation instructions (Windows, macOS, Linux)
- Fixes and status for security vulnerabilities (issue FatihMakes#2)
- Troubleshooting guide
- Instructions for obtaining Gemini API key

This guide ensures users understand security best practices and can set up the application across all platforms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…structions

- Add clear setup instructions with .env support (recommended method)
- Reference SECURITY.md for detailed security and platform-specific guidance
- Add troubleshooting section with links to detailed solutions
- Update feature list to mention enhanced security
- Improve formatting for better readability
- Add links to contributing and issue tracking

Fixes issues FatihMakes#15, FatihMakes#21, FatihMakes#11 by providing clear cross-platform setup documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant