[PR #153] [CLOSED] feat: generate human-readable url path #181

Closed
opened 2026-02-27 10:16:05 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/matze/wastebin/pull/153
Author: @mokurin000
Created: 4/5/2025
Status: Closed

Base: masterHead: human-readable


📝 Commits (6)

  • 3dcbace feat: generate human-readable url path
  • 43e8b0d Update textarea properties
  • 874fe97 ci: fix ci & support more platforms
  • 902d389 perf: stay neat and high-performance
  • 9debf3a Merge branch 'matze:master' into human-readable
  • 2fad4c2 enhance: smplify call-side code of id generation

📊 Changes

14 files changed (+352 additions, -185 deletions)

View changed files

📝 Cargo.lock (+66 -33)
📝 README.md (+1 -0)
📝 crates/wastebin_core/Cargo.toml (+11 -1)
📝 crates/wastebin_core/src/db.rs (+118 -94)
📝 crates/wastebin_core/src/id.rs (+109 -38)
📝 crates/wastebin_ctl/Cargo.toml (+1 -0)
📝 crates/wastebin_ctl/src/main.rs (+4 -3)
📝 crates/wastebin_server/src/handlers/download.rs (+1 -1)
📝 crates/wastebin_server/src/handlers/html/paste.rs (+1 -1)
📝 crates/wastebin_server/src/handlers/html/qr.rs (+1 -1)
📝 crates/wastebin_server/src/handlers/insert/api.rs (+18 -5)
📝 crates/wastebin_server/src/handlers/insert/form.rs (+14 -7)
📝 crates/wastebin_server/src/handlers/raw.rs (+1 -1)
📝 crates/wastebin_server/templates/index.html (+6 -0)

📄 Description

This implements #152,

Performance

See HTML reports in wastebin-bench.zip.

Tested on Windows 11, with i7-12700H, sqlite backend in memory mode.

Other changes

  • Fixed test build configuration for wastebin_core when test it without other crates
  • Check collisions of id. (Writing an exists method for db will not work, due to TOCTOU problem)
    • In previous implementation, we will return 500 Error on collision, that's not cool
  • No additional environment variable introduced. Users could request to generate traditional random id or human readable id
  • 11% higher throughput (tested on i7-12700H, see report.zip).
    • Mutex::lock() everytime is generally a bad idea. Connection per thread is not possible if we don't want to drop in-memory mode.

TODO

  • add tests for human-readable Id
  • add human-readable checkbox to webui

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/matze/wastebin/pull/153 **Author:** [@mokurin000](https://github.com/mokurin000) **Created:** 4/5/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `human-readable` --- ### 📝 Commits (6) - [`3dcbace`](https://github.com/matze/wastebin/commit/3dcbace7ae84059d46e1b2c0c4a7d0a3417ba0dd) feat: generate human-readable url path - [`43e8b0d`](https://github.com/matze/wastebin/commit/43e8b0d64373a6b8e8b7d18b4850be5de7f25a04) Update textarea properties - [`874fe97`](https://github.com/matze/wastebin/commit/874fe97f33331f88e61c75d7f84414afb475819b) ci: fix ci & support more platforms - [`902d389`](https://github.com/matze/wastebin/commit/902d38913904d0417ea8cd7fe1a12e558e433231) perf: stay neat and high-performance - [`9debf3a`](https://github.com/matze/wastebin/commit/9debf3a250ab3dd58edbeaca49087fa7258a0f1a) Merge branch 'matze:master' into human-readable - [`2fad4c2`](https://github.com/matze/wastebin/commit/2fad4c2f8f725bebb64519cf6aa084fed514c1a2) enhance: smplify call-side code of id generation ### 📊 Changes **14 files changed** (+352 additions, -185 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+66 -33) 📝 `README.md` (+1 -0) 📝 `crates/wastebin_core/Cargo.toml` (+11 -1) 📝 `crates/wastebin_core/src/db.rs` (+118 -94) 📝 `crates/wastebin_core/src/id.rs` (+109 -38) 📝 `crates/wastebin_ctl/Cargo.toml` (+1 -0) 📝 `crates/wastebin_ctl/src/main.rs` (+4 -3) 📝 `crates/wastebin_server/src/handlers/download.rs` (+1 -1) 📝 `crates/wastebin_server/src/handlers/html/paste.rs` (+1 -1) 📝 `crates/wastebin_server/src/handlers/html/qr.rs` (+1 -1) 📝 `crates/wastebin_server/src/handlers/insert/api.rs` (+18 -5) 📝 `crates/wastebin_server/src/handlers/insert/form.rs` (+14 -7) 📝 `crates/wastebin_server/src/handlers/raw.rs` (+1 -1) 📝 `crates/wastebin_server/templates/index.html` (+6 -0) </details> ### 📄 Description This implements #152, ## Performance See HTML reports in [wastebin-bench.zip](https://github.com/user-attachments/files/19618873/wastebin-bench.zip). Tested on Windows 11, with `i7-12700H`, sqlite backend in memory mode. ## Other changes - Fixed test build configuration for wastebin_core when test it without other crates - Check collisions of id. (Writing an `exists` method for db will not work, due to TOCTOU problem) - In previous implementation, we will return 500 Error on collision, that's not cool - No additional environment variable introduced. Users could request to generate traditional random id or human readable id - 11% higher throughput (tested on i7-12700H, see [report.zip](https://github.com/user-attachments/files/19637002/report.zip)). - Mutex::lock() everytime is generally a bad idea. Connection per thread is not possible if we don't want to drop in-memory mode. ## TODO - [x] add tests for human-readable Id - [x] add human-readable checkbox to webui --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 10:16:05 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wastebin-matze#181
No description provided.