{"id":28396239,"url":"https://github.com/ssbc/ssb-serve-blobs","last_synced_at":"2025-07-05T08:05:20.472Z","repository":{"id":54189994,"uuid":"121677016","full_name":"ssbc/ssb-serve-blobs","owner":"ssbc","description":"Sbot plugin to serve blobs from a local http server","archived":false,"fork":false,"pushed_at":"2023-07-12T21:18:28.000Z","size":57,"stargazers_count":9,"open_issues_count":0,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-09T15:48:02.796Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssbc.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}},"created_at":"2018-02-15T20:08:28.000Z","updated_at":"2023-08-05T22:42:08.000Z","dependencies_parsed_at":"2024-03-17T02:25:07.673Z","dependency_job_id":null,"html_url":"https://github.com/ssbc/ssb-serve-blobs","commit_stats":{"total_commits":57,"total_committers":7,"mean_commits":8.142857142857142,"dds":"0.45614035087719296","last_synced_commit":"3e83da776eb72e9f6068851c525fbb4980377014"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/ssbc/ssb-serve-blobs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-serve-blobs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-serve-blobs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-serve-blobs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-serve-blobs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssbc","download_url":"https://codeload.github.com/ssbc/ssb-serve-blobs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-serve-blobs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260089978,"owners_count":22957161,"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":"2025-05-31T21:37:28.253Z","updated_at":"2025-06-23T06:32:46.055Z","avatar_url":"https://github.com/ssbc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ssb-serve-blobs\n\nScuttlebot plugin to serve blobs from a local http server on port 26835.\n\nNote also this remark plugin for modifying markdown to link to the server: [remark-images-to-ssb-serve-blobs](https://gitlab.com/staltz/remark-images-to-ssb-serve-blobs)\n\n## Installation\n\nRequires ssb-blobs plugin.\n\n```diff\n const createSbot = require('scuttlebot/index')\n   .use(require('scuttlebot/plugins/plugins'))\n   .use(require('scuttlebot/plugins/master'))\n   .use(require('scuttlebot/plugins/gossip'))\n   .use(require('scuttlebot/plugins/replicate'))\n   .use(require('ssb-friends'))\n+  .use(require('ssb-blobs'))\n   .use(require('ssb-backlinks'))\n   .use(require('ssb-private'))\n   .use(require('ssb-about'))\n   .use(require('ssb-query'))\n+  .use(require('ssb-serve-blobs'))\n   .use(require('scuttlebot/plugins/invite'))\n   .use(require('scuttlebot/plugins/block'))\n   .use(require('scuttlebot/plugins/local'))\n```\n\n## Usage\n\n```js\nconst Stack = require('secret-stack')\nconst caps = require('ssb-caps')\n\nconst stack = Stack({ caps })\n  .use(require('ssb-db'))\n  .use(require('ssb-blobs'))       // \u003c\u003c required\n  .use(require('ssb-serve-blobs')) // needs: blobs\n\nconst config = {\n  // See ssb-config for other needed config\n  serveBlobs: {\n    // Enable CORS\n    cors: true,\n\n    // Content Security Policy (default: 'default-src none; sandbox')\n    csp: \"default-src 'self';\",\n\n    // Port to serve blobs from (default: 26835)\n    port: 3921,\n  },\n};\nconst server = stack(config)\n```\n\n## Utils\n\n```js\nconst toUrl = require('ssb-serve-blobs/id-to-url')\n\nconst blobId = '\u0026d8kM9RXf5zvvy+AzlQ//JbCF0AEJelTl6m03u3dVVj4=.sha256'\nconst unboxKey = 'uU0nuZNNPgilLlLX2n2r+sSE7+N6U4DukIj3rOLvzek='\n\nconsole.log(toUrl(blobId))\n// http://localhost:26835/get/%26d8kM9RXf5zvvy%2BAzlQ%2F%2FJbCF0AEJelTl6m03u3dVVj4%3D.sha256\n\nconsole.log(toUrl(blobId, {unbox: unboxKey}))\n// http://localhost:26835/get/%26d8kM9RXf5zvvy%2BAzlQ%2F%2FJbCF0AEJelTl6m03u3dVVj4%3D.sha256?unbox=uU0nuZNNPgilLlLX2n2r%2BsSE7%2BN6U4DukIj3rOLvzek%3D\n\nconsole.log(toUrl(blobId, {port: 6000}))\n// http://localhost:6000/get/%26d8kM9RXf5zvvy%2BAzlQ%2F%2FJbCF0AEJelTl6m03u3dVVj4%3D.sha256\n```\n\n```js\nconst fromUrl = require('ssb-serve-blobs/url-to-id')\n\nconsole.log(fromUrl('http://localhost:26835/get/%26Pe5kTo%2FV%2Fw4MToasp1IuyMrMcCkQwDOdyzbyD5fy4ac%3D.sha256'))\n// \u0026Pe5kTo/V/w4MToasp1IuyMrMcCkQwDOdyzbyD5fy4ac=.sha256\n\nconsole.log(fromUrl('http://localhost:12345/get/%26Pe5kTo%2FV%2Fw4MToasp1IuyMrMcCkQwDOdyzbyD5fy4ac%3D.sha256', {port: 12345}))\n// \u0026Pe5kTo/V/w4MToasp1IuyMrMcCkQwDOdyzbyD5fy4ac=.sha256\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbc%2Fssb-serve-blobs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssbc%2Fssb-serve-blobs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbc%2Fssb-serve-blobs/lists"}