{"id":13687548,"url":"https://github.com/aeyoll/toothpaste","last_synced_at":"2025-03-18T18:33:38.784Z","repository":{"id":145374969,"uuid":"402317093","full_name":"aeyoll/toothpaste","owner":"aeyoll","description":"A pastebin written in Rust","archived":false,"fork":false,"pushed_at":"2024-10-22T07:11:05.000Z","size":593,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-22T07:37:48.108Z","etag":null,"topics":["axum","bootstrap","pastebin","pastebin-service","rust","sqlite","webpack"],"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/aeyoll.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-09-02T06:39:03.000Z","updated_at":"2024-10-22T07:11:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"19d305b4-dadf-42cc-a291-27af3732c438","html_url":"https://github.com/aeyoll/toothpaste","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeyoll%2Ftoothpaste","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeyoll%2Ftoothpaste/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeyoll%2Ftoothpaste/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeyoll%2Ftoothpaste/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aeyoll","download_url":"https://codeload.github.com/aeyoll/toothpaste/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221715973,"owners_count":16868647,"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":["axum","bootstrap","pastebin","pastebin-service","rust","sqlite","webpack"],"created_at":"2024-08-02T15:00:56.401Z","updated_at":"2025-03-18T18:33:38.777Z","avatar_url":"https://github.com/aeyoll.png","language":"Rust","funding_links":[],"categories":["bootstrap"],"sub_categories":[],"readme":"# Toothpaste\n\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n![License](https://img.shields.io/github/license/aeyoll/toothpaste)\n\nA pastebin application written in Rust with a frontend built using Yew. It also includes a CLI tool to create pastes.\n\n## Requirements\n\n- [Rust](https://www.rust-lang.org/)\n- [Trunk](https://trunkrs.dev/)\n\n## Project Structure\n\nThe project is organized into three main crates:\n\n1. `toothpaste-backend`: The Rust backend server\n2. `toothpaste-frontend`: The Yew-based frontend\n3. `toothpaste-cli`: The CLI tool to create pastes\n\n## Installation and Setup\n\n1. Set the `DATABASE_URL` environment variable (e.g., `DATABASE_URL=sqlite://sqlite.db`).\n\n2. Initialize the database:\n\n```shell\ntouch sqlite.db\n```\n\n## Build the frontend assets\n\n```shell\ncd crates/toothpaste-frontend\n\n# Build the frontend static\n# For development\nTOOTHPASTE_API_URL=http://127.0.0.1:8080 trunk serve --port 8081\n# For production\ntrunk build --release\n```\n\n## Build and run the backend server:\n\n```shell\ntoothpaste-backend --ip 127.0.0.1 --port 8080 # default values\n```\n\n## Build and run the CLI tool:\n\n```shell\ntoothpaste-cli --name toothpaste.txt --expire-after 86400 \u003c your-content.txt # From stdin redirection\ncat your-content.txt | toothpaste-cli --name toothpaste.txt --expire-after 86400 # From stdin indirection\ntoothpaste-cli --expire-after 86400 -f your-content.txt # From file\n```\n\n## Set up a cron job for paste expiration cleanup:\n\n```shell\n* * * * * wget -q -O /dev/null \"http(s)://your_host/api/paste/cleanup\"\n```\n\n## Sample nginx configuration\n\n```nginx\nserver {\n    server_name paste.foo.bar;\n\n    root /path/to/toothpaste/frontend;\n\n    location / {\n        try_files $uri $uri/ /index.html;\n    }\n\n    location /api/ {\n        proxy_pass http://127.0.0.1:8081;\n        proxy_set_header Host $host;\n        proxy_http_version 1.1;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection 'upgrade';\n    }\n}\n```\n\n## License\n\nSee the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeyoll%2Ftoothpaste","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faeyoll%2Ftoothpaste","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeyoll%2Ftoothpaste/lists"}