{"id":27777805,"url":"https://github.com/melchizedek6809/url2og","last_synced_at":"2026-05-01T16:35:13.953Z","repository":{"id":290274138,"uuid":"973880930","full_name":"Melchizedek6809/url2og","owner":"Melchizedek6809","description":"A cute web service that can turn any URL into a screenshot with common OpenGraph dimensions! Perfect for generating preview images for social media.","archived":false,"fork":false,"pushed_at":"2025-04-29T02:12:59.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T07:11:53.587Z","etag":null,"topics":["nodejs","opengraph","puppeteer","vibe-coding"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Melchizedek6809.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-27T23:26:19.000Z","updated_at":"2025-04-29T02:13:03.000Z","dependencies_parsed_at":"2025-04-28T00:31:02.029Z","dependency_job_id":"6cfdbbe7-2007-43f8-9f88-6a9a5b3b66c2","html_url":"https://github.com/Melchizedek6809/url2og","commit_stats":null,"previous_names":["melchizedek6809/url2og"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melchizedek6809%2Furl2og","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melchizedek6809%2Furl2og/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melchizedek6809%2Furl2og/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Melchizedek6809%2Furl2og/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Melchizedek6809","download_url":"https://codeload.github.com/Melchizedek6809/url2og/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251658213,"owners_count":21622822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","opengraph","puppeteer","vibe-coding"],"created_at":"2025-04-30T07:11:57.109Z","updated_at":"2026-05-01T16:35:13.920Z","avatar_url":"https://github.com/Melchizedek6809.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL to OpenGraph Image Web Service ✨\n\nA cute web service that can turn any URL into a screenshot with common OpenGraph dimensions! Perfect for generating preview images for social media.\n\n## Installation\n\n### Standard Installation\n\n```bash\n# Clone the repository\ngit clone \u003cyour-repo-url\u003e\ncd url2og\n\n# Install dependencies\nnpm install\n```\n\n### Docker Installation\n\n```bash\n# Build the Docker image\ndocker build -t url2og .\n\n# Run the container\ndocker run -p 4040:4040 url2og\n\n# Run with domain whitelist\ndocker run -p 4040:4040 -e ALLOWED_DOMAINS=\"example.com,mysite.org\" url2og\n\n# Run with custom security settings\ndocker run -p 4040:4040 \\\n  -e ALLOWED_DOMAINS=\"example.com,mysite.org\" \\\n  -e MAX_WIDTH=2000 \\\n  -e MAX_HEIGHT=2000 \\\n  -e MAX_CACHE_SIZE_MB=250 \\\n  -e MAX_CONCURRENT_REQUESTS=5 \\\n  url2og\n```\n\n## Usage\n\n```bash\n# Start the web service\nnpm start\n\n# Start with domain whitelist\nALLOWED_DOMAINS=\"example.com,mysite.org\" npm start\n\n# Start with custom security settings\nMAX_WIDTH=2000 MAX_HEIGHT=2000 MAX_CACHE_SIZE_MB=250 npm start\n```\n\nThen open your browser to http://localhost:4040\n\n## Environment Variables\n\n| Variable | Description | Default | Example |\n|----------|-------------|---------|---------|\n| `PORT` | Port to run the server on | `4040` | `PORT=8080 npm start` |\n| `ALLOWED_DOMAINS` | Comma-separated list of allowed domains | (none) | `ALLOWED_DOMAINS=\"example.com,mysite.org\"` |\n| `PUPPETEER_EXECUTABLE_PATH` | Custom path to Chrome/Chromium executable | (auto) | Used automatically in Docker |\n| `MAX_WIDTH` | Maximum allowed width in pixels | `3000` | `MAX_WIDTH=2000` |\n| `MAX_HEIGHT` | Maximum allowed height in pixels | `3000` | `MAX_HEIGHT=2000` |\n| `MAX_CACHE_SIZE_MB` | Maximum cache size in MB | `500` | `MAX_CACHE_SIZE_MB=250` |\n| `MAX_CONCURRENT_REQUESTS` | Maximum concurrent screenshot requests | `10` | `MAX_CONCURRENT_REQUESTS=5` |\n\n## API\n\n### Get Screenshot\n\n```\nGET /?url=\u003ctarget-url\u003e[\u0026width=\u003cwidth\u003e\u0026height=\u003cheight\u003e]\n```\n\n#### Parameters:\n\n- `url`: The URL to capture (required)\n- `width`: Width of image in pixels (default: 1200, max: defined by MAX_WIDTH)\n- `height`: Height of image in pixels (default: 630, max: defined by MAX_HEIGHT)\n\n#### Examples:\n\nBasic usage:\n```\nhttp://localhost:4040/?url=google.com\n```\n\nCustom dimensions:\n```\nhttp://localhost:4040/?url=twitter.com\u0026width=800\u0026height=400\n```\n\n### Health Check\n\n```\nGET /health\n```\n\nReturns 200 OK if the service is running properly.\n\n## Features\n\n- 🌸 Returns JPEG images directly in the response\n- 🌟 Auto-prefixes URLs with https:// if protocol is missing\n- 💖 Includes a friendly web interface with a form\n- 🎀 Optimized with browser reuse for better performance\n- 🍡 Standard OpenGraph dimensions (1200×630) by default\n- 💾 Two-level caching system for improved performance\n- 🧹 Automatic cache management with 7-day retention policy\n- 🔒 Domain whitelist to prevent unauthorized usage\n- 🐳 Docker support for easy deployment\n- 🛡️ Enhanced security features for production use\n\n## Security Features\n\n- Domain whitelist restricts which sites can be captured\n- Size limits for images prevent resource abuse\n- Request rate limiting prevents DoS attacks\n- Disk size management prevents filling server storage\n- Docker container runs as non-root user\n- Regular security headers to prevent common attacks\n- Resource filtering to reduce attack surface\n- Health check endpoint for monitoring\n- Error handling that doesn't leak information\n\n## Technical Details\n\n- Images are stored in a filesystem cache (`./cache` directory)\n- In-memory caching layer for faster repeat access\n- Cache keys are generated using MD5 hash of URL + dimensions\n- Response headers include `X-Cache: HIT` or `X-Cache: MISS` to indicate cache status\n- Cache cleanup runs automatically every 24 hours to remove expired entries\n- Domain whitelist supports both exact domains and subdomains (e.g., allowing `example.com` also allows `sub.example.com`)\n\n## Requirements\n\n### Without Docker\n- Node.js 14+\n- Internet connection\n\n### With Docker\n- Docker\n- Internet connection","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelchizedek6809%2Furl2og","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelchizedek6809%2Furl2og","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelchizedek6809%2Furl2og/lists"}