{"id":13499285,"url":"https://github.com/ElementsProject/filebazaar","last_synced_at":"2025-03-29T04:31:00.441Z","repository":{"id":57235711,"uuid":"114530182","full_name":"ElementsProject/filebazaar","owner":"ElementsProject","description":"Sell digital files with Bitcoin \u0026 Lightning :zap:","archived":false,"fork":false,"pushed_at":"2019-10-14T10:18:22.000Z","size":183,"stargazers_count":122,"open_issues_count":2,"forks_count":28,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-02T10:02:35.972Z","etag":null,"topics":["bitcoin","lightning","lightning-charge","micropayments","nanopayments"],"latest_commit_sha":null,"homepage":"https://blockstream.com/2018/03/22/filebazaar-joins-the-lightning-charge-lapps.html","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/ElementsProject.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}},"created_at":"2017-12-17T11:16:29.000Z","updated_at":"2024-10-18T21:41:26.000Z","dependencies_parsed_at":"2022-08-23T15:50:51.290Z","dependency_job_id":null,"html_url":"https://github.com/ElementsProject/filebazaar","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElementsProject%2Ffilebazaar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElementsProject%2Ffilebazaar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElementsProject%2Ffilebazaar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElementsProject%2Ffilebazaar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElementsProject","download_url":"https://codeload.github.com/ElementsProject/filebazaar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246140565,"owners_count":20729797,"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":["bitcoin","lightning","lightning-charge","micropayments","nanopayments"],"created_at":"2024-07-31T22:00:31.851Z","updated_at":"2025-03-29T04:31:00.111Z","avatar_url":"https://github.com/ElementsProject.png","language":"JavaScript","readme":"# FileBazaar\n\n[![npm release](https://img.shields.io/npm/v/filebazaar.svg)](https://www.npmjs.com/package/filebazaar)\n[![MIT license](https://img.shields.io/github/license/elementsproject/filebazaar.svg)](https://github.com/elementsproject/filebazaar/blob/master/LICENSE)\n[![Pull Requests Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n[![IRC](https://img.shields.io/badge/chat-on%20freenode-brightgreen.svg)](https://webchat.freenode.net/?channels=lightning-charge)\n\nSell digital files with Bitcoin \u0026 Lightning.\n\n- Simple setup and minimal configuration, just put some files in a directory and start the server.\n\n- Lightweight web browsing interface, works without JavaScript.\n\n- Generates previews for images, videos, audio, pdf and text documents.\n\nPowered by :zap: [Lightning Charge](https://github.com/ElementsProject/lightning-charge).\n\n![FileBazaar demo](https://i.imgur.com/UhQD0Tg.gif)\n\n## Quickstart\n\nSetup [Lightning Charge](https://github.com/ElementsProject/lightning-charge), then:\n\n```bash\n# Install dependencies for EXIF extraction and preview generation\n$ apt install exiftool ffmpeg graphicsmagick unoconv\n\n# Install dependencies for node-canvas (see https://github.com/Automattic/node-canvas#installation)\n$ apt install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++\n\n# Install filebazaar\n$ npm install -g filebazaar\n\n# Prepare a directory with the files you wish to sell and cd to it\n$ mkdir ~/ForSale \u0026\u0026 cd ~/ForSale\n\n# Initialize the `_filebazaar.yaml` config file\n$ filebazaar init\n\n# Edit the config file (`charge_token` is required, `token_secret` is auto-generated)\n$ edit _filebazaar.yaml\n\n# Start filebazaar!\n$ filebazaar\n```\n\n## Configuration\n\nFileBazaar's configuration options can be managed using the `_filebazaar.yaml` file or via environment variables.\nAll config options are optional and have sane defaults except for `charge_token` and `token_secret`, which are required.\nIf you're accessing the web server remotely, you probably also want to set `host` and `url`.\nSee [`lib/config.js`](https://github.com/elementsproject/filebazaar/blob/master/src/lib/config.js) for more details.\n\nBelow is an example `_filebazaar.yaml` file:\n\n```yaml\n---\n\n### Server settings\n\nport: 9678\nhost: 127.0.0.1\nenv: production\nurl: http://my-public-url.com/\n\n### Lightning Charge\n\ncharge_url: http://localhost:9112\ncharge_token: API_TOKEN_CONFIGURED_IN_CHARGE\n\n### FileBazaar settings\n\n# The directory containing the files for sale\n# defaults to the directory containing the _filebazaar.yaml file\ndirectory: /home/shesek/ForSale\n\n# The default file price, can be overridden for individual files (see below)\ndefault_price: 0.25 USD\n\n# Expiry times\ninvoice_ttl: 3600 # lock-in exchange rate for 1 hour\ndownload_ttl: 172800 # make download available for 2 days after payment\n\n# Secret for generating HMAC access tokens (required)\ntoken_secret: SOME_LONG_RANDOM_STRING\n\n# Directory to keep cached preview files\n# defaults to `{directory}/_filebazaar_cache`\ncache_path: /path/to/filebazaar_cache\n\n### Looks \u0026 feel\n\n# See available themes on https://bootswatch.com\ntheme: yeti\n\n# Add custom CSS\ncss: |\n  body { background: blue }\n  a { color: orange }\n\n# Set custom views directory\nviews_dir: /path/to/custom/views\n\n# Set custom static files directory\nstatic_dir: /path/to/custom/static\n\n### Files settings\n\nfiles:\n  Books/Mastering-Bitcoin.pdf:\n    price: 5 USD\n    button: Buy this book\n    desc: \u003e      \n      Mastering Bitcoin is essential reading for everyone interested in learning about bitcoin.\n      \n      This field **supports markdown** and will show up on the file's page.\n\n  # if you're only interested in setting the price, you can use:\n  Books/Mastering-Bitcoin.pdf: 5 USD\n\n  # if you want to configure multiple files inside the same directory, you can nest them:\n  Media/: # (note the trailing slash)\n    Books/Andreas/:\n      Mastering-Bitcoin.pdf: 5 USD # /Media/Books/Andreas/Mastering-Bitcoin.pdf\n      The-Internet-of-Money.pdf: 4 USD # /Media/Books/Andreas/The-Internet-of-Money.pdf\n```\n\n## CLI\n\n#### Initializing `_filebazaar.yaml`\n\nYou can use `$ filebazaar init [directory]` to initialize a new `_filebazaar.yaml` config file.\nA random `token_secret` will be added for you. If no `[directory]` is specified, the file will be created in the working directory.\n\n#### Running FileBazaar\n\nTo start FileBazaar, run `$ filebazaar [path]`. You can either specify the path to the files directory or to the `_filebazaar.yaml` file.\nIf no `[path]` is specified, defaults to the working directory.\n\n## File Preview\n\nFileBazaar can currently generate previews for the following file types:\n\n- Images: a preview image will be generated by pixelating the left half of the image and adding watermark text using [node-canvas](https://github.com/Automattic/node-canvas) and [graphicsmagick](http://www.graphicsmagick.org) (see [example image](https://i.imgur.com/OmrUysL.png)).\n\n- Videos \u0026 audio: a preview will be generated by slicing off the first 30 seconds using [ffmpeg](http://ffmpeg.org).\n\n- Documents: a preview image of the first page of the document will be generated using [unoconv](https://github.com/dagwieers/unoconv) (supports pdf, doc, docx, odt, and many others).\n\nIn addition, EXIF metadata will be extracted using [exiftool](https://www.sno.phy.queensu.ca/~phil/exiftool/) and displayed for all file types.\n\n## License\n\nMIT\n","funding_links":[],"categories":["JavaScript","Developer Resources"],"sub_categories":["Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FElementsProject%2Ffilebazaar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FElementsProject%2Ffilebazaar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FElementsProject%2Ffilebazaar/lists"}