{"id":21964568,"url":"https://github.com/intob/media-store-worker","last_synced_at":"2026-04-28T23:04:55.372Z","repository":{"id":152467624,"uuid":"408210055","full_name":"intob/media-store-worker","owner":"intob","description":"A Cloudflare Worker to handle storing \u0026 retrieving media files, using Cloudflare KV","archived":false,"fork":false,"pushed_at":"2021-09-19T18:49:34.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T08:04:09.241Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intob.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-09-19T18:49:33.000Z","updated_at":"2024-03-24T08:43:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"f86f5941-eb1d-4697-8a4a-304f4bb08c6c","html_url":"https://github.com/intob/media-store-worker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intob%2Fmedia-store-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intob%2Fmedia-store-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intob%2Fmedia-store-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intob%2Fmedia-store-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intob","download_url":"https://codeload.github.com/intob/media-store-worker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245021301,"owners_count":20548318,"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-11-29T12:24:53.560Z","updated_at":"2026-04-28T23:04:50.328Z","avatar_url":"https://github.com/intob.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# media-store-worker\nmedia-store-worker is a Cloudflare Worker that uses Cloudflare KV to store \u0026 serve media files very quickly.\n\nYour application must authenticate to PUT new media files, this is currently implemented using GitHub's auth0 API. When you PUT a new media file, you get a permalink back:\n```\nhttps://{workersDomain}/{mimeType}/{contentHash}`\n```\n\n\n## Deployment\nDeploy this Worker using the [wrangler](https://developers.cloudflare.com/workers/cli-wrangler) CLI\n\nYou must set the following secrets either using wrangler CLI or in your Cloudflare Workers dashboard:\n- GITHUB_CLIENT_ID `wrangler secret put GITHUB_CLIENT_ID`\n- GITHUB_CLIENT_SECRET `wrangler secret put GITHUB_CLIENT_SECRET`\n\nYou must also enter your Cloudflare account details in `wrangler.toml`, so wrangler can deploy your worker.\n\nFinally, deploy the Worker...\n```bash\nwrangler publish\n```\n\n## Usage\nPUT an image, for example...\n```\ncurl --location --request PUT 'https://media-store.dr-useless.workers.dev/' \\\n--header 'Authorization: Bearer [MY_GITHUB_APP_TOKEN]' \\\n--header 'Content-Type: image/jpeg' \\\n--data-binary '@~/Pictures/wow.jpg'\n```\nResponds with:\n```\nhttps://media-store.dr-useless.workers.dev/image/jpeg/30ab85b49559810996e6ad256ee51708e0180f991341c8e7430824a04767474e\n```\n- This URL contains a hash of the content, and will never change.\n- On each request, this key will refresh if inside the `refreshThreshold`.\n- This key will expire `keyTtl` seconds after the last refresh.\n\nThis media-store will not bloat with old keys, as they expire if they are not requested for the configured `keyTtl`.\n\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nDefinitely needed:\n- `config.js`\n- Provide an agnostic/generic interface for handling authentication\n\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintob%2Fmedia-store-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintob%2Fmedia-store-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintob%2Fmedia-store-worker/lists"}