├── .gitignore ├── pastebin-server ├── .gitignore ├── rustfmt.toml ├── justfile ├── src │ ├── lib.rs │ ├── time.rs │ ├── block_rules.rs │ ├── dto.rs │ ├── error.rs │ ├── anti_bot.rs │ ├── crypto.rs │ ├── config.rs │ ├── main.rs │ ├── redis.rs │ ├── web.rs │ └── svc.rs ├── pastebin-server.toml ├── Cargo.toml └── Cargo.lock ├── pastebin-front ├── env.d.ts ├── public │ ├── robots.txt │ └── favicon.ico ├── src │ ├── components │ │ ├── XButton.vue │ │ ├── CodeView.vue │ │ ├── MarkdownView.vue │ │ ├── XView.vue │ │ └── XModal.vue │ ├── styles │ │ ├── prismjs.css │ │ ├── form.css │ │ ├── index.css │ │ └── btn.css │ ├── main.ts │ ├── router.ts │ ├── data │ │ ├── store.ts │ │ ├── expiration.ts │ │ ├── download.ts │ │ ├── dto.d.ts │ │ ├── lang.ts │ │ └── api.ts │ ├── hooks │ │ ├── useHighlight.ts │ │ ├── useCopyBtn.ts │ │ └── useKatex.ts │ ├── App.vue │ └── pages │ │ ├── EditorPage.vue │ │ └── ViewPage.vue ├── .prettierrc.json ├── tsconfig.json ├── tsconfig.node.json ├── .gitignore ├── .eslintrc.cjs ├── index.html ├── prismjs-custom.ts ├── vite.config.ts ├── package.json └── README.md ├── justfile ├── pastebin.nginx.conf ├── scripts └── dist.sh ├── README.md ├── .github ├── dependabot.yml └── workflows │ └── ci.yml └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | /dist -------------------------------------------------------------------------------- /pastebin-server/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /pastebin-front/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /pastebin-front/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-Agent: * 2 | Disallow: / 3 | -------------------------------------------------------------------------------- /pastebin-server/rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 100 2 | single_line_let_else_max_width = 100 3 | -------------------------------------------------------------------------------- /pastebin-front/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nugine/pastebin/HEAD/pastebin-front/public/favicon.ico -------------------------------------------------------------------------------- /pastebin-server/justfile: -------------------------------------------------------------------------------- 1 | dev: 2 | cargo fmt 3 | cargo clippy 4 | cargo test 5 | 6 | install: 7 | cargo install --path . 8 | 9 | -------------------------------------------------------------------------------- /pastebin-front/src/components/XButton.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | dist: 2 | ./scripts/dist.sh 3 | 4 | clean: 5 | cd pastebin-front && rm -rf node_modules 6 | cd pastebin-server && rm -rf target 7 | rm -rf dist 8 | -------------------------------------------------------------------------------- /pastebin-front/src/styles/prismjs.css: -------------------------------------------------------------------------------- 1 | /* 修改 prismjs theme "coy" */ 2 | pre[class*="language-"]::after, 3 | pre[class*="language-"]::before { 4 | box-shadow: none !important; 5 | display: none; 6 | } 7 | -------------------------------------------------------------------------------- /pastebin-server/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![forbid(unsafe_code)] 2 | 3 | mod anti_bot; 4 | mod block_rules; 5 | mod crypto; 6 | mod dto; 7 | mod error; 8 | mod redis; 9 | mod svc; 10 | mod time; 11 | 12 | pub mod config; 13 | pub mod web; 14 | -------------------------------------------------------------------------------- /pastebin-front/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/prettierrc", 3 | "semi": true, 4 | "tabWidth": 4, 5 | "useTabs": false, 6 | "singleQuote": false, 7 | "printWidth": 100, 8 | "trailingComma": "es5" 9 | } -------------------------------------------------------------------------------- /pastebin-front/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.json", 3 | "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], 4 | "compilerOptions": { 5 | "baseUrl": ".", 6 | "paths": { 7 | "@/*": ["./src/*"] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /pastebin-front/src/main.ts: -------------------------------------------------------------------------------- 1 | import "./styles/index.css"; 2 | 3 | import { createApp } from "vue"; 4 | import { createPinia } from "pinia"; 5 | 6 | import App from "./App.vue"; 7 | import router from "./router"; 8 | 9 | const app = createApp(App); 10 | 11 | app.use(createPinia()); 12 | app.use(router); 13 | 14 | app.mount("#app"); 15 | -------------------------------------------------------------------------------- /pastebin-front/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.json", 3 | "include": [ 4 | "vite.config.*", 5 | "vitest.config.*", 6 | "cypress.config.*", 7 | "playwright.config.*", 8 | "prismjs.custom.ts" 9 | ], 10 | "compilerOptions": { 11 | "composite": true, 12 | "types": ["node"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pastebin.nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | 4 | server_name "pastebin"; 5 | 6 | gzip on; 7 | gzip_comp_level 4; 8 | gzip_types application/javascript text/css application/json; 9 | gzip_vary on; 10 | gzip_static on; 11 | 12 | location / { 13 | proxy_pass http://localhost:3000; 14 | } 15 | 16 | location /api/ { 17 | proxy_pass http://localhost:8000; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pastebin-server/pastebin-server.toml: -------------------------------------------------------------------------------- 1 | [server] 2 | bind_addr = "localhost:8000" 3 | host_addr = "localhost" 4 | 5 | [security] 6 | secret_key = "magic" 7 | max_http_body_length = 262144 # 256 KiB 8 | max_expiration_seconds = 2592123 # 30 days 9 | max_qps = 1000 10 | max_title_chars = 64 11 | block_rules = [] 12 | anti_bot = true 13 | 14 | [redis] 15 | url = "redis://localhost:6379" 16 | key_prefix = "pastebin" 17 | max_open_connections = 32 18 | -------------------------------------------------------------------------------- /pastebin-front/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | .DS_Store 12 | dist 13 | dist-ssr 14 | coverage 15 | *.local 16 | 17 | /cypress/videos/ 18 | /cypress/screenshots/ 19 | 20 | # Editor directories and files 21 | .vscode/* 22 | !.vscode/extensions.json 23 | .idea 24 | *.suo 25 | *.ntvs* 26 | *.njsproj 27 | *.sln 28 | *.sw? 29 | -------------------------------------------------------------------------------- /pastebin-front/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | require("@rushstack/eslint-patch/modern-module-resolution"); 3 | 4 | module.exports = { 5 | root: true, 6 | extends: [ 7 | "plugin:vue/vue3-essential", 8 | "eslint:recommended", 9 | "@vue/eslint-config-typescript", 10 | "@vue/eslint-config-prettier/skip-formatting", 11 | ], 12 | parserOptions: { 13 | ecmaVersion: "latest", 14 | }, 15 | }; 16 | -------------------------------------------------------------------------------- /pastebin-server/src/time.rs: -------------------------------------------------------------------------------- 1 | use std::time::{SystemTime, UNIX_EPOCH}; 2 | 3 | use serde::{Deserialize, Serialize}; 4 | 5 | /// seconds since the unix epoch 6 | #[derive(Debug, Clone, Copy, Serialize, Deserialize)] 7 | pub struct UnixTimestamp(u64); 8 | 9 | impl UnixTimestamp { 10 | pub fn now() -> Option { 11 | let d = SystemTime::now().duration_since(UNIX_EPOCH).ok()?; 12 | Some(UnixTimestamp(d.as_secs())) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pastebin-front/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 在线剪贴板 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /pastebin-front/src/router.ts: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHistory } from "vue-router"; 2 | import EditorPage from "./pages/EditorPage.vue"; 3 | import ViewPage from "./pages/ViewPage.vue"; 4 | 5 | export default createRouter({ 6 | history: createWebHistory(import.meta.env.BASE_URL), 7 | routes: [ 8 | { path: "/:key", component: ViewPage }, 9 | { path: "/", component: EditorPage }, 10 | { path: "/:pathMatch(.*)", redirect: "/" }, 11 | ], 12 | strict: true, 13 | sensitive: true, 14 | }); 15 | -------------------------------------------------------------------------------- /pastebin-front/src/data/store.ts: -------------------------------------------------------------------------------- 1 | import { defineStore } from "pinia"; 2 | import { reactive } from "vue"; 3 | 4 | import type { PastebinRecord } from "./dto"; 5 | 6 | import { DEFAULT_EXPIRATION } from "./expiration"; 7 | import { DEFAULT_LANG } from "./lang"; 8 | 9 | export const useStore = defineStore("store", () => { 10 | const record: PastebinRecord = reactive({ 11 | title: "", 12 | lang: DEFAULT_LANG, 13 | expiration_seconds: DEFAULT_EXPIRATION, 14 | content: "", 15 | }); 16 | 17 | return { record }; 18 | }); 19 | -------------------------------------------------------------------------------- /pastebin-front/src/hooks/useHighlight.ts: -------------------------------------------------------------------------------- 1 | import { watch, type Ref } from "vue"; 2 | import prismjs from "prismjs"; 3 | 4 | export function useHighlight(div: Ref, content: Ref) { 5 | const highlight = () => { 6 | const e = div.value; 7 | if (e) { 8 | prismjs.highlightAllUnder(e); 9 | } 10 | }; 11 | 12 | watch( 13 | content, 14 | (_newVal, _oldVal, onCleanup) => { 15 | const timer = setTimeout(highlight, 60); 16 | onCleanup(() => clearTimeout(timer)); 17 | }, 18 | { immediate: true, flush: "post" } 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /pastebin-front/src/data/expiration.ts: -------------------------------------------------------------------------------- 1 | export interface Expiration { 2 | value: number; 3 | display: string; 4 | } 5 | 6 | export const EXPIRATIONS: Expiration[] = [ 7 | { 8 | value: 3600, 9 | display: "1 小时", 10 | }, 11 | { 12 | value: 3600 * 24, 13 | display: "1 天", 14 | }, 15 | { 16 | value: 3600 * 24 * 3, 17 | display: "3 天", 18 | }, 19 | { 20 | value: 3600 * 24 * 7, 21 | display: "7 天", 22 | }, 23 | { 24 | value: 3600 * 24 * 30, 25 | display: "30 天", 26 | }, 27 | ]; 28 | 29 | export const DEFAULT_EXPIRATION = EXPIRATIONS[2].value; 30 | -------------------------------------------------------------------------------- /pastebin-front/src/components/CodeView.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ props.content }} 4 | 5 | 6 | 7 | 21 | -------------------------------------------------------------------------------- /pastebin-front/src/App.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | 28 | 29 | 32 | -------------------------------------------------------------------------------- /pastebin-front/src/data/download.ts: -------------------------------------------------------------------------------- 1 | export function isValidFileName(s: string): boolean { 2 | if (s === "") return false; 3 | const invalidChars = "~`!@#$%^&*()-+={}[]|:;\"'<>,.?/\b\f\n\r\t\v\\\0"; 4 | for (const ch of s.split("")) { 5 | if (invalidChars.indexOf(ch) !== -1) return false; 6 | } 7 | return true; 8 | } 9 | 10 | export function downloadFile(filename: string, content: string) { 11 | const a = document.createElement("a"); 12 | a.download = filename; 13 | a.href = URL.createObjectURL(new Blob([content])); 14 | a.style.display = "none"; 15 | document.body.appendChild(a); 16 | a.click(); 17 | document.body.removeChild(a); 18 | } 19 | -------------------------------------------------------------------------------- /pastebin-front/src/data/dto.d.ts: -------------------------------------------------------------------------------- 1 | interface RecordBase { 2 | title: string; 3 | lang: string; 4 | content: string; 5 | expiration_seconds: number; 6 | } 7 | 8 | interface SavedRecordMixin { 9 | saving_time: number; 10 | view_count: number; 11 | } 12 | 13 | export type PastebinRecord = RecordBase & Partial; 14 | 15 | export type SaveRecordInput = RecordBase; 16 | 17 | export interface SaveRecordOutput { 18 | key: string; 19 | } 20 | 21 | export interface FindRecordInput { 22 | key: string; 23 | } 24 | 25 | export type FindRecordOutput = RecordBase & SavedRecordMixin; 26 | 27 | export interface PastebinError { 28 | code: number; 29 | message: string; 30 | } 31 | -------------------------------------------------------------------------------- /pastebin-server/src/block_rules.rs: -------------------------------------------------------------------------------- 1 | use crate::config::Config; 2 | use crate::dto::SaveRecordInput; 3 | 4 | use anyhow::Result; 5 | use regex::RegexSet; 6 | 7 | pub struct BlockRules { 8 | rules: RegexSet, 9 | } 10 | 11 | impl BlockRules { 12 | pub fn new(config: &Config) -> Result> { 13 | let Some(regexps) = &config.security.block_rules else { return Ok(None) }; 14 | 15 | if regexps.is_empty() { 16 | return Ok(None); 17 | } 18 | 19 | let rules = RegexSet::new(regexps)?; 20 | Ok(Some(Self { rules })) 21 | } 22 | 23 | pub fn is_match(&self, input: &SaveRecordInput) -> bool { 24 | self.rules.is_match(&input.title) || self.rules.is_match(&input.content) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /pastebin-front/src/components/MarkdownView.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /pastebin-front/src/hooks/useCopyBtn.ts: -------------------------------------------------------------------------------- 1 | import copyToClipboard from "copy-to-clipboard"; 2 | import { computed, ref } from "vue"; 3 | 4 | export function useCopyBtn(content: () => string) { 5 | const btnClasses = { 6 | none: [], 7 | success: ["btn-success"], 8 | failure: ["btn-failure"], 9 | }; 10 | const copyStatus = ref("none"); 11 | 12 | function handleCopy() { 13 | const result = copyToClipboard(content()); 14 | copyStatus.value = result ? "success" : "failure"; 15 | const resetTime = 600; 16 | setTimeout(() => (copyStatus.value = "none"), resetTime); 17 | } 18 | 19 | const copyBtnClass = computed(() => btnClasses[copyStatus.value]); 20 | 21 | return { 22 | copyBtnClass, 23 | handleCopy, 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /pastebin-front/prismjs-custom.ts: -------------------------------------------------------------------------------- 1 | export const LANGUAGES: [string, string, string][] = [ 2 | ["markdown", "Markdown", ".md"], 3 | ["html", "HTML", ".html"], 4 | ["css", "CSS", ".css"], 5 | ["javascript", "JavaScript", ".js"], 6 | ["bash", "Bash", ".sh"], 7 | ["c", "C", ".c"], 8 | ["cpp", "C++", ".cpp"], 9 | ["cs", "C#", ".cs"], 10 | ["erlang", "Erlang", ".erl"], 11 | ["go", "Go", ".go"], 12 | ["haskell", "Haskell", ".hs"], 13 | ["rust", "Rust", ".rs"], 14 | ["java", "Java", ".java"], 15 | ["json", "JSON", ".json"], 16 | ["kotlin", "Kotlin", ".kt"], 17 | ["latex", "LaTeX", ".tex"], 18 | ["php", "PHP", ".php"], 19 | ["python", "Python", ".py"], 20 | ["scala", "Scala", ".scala"], 21 | ["sql", "SQL", ".sql"], 22 | ["toml", "TOML", ".toml"], 23 | ["typescript", "TypeScript", ".ts"], 24 | ]; 25 | -------------------------------------------------------------------------------- /pastebin-server/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pastebin-server" 3 | version = "0.4.0" 4 | edition = "2021" 5 | publish = false 6 | 7 | [dependencies] 8 | anyhow = "1.0.89" 9 | axum = "0.7.9" 10 | bytestring = { version = "1.5.0", features = ["serde"] } 11 | camino = "1.2.1" 12 | clap = { version = "4.5.19", features = ["derive"] } 13 | mobc-redis = "0.9.0" 14 | rand = "0.9.0" 15 | regex = "1.12.2" 16 | serde = { version = "1.0.210", features = ["derive"] } 17 | serde_json = "1.0.128" 18 | serde_repr = "0.1.19" 19 | short-crypt = "1.0.28" 20 | thiserror = "2.0.3" 21 | tokio = { version = "1.48.0", features = ["full"] } 22 | toml = "0.9.8" 23 | tower = { version = "0.5.1", features = ["limit", "buffer", "load-shed"] } 24 | tracing = "0.1.40" 25 | tracing-futures = "0.2.5" 26 | tracing-subscriber = { version = "0.3.18", features = ["env-filter", "time", "local-time"] } 27 | -------------------------------------------------------------------------------- /scripts/dist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | TIME=$(date -u +"%Y%m%d%H%M%S") 4 | 5 | DIST="$PWD"/dist 6 | FRONTEND="$DIST"/frontend 7 | BACKEND="$DIST"/backend 8 | 9 | mkdir -p "$FRONTEND" 10 | mkdir -p "$BACKEND" 11 | 12 | pushd pastebin-front 13 | npm install 14 | npm run build 15 | cp -r dist/* "$FRONTEND" 16 | popd 17 | 18 | pushd pastebin-server 19 | if [ -n "$ZIGBUILD" ]; then 20 | cargo zigbuild --release --target x86_64-unknown-linux-gnu.2.27 21 | cp target/x86_64-unknown-linux-gnu/release/pastebin-server "$BACKEND" 22 | else 23 | cargo build --release 24 | cp target/release/pastebin-server "$BACKEND" 25 | fi 26 | cp pastebin-server.toml "$BACKEND" 27 | popd 28 | 29 | pushd "$DIST" 30 | zip -r pastebin.dist."$TIME".zip frontend backend 31 | rm -rf frontend backend 32 | popd 33 | 34 | echo "done" 35 | -------------------------------------------------------------------------------- /pastebin-front/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath, URL } from "node:url"; 2 | 3 | import { defineConfig } from "vite"; 4 | import vue from "@vitejs/plugin-vue"; 5 | import vueJsx from "@vitejs/plugin-vue-jsx"; 6 | 7 | import prismjs from "vite-plugin-prismjs"; 8 | import { LANGUAGES } from "./prismjs-custom"; 9 | 10 | // https://vitejs.dev/config/ 11 | export default defineConfig({ 12 | plugins: [ 13 | vue(), 14 | vueJsx(), 15 | prismjs({ 16 | languages: LANGUAGES.map((tuple) => tuple[0]), 17 | plugins: ["line-numbers"], 18 | theme: "coy", 19 | css: true, 20 | }), 21 | ], 22 | resolve: { 23 | alias: { 24 | "@": fileURLToPath(new URL("./src", import.meta.url)), 25 | }, 26 | }, 27 | server: { 28 | port: 3000, 29 | }, 30 | preview: { 31 | port: 3000, 32 | }, 33 | }); 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pastebin 2 | 3 | 在线剪贴板 4 | 5 | ## 开发 6 | 7 | 前置要求 8 | 9 | + Node.js 10 | + Rust 11 | + Nginx 12 | + Redis 13 | + [just](https://github.com/casey/just) 14 | 15 | 下载后端依赖 16 | 17 | ```bash 18 | cd pastebin-server 19 | cargo fetch 20 | ``` 21 | 22 | 下载前端依赖 23 | 24 | ```bash 25 | cd pastebin-front 26 | npm install 27 | ``` 28 | 29 | 启用 nginx 配置文件 30 | 31 | ```bash 32 | sudo ln -s $PWD/pastebin.nginx.conf /etc/nginx/sites-enabled/pastebin 33 | sudo nginx -t 34 | sudo nginx -s reload 35 | ``` 36 | 37 | 启动后端 38 | 39 | ```bash 40 | cd pastebin-server 41 | cargo run --release 42 | ``` 43 | 44 | 启动前端开发服务器 45 | 46 | ```bash 47 | cd pastebin-front 48 | npm run dev 49 | ``` 50 | 51 | 打开页面 52 | 53 | ## 部署 54 | 55 | 编译并打包前端与后端 56 | 57 | ```bash 58 | just dist 59 | ``` 60 | 61 | 将 dist 目录下的最新压缩包上传至服务器,解压并修改配置,自行部署 62 | 63 | ## 其他 64 | 65 | 删除生成文件,释放空间 66 | 67 | ```bash 68 | just clean 69 | ``` 70 | -------------------------------------------------------------------------------- /pastebin-front/src/data/lang.ts: -------------------------------------------------------------------------------- 1 | import { LANGUAGES } from "../../prismjs-custom"; 2 | 3 | export interface Lang { 4 | value: string; 5 | display: string; 6 | ext: string; 7 | } 8 | 9 | export const LANGS: Lang[] = (() => { 10 | const langs: Lang[] = [convert(LANGUAGES[0]), convert(["plaintext", "纯文本", ".txt"])]; 11 | 12 | const others = [...LANGUAGES.slice(1)]; 13 | others.sort((lhs, rhs) => compareString(lhs[1], rhs[1])); 14 | others.forEach((tuple) => langs.push(convert(tuple))); 15 | 16 | return langs; 17 | })(); 18 | 19 | function convert(tuple: [string, string, string]): Lang { 20 | return { value: tuple[0], display: tuple[1], ext: tuple[2] }; 21 | } 22 | 23 | function compareString(lhs: string, rhs: string): number { 24 | return lhs < rhs ? -1 : lhs === rhs ? 0 : 1; 25 | } 26 | 27 | export function findLangExt(langValue: string): string | null { 28 | const ans = LANGS.find((lang) => lang.value === langValue); 29 | return ans ? ans.ext : null; 30 | } 31 | 32 | export const DEFAULT_LANG = LANGS[0].value; 33 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "cargo" # See documentation for possible values 9 | directory: "/pastebin-server" # Location of package manifests 10 | schedule: 11 | interval: "monthly" 12 | ignore: 13 | - dependency-name: "*" 14 | update-types: ["version-update:semver-patch"] 15 | groups: 16 | backend: 17 | patterns: 18 | - "*" 19 | - package-ecosystem: "npm" 20 | directory: "/pastebin-front" 21 | schedule: 22 | interval: "monthly" 23 | ignore: 24 | - dependency-name: "*" 25 | update-types: ["version-update:semver-patch"] 26 | groups: 27 | frontend: 28 | patterns: 29 | - "*" 30 | -------------------------------------------------------------------------------- /pastebin-front/src/components/XView.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ props.record.title }} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 21 | 22 | 35 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | pull_request: 6 | branches: 7 | - main 8 | schedule: # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule 9 | - cron: '0 0 * * 0' # at midnight of each sunday 10 | 11 | name: CI 12 | 13 | jobs: 14 | server: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v4 18 | - uses: dtolnay/rust-toolchain@nightly 19 | with: 20 | components: rustfmt, clippy 21 | - name: Rust check 22 | run: | 23 | cd pastebin-server 24 | cargo fmt --all -- --check 25 | cargo clippy -- -D warnings 26 | cargo test 27 | cargo build --release 28 | 29 | front: 30 | runs-on: ubuntu-latest 31 | steps: 32 | - uses: actions/checkout@v4 33 | - uses: actions/setup-node@v4 34 | with: 35 | node-version: 22 36 | - name: Vue check 37 | run: | 38 | cd pastebin-front 39 | npm ci 40 | npm run build 41 | -------------------------------------------------------------------------------- /pastebin-front/src/styles/form.css: -------------------------------------------------------------------------------- 1 | .form-group { 2 | margin-bottom: 1rem; 3 | } 4 | 5 | .form-group label { 6 | display: inline-block; 7 | margin-bottom: 0.5rem; 8 | } 9 | 10 | .form-control { 11 | display: block; 12 | width: 100%; 13 | height: calc(1.5em + 0.75rem + 2px); 14 | padding: 0.375rem 0.75rem; 15 | font-size: 1rem; 16 | font-weight: 400; 17 | line-height: 1.5; 18 | color: #495057; 19 | background-color: #fff; 20 | background-clip: padding-box; 21 | border: 1px solid #ced4da; 22 | border-radius: 0.25rem; 23 | transition: 24 | border-color 0.15s ease-in-out, 25 | box-shadow 0.15s ease-in-out; 26 | } 27 | 28 | .form-control:focus:not(.form-control-invalid) { 29 | color: #495057; 30 | background-color: #fff; 31 | border-color: #80bdff; 32 | outline: 0; 33 | box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); 34 | } 35 | 36 | .form-control-invalid { 37 | border-color: #dc3545; 38 | } 39 | 40 | textarea.form-control { 41 | height: auto; 42 | overflow: auto; 43 | resize: vertical; 44 | } 45 | -------------------------------------------------------------------------------- /pastebin-server/src/dto.rs: -------------------------------------------------------------------------------- 1 | use crate::crypto::Key; 2 | use crate::time::UnixTimestamp; 3 | 4 | use serde::{Deserialize, Serialize}; 5 | 6 | type SharedString = bytestring::ByteString; 7 | 8 | #[derive(Debug, Serialize, Deserialize)] 9 | pub struct Record { 10 | pub title: SharedString, 11 | pub lang: SharedString, 12 | pub content: SharedString, 13 | pub expiration_seconds: u32, 14 | pub saving_time: UnixTimestamp, 15 | } 16 | 17 | #[derive(Debug, Serialize, Deserialize)] 18 | #[serde(deny_unknown_fields)] 19 | pub struct SaveRecordInput { 20 | pub title: SharedString, 21 | pub lang: SharedString, 22 | pub content: SharedString, 23 | pub expiration_seconds: u32, 24 | } 25 | 26 | #[derive(Debug, Serialize, Deserialize)] 27 | pub struct SaveRecordOutput { 28 | pub key: Key, 29 | } 30 | 31 | #[derive(Debug, Serialize, Deserialize)] 32 | #[serde(deny_unknown_fields)] 33 | pub struct FindRecordInput { 34 | pub key: String, 35 | } 36 | 37 | #[derive(Debug, Serialize, Deserialize)] 38 | pub struct FindRecordOutput { 39 | #[serde(flatten)] 40 | pub record: Record, 41 | pub view_count: u64, 42 | } 43 | -------------------------------------------------------------------------------- /pastebin-front/src/styles/index.css: -------------------------------------------------------------------------------- 1 | @import "./btn.css"; 2 | @import "./form.css"; 3 | @import "./prismjs.css"; 4 | 5 | * { 6 | box-sizing: border-box; 7 | } 8 | 9 | body { 10 | margin: 0; 11 | padding: 0; 12 | 13 | font-family: 14 | -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, 15 | "Apple Color Emoji", "Segoe UI Emoji"; 16 | 17 | font-size: 1rem; 18 | font-weight: 400; 19 | line-height: 1.5; 20 | 21 | width: 100%; 22 | min-height: 100vh; 23 | } 24 | 25 | #app { 26 | width: 100%; 27 | min-height: 100vh; 28 | 29 | display: flex; 30 | flex-direction: column; 31 | align-items: center; 32 | } 33 | 34 | a { 35 | color: #007bff; 36 | text-decoration: none; 37 | background-color: transparent; 38 | } 39 | 40 | a:hover { 41 | text-decoration: underline; 42 | } 43 | 44 | .container-lg { 45 | width: 100%; 46 | } 47 | 48 | @media (min-width: 992px) { 49 | .container-lg { 50 | max-width: 960px; 51 | } 52 | } 53 | 54 | @media (min-width: 1200px) { 55 | .container-lg { 56 | max-width: 1140px; 57 | } 58 | } 59 | 60 | .code-area { 61 | font-family: "Fira Code"; 62 | } 63 | -------------------------------------------------------------------------------- /pastebin-server/src/error.rs: -------------------------------------------------------------------------------- 1 | use axum::http::StatusCode; 2 | use serde::{Deserialize, Serialize}; 3 | use serde_repr::{Deserialize_repr, Serialize_repr}; 4 | 5 | #[derive(Debug, Serialize, Deserialize)] 6 | pub struct PastebinError { 7 | pub code: PastebinErrorCode, 8 | pub message: String, 9 | } 10 | 11 | #[repr(u16)] 12 | #[derive(Debug, Clone, Copy, Serialize_repr, Deserialize_repr)] 13 | pub enum PastebinErrorCode { 14 | InternalError = 1001, 15 | Unavailable = 1002, 16 | 17 | BadKey = 2001, 18 | TooLongExpirations = 2002, 19 | TooLongTitle = 2003, 20 | 21 | NotFound = 3001, 22 | } 23 | 24 | impl PastebinErrorCode { 25 | pub fn status(&self) -> StatusCode { 26 | use PastebinErrorCode::*; 27 | 28 | match self { 29 | InternalError => StatusCode::INTERNAL_SERVER_ERROR, 30 | Unavailable => StatusCode::SERVICE_UNAVAILABLE, 31 | BadKey => StatusCode::BAD_REQUEST, 32 | TooLongExpirations => StatusCode::BAD_REQUEST, 33 | TooLongTitle => StatusCode::BAD_REQUEST, 34 | NotFound => StatusCode::NOT_FOUND, 35 | } 36 | } 37 | } 38 | 39 | impl From for PastebinError { 40 | fn from(code: PastebinErrorCode) -> Self { 41 | let message = format!("{code:?}"); 42 | Self { code, message } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /pastebin-front/src/data/api.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | FindRecordInput, 3 | FindRecordOutput, 4 | PastebinError, 5 | SaveRecordInput, 6 | SaveRecordOutput, 7 | } from "./dto"; 8 | import { mande, type MandeError } from "mande"; 9 | 10 | const records = mande("/api/records", { 11 | mode: "same-origin", 12 | }); 13 | 14 | export type Result = { ok: true; value: T } | { ok: false; error: E }; 15 | 16 | function resultOk(value: T): Result { 17 | return { ok: true, value }; 18 | } 19 | 20 | function resultErr(error: E): Result { 21 | return { ok: false, error }; 22 | } 23 | 24 | export async function saveRecord( 25 | input: SaveRecordInput 26 | ): Promise> { 27 | try { 28 | const value: SaveRecordOutput = await records.put(input); 29 | return resultOk(value); 30 | } catch (exc) { 31 | const error = (exc as MandeError).body; 32 | return resultErr(error); 33 | } 34 | } 35 | 36 | export async function findRecord( 37 | input: FindRecordInput 38 | ): Promise> { 39 | try { 40 | const value: FindRecordOutput = await records.get(input.key); 41 | return resultOk(value); 42 | } catch (exc) { 43 | const error = (exc as MandeError).body; 44 | return resultErr(error); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /pastebin-front/src/hooks/useKatex.ts: -------------------------------------------------------------------------------- 1 | import { ref, watch, type Ref } from "vue"; 2 | import type { RenderMathInElementOptions } from "katex/contrib/auto-render"; 3 | import type renderMathInElement from "katex/contrib/auto-render"; 4 | 5 | import "katex/dist/katex.min.css"; 6 | 7 | const katexOptions: RenderMathInElementOptions = { 8 | delimiters: [ 9 | { left: "$$", right: "$$", display: true }, 10 | { left: "\\(", right: "\\)", display: false }, 11 | { left: "\\[", right: "\\]", display: true }, 12 | { left: "$", right: "$", display: false }, 13 | ], 14 | errorColor: "#cc0000", 15 | throwOnError: false, 16 | strict: "ignore", 17 | }; 18 | 19 | export function useKatex(div: Ref, content: Ref) { 20 | const katex = ref(null); 21 | 22 | import("katex/contrib/auto-render").then((module) => { 23 | katex.value = module.default; 24 | }); 25 | 26 | const render = () => { 27 | const e = div.value; 28 | const f = katex.value; 29 | if (e && f) { 30 | f(e, katexOptions); 31 | } 32 | }; 33 | 34 | watch( 35 | [content, katex], 36 | (_newVal, _oldVal, onCleanup) => { 37 | const timer = setTimeout(render, 60); 38 | onCleanup(() => clearTimeout(timer)); 39 | }, 40 | { immediate: true, flush: "post" } 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /pastebin-server/src/anti_bot.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::mutable_key_type)] // false positive 2 | 3 | use crate::config::Config; 4 | use crate::crypto::Key; 5 | 6 | use std::collections::HashMap; 7 | use std::ops::Not; 8 | use std::time::Duration; 9 | 10 | use anyhow::Result; 11 | use tokio::spawn; 12 | use tokio::sync::Mutex; 13 | use tokio::task::JoinHandle; 14 | use tokio::time::sleep; 15 | 16 | pub struct AntiBot { 17 | watch_task_map: Mutex>>, 18 | } 19 | 20 | impl AntiBot { 21 | pub fn new(config: &Config) -> Result> { 22 | if config.security.anti_bot.not() { 23 | return Ok(None); 24 | } 25 | let activate_task_map = Mutex::new(HashMap::new()); 26 | Ok(Some(Self { 27 | watch_task_map: activate_task_map, 28 | })) 29 | } 30 | 31 | pub async fn watch_deactivate(&self, key: &Key, on_fail: impl FnOnce() + Send + 'static) { 32 | let key = key.clone(); 33 | 34 | let mut guard = self.watch_task_map.lock().await; 35 | let map = &mut *guard; 36 | 37 | let task = spawn(async move { 38 | sleep(Duration::from_secs(2)).await; 39 | on_fail(); 40 | }); 41 | 42 | map.insert(key, task); 43 | } 44 | 45 | pub async fn cancel_deactivate(&self, key: &Key) { 46 | let mut guard = self.watch_task_map.lock().await; 47 | let map = &mut *guard; 48 | 49 | if let Some(task) = map.remove(key) { 50 | task.abort(); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /pastebin-front/src/styles/btn.css: -------------------------------------------------------------------------------- 1 | .btn-bar { 2 | display: flex; 3 | justify-content: center; 4 | align-items: center; 5 | margin: 1em 0; 6 | } 7 | 8 | .btn-bar .btn { 9 | margin: 0 0.2rem; 10 | } 11 | 12 | .btn { 13 | display: inline-block; 14 | 15 | padding: 0.375rem 0.75rem; 16 | 17 | color: #333; 18 | background-color: transparent; 19 | 20 | border-width: 1px; 21 | border-style: solid; 22 | border-color: #ccc; 23 | border-radius: 0.25rem; 24 | 25 | text-align: center; 26 | 27 | font-weight: 400; 28 | font-size: 1rem; 29 | line-height: 1.5; 30 | 31 | box-shadow: none; 32 | transition: box-shadow 0.1s linear; 33 | 34 | user-select: none; 35 | } 36 | 37 | .btn:hover, 38 | .btn:focus, 39 | .btn:active { 40 | border-color: #0099ff; 41 | } 42 | 43 | .btn:hover { 44 | cursor: pointer; 45 | } 46 | 47 | .btn:active { 48 | box-shadow: 0 0 4px #0099ff; 49 | } 50 | 51 | .btn:disabled { 52 | border-color: #ccc; 53 | cursor: default; 54 | box-shadow: none; 55 | } 56 | 57 | .btn-success, 58 | .btn-success:hover, 59 | .btn-success:focus, 60 | .btn-success:active { 61 | color: white; 62 | background-color: #28a745; 63 | border-color: #28a745; 64 | } 65 | 66 | .btn-success:focus { 67 | box-shadow: 0 0 3px #00dd00; 68 | } 69 | 70 | .btn-success svg path { 71 | stroke: white; 72 | } 73 | 74 | .btn-failure, 75 | .btn-failure:hover, 76 | .btn-failure:focus, 77 | .btn-failure:active { 78 | color: white; 79 | background-color: #c82333; 80 | border-color: #c82333; 81 | } 82 | -------------------------------------------------------------------------------- /pastebin-server/src/crypto.rs: -------------------------------------------------------------------------------- 1 | use bytestring::ByteString; 2 | use serde::{Deserialize, Serialize}; 3 | use short_crypt::ShortCrypt; 4 | 5 | #[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] 6 | pub struct Key(ByteString); 7 | 8 | impl Key { 9 | #[inline(always)] 10 | pub fn as_str(&self) -> &str { 11 | &self.0 12 | } 13 | } 14 | 15 | pub struct Crypto(ShortCrypt); 16 | 17 | impl Crypto { 18 | pub fn new(secret_key: &str) -> Self { 19 | Self(ShortCrypt::new(secret_key)) 20 | } 21 | 22 | pub fn generate(&self) -> Key { 23 | let rand_bytes: [u8; 4] = rand::random(); 24 | 25 | let mut s: String = self.0.encrypt_to_qr_code_alphanumeric(&rand_bytes); 26 | s.make_ascii_lowercase(); 27 | Key(s.into()) 28 | } 29 | 30 | pub fn validate(&self, input: &str) -> Option { 31 | // 忽略输入的大小写 32 | let mut s: Box = input.to_ascii_uppercase().into(); 33 | 34 | let v = self.0.decrypt_qr_code_alphanumeric(&s).ok()?; 35 | if v.len() != 4 { 36 | return None; 37 | } 38 | 39 | // 统一表示为小写 40 | s.make_ascii_lowercase(); 41 | Some(Key(s.into())) 42 | } 43 | } 44 | 45 | #[cfg(test)] 46 | mod tests { 47 | use super::*; 48 | 49 | #[test] 50 | fn basic() { 51 | let secret_key = "asdf"; 52 | let crypto = Crypto::new(secret_key); 53 | let k1 = crypto.generate(); 54 | println!("k1 = {k1:?}"); 55 | 56 | let k2 = crypto.validate(k1.as_str()).unwrap(); 57 | assert_eq!(k1, k2); 58 | 59 | let k3 = crypto.validate(&k1.as_str().to_ascii_uppercase()).unwrap(); 60 | assert_eq!(k1, k3); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /pastebin-server/src/config.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | 3 | use anyhow::Result; 4 | use camino::Utf8Path; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | #[derive(Debug, Clone, Serialize, Deserialize)] 8 | #[serde(deny_unknown_fields)] 9 | pub struct Config { 10 | pub server: ServerConfig, 11 | pub security: SecurityConfig, 12 | pub redis: RedisConfig, 13 | } 14 | 15 | #[derive(Debug, Clone, Serialize, Deserialize)] 16 | pub struct ServerConfig { 17 | pub bind_addr: String, 18 | pub host_addr: String, 19 | } 20 | 21 | #[derive(Debug, Clone, Serialize, Deserialize)] 22 | pub struct SecurityConfig { 23 | pub secret_key: String, 24 | 25 | // TODO: serde with human readable bytes representation 26 | // 27 | pub max_http_body_length: usize, 28 | 29 | pub max_expiration_seconds: u32, 30 | pub max_qps: u32, 31 | 32 | pub max_title_chars: usize, 33 | 34 | pub block_rules: Option>, 35 | 36 | pub anti_bot: bool, 37 | } 38 | 39 | #[derive(Debug, Clone, Serialize, Deserialize)] 40 | pub struct RedisConfig { 41 | pub url: String, 42 | pub key_prefix: String, 43 | pub max_open_connections: u64, 44 | } 45 | 46 | impl Config { 47 | pub fn from_toml(path: &Utf8Path) -> Result { 48 | let content = fs::read_to_string(path)?; 49 | let config = toml::from_str(&content)?; 50 | Ok(config) 51 | } 52 | } 53 | 54 | #[cfg(test)] 55 | mod tests { 56 | use super::*; 57 | 58 | #[test] 59 | fn example_config() { 60 | let config_path = concat!(env!("CARGO_MANIFEST_DIR"), "/pastebin-server.toml"); 61 | let config = Config::from_toml(config_path.as_ref()).unwrap(); 62 | println!("{config:#?}"); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /pastebin-front/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pastebin-front", 3 | "version": "0.4.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "vite", 7 | "build": "run-p fmt-check type-check build-only", 8 | "preview": "vite preview", 9 | "build-only": "vite build", 10 | "type-check": "vue-tsc --noEmit", 11 | "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", 12 | "fmt": "prettier --write src/ *.ts *.cjs *.json *.html", 13 | "fmt-check": "prettier --check src/ *.ts *.cjs *.json *.html" 14 | }, 15 | "dependencies": { 16 | "@icon-park/vue-next": "^1.4.2", 17 | "copy-to-clipboard": "^3.3.3", 18 | "katex": "^0.16.21", 19 | "mande": "^2.0.7", 20 | "markdown-it": "^14.1.0", 21 | "pinia": "^3.0.1", 22 | "prismjs": "^1.30.0", 23 | "qrcode": "^1.5.3", 24 | "vite-plugin-prismjs": "^0.0.8", 25 | "vue": "^3.4.3", 26 | "vue-router": "^4.6.3" 27 | }, 28 | "devDependencies": { 29 | "@rushstack/eslint-patch": "^1.15.0", 30 | "@types/katex": "^0.16.2", 31 | "@types/markdown-it": "^14.1.2", 32 | "@types/node": "^24.10.1", 33 | "@types/prismjs": "^1.26.0", 34 | "@types/qrcode": "^1.5.1", 35 | "@vitejs/plugin-vue": "^6.0.2", 36 | "@vitejs/plugin-vue-jsx": "^5.1.2", 37 | "@vue/eslint-config-prettier": "^10.2.0", 38 | "@vue/eslint-config-typescript": "^14.6.0", 39 | "@vue/tsconfig": "^0.7.0", 40 | "eslint": "^9.39.1", 41 | "eslint-plugin-vue": "^10.6.2", 42 | "npm-run-all": "^4.1.5", 43 | "prettier": "^3.7.3", 44 | "typescript": "5.7.2", 45 | "vite": "^7.2.6", 46 | "vue-tsc": "^3.1.5" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /pastebin-front/README.md: -------------------------------------------------------------------------------- 1 | # vue-scaffold-mini 2 | 3 | This template should help get you started developing with Vue 3 in Vite. 4 | 5 | ## Recommended IDE Setup 6 | 7 | [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). 8 | 9 | ## Type Support for `.vue` Imports in TS 10 | 11 | TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types. 12 | 13 | If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps: 14 | 15 | 1. Disable the built-in TypeScript Extension 16 | 1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette 17 | 2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)` 18 | 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette. 19 | 20 | ## Customize configuration 21 | 22 | See [Vite Configuration Reference](https://vitejs.dev/config/). 23 | 24 | ## Project Setup 25 | 26 | ```sh 27 | npm install 28 | ``` 29 | 30 | ### Compile and Hot-Reload for Development 31 | 32 | ```sh 33 | npm run dev 34 | ``` 35 | 36 | ### Type-Check, Compile and Minify for Production 37 | 38 | ```sh 39 | npm run build 40 | ``` 41 | 42 | ### Lint with [ESLint](https://eslint.org/) 43 | 44 | ```sh 45 | npm run lint 46 | ``` 47 | -------------------------------------------------------------------------------- /pastebin-server/src/main.rs: -------------------------------------------------------------------------------- 1 | #![forbid(unsafe_code)] 2 | #![deny(clippy::all)] 3 | 4 | use pastebin_server::config::Config; 5 | 6 | use std::io::IsTerminal; 7 | 8 | use anyhow::Context; 9 | use anyhow::Result; 10 | use axum::Router; 11 | use camino::Utf8Path; 12 | use camino::Utf8PathBuf; 13 | use clap::Parser; 14 | use tokio::net::TcpListener; 15 | use tracing::info; 16 | 17 | #[derive(clap::Parser)] 18 | struct Opt { 19 | #[clap(long)] 20 | #[clap(default_value = "pastebin-server.toml")] 21 | pub config: Utf8PathBuf, 22 | } 23 | 24 | fn main() -> Result<()> { 25 | setup_tracing(); 26 | 27 | let opt = Opt::parse(); 28 | 29 | let config = load_config(&opt.config)?; 30 | run(config) 31 | } 32 | 33 | #[tokio::main] 34 | async fn run(config: Config) -> Result<()> { 35 | let app = pastebin_server::web::build(&config)?; 36 | serve(app, &config.server.bind_addr).await?; 37 | Ok(()) 38 | } 39 | 40 | fn setup_tracing() { 41 | use tracing_subscriber::filter::{EnvFilter, LevelFilter}; 42 | use tracing_subscriber::fmt::time::OffsetTime; 43 | 44 | let env_filter = EnvFilter::builder() 45 | .with_default_directive(LevelFilter::INFO.into()) 46 | .from_env_lossy(); 47 | 48 | let enable_color = std::io::stdout().is_terminal(); 49 | 50 | let timer = OffsetTime::local_rfc_3339().expect("could not get local time offset"); 51 | 52 | tracing_subscriber::fmt() 53 | .pretty() 54 | .with_env_filter(env_filter) 55 | .with_ansi(enable_color) 56 | .with_timer(timer) 57 | .init() 58 | } 59 | 60 | fn load_config(path: &Utf8Path) -> Result { 61 | Config::from_toml(path).with_context(|| format!("Failed to read config from {path:?}")) 62 | } 63 | 64 | async fn serve(app: Router, addr: &str) -> Result<()> { 65 | let listener = TcpListener::bind(addr).await?; 66 | info!("listening on {}", addr); 67 | axum::serve(listener, app.into_make_service()) 68 | .with_graceful_shutdown(shutdown_signal()) 69 | .await?; 70 | Ok(()) 71 | } 72 | 73 | async fn shutdown_signal() { 74 | let _ = tokio::signal::ctrl_c().await; 75 | } 76 | -------------------------------------------------------------------------------- /pastebin-front/src/components/XModal.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 69 | 70 | 97 | -------------------------------------------------------------------------------- /pastebin-server/src/redis.rs: -------------------------------------------------------------------------------- 1 | use crate::config::RedisConfig; 2 | use crate::crypto::Key; 3 | use crate::dto::Record; 4 | 5 | use mobc_redis::mobc; 6 | use mobc_redis::redis; 7 | use redis::aio::MultiplexedConnection; 8 | use redis::AsyncCommands; 9 | 10 | use anyhow::Result; 11 | use tracing::error; 12 | 13 | pub struct RedisStorage { 14 | key_prefix: Box, 15 | pool: mobc::Pool, 16 | } 17 | 18 | const VIEW_COUNT_FIELD: &str = "view_count"; 19 | const JSON_FIELD: &str = "json"; 20 | 21 | async fn exists(conn: &mut MultiplexedConnection, redis_key: &str) -> Result { 22 | let exists: bool = conn 23 | .exists(redis_key) 24 | .await 25 | .inspect_err(|err| error!(?err))?; 26 | Ok(exists) 27 | } 28 | 29 | impl RedisStorage { 30 | pub fn new(config: &RedisConfig) -> Result { 31 | let key_prefix = config.key_prefix.clone().into_boxed_str(); 32 | 33 | let pool = { 34 | let client = redis::Client::open(&*config.url)?; 35 | let manager = mobc_redis::RedisConnectionManager::new(client); 36 | mobc::Pool::builder() 37 | .max_open(config.max_open_connections) 38 | .build(manager) 39 | }; 40 | 41 | Ok(Self { key_prefix, pool }) 42 | } 43 | 44 | async fn get_conn(&self) -> Result> { 45 | let conn = self.pool.get().await.inspect_err(|err| error!(?err))?; 46 | Ok(conn) 47 | } 48 | 49 | fn concat_key(&self, key: &Key) -> String { 50 | format!("{}:{}", self.key_prefix, key.as_str()) 51 | } 52 | 53 | pub async fn save( 54 | &self, 55 | key_gen: impl Fn() -> Key, 56 | record: &Record, 57 | expiration_seconds: u32, 58 | ) -> Result { 59 | let mut conn = self.get_conn().await?; 60 | 61 | let (key, redis_key) = loop { 62 | let key = key_gen(); 63 | let redis_key = self.concat_key(&key); 64 | 65 | if !exists(&mut conn, &redis_key).await? { 66 | break (key, redis_key); 67 | } 68 | }; 69 | 70 | let json = serde_json::to_string(record).unwrap(); 71 | 72 | redis::pipe() 73 | .atomic() 74 | .hset(&redis_key, VIEW_COUNT_FIELD, 0_u64) 75 | .hset(&redis_key, JSON_FIELD, &*json) 76 | .expire(&redis_key, expiration_seconds as i64) 77 | .query_async::<()>(&mut *conn) 78 | .await 79 | .inspect_err(|err| error!(?err))?; 80 | 81 | Ok(key) 82 | } 83 | 84 | pub async fn access(&self, key: &Key) -> Result> { 85 | let mut conn = self.get_conn().await?; 86 | let redis_key = self.concat_key(key); 87 | 88 | if !exists(&mut conn, &redis_key).await? { 89 | return Ok(None); 90 | } 91 | 92 | let (view, json): (u64, String) = redis::pipe() 93 | .atomic() 94 | .hincr(&redis_key, VIEW_COUNT_FIELD, 1_u64) 95 | .hget(&redis_key, JSON_FIELD) 96 | .query_async(&mut *conn) 97 | .await 98 | .inspect_err(|err| error!(?err))?; 99 | 100 | let record: Record = serde_json::from_str(&json).inspect_err(|err| error!(?err))?; 101 | Ok(Some((record, view))) 102 | } 103 | 104 | pub async fn delete(&self, key: &Key) -> Result { 105 | let mut conn = self.get_conn().await?; 106 | let redis_key = self.concat_key(key); 107 | 108 | let deleted: bool = conn.del(redis_key).await.inspect_err(|err| error!(?err))?; 109 | Ok(deleted) 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /pastebin-server/src/web.rs: -------------------------------------------------------------------------------- 1 | use crate::config::Config; 2 | use crate::dto::*; 3 | use crate::error::PastebinError; 4 | use crate::error::PastebinErrorCode; 5 | use crate::svc::PastebinService; 6 | 7 | use std::sync::Arc; 8 | use std::time::Duration; 9 | 10 | use axum::error_handling::HandleErrorLayer; 11 | use axum::extract::DefaultBodyLimit; 12 | use axum::extract::Path; 13 | use axum::extract::Request; 14 | use axum::extract::State; 15 | use axum::http::StatusCode; 16 | use axum::middleware::Next; 17 | use axum::response::IntoResponse; 18 | use axum::response::Response; 19 | use axum::routing::get; 20 | use axum::routing::put; 21 | use axum::BoxError; 22 | use axum::Json; 23 | use axum::Router; 24 | 25 | use anyhow::Result; 26 | use serde::Serialize; 27 | use tracing::error; 28 | use tracing::warn; 29 | use tracing_futures::Instrument; 30 | 31 | pub fn build(config: &Config) -> Result { 32 | let svc = PastebinService::new(config)?; 33 | let state = Arc::new(svc); 34 | 35 | let tower_middleware = tower::ServiceBuilder::new() 36 | .layer(HandleErrorLayer::new(handle_error)) 37 | .buffer(4096) 38 | .load_shed() 39 | .rate_limit(config.security.max_qps.into(), Duration::from_secs(1)) 40 | .into_inner(); 41 | 42 | let router = Router::new() 43 | .route("/api/records/:key", get(find_record)) 44 | .route("/api/records", put(save_record)) 45 | .with_state(state.clone()) 46 | .layer(axum::middleware::from_fn_with_state(state, axum_middleware)) 47 | .layer(tower_middleware) 48 | .layer(DefaultBodyLimit::max(config.security.max_http_body_length)); 49 | 50 | Ok(router) 51 | } 52 | 53 | async fn handle_error(err: BoxError) -> Response { 54 | if err.is::() { 55 | warn!("load shed: overloaded"); 56 | return error_response(PastebinErrorCode::Unavailable.into()); 57 | } 58 | 59 | error!(?err); 60 | error_response(PastebinErrorCode::InternalError.into()) 61 | } 62 | 63 | async fn axum_middleware(State(svc): AppState, req: Request, next: Next) -> Response { 64 | let _svc = svc; 65 | 66 | let x_forwarded_for = req.headers().get("x-forwarded-for"); 67 | let x_real_ip = req.headers().get("x-real-ip"); 68 | let span = tracing::debug_span!( 69 | "axum_middleware", 70 | method = %req.method(), 71 | path = %req.uri().path(), 72 | ?x_forwarded_for, 73 | ?x_real_ip 74 | ); 75 | 76 | let res = next.run(req).instrument(span).await; 77 | 78 | // hide error details from serde_json 79 | if res.status() == StatusCode::UNPROCESSABLE_ENTITY { 80 | return StatusCode::UNPROCESSABLE_ENTITY.into_response(); 81 | } 82 | 83 | res 84 | } 85 | 86 | fn json_result(ret: Result) -> Response 87 | where 88 | T: Serialize, 89 | { 90 | match ret { 91 | Ok(val) => Json(val).into_response(), 92 | Err(err) => error_response(err), 93 | } 94 | } 95 | 96 | fn error_response(err: PastebinError) -> Response { 97 | let status = err.code.status(); 98 | let mut res = Json(err).into_response(); 99 | *res.status_mut() = status; 100 | res 101 | } 102 | 103 | type AppState = State>; 104 | 105 | /// GET /api/records/:key 106 | /// 107 | /// -> JSON FindRecordOutput 108 | #[tracing::instrument(skip(svc))] 109 | pub async fn find_record(State(svc): AppState, Path(key): Path) -> Response { 110 | json_result(svc.find_record(FindRecordInput { key }).await) 111 | } 112 | 113 | /// PUT /api/records 114 | /// 115 | /// JSON SaveRecordInput -> JSON SaveRecordOutput 116 | #[tracing::instrument(skip(svc, payload))] 117 | pub async fn save_record(State(svc): AppState, Json(payload): Json) -> Response { 118 | json_result(svc.save_record(payload).await) 119 | } 120 | -------------------------------------------------------------------------------- /pastebin-front/src/pages/EditorPage.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 编辑 4 | 预览 5 | 复制 6 | 提交 7 | 8 | 9 | 10 | 标题 11 | 12 | 13 | 14 | 语言 15 | 16 | 17 | {{ lang.display }} 18 | 19 | 20 | 21 | 22 | 过期时间 23 | 24 | 25 | {{ exp.display }} 26 | 27 | 28 | 29 | 30 | 内容 31 | 40 | 内容不能为空 41 | 42 | 43 | 44 | 45 | 46 | 53 | 54 | 123 | -------------------------------------------------------------------------------- /pastebin-server/src/svc.rs: -------------------------------------------------------------------------------- 1 | use crate::anti_bot::AntiBot; 2 | use crate::block_rules::BlockRules; 3 | use crate::config::Config; 4 | use crate::crypto::Crypto; 5 | use crate::crypto::Key; 6 | use crate::dto::*; 7 | use crate::error::PastebinError; 8 | use crate::error::PastebinErrorCode; 9 | use crate::redis::RedisStorage; 10 | use crate::time::UnixTimestamp; 11 | 12 | use std::sync::Arc; 13 | 14 | use anyhow::Result; 15 | use tokio::spawn; 16 | use tracing::error; 17 | use tracing::info; 18 | 19 | pub struct PastebinService { 20 | config: Config, 21 | db: RedisStorage, 22 | crypto: Crypto, 23 | 24 | block_rules: Option, 25 | anti_bot: Option, 26 | } 27 | 28 | impl PastebinService { 29 | pub fn new(config: &Config) -> Result { 30 | let block_rules = BlockRules::new(config)?; 31 | 32 | let anti_bot = AntiBot::new(config)?; 33 | 34 | let db = RedisStorage::new(&config.redis)?; 35 | 36 | let crypto = Crypto::new(&config.security.secret_key); 37 | 38 | let config = config.clone(); 39 | 40 | Ok(Self { 41 | config, 42 | db, 43 | crypto, 44 | block_rules, 45 | anti_bot, 46 | }) 47 | } 48 | 49 | pub async fn find_record( 50 | self: &Arc, 51 | input: FindRecordInput, 52 | ) -> Result { 53 | let key = self 54 | .crypto 55 | .validate(&input.key) 56 | .ok_or(PastebinErrorCode::BadKey)?; 57 | 58 | if let Some(anti_bot) = self.anti_bot.as_ref() { 59 | anti_bot.cancel_deactivate(&key).await; 60 | } 61 | 62 | let result = self.db.access(&key).await; 63 | 64 | let (record, view_count) = result 65 | .inspect_err(|err| error!(?err)) 66 | .map_err(|_| PastebinErrorCode::InternalError)? 67 | .ok_or(PastebinErrorCode::NotFound)?; 68 | 69 | info!("FIND key = {}, view_count = {}", key.as_str(), view_count); 70 | 71 | Ok(FindRecordOutput { record, view_count }) 72 | } 73 | 74 | pub async fn save_record( 75 | self: &Arc, 76 | input: SaveRecordInput, 77 | ) -> Result { 78 | if input.title.chars().count() > self.config.security.max_title_chars { 79 | return Err(PastebinErrorCode::TooLongTitle.into()); 80 | } 81 | 82 | if input.expiration_seconds > self.config.security.max_expiration_seconds { 83 | return Err(PastebinErrorCode::TooLongExpirations.into()); 84 | } 85 | 86 | if let Some(block_rules) = self.block_rules.as_ref() { 87 | if block_rules.is_match(&input) { 88 | let key = self.crypto.generate(); 89 | info!("BLOCKED key = {}", key.as_str()); 90 | return Ok(SaveRecordOutput { key }); 91 | } 92 | } 93 | 94 | let now = UnixTimestamp::now().expect("must be after 1970"); 95 | 96 | let record = Record { 97 | title: input.title, 98 | lang: input.lang, 99 | content: input.content, 100 | saving_time: now, 101 | expiration_seconds: input.expiration_seconds, 102 | }; 103 | 104 | let key_gen = || self.crypto.generate(); 105 | let expiration = record.expiration_seconds; 106 | let result = self.db.save(key_gen, &record, expiration).await; 107 | 108 | let key = result 109 | .inspect_err(|err| error!(?err)) 110 | .map_err(|_| PastebinErrorCode::InternalError)?; 111 | 112 | if let Some(anti_bot) = self.anti_bot.as_ref() { 113 | let on_fail = { 114 | let svc = self.clone(); 115 | let key = key.clone(); 116 | || deactivate_new_key(svc, key) 117 | }; 118 | anti_bot.watch_deactivate(&key, on_fail).await; 119 | } 120 | 121 | info!("SAVE key = {}, expiration = {}", key.as_str(), expiration); 122 | 123 | Ok(SaveRecordOutput { key }) 124 | } 125 | } 126 | 127 | fn deactivate_new_key(svc: Arc, key: Key) { 128 | drop(spawn(async move { 129 | let result = svc.db.delete(&key).await; 130 | match result { 131 | Ok(true) => info!("ANTIBOT DEL key = {}", key.as_str()), 132 | Ok(false) => {} 133 | Err(err) => error!(?err), 134 | } 135 | })) 136 | } 137 | -------------------------------------------------------------------------------- /pastebin-front/src/pages/ViewPage.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | {{ store.record.view_count }} 18 | 19 | 20 | {{ saving_time }} 21 | 22 | 23 | 24 | 25 | {{ qrcodeModal.title }} 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 72 | 73 | 176 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published by 637 | the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . -------------------------------------------------------------------------------- /pastebin-server/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "ahash" 7 | version = "0.8.11" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 10 | dependencies = [ 11 | "cfg-if", 12 | "once_cell", 13 | "version_check", 14 | "zerocopy 0.7.35", 15 | ] 16 | 17 | [[package]] 18 | name = "aho-corasick" 19 | version = "1.1.3" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 22 | dependencies = [ 23 | "memchr", 24 | ] 25 | 26 | [[package]] 27 | name = "anstream" 28 | version = "0.6.15" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" 31 | dependencies = [ 32 | "anstyle", 33 | "anstyle-parse", 34 | "anstyle-query", 35 | "anstyle-wincon", 36 | "colorchoice", 37 | "is_terminal_polyfill", 38 | "utf8parse", 39 | ] 40 | 41 | [[package]] 42 | name = "anstyle" 43 | version = "1.0.8" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" 46 | 47 | [[package]] 48 | name = "anstyle-parse" 49 | version = "0.2.5" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" 52 | dependencies = [ 53 | "utf8parse", 54 | ] 55 | 56 | [[package]] 57 | name = "anstyle-query" 58 | version = "1.1.1" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" 61 | dependencies = [ 62 | "windows-sys 0.52.0", 63 | ] 64 | 65 | [[package]] 66 | name = "anstyle-wincon" 67 | version = "3.0.4" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" 70 | dependencies = [ 71 | "anstyle", 72 | "windows-sys 0.52.0", 73 | ] 74 | 75 | [[package]] 76 | name = "anyhow" 77 | version = "1.0.89" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" 80 | 81 | [[package]] 82 | name = "arc-swap" 83 | version = "1.7.1" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" 86 | 87 | [[package]] 88 | name = "async-trait" 89 | version = "0.1.83" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" 92 | dependencies = [ 93 | "proc-macro2", 94 | "quote", 95 | "syn", 96 | ] 97 | 98 | [[package]] 99 | name = "autocfg" 100 | version = "1.4.0" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" 103 | 104 | [[package]] 105 | name = "axum" 106 | version = "0.7.9" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" 109 | dependencies = [ 110 | "async-trait", 111 | "axum-core", 112 | "bytes", 113 | "futures-util", 114 | "http", 115 | "http-body", 116 | "http-body-util", 117 | "hyper", 118 | "hyper-util", 119 | "itoa", 120 | "matchit", 121 | "memchr", 122 | "mime", 123 | "percent-encoding", 124 | "pin-project-lite", 125 | "rustversion", 126 | "serde", 127 | "serde_json", 128 | "serde_path_to_error", 129 | "serde_urlencoded", 130 | "sync_wrapper 1.0.1", 131 | "tokio", 132 | "tower", 133 | "tower-layer", 134 | "tower-service", 135 | "tracing", 136 | ] 137 | 138 | [[package]] 139 | name = "axum-core" 140 | version = "0.4.5" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" 143 | dependencies = [ 144 | "async-trait", 145 | "bytes", 146 | "futures-util", 147 | "http", 148 | "http-body", 149 | "http-body-util", 150 | "mime", 151 | "pin-project-lite", 152 | "rustversion", 153 | "sync_wrapper 1.0.1", 154 | "tower-layer", 155 | "tower-service", 156 | "tracing", 157 | ] 158 | 159 | [[package]] 160 | name = "base32" 161 | version = "0.4.0" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" 164 | 165 | [[package]] 166 | name = "base64" 167 | version = "0.21.7" 168 | source = "registry+https://github.com/rust-lang/crates.io-index" 169 | checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" 170 | 171 | [[package]] 172 | name = "base64-url" 173 | version = "2.0.2" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "fb9fb9fb058cc3063b5fc88d9a21eefa2735871498a04e1650da76ed511c8569" 176 | dependencies = [ 177 | "base64", 178 | ] 179 | 180 | [[package]] 181 | name = "bitflags" 182 | version = "2.6.0" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" 185 | 186 | [[package]] 187 | name = "byteorder" 188 | version = "1.5.0" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 191 | 192 | [[package]] 193 | name = "bytes" 194 | version = "1.7.2" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" 197 | 198 | [[package]] 199 | name = "bytestring" 200 | version = "1.5.0" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "113b4343b5f6617e7ad401ced8de3cc8b012e73a594347c307b90db3e9271289" 203 | dependencies = [ 204 | "bytes", 205 | "serde_core", 206 | ] 207 | 208 | [[package]] 209 | name = "camino" 210 | version = "1.2.1" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "276a59bf2b2c967788139340c9f0c5b12d7fd6630315c15c217e559de85d2609" 213 | 214 | [[package]] 215 | name = "cfg-if" 216 | version = "1.0.0" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 219 | 220 | [[package]] 221 | name = "clap" 222 | version = "4.5.19" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" 225 | dependencies = [ 226 | "clap_builder", 227 | "clap_derive", 228 | ] 229 | 230 | [[package]] 231 | name = "clap_builder" 232 | version = "4.5.19" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" 235 | dependencies = [ 236 | "anstream", 237 | "anstyle", 238 | "clap_lex", 239 | "strsim", 240 | ] 241 | 242 | [[package]] 243 | name = "clap_derive" 244 | version = "4.5.18" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" 247 | dependencies = [ 248 | "heck", 249 | "proc-macro2", 250 | "quote", 251 | "syn", 252 | ] 253 | 254 | [[package]] 255 | name = "clap_lex" 256 | version = "0.7.2" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" 259 | 260 | [[package]] 261 | name = "colorchoice" 262 | version = "1.0.2" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" 265 | 266 | [[package]] 267 | name = "combine" 268 | version = "4.6.7" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" 271 | dependencies = [ 272 | "bytes", 273 | "futures-core", 274 | "memchr", 275 | "pin-project-lite", 276 | "tokio", 277 | "tokio-util", 278 | ] 279 | 280 | [[package]] 281 | name = "crc-any" 282 | version = "2.5.0" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | checksum = "a62ec9ff5f7965e4d7280bd5482acd20aadb50d632cf6c1d74493856b011fa73" 285 | dependencies = [ 286 | "debug-helper", 287 | ] 288 | 289 | [[package]] 290 | name = "debug-helper" 291 | version = "0.3.13" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" 294 | 295 | [[package]] 296 | name = "deranged" 297 | version = "0.3.11" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" 300 | dependencies = [ 301 | "powerfmt", 302 | ] 303 | 304 | [[package]] 305 | name = "equivalent" 306 | version = "1.0.1" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 309 | 310 | [[package]] 311 | name = "fnv" 312 | version = "1.0.7" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 315 | 316 | [[package]] 317 | name = "form_urlencoded" 318 | version = "1.2.1" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 321 | dependencies = [ 322 | "percent-encoding", 323 | ] 324 | 325 | [[package]] 326 | name = "futures-channel" 327 | version = "0.3.30" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 330 | dependencies = [ 331 | "futures-core", 332 | "futures-sink", 333 | ] 334 | 335 | [[package]] 336 | name = "futures-core" 337 | version = "0.3.31" 338 | source = "registry+https://github.com/rust-lang/crates.io-index" 339 | checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 340 | 341 | [[package]] 342 | name = "futures-macro" 343 | version = "0.3.31" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" 346 | dependencies = [ 347 | "proc-macro2", 348 | "quote", 349 | "syn", 350 | ] 351 | 352 | [[package]] 353 | name = "futures-sink" 354 | version = "0.3.31" 355 | source = "registry+https://github.com/rust-lang/crates.io-index" 356 | checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 357 | 358 | [[package]] 359 | name = "futures-task" 360 | version = "0.3.31" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 363 | 364 | [[package]] 365 | name = "futures-timer" 366 | version = "3.0.3" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" 369 | 370 | [[package]] 371 | name = "futures-util" 372 | version = "0.3.31" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 375 | dependencies = [ 376 | "futures-core", 377 | "futures-macro", 378 | "futures-sink", 379 | "futures-task", 380 | "pin-project-lite", 381 | "pin-utils", 382 | "slab", 383 | ] 384 | 385 | [[package]] 386 | name = "getrandom" 387 | version = "0.3.1" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" 390 | dependencies = [ 391 | "cfg-if", 392 | "libc", 393 | "wasi 0.13.3+wasi-0.2.2", 394 | "windows-targets 0.52.6", 395 | ] 396 | 397 | [[package]] 398 | name = "hashbrown" 399 | version = "0.16.0" 400 | source = "registry+https://github.com/rust-lang/crates.io-index" 401 | checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" 402 | 403 | [[package]] 404 | name = "heck" 405 | version = "0.5.0" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 408 | 409 | [[package]] 410 | name = "hermit-abi" 411 | version = "0.3.9" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 414 | 415 | [[package]] 416 | name = "http" 417 | version = "1.1.0" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" 420 | dependencies = [ 421 | "bytes", 422 | "fnv", 423 | "itoa", 424 | ] 425 | 426 | [[package]] 427 | name = "http-body" 428 | version = "1.0.1" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" 431 | dependencies = [ 432 | "bytes", 433 | "http", 434 | ] 435 | 436 | [[package]] 437 | name = "http-body-util" 438 | version = "0.1.2" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" 441 | dependencies = [ 442 | "bytes", 443 | "futures-util", 444 | "http", 445 | "http-body", 446 | "pin-project-lite", 447 | ] 448 | 449 | [[package]] 450 | name = "httparse" 451 | version = "1.9.5" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" 454 | 455 | [[package]] 456 | name = "httpdate" 457 | version = "1.0.3" 458 | source = "registry+https://github.com/rust-lang/crates.io-index" 459 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 460 | 461 | [[package]] 462 | name = "hyper" 463 | version = "1.4.1" 464 | source = "registry+https://github.com/rust-lang/crates.io-index" 465 | checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" 466 | dependencies = [ 467 | "bytes", 468 | "futures-channel", 469 | "futures-util", 470 | "http", 471 | "http-body", 472 | "httparse", 473 | "httpdate", 474 | "itoa", 475 | "pin-project-lite", 476 | "smallvec", 477 | "tokio", 478 | ] 479 | 480 | [[package]] 481 | name = "hyper-util" 482 | version = "0.1.9" 483 | source = "registry+https://github.com/rust-lang/crates.io-index" 484 | checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" 485 | dependencies = [ 486 | "bytes", 487 | "futures-util", 488 | "http", 489 | "http-body", 490 | "hyper", 491 | "pin-project-lite", 492 | "tokio", 493 | "tower-service", 494 | ] 495 | 496 | [[package]] 497 | name = "idna" 498 | version = "0.5.0" 499 | source = "registry+https://github.com/rust-lang/crates.io-index" 500 | checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" 501 | dependencies = [ 502 | "unicode-bidi", 503 | "unicode-normalization", 504 | ] 505 | 506 | [[package]] 507 | name = "indexmap" 508 | version = "2.12.0" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" 511 | dependencies = [ 512 | "equivalent", 513 | "hashbrown", 514 | ] 515 | 516 | [[package]] 517 | name = "is_terminal_polyfill" 518 | version = "1.70.1" 519 | source = "registry+https://github.com/rust-lang/crates.io-index" 520 | checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" 521 | 522 | [[package]] 523 | name = "itoa" 524 | version = "1.0.11" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 527 | 528 | [[package]] 529 | name = "lazy_static" 530 | version = "1.5.0" 531 | source = "registry+https://github.com/rust-lang/crates.io-index" 532 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 533 | 534 | [[package]] 535 | name = "libc" 536 | version = "0.2.177" 537 | source = "registry+https://github.com/rust-lang/crates.io-index" 538 | checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" 539 | 540 | [[package]] 541 | name = "lock_api" 542 | version = "0.4.12" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 545 | dependencies = [ 546 | "autocfg", 547 | "scopeguard", 548 | ] 549 | 550 | [[package]] 551 | name = "log" 552 | version = "0.4.22" 553 | source = "registry+https://github.com/rust-lang/crates.io-index" 554 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 555 | 556 | [[package]] 557 | name = "matchers" 558 | version = "0.1.0" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" 561 | dependencies = [ 562 | "regex-automata 0.1.10", 563 | ] 564 | 565 | [[package]] 566 | name = "matchit" 567 | version = "0.7.3" 568 | source = "registry+https://github.com/rust-lang/crates.io-index" 569 | checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" 570 | 571 | [[package]] 572 | name = "memchr" 573 | version = "2.7.4" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 576 | 577 | [[package]] 578 | name = "metrics" 579 | version = "0.24.2" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | checksum = "25dea7ac8057892855ec285c440160265225438c3c45072613c25a4b26e98ef5" 582 | dependencies = [ 583 | "ahash", 584 | "portable-atomic", 585 | ] 586 | 587 | [[package]] 588 | name = "mime" 589 | version = "0.3.17" 590 | source = "registry+https://github.com/rust-lang/crates.io-index" 591 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 592 | 593 | [[package]] 594 | name = "mio" 595 | version = "1.0.2" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" 598 | dependencies = [ 599 | "hermit-abi", 600 | "libc", 601 | "wasi 0.11.0+wasi-snapshot-preview1", 602 | "windows-sys 0.52.0", 603 | ] 604 | 605 | [[package]] 606 | name = "mobc" 607 | version = "0.9.0" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | checksum = "4ee4c321f7581ff6d3b02c1fd05dc0b1f17c05f23c8532d1af9413890ab5fab5" 610 | dependencies = [ 611 | "async-trait", 612 | "futures-channel", 613 | "futures-core", 614 | "futures-timer", 615 | "futures-util", 616 | "log", 617 | "metrics", 618 | "thiserror 1.0.69", 619 | "tokio", 620 | "tracing", 621 | "tracing-subscriber", 622 | ] 623 | 624 | [[package]] 625 | name = "mobc-redis" 626 | version = "0.9.0" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "f8b4ebc994c8fa99a3655aa979be17af36f445f98c282a0b00bd03a549e8e42f" 629 | dependencies = [ 630 | "mobc", 631 | "redis", 632 | ] 633 | 634 | [[package]] 635 | name = "nu-ansi-term" 636 | version = "0.46.0" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 639 | dependencies = [ 640 | "overload", 641 | "winapi", 642 | ] 643 | 644 | [[package]] 645 | name = "num-bigint" 646 | version = "0.4.6" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" 649 | dependencies = [ 650 | "num-integer", 651 | "num-traits", 652 | ] 653 | 654 | [[package]] 655 | name = "num-conv" 656 | version = "0.1.0" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" 659 | 660 | [[package]] 661 | name = "num-integer" 662 | version = "0.1.46" 663 | source = "registry+https://github.com/rust-lang/crates.io-index" 664 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 665 | dependencies = [ 666 | "num-traits", 667 | ] 668 | 669 | [[package]] 670 | name = "num-traits" 671 | version = "0.2.19" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 674 | dependencies = [ 675 | "autocfg", 676 | ] 677 | 678 | [[package]] 679 | name = "num_threads" 680 | version = "0.1.7" 681 | source = "registry+https://github.com/rust-lang/crates.io-index" 682 | checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" 683 | dependencies = [ 684 | "libc", 685 | ] 686 | 687 | [[package]] 688 | name = "once_cell" 689 | version = "1.20.1" 690 | source = "registry+https://github.com/rust-lang/crates.io-index" 691 | checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" 692 | dependencies = [ 693 | "portable-atomic", 694 | ] 695 | 696 | [[package]] 697 | name = "overload" 698 | version = "0.1.1" 699 | source = "registry+https://github.com/rust-lang/crates.io-index" 700 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 701 | 702 | [[package]] 703 | name = "parking_lot" 704 | version = "0.12.3" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" 707 | dependencies = [ 708 | "lock_api", 709 | "parking_lot_core", 710 | ] 711 | 712 | [[package]] 713 | name = "parking_lot_core" 714 | version = "0.9.10" 715 | source = "registry+https://github.com/rust-lang/crates.io-index" 716 | checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" 717 | dependencies = [ 718 | "cfg-if", 719 | "libc", 720 | "redox_syscall", 721 | "smallvec", 722 | "windows-targets 0.52.6", 723 | ] 724 | 725 | [[package]] 726 | name = "pastebin-server" 727 | version = "0.4.0" 728 | dependencies = [ 729 | "anyhow", 730 | "axum", 731 | "bytestring", 732 | "camino", 733 | "clap", 734 | "mobc-redis", 735 | "rand", 736 | "regex", 737 | "serde", 738 | "serde_json", 739 | "serde_repr", 740 | "short-crypt", 741 | "thiserror 2.0.3", 742 | "tokio", 743 | "toml", 744 | "tower", 745 | "tracing", 746 | "tracing-futures", 747 | "tracing-subscriber", 748 | ] 749 | 750 | [[package]] 751 | name = "percent-encoding" 752 | version = "2.3.1" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 755 | 756 | [[package]] 757 | name = "pin-project" 758 | version = "1.1.5" 759 | source = "registry+https://github.com/rust-lang/crates.io-index" 760 | checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" 761 | dependencies = [ 762 | "pin-project-internal", 763 | ] 764 | 765 | [[package]] 766 | name = "pin-project-internal" 767 | version = "1.1.5" 768 | source = "registry+https://github.com/rust-lang/crates.io-index" 769 | checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" 770 | dependencies = [ 771 | "proc-macro2", 772 | "quote", 773 | "syn", 774 | ] 775 | 776 | [[package]] 777 | name = "pin-project-lite" 778 | version = "0.2.14" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 781 | 782 | [[package]] 783 | name = "pin-utils" 784 | version = "0.1.0" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 787 | 788 | [[package]] 789 | name = "portable-atomic" 790 | version = "1.9.0" 791 | source = "registry+https://github.com/rust-lang/crates.io-index" 792 | checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" 793 | 794 | [[package]] 795 | name = "powerfmt" 796 | version = "0.2.0" 797 | source = "registry+https://github.com/rust-lang/crates.io-index" 798 | checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 799 | 800 | [[package]] 801 | name = "ppv-lite86" 802 | version = "0.2.20" 803 | source = "registry+https://github.com/rust-lang/crates.io-index" 804 | checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" 805 | dependencies = [ 806 | "zerocopy 0.7.35", 807 | ] 808 | 809 | [[package]] 810 | name = "proc-macro2" 811 | version = "1.0.92" 812 | source = "registry+https://github.com/rust-lang/crates.io-index" 813 | checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" 814 | dependencies = [ 815 | "unicode-ident", 816 | ] 817 | 818 | [[package]] 819 | name = "quote" 820 | version = "1.0.37" 821 | source = "registry+https://github.com/rust-lang/crates.io-index" 822 | checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" 823 | dependencies = [ 824 | "proc-macro2", 825 | ] 826 | 827 | [[package]] 828 | name = "rand" 829 | version = "0.9.0" 830 | source = "registry+https://github.com/rust-lang/crates.io-index" 831 | checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" 832 | dependencies = [ 833 | "rand_chacha", 834 | "rand_core", 835 | "zerocopy 0.8.14", 836 | ] 837 | 838 | [[package]] 839 | name = "rand_chacha" 840 | version = "0.9.0" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" 843 | dependencies = [ 844 | "ppv-lite86", 845 | "rand_core", 846 | ] 847 | 848 | [[package]] 849 | name = "rand_core" 850 | version = "0.9.0" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff" 853 | dependencies = [ 854 | "getrandom", 855 | "zerocopy 0.8.14", 856 | ] 857 | 858 | [[package]] 859 | name = "redis" 860 | version = "0.28.2" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "e37ec3fd44bea2ec947ba6cc7634d7999a6590aca7c35827c250bc0de502bda6" 863 | dependencies = [ 864 | "arc-swap", 865 | "bytes", 866 | "combine", 867 | "futures-util", 868 | "itoa", 869 | "num-bigint", 870 | "percent-encoding", 871 | "pin-project-lite", 872 | "ryu", 873 | "sha1_smol", 874 | "socket2 0.5.7", 875 | "tokio", 876 | "tokio-util", 877 | "url", 878 | ] 879 | 880 | [[package]] 881 | name = "redox_syscall" 882 | version = "0.5.7" 883 | source = "registry+https://github.com/rust-lang/crates.io-index" 884 | checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" 885 | dependencies = [ 886 | "bitflags", 887 | ] 888 | 889 | [[package]] 890 | name = "regex" 891 | version = "1.12.2" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" 894 | dependencies = [ 895 | "aho-corasick", 896 | "memchr", 897 | "regex-automata 0.4.13", 898 | "regex-syntax 0.8.5", 899 | ] 900 | 901 | [[package]] 902 | name = "regex-automata" 903 | version = "0.1.10" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 906 | dependencies = [ 907 | "regex-syntax 0.6.29", 908 | ] 909 | 910 | [[package]] 911 | name = "regex-automata" 912 | version = "0.4.13" 913 | source = "registry+https://github.com/rust-lang/crates.io-index" 914 | checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" 915 | dependencies = [ 916 | "aho-corasick", 917 | "memchr", 918 | "regex-syntax 0.8.5", 919 | ] 920 | 921 | [[package]] 922 | name = "regex-syntax" 923 | version = "0.6.29" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" 926 | 927 | [[package]] 928 | name = "regex-syntax" 929 | version = "0.8.5" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 932 | 933 | [[package]] 934 | name = "rustversion" 935 | version = "1.0.17" 936 | source = "registry+https://github.com/rust-lang/crates.io-index" 937 | checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" 938 | 939 | [[package]] 940 | name = "ryu" 941 | version = "1.0.18" 942 | source = "registry+https://github.com/rust-lang/crates.io-index" 943 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 944 | 945 | [[package]] 946 | name = "scopeguard" 947 | version = "1.2.0" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 950 | 951 | [[package]] 952 | name = "serde" 953 | version = "1.0.228" 954 | source = "registry+https://github.com/rust-lang/crates.io-index" 955 | checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 956 | dependencies = [ 957 | "serde_core", 958 | "serde_derive", 959 | ] 960 | 961 | [[package]] 962 | name = "serde_core" 963 | version = "1.0.228" 964 | source = "registry+https://github.com/rust-lang/crates.io-index" 965 | checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 966 | dependencies = [ 967 | "serde_derive", 968 | ] 969 | 970 | [[package]] 971 | name = "serde_derive" 972 | version = "1.0.228" 973 | source = "registry+https://github.com/rust-lang/crates.io-index" 974 | checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 975 | dependencies = [ 976 | "proc-macro2", 977 | "quote", 978 | "syn", 979 | ] 980 | 981 | [[package]] 982 | name = "serde_json" 983 | version = "1.0.128" 984 | source = "registry+https://github.com/rust-lang/crates.io-index" 985 | checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" 986 | dependencies = [ 987 | "itoa", 988 | "memchr", 989 | "ryu", 990 | "serde", 991 | ] 992 | 993 | [[package]] 994 | name = "serde_path_to_error" 995 | version = "0.1.16" 996 | source = "registry+https://github.com/rust-lang/crates.io-index" 997 | checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" 998 | dependencies = [ 999 | "itoa", 1000 | "serde", 1001 | ] 1002 | 1003 | [[package]] 1004 | name = "serde_repr" 1005 | version = "0.1.19" 1006 | source = "registry+https://github.com/rust-lang/crates.io-index" 1007 | checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" 1008 | dependencies = [ 1009 | "proc-macro2", 1010 | "quote", 1011 | "syn", 1012 | ] 1013 | 1014 | [[package]] 1015 | name = "serde_spanned" 1016 | version = "1.0.3" 1017 | source = "registry+https://github.com/rust-lang/crates.io-index" 1018 | checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392" 1019 | dependencies = [ 1020 | "serde_core", 1021 | ] 1022 | 1023 | [[package]] 1024 | name = "serde_urlencoded" 1025 | version = "0.7.1" 1026 | source = "registry+https://github.com/rust-lang/crates.io-index" 1027 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1028 | dependencies = [ 1029 | "form_urlencoded", 1030 | "itoa", 1031 | "ryu", 1032 | "serde", 1033 | ] 1034 | 1035 | [[package]] 1036 | name = "sha1_smol" 1037 | version = "1.0.1" 1038 | source = "registry+https://github.com/rust-lang/crates.io-index" 1039 | checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" 1040 | 1041 | [[package]] 1042 | name = "sharded-slab" 1043 | version = "0.1.7" 1044 | source = "registry+https://github.com/rust-lang/crates.io-index" 1045 | checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" 1046 | dependencies = [ 1047 | "lazy_static", 1048 | ] 1049 | 1050 | [[package]] 1051 | name = "short-crypt" 1052 | version = "1.0.28" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "ced9fb70ffc5ba75e25935b67bedebdf21dda4fe796445005b4e8a323ad2d7f9" 1055 | dependencies = [ 1056 | "base32", 1057 | "base64-url", 1058 | "crc-any", 1059 | "debug-helper", 1060 | ] 1061 | 1062 | [[package]] 1063 | name = "signal-hook-registry" 1064 | version = "1.4.2" 1065 | source = "registry+https://github.com/rust-lang/crates.io-index" 1066 | checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" 1067 | dependencies = [ 1068 | "libc", 1069 | ] 1070 | 1071 | [[package]] 1072 | name = "slab" 1073 | version = "0.4.9" 1074 | source = "registry+https://github.com/rust-lang/crates.io-index" 1075 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1076 | dependencies = [ 1077 | "autocfg", 1078 | ] 1079 | 1080 | [[package]] 1081 | name = "smallvec" 1082 | version = "1.13.2" 1083 | source = "registry+https://github.com/rust-lang/crates.io-index" 1084 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1085 | 1086 | [[package]] 1087 | name = "socket2" 1088 | version = "0.5.7" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" 1091 | dependencies = [ 1092 | "libc", 1093 | "windows-sys 0.52.0", 1094 | ] 1095 | 1096 | [[package]] 1097 | name = "socket2" 1098 | version = "0.6.1" 1099 | source = "registry+https://github.com/rust-lang/crates.io-index" 1100 | checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" 1101 | dependencies = [ 1102 | "libc", 1103 | "windows-sys 0.60.2", 1104 | ] 1105 | 1106 | [[package]] 1107 | name = "strsim" 1108 | version = "0.11.1" 1109 | source = "registry+https://github.com/rust-lang/crates.io-index" 1110 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 1111 | 1112 | [[package]] 1113 | name = "syn" 1114 | version = "2.0.90" 1115 | source = "registry+https://github.com/rust-lang/crates.io-index" 1116 | checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" 1117 | dependencies = [ 1118 | "proc-macro2", 1119 | "quote", 1120 | "unicode-ident", 1121 | ] 1122 | 1123 | [[package]] 1124 | name = "sync_wrapper" 1125 | version = "0.1.2" 1126 | source = "registry+https://github.com/rust-lang/crates.io-index" 1127 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 1128 | 1129 | [[package]] 1130 | name = "sync_wrapper" 1131 | version = "1.0.1" 1132 | source = "registry+https://github.com/rust-lang/crates.io-index" 1133 | checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" 1134 | 1135 | [[package]] 1136 | name = "thiserror" 1137 | version = "1.0.69" 1138 | source = "registry+https://github.com/rust-lang/crates.io-index" 1139 | checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" 1140 | dependencies = [ 1141 | "thiserror-impl 1.0.69", 1142 | ] 1143 | 1144 | [[package]] 1145 | name = "thiserror" 1146 | version = "2.0.3" 1147 | source = "registry+https://github.com/rust-lang/crates.io-index" 1148 | checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" 1149 | dependencies = [ 1150 | "thiserror-impl 2.0.3", 1151 | ] 1152 | 1153 | [[package]] 1154 | name = "thiserror-impl" 1155 | version = "1.0.69" 1156 | source = "registry+https://github.com/rust-lang/crates.io-index" 1157 | checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" 1158 | dependencies = [ 1159 | "proc-macro2", 1160 | "quote", 1161 | "syn", 1162 | ] 1163 | 1164 | [[package]] 1165 | name = "thiserror-impl" 1166 | version = "2.0.3" 1167 | source = "registry+https://github.com/rust-lang/crates.io-index" 1168 | checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" 1169 | dependencies = [ 1170 | "proc-macro2", 1171 | "quote", 1172 | "syn", 1173 | ] 1174 | 1175 | [[package]] 1176 | name = "thread_local" 1177 | version = "1.1.8" 1178 | source = "registry+https://github.com/rust-lang/crates.io-index" 1179 | checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" 1180 | dependencies = [ 1181 | "cfg-if", 1182 | "once_cell", 1183 | ] 1184 | 1185 | [[package]] 1186 | name = "time" 1187 | version = "0.3.36" 1188 | source = "registry+https://github.com/rust-lang/crates.io-index" 1189 | checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" 1190 | dependencies = [ 1191 | "deranged", 1192 | "itoa", 1193 | "libc", 1194 | "num-conv", 1195 | "num_threads", 1196 | "powerfmt", 1197 | "serde", 1198 | "time-core", 1199 | "time-macros", 1200 | ] 1201 | 1202 | [[package]] 1203 | name = "time-core" 1204 | version = "0.1.2" 1205 | source = "registry+https://github.com/rust-lang/crates.io-index" 1206 | checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" 1207 | 1208 | [[package]] 1209 | name = "time-macros" 1210 | version = "0.2.18" 1211 | source = "registry+https://github.com/rust-lang/crates.io-index" 1212 | checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" 1213 | dependencies = [ 1214 | "num-conv", 1215 | "time-core", 1216 | ] 1217 | 1218 | [[package]] 1219 | name = "tinyvec" 1220 | version = "1.8.0" 1221 | source = "registry+https://github.com/rust-lang/crates.io-index" 1222 | checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" 1223 | dependencies = [ 1224 | "tinyvec_macros", 1225 | ] 1226 | 1227 | [[package]] 1228 | name = "tinyvec_macros" 1229 | version = "0.1.1" 1230 | source = "registry+https://github.com/rust-lang/crates.io-index" 1231 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1232 | 1233 | [[package]] 1234 | name = "tokio" 1235 | version = "1.48.0" 1236 | source = "registry+https://github.com/rust-lang/crates.io-index" 1237 | checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" 1238 | dependencies = [ 1239 | "bytes", 1240 | "libc", 1241 | "mio", 1242 | "parking_lot", 1243 | "pin-project-lite", 1244 | "signal-hook-registry", 1245 | "socket2 0.6.1", 1246 | "tokio-macros", 1247 | "windows-sys 0.61.2", 1248 | ] 1249 | 1250 | [[package]] 1251 | name = "tokio-macros" 1252 | version = "2.6.0" 1253 | source = "registry+https://github.com/rust-lang/crates.io-index" 1254 | checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" 1255 | dependencies = [ 1256 | "proc-macro2", 1257 | "quote", 1258 | "syn", 1259 | ] 1260 | 1261 | [[package]] 1262 | name = "tokio-util" 1263 | version = "0.7.12" 1264 | source = "registry+https://github.com/rust-lang/crates.io-index" 1265 | checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" 1266 | dependencies = [ 1267 | "bytes", 1268 | "futures-core", 1269 | "futures-sink", 1270 | "pin-project-lite", 1271 | "tokio", 1272 | ] 1273 | 1274 | [[package]] 1275 | name = "toml" 1276 | version = "0.9.8" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" 1279 | dependencies = [ 1280 | "indexmap", 1281 | "serde_core", 1282 | "serde_spanned", 1283 | "toml_datetime", 1284 | "toml_parser", 1285 | "toml_writer", 1286 | "winnow", 1287 | ] 1288 | 1289 | [[package]] 1290 | name = "toml_datetime" 1291 | version = "0.7.3" 1292 | source = "registry+https://github.com/rust-lang/crates.io-index" 1293 | checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" 1294 | dependencies = [ 1295 | "serde_core", 1296 | ] 1297 | 1298 | [[package]] 1299 | name = "toml_parser" 1300 | version = "1.0.4" 1301 | source = "registry+https://github.com/rust-lang/crates.io-index" 1302 | checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" 1303 | dependencies = [ 1304 | "winnow", 1305 | ] 1306 | 1307 | [[package]] 1308 | name = "toml_writer" 1309 | version = "1.0.4" 1310 | source = "registry+https://github.com/rust-lang/crates.io-index" 1311 | checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" 1312 | 1313 | [[package]] 1314 | name = "tower" 1315 | version = "0.5.1" 1316 | source = "registry+https://github.com/rust-lang/crates.io-index" 1317 | checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" 1318 | dependencies = [ 1319 | "futures-core", 1320 | "futures-util", 1321 | "pin-project-lite", 1322 | "sync_wrapper 0.1.2", 1323 | "tokio", 1324 | "tokio-util", 1325 | "tower-layer", 1326 | "tower-service", 1327 | "tracing", 1328 | ] 1329 | 1330 | [[package]] 1331 | name = "tower-layer" 1332 | version = "0.3.3" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" 1335 | 1336 | [[package]] 1337 | name = "tower-service" 1338 | version = "0.3.3" 1339 | source = "registry+https://github.com/rust-lang/crates.io-index" 1340 | checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 1341 | 1342 | [[package]] 1343 | name = "tracing" 1344 | version = "0.1.40" 1345 | source = "registry+https://github.com/rust-lang/crates.io-index" 1346 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1347 | dependencies = [ 1348 | "log", 1349 | "pin-project-lite", 1350 | "tracing-attributes", 1351 | "tracing-core", 1352 | ] 1353 | 1354 | [[package]] 1355 | name = "tracing-attributes" 1356 | version = "0.1.27" 1357 | source = "registry+https://github.com/rust-lang/crates.io-index" 1358 | checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 1359 | dependencies = [ 1360 | "proc-macro2", 1361 | "quote", 1362 | "syn", 1363 | ] 1364 | 1365 | [[package]] 1366 | name = "tracing-core" 1367 | version = "0.1.32" 1368 | source = "registry+https://github.com/rust-lang/crates.io-index" 1369 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1370 | dependencies = [ 1371 | "once_cell", 1372 | "valuable", 1373 | ] 1374 | 1375 | [[package]] 1376 | name = "tracing-futures" 1377 | version = "0.2.5" 1378 | source = "registry+https://github.com/rust-lang/crates.io-index" 1379 | checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" 1380 | dependencies = [ 1381 | "pin-project", 1382 | "tracing", 1383 | ] 1384 | 1385 | [[package]] 1386 | name = "tracing-log" 1387 | version = "0.2.0" 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" 1389 | checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" 1390 | dependencies = [ 1391 | "log", 1392 | "once_cell", 1393 | "tracing-core", 1394 | ] 1395 | 1396 | [[package]] 1397 | name = "tracing-subscriber" 1398 | version = "0.3.18" 1399 | source = "registry+https://github.com/rust-lang/crates.io-index" 1400 | checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" 1401 | dependencies = [ 1402 | "matchers", 1403 | "nu-ansi-term", 1404 | "once_cell", 1405 | "regex", 1406 | "sharded-slab", 1407 | "smallvec", 1408 | "thread_local", 1409 | "time", 1410 | "tracing", 1411 | "tracing-core", 1412 | "tracing-log", 1413 | ] 1414 | 1415 | [[package]] 1416 | name = "unicode-bidi" 1417 | version = "0.3.17" 1418 | source = "registry+https://github.com/rust-lang/crates.io-index" 1419 | checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" 1420 | 1421 | [[package]] 1422 | name = "unicode-ident" 1423 | version = "1.0.13" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" 1426 | 1427 | [[package]] 1428 | name = "unicode-normalization" 1429 | version = "0.1.24" 1430 | source = "registry+https://github.com/rust-lang/crates.io-index" 1431 | checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" 1432 | dependencies = [ 1433 | "tinyvec", 1434 | ] 1435 | 1436 | [[package]] 1437 | name = "url" 1438 | version = "2.5.2" 1439 | source = "registry+https://github.com/rust-lang/crates.io-index" 1440 | checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" 1441 | dependencies = [ 1442 | "form_urlencoded", 1443 | "idna", 1444 | "percent-encoding", 1445 | ] 1446 | 1447 | [[package]] 1448 | name = "utf8parse" 1449 | version = "0.2.2" 1450 | source = "registry+https://github.com/rust-lang/crates.io-index" 1451 | checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 1452 | 1453 | [[package]] 1454 | name = "valuable" 1455 | version = "0.1.0" 1456 | source = "registry+https://github.com/rust-lang/crates.io-index" 1457 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 1458 | 1459 | [[package]] 1460 | name = "version_check" 1461 | version = "0.9.5" 1462 | source = "registry+https://github.com/rust-lang/crates.io-index" 1463 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 1464 | 1465 | [[package]] 1466 | name = "wasi" 1467 | version = "0.11.0+wasi-snapshot-preview1" 1468 | source = "registry+https://github.com/rust-lang/crates.io-index" 1469 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1470 | 1471 | [[package]] 1472 | name = "wasi" 1473 | version = "0.13.3+wasi-0.2.2" 1474 | source = "registry+https://github.com/rust-lang/crates.io-index" 1475 | checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" 1476 | dependencies = [ 1477 | "wit-bindgen-rt", 1478 | ] 1479 | 1480 | [[package]] 1481 | name = "winapi" 1482 | version = "0.3.9" 1483 | source = "registry+https://github.com/rust-lang/crates.io-index" 1484 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1485 | dependencies = [ 1486 | "winapi-i686-pc-windows-gnu", 1487 | "winapi-x86_64-pc-windows-gnu", 1488 | ] 1489 | 1490 | [[package]] 1491 | name = "winapi-i686-pc-windows-gnu" 1492 | version = "0.4.0" 1493 | source = "registry+https://github.com/rust-lang/crates.io-index" 1494 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1495 | 1496 | [[package]] 1497 | name = "winapi-x86_64-pc-windows-gnu" 1498 | version = "0.4.0" 1499 | source = "registry+https://github.com/rust-lang/crates.io-index" 1500 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1501 | 1502 | [[package]] 1503 | name = "windows-link" 1504 | version = "0.2.1" 1505 | source = "registry+https://github.com/rust-lang/crates.io-index" 1506 | checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 1507 | 1508 | [[package]] 1509 | name = "windows-sys" 1510 | version = "0.52.0" 1511 | source = "registry+https://github.com/rust-lang/crates.io-index" 1512 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1513 | dependencies = [ 1514 | "windows-targets 0.52.6", 1515 | ] 1516 | 1517 | [[package]] 1518 | name = "windows-sys" 1519 | version = "0.60.2" 1520 | source = "registry+https://github.com/rust-lang/crates.io-index" 1521 | checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" 1522 | dependencies = [ 1523 | "windows-targets 0.53.5", 1524 | ] 1525 | 1526 | [[package]] 1527 | name = "windows-sys" 1528 | version = "0.61.2" 1529 | source = "registry+https://github.com/rust-lang/crates.io-index" 1530 | checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" 1531 | dependencies = [ 1532 | "windows-link", 1533 | ] 1534 | 1535 | [[package]] 1536 | name = "windows-targets" 1537 | version = "0.52.6" 1538 | source = "registry+https://github.com/rust-lang/crates.io-index" 1539 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1540 | dependencies = [ 1541 | "windows_aarch64_gnullvm 0.52.6", 1542 | "windows_aarch64_msvc 0.52.6", 1543 | "windows_i686_gnu 0.52.6", 1544 | "windows_i686_gnullvm 0.52.6", 1545 | "windows_i686_msvc 0.52.6", 1546 | "windows_x86_64_gnu 0.52.6", 1547 | "windows_x86_64_gnullvm 0.52.6", 1548 | "windows_x86_64_msvc 0.52.6", 1549 | ] 1550 | 1551 | [[package]] 1552 | name = "windows-targets" 1553 | version = "0.53.5" 1554 | source = "registry+https://github.com/rust-lang/crates.io-index" 1555 | checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" 1556 | dependencies = [ 1557 | "windows-link", 1558 | "windows_aarch64_gnullvm 0.53.1", 1559 | "windows_aarch64_msvc 0.53.1", 1560 | "windows_i686_gnu 0.53.1", 1561 | "windows_i686_gnullvm 0.53.1", 1562 | "windows_i686_msvc 0.53.1", 1563 | "windows_x86_64_gnu 0.53.1", 1564 | "windows_x86_64_gnullvm 0.53.1", 1565 | "windows_x86_64_msvc 0.53.1", 1566 | ] 1567 | 1568 | [[package]] 1569 | name = "windows_aarch64_gnullvm" 1570 | version = "0.52.6" 1571 | source = "registry+https://github.com/rust-lang/crates.io-index" 1572 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1573 | 1574 | [[package]] 1575 | name = "windows_aarch64_gnullvm" 1576 | version = "0.53.1" 1577 | source = "registry+https://github.com/rust-lang/crates.io-index" 1578 | checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" 1579 | 1580 | [[package]] 1581 | name = "windows_aarch64_msvc" 1582 | version = "0.52.6" 1583 | source = "registry+https://github.com/rust-lang/crates.io-index" 1584 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1585 | 1586 | [[package]] 1587 | name = "windows_aarch64_msvc" 1588 | version = "0.53.1" 1589 | source = "registry+https://github.com/rust-lang/crates.io-index" 1590 | checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" 1591 | 1592 | [[package]] 1593 | name = "windows_i686_gnu" 1594 | version = "0.52.6" 1595 | source = "registry+https://github.com/rust-lang/crates.io-index" 1596 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1597 | 1598 | [[package]] 1599 | name = "windows_i686_gnu" 1600 | version = "0.53.1" 1601 | source = "registry+https://github.com/rust-lang/crates.io-index" 1602 | checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" 1603 | 1604 | [[package]] 1605 | name = "windows_i686_gnullvm" 1606 | version = "0.52.6" 1607 | source = "registry+https://github.com/rust-lang/crates.io-index" 1608 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1609 | 1610 | [[package]] 1611 | name = "windows_i686_gnullvm" 1612 | version = "0.53.1" 1613 | source = "registry+https://github.com/rust-lang/crates.io-index" 1614 | checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" 1615 | 1616 | [[package]] 1617 | name = "windows_i686_msvc" 1618 | version = "0.52.6" 1619 | source = "registry+https://github.com/rust-lang/crates.io-index" 1620 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1621 | 1622 | [[package]] 1623 | name = "windows_i686_msvc" 1624 | version = "0.53.1" 1625 | source = "registry+https://github.com/rust-lang/crates.io-index" 1626 | checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" 1627 | 1628 | [[package]] 1629 | name = "windows_x86_64_gnu" 1630 | version = "0.52.6" 1631 | source = "registry+https://github.com/rust-lang/crates.io-index" 1632 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 1633 | 1634 | [[package]] 1635 | name = "windows_x86_64_gnu" 1636 | version = "0.53.1" 1637 | source = "registry+https://github.com/rust-lang/crates.io-index" 1638 | checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" 1639 | 1640 | [[package]] 1641 | name = "windows_x86_64_gnullvm" 1642 | version = "0.52.6" 1643 | source = "registry+https://github.com/rust-lang/crates.io-index" 1644 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 1645 | 1646 | [[package]] 1647 | name = "windows_x86_64_gnullvm" 1648 | version = "0.53.1" 1649 | source = "registry+https://github.com/rust-lang/crates.io-index" 1650 | checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" 1651 | 1652 | [[package]] 1653 | name = "windows_x86_64_msvc" 1654 | version = "0.52.6" 1655 | source = "registry+https://github.com/rust-lang/crates.io-index" 1656 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 1657 | 1658 | [[package]] 1659 | name = "windows_x86_64_msvc" 1660 | version = "0.53.1" 1661 | source = "registry+https://github.com/rust-lang/crates.io-index" 1662 | checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" 1663 | 1664 | [[package]] 1665 | name = "winnow" 1666 | version = "0.7.13" 1667 | source = "registry+https://github.com/rust-lang/crates.io-index" 1668 | checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" 1669 | 1670 | [[package]] 1671 | name = "wit-bindgen-rt" 1672 | version = "0.33.0" 1673 | source = "registry+https://github.com/rust-lang/crates.io-index" 1674 | checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" 1675 | dependencies = [ 1676 | "bitflags", 1677 | ] 1678 | 1679 | [[package]] 1680 | name = "zerocopy" 1681 | version = "0.7.35" 1682 | source = "registry+https://github.com/rust-lang/crates.io-index" 1683 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 1684 | dependencies = [ 1685 | "byteorder", 1686 | "zerocopy-derive 0.7.35", 1687 | ] 1688 | 1689 | [[package]] 1690 | name = "zerocopy" 1691 | version = "0.8.14" 1692 | source = "registry+https://github.com/rust-lang/crates.io-index" 1693 | checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" 1694 | dependencies = [ 1695 | "zerocopy-derive 0.8.14", 1696 | ] 1697 | 1698 | [[package]] 1699 | name = "zerocopy-derive" 1700 | version = "0.7.35" 1701 | source = "registry+https://github.com/rust-lang/crates.io-index" 1702 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 1703 | dependencies = [ 1704 | "proc-macro2", 1705 | "quote", 1706 | "syn", 1707 | ] 1708 | 1709 | [[package]] 1710 | name = "zerocopy-derive" 1711 | version = "0.8.14" 1712 | source = "registry+https://github.com/rust-lang/crates.io-index" 1713 | checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" 1714 | dependencies = [ 1715 | "proc-macro2", 1716 | "quote", 1717 | "syn", 1718 | ] 1719 | --------------------------------------------------------------------------------
{{ props.content }}