{"id":19605101,"url":"https://github.com/gztimewalker/berry-pasty","last_synced_at":"2025-04-27T19:32:44.023Z","repository":{"id":242151432,"uuid":"808822710","full_name":"GZTimeWalker/berry-pasty","owner":"GZTimeWalker","description":"Just a pastebin and url shortener. Multi arch with only ~4MB image size.","archived":false,"fork":false,"pushed_at":"2025-04-01T15:36:51.000Z","size":88,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-21T10:17:57.905Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/GZTimeWalker.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,"publiccode":null,"codemeta":null}},"created_at":"2024-05-31T22:41:32.000Z","updated_at":"2025-04-01T15:36:55.000Z","dependencies_parsed_at":"2024-09-07T10:43:16.466Z","dependency_job_id":"b9ecfe11-deee-47c5-8846-252fecb1372e","html_url":"https://github.com/GZTimeWalker/berry-pasty","commit_stats":null,"previous_names":["gztimewalker/berry-pasty"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GZTimeWalker%2Fberry-pasty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GZTimeWalker%2Fberry-pasty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GZTimeWalker%2Fberry-pasty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GZTimeWalker%2Fberry-pasty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GZTimeWalker","download_url":"https://codeload.github.com/GZTimeWalker/berry-pasty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251196111,"owners_count":21550904,"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-11T09:41:11.090Z","updated_at":"2025-04-27T19:32:43.768Z","avatar_url":"https://github.com/GZTimeWalker.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Berry Pasty\n\nA simple **pure Rust** pastebin and url shortener, inspired by [pasty](https://github.com/darkyzhou/pasty).\n\n\u003e [!TIP]\n\u003e\n\u003e **The image size is only 3.9MiB (1.77MiB compressed), currently support x86_64, aarch64.**\n\u003e\n\u003e Theoretically, it can be compiled to any Rust-supported architecture and run as a single binary.\n\n## Usage\n\n### Access\n\n- **Index**\n\n    You can set the index text or link in the configuration file, if the index link is specified, it will redirect to the link directly.\n\n- **Access a paste**\n\n    To access a paste, you can just visit the link.\n\n    ```bash\n    curl http://localhost:8080/\u003cid\u003e\n    ```\n\n### Update\n\nTo update (or add) a paste, you can send a POST request to the server with the content in the body, the server will return the link to the paste.\n\n- **Update a text paste**\n\n    To update (or add) a text paste, you can send a POST request to the server with the content in the body, the server will return the link to the paste.\n\n    ```bash\n    curl --data \"Hello, World!\" http://localhost:8080/access=\u003caccess_password\u003e\n    ```\n\n- **Update a redirect link**\n\n    To update (or add) a redirect link, you should specify the type as `link` and the link in the body.\n\n    ```bash\n    curl --data \"https://example.com\" http://localhost:8080/access=\u003caccess_password\u003e\u0026type=link\n    ```\n\n- **Update a paste with a specific ID**\n\n    To update (or add) a paste with a specific ID (or path), you can just specify the ID in the URL.\n\n    ```bash\n    curl --data \"Hello, World!\" http://localhost:8080/\u003cid\u003e?access=\u003caccess_password\u003e\n    ```\n\n- **Update a paste with a password**\n\n    To update (or add) a paste with a password, you can specify the password in the URL.\n\n    **Only the owner can edit or delete the paste with the password.**\n\n    ```bash\n    curl --data \"Hello, World!\" http://localhost:8080/\u003cid\u003e?access=\u003caccess_password\u003e\u0026password=\u003cpassword\u003e\n    ```\n\n### Delete\n\nTo delete a paste, you can send a DELETE request to the server with the password in the URL.\n\n```bash\ncurl -X DELETE http://localhost:8080/\u003cid\u003e?access=\u003caccess_password\u003e\u0026password=\u003cpassword\u003e\n```\n\n### Statistics and Management\n\nAll data is returned in JSON format. you can use `curl` and pipe it to `python -m json.tools` to get a better view.\n\n- **Statistics**\n\n    You can visit the `\u003cid\u003e/stats` path to get the statistics of the paste.\n\n- **List**\n\n    You can visit the `/all?access=\u003caccess_password\u003e` path to get a list of all pastes and its statistics.\n\n## Configuration\n\n```toml\n[default]\naddress = \"0.0.0.0\"\n\n[default.limits]\n# only allow 128 KiB of data to be uploaded\n\"plain/text\" = \"128 KiB\"\n\n[default.pasty]\n# the path to the database file\ndb_path = \"berry-pasty.redb\"\n\n# the password required to add or delete, set to \"\" if not needed\naccess_password = \"password\"\n\n# the length of the random ID for pastes\nrandom_id_length = 8\n\n# The text displayed on the index page,\n# if index_link is specified, it will redirect to the link directly\nindex_text = \"Welcome Berry Pasty！\"\nindex_link = \"\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgztimewalker%2Fberry-pasty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgztimewalker%2Fberry-pasty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgztimewalker%2Fberry-pasty/lists"}