{"id":25220411,"url":"https://github.com/adridevelopsthings/hastebin","last_synced_at":"2025-04-05T11:21:16.398Z","repository":{"id":216159843,"uuid":"740258712","full_name":"AdriDevelopsThings/hastebin","owner":"AdriDevelopsThings","description":"A minimalistic hastebin server","archived":false,"fork":false,"pushed_at":"2024-03-04T22:26:21.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T21:53:12.778Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://haste.adridoesthings.com","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdriDevelopsThings.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}},"created_at":"2024-01-08T00:51:22.000Z","updated_at":"2024-01-08T17:04:13.000Z","dependencies_parsed_at":"2024-01-15T17:04:33.837Z","dependency_job_id":null,"html_url":"https://github.com/AdriDevelopsThings/hastebin","commit_stats":null,"previous_names":["adridevelopsthings/hastebin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdriDevelopsThings%2Fhastebin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdriDevelopsThings%2Fhastebin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdriDevelopsThings%2Fhastebin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdriDevelopsThings%2Fhastebin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdriDevelopsThings","download_url":"https://codeload.github.com/AdriDevelopsThings/hastebin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247326583,"owners_count":20920872,"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-02-10T21:53:15.373Z","updated_at":"2025-04-05T11:21:16.375Z","avatar_url":"https://github.com/AdriDevelopsThings.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hastebin\n\n## Installation\n### Docker\nJust pull the docker image:\n```\ndocker pull ghcr.io/adridevelopsthings/hastebin:main\n```\nand run the docker image:\n```\ndocker run --name hastebin -d -p 80:80 -v ./data:/data ghcr.io/adridevelopsthings/hastebin:main\n```\n\n### Build it yourself\nBuild a binary with cargo yourself:\n```\ncargo build --release\n```\n\n## Configuration\nConfigure your hastebin instance with environment variables:\n- `LISTEN_ADDRESS`: default=`127.0.0.1:8000`, docker default=`0.0.0.0:80`\n- `DATA_DIRECTORY`: path to the directory where the uploaded files should be stored, default=`data`, docker default=`/data`\n- `MAX_FILE_SIZE`: maximum size a file can have, default=`1048576` (1 MB)\n- `AUTO_DELETE_CHECK_INTERVAL`: in seconds, default=`120`\n- `AUTO_DELETE_OLDER_THAN`: files older than this duration will be deleted (set this value to 0 to disable auto deletion), default=`172800`(2 days)\n- `ID_LENGTH`: the length a generated file id should have, default=`10`\n- `CHANGE_KEY_LENGTH`: the length a change key should have, default=`64`\n\n## Endpoints\n\n### Static endpoints\n`/index.html` and `/*/*` will return a html file. `/index.js` will return a javascript file.\n\n### Api endpoints\n- *Getting the content of a file* Make a GET request to `/api/file/\u003cfile_id\u003e/\u003cfile_name\u003e` and you will get the file with a guessed mime type or a 404 error.\n- *Creating a new file* Make a POST request to `/api/file/\u003cfile_name\u003e` and put the content in the body and you will get json that looks like this: `{\"id\": \"file_id\", \"change_key\": \"change_key\"}` back. If your uploaded file is too big an error 400 with the body `File is too big` will be responded.\n- *Modifying a file* Make a PUT request to `/api/file/\u003cfile_id\u003e/\u003cfile_name\u003e`, put the content in the body and set the `Change-Key` header to your change key. If the modification was successfull a status 204 will be responded. If your uploaded file is too big an error 400 with the body `File is too big` will be responded. If your change key is invalid an error 403 with the body `Invalid change key` will be responded.\n- *Deleting a file* Make a DELETE request to `/api/file/\u003cfile_id\u003e/\u003cfile_name\u003e` and set the `Change-Key` header to your change key. If the deletion was successfull a status 204 will be responded. If your change key is invalid an error 403 with the body `Invalid change key` will be responded.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadridevelopsthings%2Fhastebin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadridevelopsthings%2Fhastebin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadridevelopsthings%2Fhastebin/lists"}