{"id":13513714,"url":"https://github.com/atmos/camo","last_synced_at":"2025-12-15T14:27:59.746Z","repository":{"id":1178473,"uuid":"1076534","full_name":"atmos/camo","owner":"atmos","description":":lock: an http proxy to route images through SSL","archived":true,"fork":false,"pushed_at":"2021-04-04T19:59:16.000Z","size":215,"stargazers_count":1803,"open_issues_count":25,"forks_count":370,"subscribers_count":106,"default_branch":"master","last_synced_at":"2024-09-27T03:03:51.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atmos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-11-13T02:56:46.000Z","updated_at":"2024-09-24T08:23:51.000Z","dependencies_parsed_at":"2022-08-06T10:15:38.399Z","dependency_job_id":null,"html_url":"https://github.com/atmos/camo","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atmos%2Fcamo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atmos%2Fcamo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atmos%2Fcamo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atmos%2Fcamo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atmos","download_url":"https://codeload.github.com/atmos/camo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234563125,"owners_count":18853057,"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":[],"created_at":"2024-08-01T05:00:36.275Z","updated_at":"2025-09-28T21:30:22.678Z","avatar_url":"https://github.com/atmos.png","language":"CoffeeScript","funding_links":[],"categories":["CoffeeScript"],"sub_categories":[],"readme":"# camo [![Build Status](https://travis-ci.org/atmos/camo.svg?branch=master)](https://travis-ci.org/atmos/camo)\n\nCamo is all about making insecure assets look secure.  This is an SSL image proxy to prevent mixed content warnings on secure pages served from [GitHub](https://github.com).\n\n![camo](https://cloud.githubusercontent.com/assets/38/24514552/88f29edc-1529-11e7-832f-6d2942144c87.gif)\n\nWe want to allow people to keep embedding images in comments/issues/READMEs.\n\n[There's more info on the GitHub blog](https://github.com/blog/743-sidejack-prevention-phase-3-ssl-proxied-assets).\n\nUsing a shared key, proxy URLs are authenticated with [hmac](http://en.wikipedia.org/wiki/HMAC) so we can bust caches/ban/rate limit if needed.\n\nCamo currently runs on node version 0.10.29 at GitHub on [heroku](http://heroku.com).\n\n[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/atmos/camo)\n\nFeatures\n--------\n\n* Max size for proxied images\n* Follow redirects to a certain depth\n* Restricts proxied images content-types to a whitelist\n* Forward images regardless of HTTP status code\n\nAt GitHub we render markdown and replace all of the `src` attributes on the `img` tags with the appropriate URL to hit the proxies.  There's example code for creating URLs in [the tests](https://github.com/atmos/camo/blob/master/test/proxy_test.rb).\n\n## URL Formats\n\nCamo supports two distinct URL formats:\n\n    http://example.org/\u003cdigest\u003e?url=\u003cimage-url\u003e\n    http://example.org/\u003cdigest\u003e/\u003cimage-url\u003e\n\nThe `\u003cdigest\u003e` is a 40 character hex encoded HMAC digest generated with a shared\nsecret key and the unescaped `\u003cimage-url\u003e` value. The `\u003cimage-url\u003e` is the\nabsolute URL locating an image. In the first format, the `\u003cimage-url\u003e` should be\nURL escaped aggressively to ensure the original value isn't mangled in transit.\nIn the second format, each byte of the `\u003cimage-url\u003e` should be hex encoded such\nthat the resulting value includes only characters `[0-9a-f]`.\n\n## Configuration\n\nCamo is configured through environment variables.\n\n* `PORT`: The port number Camo should listen on. (default: 8081)\n* `CAMO_HEADER_VIA`: The string for Camo to include in the `Via` and `User-Agent` headers it sends in requests to origin servers. (default: `Camo Asset Proxy \u003cversion\u003e`)\n* `CAMO_KEY`: A shared key consisting of a random string, used to generate the HMAC digest.\n* `CAMO_LENGTH_LIMIT`: The maximum `Content-Length` Camo will proxy. (default: 5242880)\n* `CAMO_LOGGING_ENABLED`: The logging level used for reporting debug or error information. Options are `debug` and `disabled`. (default: `disabled`)\n* `CAMO_MAX_REDIRECTS`: The maximum number of redirects Camo will follow while fetching an image. (default: 4)\n* `CAMO_SOCKET_TIMEOUT`: The maximum number of seconds Camo will wait before giving up on fetching an image. (default: 10)\n* `CAMO_TIMING_ALLOW_ORIGIN`: The string for Camo to include in the [`Timing-Allow-Origin` header](http://www.w3.org/TR/resource-timing/#cross-origin-resources) it sends in responses to clients. The header is omitted if this environment variable is not set. (default: not set)\n* `CAMO_HOSTNAME`: The `Camo-Host` header value that Camo will send. (default: `unknown`)\n* `CAMO_KEEP_ALIVE`: Whether or not to enable keep-alive session. (default: `false`)\n\n## Testing Functionality\n\n### Bundle Everything\n\n    % rake bundle\n\n### Start the server\n\n    % coffee server.coffee\n\n### In another shell\n\n    % rake\n\n### Debugging\n\nTo see the full URL restclient is hitting etc, try this.\n\n    % RESTCLIENT_LOG=stdout rake\n\n### Deployment\n\nYou should run this on heroku.\n\nTo enable useful line numbers in stacktraces you probably want to compile the server.coffee file to native javascript when deploying.\n\n    % coffee -c server.coffee\n    % /usr/bin/env PORT=9090 CAMO_KEY=\"\u003cmy application key\u003e\" node server.js\n\n### Docker\n\nA `Dockerfile` is included, you can build and run it with:\n\n```bash\ndocker build -t camo .\ndocker run --env CAMO_KEY=YOUR_KEY -t camo\n```\n\n## Examples\n* Ruby - https://github.com/ankane/camo\n* PHP - https://github.com/willwashburn/Phpamo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatmos%2Fcamo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatmos%2Fcamo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatmos%2Fcamo/lists"}