{"id":13688755,"url":"https://github.com/beleon/buckets","last_synced_at":"2025-12-15T09:18:40.105Z","repository":{"id":46955426,"uuid":"243962677","full_name":"beleon/buckets","owner":"beleon","description":"A tiny and fast in-memory pastbin with curl support","archived":false,"fork":false,"pushed_at":"2021-09-20T15:39:40.000Z","size":244,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-03T15:12:14.003Z","etag":null,"topics":["curl","docker","go","golang","pastebin","self-hosted"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/beleon.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":"2020-02-29T12:13:34.000Z","updated_at":"2022-12-01T22:58:22.000Z","dependencies_parsed_at":"2022-09-01T05:22:27.680Z","dependency_job_id":null,"html_url":"https://github.com/beleon/buckets","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beleon%2Fbuckets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beleon%2Fbuckets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beleon%2Fbuckets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beleon%2Fbuckets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beleon","download_url":"https://codeload.github.com/beleon/buckets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224274848,"owners_count":17284654,"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":["curl","docker","go","golang","pastebin","self-hosted"],"created_at":"2024-08-02T15:01:21.792Z","updated_at":"2025-12-15T09:18:35.047Z","avatar_url":"https://github.com/beleon.png","language":"HTML","funding_links":[],"categories":["golang"],"sub_categories":[],"readme":"# \u003cimg src=\"https://github.com/sellleon/buckets/raw/master/logo.png\" width=\"25px\"/\u003e Buckets\n[![Go Report Card](https://goreportcard.com/badge/github.com/sellleon/buckets)](https://goreportcard.com/report/github.com/sellleon/buckets)\n[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/sellleon/buckets/blob/master/LICENSE)\n\nA tiny and fast in-memory pastbin with curl support. Buckets is a ~350 lines single file go project with no dependencies which\nserves a single file HTML page with no dependencies using only vanilla javascript. The services can be hosted via\ndocker and accessed using simple curl commands. It has no means of authentication and stores all data in memory; no \ndatabases.\n\n## Usage\n\nEither open your browser at `http://localhost:8080` or use the API directly:\n\n### Storing Buckets\nTo store a bucket send a POST request to `http://localhost:8080` with the message or file as the request body. Storing\na message with curl would look like this:\n\n```bash\ncurl -X POST --data \"Hello, World\" http://localhost:8080\n```\n\nA file upload would look like this:\n\n```bash\ncurl -X POST --data-binary @path/to/file http://localhost:8080\n```\n\nThe response is the URL where your data is stored at. E.g. `http://localhost:8080/shbo`\n\nYou can also store a bucket at a location of your choice by sending a POST request to that location:\n\n```bash\ncurl -X POST --data-binary @path/to/file http://localhost:8080/my/custom/bucket/location\n```\n\nNow your bucket is stored at `http://localhost:8080/my/custom/bucket/location`.\n\nWARNING: This will replace any data that was stored at this location before.\n\n### Retrieving Buckets\nSimply send a GET request to the URL your bucket is stored at. E.g. through opening the address in your\nbrowser or using curl:\n\n```bash\ncurl http://localhost:8080/shbo\n```\n\nIf your bucket stores binary data you can save the data into a file using:\n\n```bash\ncurl -o path/to/savefile http://localhost:8080/shbo\n```\n\n### Deleting Buckets\nTo delete a bucket send a DELETE request to the URL your bucket is stored at. E.g. using curl:\n\n```bash\ncurl -X DELETE http://localhost:8080/shbo\n```\n\n## Setup\n\n### Build Project\n\nWorking go installation and git needed.\n\nclone project:\n\n```bash\ngit clone https://github.com/sellleon/buckets\n```\n\nchange into project dir:\n\n```bash\ncd buckets\n```\n\nbuild project:\n\n```bash\ngo build\n```\n\nrun:\n\n```bash\n./buckets\n```\n\n### Docker\n\nWorking docker installation and git needed.\n\nclone project:\n\n```bash\ngit clone https://github.com/sellleon/buckets\n```\n\nchange into project dir:\n\n```bash\ncd buckets\n```\n\nbuild docker image:\n\n```bash\ndocker image build -t buckets:0.1 .\n```\n\nrun docker:\n\n```bash\ndocker run --rm --name=buckets -p 8080:8080 buckets:0.1\n```\n\nor run docker with some environment variables (time to live 2 days, store a maximum of 20 buckets):\n\n```bash\ndocker run --rm --name=buckets -p 8080:8080 --env BUCKETS_TTL=172800 --env BUCKETS_MAX_BUCKETS=20 buckets:0.1\n```\n\n## Configuration\n\nA couple of properties can be set via environment variables:\n\n| Env Name                 |  Description                                                                                                                                                                                                                                                            |\n|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| BUCKETS_BASE_URL         | URL location of your service. Default `http://localhost:8080`. Used for generating links of buckets and for the HTML page.                                                                                                                                              |\n| BUCKETS_TTL              | A bucket's time to live. Determines how long a bucket will be stored. Default is 2 days. Use 0 for indefinite storage of buckets.                                                                                                                                       |\n| BUCKETS_MAX_STORAGE_SIZE | Maximum size that the sum of all buckets can have in MB (i.e. 1000000 bytes) as a float64 value. Oldest buckets will be delete until enough free space is available if new bucket would cause the storage size to be larger than the MAX_STORAGE_SIZE. Default is 1000. |\n| BUCKETS_MAX_BUCKETS      | Maximum amount of buckets that can be stored at once. Oldest bucket will be deleted when inserting new bucket when maximum number of buckets is reached. Default is 1000.                                                                                               |\n| BUCKETS_CHARSET          | The character set that will be used to generate the location of the buckets. Default is a-z.                                                                                                                                                                            |\n| BUCKETS_SLUG_SIZE        | Length of the generated bucket location. Default is 4.                                                                                                                                                                                                                  |\n| BUCKETS_SEED             | Mostly for debugging. Seed is used for generating the location of new buckets. Default is current time.                                                                                                                                                                 |\n\nIf you want to use TLS/SSL or want to constrain the size of a bucket I'd suggest using nginx with proxy_pass.\n\n## Screenshot\n![](https://github.com/sellleon/buckets/blob/master/buckets-screenshot.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeleon%2Fbuckets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeleon%2Fbuckets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeleon%2Fbuckets/lists"}