├── .github ├── FUNDING.yml └── workflows │ ├── build_gnu_linux.yml │ ├── build_macos.yml │ ├── build_windows.yml │ ├── cd.yml │ └── ci.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Dockerfile ├── LICENSE ├── README.md ├── RELEASE_CHECKLIST.md ├── docker-compose.yml └── src ├── favicon.svg ├── index.html └── main.rs /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [freetonik] 2 | patreon: rakhim 3 | -------------------------------------------------------------------------------- /.github/workflows/build_gnu_linux.yml: -------------------------------------------------------------------------------- 1 | name: GNU/Linux 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | paths-ignore: 7 | - 'LICENSE' 8 | - 'README.md' 9 | - 'RELEASE_CHECKLIST.md' 10 | 11 | 12 | env: 13 | CARGO_TERM_COLOR: always 14 | 15 | jobs: 16 | build_and_test: 17 | name: Build and test 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - run: git config --global core.autocrlf false 22 | 23 | - name: "Checkout repository" 24 | uses: actions/checkout@v4 25 | 26 | - name: Build 27 | run: cargo build --all --locked --verbose 28 | 29 | - name: Run tests 30 | run: cargo test --verbose 31 | -------------------------------------------------------------------------------- /.github/workflows/build_macos.yml: -------------------------------------------------------------------------------- 1 | name: macOS 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | paths-ignore: 7 | - 'LICENSE' 8 | - 'README.md' 9 | - 'RELEASE_CHECKLIST.md' 10 | 11 | env: 12 | CARGO_TERM_COLOR: always 13 | 14 | jobs: 15 | build_and_test: 16 | name: Build and test 17 | runs-on: macos-latest 18 | 19 | steps: 20 | - run: git config --global core.autocrlf false 21 | 22 | - name: "Checkout repository" 23 | uses: actions/checkout@v4 24 | 25 | - name: Build 26 | run: cargo build --all --locked --verbose 27 | 28 | - name: Run tests 29 | run: cargo test --verbose 30 | -------------------------------------------------------------------------------- /.github/workflows/build_windows.yml: -------------------------------------------------------------------------------- 1 | name: Windows 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | paths-ignore: 7 | - 'LICENSE' 8 | - 'README.md' 9 | - 'RELEASE_CHECKLIST.md' 10 | 11 | env: 12 | CARGO_TERM_COLOR: always 13 | 14 | jobs: 15 | build_and_test: 16 | name: Build and test 17 | runs-on: windows-latest 18 | 19 | steps: 20 | - run: git config --global core.autocrlf false 21 | 22 | - name: "Checkout repository" 23 | uses: actions/checkout@v4 24 | 25 | - name: Build 26 | run: cargo build --all --locked --verbose 27 | 28 | - name: Run tests 29 | run: cargo test --verbose -------------------------------------------------------------------------------- /.github/workflows/cd.yml: -------------------------------------------------------------------------------- 1 | name: CD 2 | 3 | on: 4 | release: 5 | types: 6 | - created 7 | 8 | jobs: 9 | linux_windows: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout the repository 13 | uses: actions/checkout@v2 14 | 15 | - name: Install Linux and Windows Cross Compilers 16 | run: sudo apt-get install --yes --no-install-recommends musl-tools gcc-mingw-w64-x86-64-win32 17 | 18 | - name: Install rustup targets 19 | run: rustup target add x86_64-unknown-linux-musl x86_64-pc-windows-gnu 20 | 21 | - name: Build the executable 22 | run: cargo build --release --target x86_64-unknown-linux-musl --target x86_64-pc-windows-gnu 23 | 24 | - name: Tar x86_64 binary 25 | run: tar -czvf textpod-gnu-linux-x86_64.tar.gz -C target/x86_64-unknown-linux-musl/release textpod 26 | 27 | - name: Zip windows binary 28 | run: zip -j textpod-windows.zip target/x86_64-pc-windows-gnu/release/textpod.exe 29 | 30 | - name: Generate SHA256 checksums 31 | run: | 32 | shasum -a 256 textpod-gnu-linux-x86_64.tar.gz > textpod-gnu-linux-x86_64.tar.gz.sha256 33 | shasum -a 256 textpod-windows.zip > textpod-windows.zip.sha256 34 | 35 | - name: Upload release binaries 36 | uses: alexellis/upload-assets@0.4.0 37 | env: 38 | GITHUB_TOKEN: ${{ github.token }} 39 | with: 40 | asset_paths: '["textpod-gnu-linux-x86_64.tar.gz", "textpod-windows.zip", "textpod-gnu-linux-x86_64.tar.gz.sha256", "textpod-windows.zip.sha256"]' 41 | 42 | macos: 43 | runs-on: macos-latest 44 | steps: 45 | - name: Checkout the repository 46 | uses: actions/checkout@v2 47 | 48 | - name: Install rustup targets 49 | run: rustup target add x86_64-apple-darwin aarch64-apple-darwin 50 | 51 | - name: Build the executable 52 | run: cargo build --release --target=x86_64-apple-darwin --target=aarch64-apple-darwin 53 | 54 | - name: Zip x86_64 binary 55 | run: tar -czvf textpod-macos-x86_64.tar.gz -C target/x86_64-apple-darwin/release textpod 56 | 57 | - name: Zip arm64 binary 58 | run: tar -czvf textpod-macos-aarch64.tar.gz -C target/aarch64-apple-darwin/release textpod 59 | 60 | - name: Generate SHA256 checksums 61 | run: | 62 | shasum -a 256 textpod-macos-x86_64.tar.gz > textpod-macos-x86_64.tar.gz.sha256 63 | shasum -a 256 textpod-macos-aarch64.tar.gz > textpod-macos-aarch64.tar.gz.sha256 64 | 65 | - name: Upload release binaries 66 | uses: alexellis/upload-assets@0.4.0 67 | env: 68 | GITHUB_TOKEN: ${{ github.token }} 69 | with: 70 | asset_paths: '["textpod-macos-x86_64.tar.gz", "textpod-macos-aarch64.tar.gz", "textpod-macos-x86_64.tar.gz.sha256", "textpod-macos-aarch64.tar.gz.sha256"]' 71 | 72 | crates: 73 | runs-on: ubuntu-latest 74 | needs: [linux_windows, macos] 75 | steps: 76 | - uses: actions/checkout@v3 77 | - uses: actions-rs/toolchain@v1 78 | with: 79 | toolchain: stable 80 | override: true 81 | - uses: katyo/publish-crates@v2 82 | with: 83 | registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} 84 | 85 | docker: 86 | runs-on: ubuntu-latest 87 | needs: crates 88 | steps: 89 | - 90 | name: Set up QEMU 91 | uses: docker/setup-qemu-action@v3 92 | - 93 | name: Set up Docker Buildx 94 | uses: docker/setup-buildx-action@v3 95 | - 96 | name: Login to Docker Hub 97 | uses: docker/login-action@v3 98 | with: 99 | username: ${{ secrets.DOCKERHUB_USERNAME }} 100 | password: ${{ secrets.DOCKERHUB_TOKEN }} 101 | - 102 | name: Build and push 103 | uses: docker/build-push-action@v6 104 | with: 105 | platforms: linux/amd64,linux/arm64 106 | push: true 107 | tags: freetonik/textpod:latest 108 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | pull_request: 5 | branches: [ "main" ] 6 | paths-ignore: 7 | - 'LICENSE' 8 | - 'README.md' 9 | - 'RELEASE_CHECKLIST.md' 10 | 11 | env: 12 | CARGO_TERM_COLOR: always 13 | 14 | jobs: 15 | build_and_test: 16 | name: Build and test 17 | strategy: 18 | matrix: 19 | os: 20 | - ubuntu-latest 21 | - macos-latest 22 | - windows-latest 23 | runs-on: ${{ matrix.os }} 24 | steps: 25 | - run: git config --global core.autocrlf false 26 | 27 | - name: Checkout repository 28 | uses: actions/checkout@v4 29 | 30 | - name: Check code formatting 31 | run: | 32 | rustup component add rustfmt 33 | cargo fmt --all -- --check 34 | 35 | - name: Build 36 | run: cargo build --all --locked --verbose 37 | 38 | - name: Run tests 39 | run: cargo test --all --verbose 40 | 41 | 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /attachments 3 | notes.md 4 | -------------------------------------------------------------------------------- /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 = "addr2line" 7 | version = "0.24.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler2" 16 | version = "2.0.0" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" 19 | 20 | [[package]] 21 | name = "aho-corasick" 22 | version = "1.1.3" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 25 | dependencies = [ 26 | "memchr", 27 | ] 28 | 29 | [[package]] 30 | name = "android-tzdata" 31 | version = "0.1.1" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 34 | 35 | [[package]] 36 | name = "android_system_properties" 37 | version = "0.1.5" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 40 | dependencies = [ 41 | "libc", 42 | ] 43 | 44 | [[package]] 45 | name = "anstream" 46 | version = "0.6.18" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" 49 | dependencies = [ 50 | "anstyle", 51 | "anstyle-parse", 52 | "anstyle-query", 53 | "anstyle-wincon", 54 | "colorchoice", 55 | "is_terminal_polyfill", 56 | "utf8parse", 57 | ] 58 | 59 | [[package]] 60 | name = "anstyle" 61 | version = "1.0.10" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" 64 | 65 | [[package]] 66 | name = "anstyle-parse" 67 | version = "0.2.6" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" 70 | dependencies = [ 71 | "utf8parse", 72 | ] 73 | 74 | [[package]] 75 | name = "anstyle-query" 76 | version = "1.1.2" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" 79 | dependencies = [ 80 | "windows-sys 0.59.0", 81 | ] 82 | 83 | [[package]] 84 | name = "anstyle-wincon" 85 | version = "3.0.6" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" 88 | dependencies = [ 89 | "anstyle", 90 | "windows-sys 0.59.0", 91 | ] 92 | 93 | [[package]] 94 | name = "async-trait" 95 | version = "0.1.83" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" 98 | dependencies = [ 99 | "proc-macro2", 100 | "quote", 101 | "syn", 102 | ] 103 | 104 | [[package]] 105 | name = "autocfg" 106 | version = "1.4.0" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" 109 | 110 | [[package]] 111 | name = "axum" 112 | version = "0.7.7" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" 115 | dependencies = [ 116 | "async-trait", 117 | "axum-core", 118 | "bytes", 119 | "futures-util", 120 | "http", 121 | "http-body", 122 | "http-body-util", 123 | "hyper", 124 | "hyper-util", 125 | "itoa", 126 | "matchit", 127 | "memchr", 128 | "mime", 129 | "multer", 130 | "percent-encoding", 131 | "pin-project-lite", 132 | "rustversion", 133 | "serde", 134 | "serde_json", 135 | "serde_path_to_error", 136 | "serde_urlencoded", 137 | "sync_wrapper 1.0.1", 138 | "tokio", 139 | "tower", 140 | "tower-layer", 141 | "tower-service", 142 | "tracing", 143 | ] 144 | 145 | [[package]] 146 | name = "axum-core" 147 | version = "0.4.5" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" 150 | dependencies = [ 151 | "async-trait", 152 | "bytes", 153 | "futures-util", 154 | "http", 155 | "http-body", 156 | "http-body-util", 157 | "mime", 158 | "pin-project-lite", 159 | "rustversion", 160 | "sync_wrapper 1.0.1", 161 | "tower-layer", 162 | "tower-service", 163 | "tracing", 164 | ] 165 | 166 | [[package]] 167 | name = "backtrace" 168 | version = "0.3.74" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" 171 | dependencies = [ 172 | "addr2line", 173 | "cfg-if", 174 | "libc", 175 | "miniz_oxide", 176 | "object", 177 | "rustc-demangle", 178 | "windows-targets", 179 | ] 180 | 181 | [[package]] 182 | name = "base64" 183 | version = "0.22.1" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 186 | 187 | [[package]] 188 | name = "bincode" 189 | version = "1.3.3" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" 192 | dependencies = [ 193 | "serde", 194 | ] 195 | 196 | [[package]] 197 | name = "bit-set" 198 | version = "0.5.3" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" 201 | dependencies = [ 202 | "bit-vec", 203 | ] 204 | 205 | [[package]] 206 | name = "bit-vec" 207 | version = "0.6.3" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" 210 | 211 | [[package]] 212 | name = "bitflags" 213 | version = "1.3.2" 214 | source = "registry+https://github.com/rust-lang/crates.io-index" 215 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 216 | 217 | [[package]] 218 | name = "bitflags" 219 | version = "2.6.0" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" 222 | 223 | [[package]] 224 | name = "bumpalo" 225 | version = "3.16.0" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 228 | 229 | [[package]] 230 | name = "bytes" 231 | version = "1.8.0" 232 | source = "registry+https://github.com/rust-lang/crates.io-index" 233 | checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" 234 | 235 | [[package]] 236 | name = "caseless" 237 | version = "0.2.1" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | checksum = "808dab3318747be122cb31d36de18d4d1c81277a76f8332a02b81a3d73463d7f" 240 | dependencies = [ 241 | "regex", 242 | "unicode-normalization", 243 | ] 244 | 245 | [[package]] 246 | name = "cc" 247 | version = "1.2.1" 248 | source = "registry+https://github.com/rust-lang/crates.io-index" 249 | checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" 250 | dependencies = [ 251 | "shlex", 252 | ] 253 | 254 | [[package]] 255 | name = "cfg-if" 256 | version = "1.0.0" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 259 | 260 | [[package]] 261 | name = "chrono" 262 | version = "0.4.38" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" 265 | dependencies = [ 266 | "android-tzdata", 267 | "iana-time-zone", 268 | "js-sys", 269 | "num-traits", 270 | "wasm-bindgen", 271 | "windows-targets", 272 | ] 273 | 274 | [[package]] 275 | name = "clap" 276 | version = "4.5.21" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" 279 | dependencies = [ 280 | "clap_builder", 281 | "clap_derive", 282 | ] 283 | 284 | [[package]] 285 | name = "clap_builder" 286 | version = "4.5.21" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" 289 | dependencies = [ 290 | "anstream", 291 | "anstyle", 292 | "clap_lex", 293 | "strsim", 294 | "terminal_size", 295 | ] 296 | 297 | [[package]] 298 | name = "clap_derive" 299 | version = "4.5.18" 300 | source = "registry+https://github.com/rust-lang/crates.io-index" 301 | checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" 302 | dependencies = [ 303 | "heck", 304 | "proc-macro2", 305 | "quote", 306 | "syn", 307 | ] 308 | 309 | [[package]] 310 | name = "clap_lex" 311 | version = "0.7.3" 312 | source = "registry+https://github.com/rust-lang/crates.io-index" 313 | checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" 314 | 315 | [[package]] 316 | name = "colorchoice" 317 | version = "1.0.3" 318 | source = "registry+https://github.com/rust-lang/crates.io-index" 319 | checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" 320 | 321 | [[package]] 322 | name = "comrak" 323 | version = "0.29.0" 324 | source = "registry+https://github.com/rust-lang/crates.io-index" 325 | checksum = "d8c32ff8b21372fab0e9ecc4e42536055702dc5faa418362bffd1544f9d12637" 326 | dependencies = [ 327 | "caseless", 328 | "clap", 329 | "derive_builder", 330 | "entities", 331 | "memchr", 332 | "once_cell", 333 | "regex", 334 | "shell-words", 335 | "slug", 336 | "syntect", 337 | "typed-arena", 338 | "unicode_categories", 339 | "xdg", 340 | ] 341 | 342 | [[package]] 343 | name = "core-foundation-sys" 344 | version = "0.8.7" 345 | source = "registry+https://github.com/rust-lang/crates.io-index" 346 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 347 | 348 | [[package]] 349 | name = "crc32fast" 350 | version = "1.4.2" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" 353 | dependencies = [ 354 | "cfg-if", 355 | ] 356 | 357 | [[package]] 358 | name = "darling" 359 | version = "0.20.10" 360 | source = "registry+https://github.com/rust-lang/crates.io-index" 361 | checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" 362 | dependencies = [ 363 | "darling_core", 364 | "darling_macro", 365 | ] 366 | 367 | [[package]] 368 | name = "darling_core" 369 | version = "0.20.10" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" 372 | dependencies = [ 373 | "fnv", 374 | "ident_case", 375 | "proc-macro2", 376 | "quote", 377 | "strsim", 378 | "syn", 379 | ] 380 | 381 | [[package]] 382 | name = "darling_macro" 383 | version = "0.20.10" 384 | source = "registry+https://github.com/rust-lang/crates.io-index" 385 | checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" 386 | dependencies = [ 387 | "darling_core", 388 | "quote", 389 | "syn", 390 | ] 391 | 392 | [[package]] 393 | name = "deranged" 394 | version = "0.3.11" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" 397 | dependencies = [ 398 | "powerfmt", 399 | ] 400 | 401 | [[package]] 402 | name = "derive_builder" 403 | version = "0.20.2" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" 406 | dependencies = [ 407 | "derive_builder_macro", 408 | ] 409 | 410 | [[package]] 411 | name = "derive_builder_core" 412 | version = "0.20.2" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" 415 | dependencies = [ 416 | "darling", 417 | "proc-macro2", 418 | "quote", 419 | "syn", 420 | ] 421 | 422 | [[package]] 423 | name = "derive_builder_macro" 424 | version = "0.20.2" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" 427 | dependencies = [ 428 | "derive_builder_core", 429 | "syn", 430 | ] 431 | 432 | [[package]] 433 | name = "deunicode" 434 | version = "1.6.0" 435 | source = "registry+https://github.com/rust-lang/crates.io-index" 436 | checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" 437 | 438 | [[package]] 439 | name = "encoding_rs" 440 | version = "0.8.35" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" 443 | dependencies = [ 444 | "cfg-if", 445 | ] 446 | 447 | [[package]] 448 | name = "entities" 449 | version = "1.0.1" 450 | source = "registry+https://github.com/rust-lang/crates.io-index" 451 | checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" 452 | 453 | [[package]] 454 | name = "equivalent" 455 | version = "1.0.1" 456 | source = "registry+https://github.com/rust-lang/crates.io-index" 457 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 458 | 459 | [[package]] 460 | name = "errno" 461 | version = "0.3.9" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" 464 | dependencies = [ 465 | "libc", 466 | "windows-sys 0.52.0", 467 | ] 468 | 469 | [[package]] 470 | name = "fancy-regex" 471 | version = "0.11.0" 472 | source = "registry+https://github.com/rust-lang/crates.io-index" 473 | checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" 474 | dependencies = [ 475 | "bit-set", 476 | "regex", 477 | ] 478 | 479 | [[package]] 480 | name = "flate2" 481 | version = "1.0.35" 482 | source = "registry+https://github.com/rust-lang/crates.io-index" 483 | checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" 484 | dependencies = [ 485 | "crc32fast", 486 | "miniz_oxide", 487 | ] 488 | 489 | [[package]] 490 | name = "fnv" 491 | version = "1.0.7" 492 | source = "registry+https://github.com/rust-lang/crates.io-index" 493 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 494 | 495 | [[package]] 496 | name = "form_urlencoded" 497 | version = "1.2.1" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 500 | dependencies = [ 501 | "percent-encoding", 502 | ] 503 | 504 | [[package]] 505 | name = "futures-channel" 506 | version = "0.3.31" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" 509 | dependencies = [ 510 | "futures-core", 511 | ] 512 | 513 | [[package]] 514 | name = "futures-core" 515 | version = "0.3.31" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 518 | 519 | [[package]] 520 | name = "futures-sink" 521 | version = "0.3.31" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 524 | 525 | [[package]] 526 | name = "futures-task" 527 | version = "0.3.31" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 530 | 531 | [[package]] 532 | name = "futures-util" 533 | version = "0.3.31" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 536 | dependencies = [ 537 | "futures-core", 538 | "futures-task", 539 | "pin-project-lite", 540 | "pin-utils", 541 | ] 542 | 543 | [[package]] 544 | name = "gimli" 545 | version = "0.31.1" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" 548 | 549 | [[package]] 550 | name = "hashbrown" 551 | version = "0.15.1" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" 554 | 555 | [[package]] 556 | name = "heck" 557 | version = "0.5.0" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 560 | 561 | [[package]] 562 | name = "hermit-abi" 563 | version = "0.3.9" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 566 | 567 | [[package]] 568 | name = "http" 569 | version = "1.1.0" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" 572 | dependencies = [ 573 | "bytes", 574 | "fnv", 575 | "itoa", 576 | ] 577 | 578 | [[package]] 579 | name = "http-body" 580 | version = "1.0.1" 581 | source = "registry+https://github.com/rust-lang/crates.io-index" 582 | checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" 583 | dependencies = [ 584 | "bytes", 585 | "http", 586 | ] 587 | 588 | [[package]] 589 | name = "http-body-util" 590 | version = "0.1.2" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" 593 | dependencies = [ 594 | "bytes", 595 | "futures-util", 596 | "http", 597 | "http-body", 598 | "pin-project-lite", 599 | ] 600 | 601 | [[package]] 602 | name = "http-range-header" 603 | version = "0.4.1" 604 | source = "registry+https://github.com/rust-lang/crates.io-index" 605 | checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" 606 | 607 | [[package]] 608 | name = "httparse" 609 | version = "1.9.5" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" 612 | 613 | [[package]] 614 | name = "httpdate" 615 | version = "1.0.3" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 618 | 619 | [[package]] 620 | name = "hyper" 621 | version = "1.5.0" 622 | source = "registry+https://github.com/rust-lang/crates.io-index" 623 | checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" 624 | dependencies = [ 625 | "bytes", 626 | "futures-channel", 627 | "futures-util", 628 | "http", 629 | "http-body", 630 | "httparse", 631 | "httpdate", 632 | "itoa", 633 | "pin-project-lite", 634 | "smallvec", 635 | "tokio", 636 | ] 637 | 638 | [[package]] 639 | name = "hyper-util" 640 | version = "0.1.10" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" 643 | dependencies = [ 644 | "bytes", 645 | "futures-util", 646 | "http", 647 | "http-body", 648 | "hyper", 649 | "pin-project-lite", 650 | "tokio", 651 | "tower-service", 652 | ] 653 | 654 | [[package]] 655 | name = "iana-time-zone" 656 | version = "0.1.61" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" 659 | dependencies = [ 660 | "android_system_properties", 661 | "core-foundation-sys", 662 | "iana-time-zone-haiku", 663 | "js-sys", 664 | "wasm-bindgen", 665 | "windows-core", 666 | ] 667 | 668 | [[package]] 669 | name = "iana-time-zone-haiku" 670 | version = "0.1.2" 671 | source = "registry+https://github.com/rust-lang/crates.io-index" 672 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 673 | dependencies = [ 674 | "cc", 675 | ] 676 | 677 | [[package]] 678 | name = "ident_case" 679 | version = "1.0.1" 680 | source = "registry+https://github.com/rust-lang/crates.io-index" 681 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 682 | 683 | [[package]] 684 | name = "indexmap" 685 | version = "2.6.0" 686 | source = "registry+https://github.com/rust-lang/crates.io-index" 687 | checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" 688 | dependencies = [ 689 | "equivalent", 690 | "hashbrown", 691 | ] 692 | 693 | [[package]] 694 | name = "is_terminal_polyfill" 695 | version = "1.70.1" 696 | source = "registry+https://github.com/rust-lang/crates.io-index" 697 | checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" 698 | 699 | [[package]] 700 | name = "itoa" 701 | version = "1.0.11" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 704 | 705 | [[package]] 706 | name = "js-sys" 707 | version = "0.3.72" 708 | source = "registry+https://github.com/rust-lang/crates.io-index" 709 | checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" 710 | dependencies = [ 711 | "wasm-bindgen", 712 | ] 713 | 714 | [[package]] 715 | name = "lazy_static" 716 | version = "1.5.0" 717 | source = "registry+https://github.com/rust-lang/crates.io-index" 718 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 719 | 720 | [[package]] 721 | name = "libc" 722 | version = "0.2.162" 723 | source = "registry+https://github.com/rust-lang/crates.io-index" 724 | checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" 725 | 726 | [[package]] 727 | name = "linked-hash-map" 728 | version = "0.5.6" 729 | source = "registry+https://github.com/rust-lang/crates.io-index" 730 | checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" 731 | 732 | [[package]] 733 | name = "linux-raw-sys" 734 | version = "0.4.14" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" 737 | 738 | [[package]] 739 | name = "lock_api" 740 | version = "0.4.12" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 743 | dependencies = [ 744 | "autocfg", 745 | "scopeguard", 746 | ] 747 | 748 | [[package]] 749 | name = "log" 750 | version = "0.4.22" 751 | source = "registry+https://github.com/rust-lang/crates.io-index" 752 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 753 | 754 | [[package]] 755 | name = "matchit" 756 | version = "0.7.3" 757 | source = "registry+https://github.com/rust-lang/crates.io-index" 758 | checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" 759 | 760 | [[package]] 761 | name = "memchr" 762 | version = "2.7.4" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 765 | 766 | [[package]] 767 | name = "mime" 768 | version = "0.3.17" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 771 | 772 | [[package]] 773 | name = "mime_guess" 774 | version = "2.0.5" 775 | source = "registry+https://github.com/rust-lang/crates.io-index" 776 | checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" 777 | dependencies = [ 778 | "mime", 779 | "unicase", 780 | ] 781 | 782 | [[package]] 783 | name = "miniz_oxide" 784 | version = "0.8.0" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" 787 | dependencies = [ 788 | "adler2", 789 | ] 790 | 791 | [[package]] 792 | name = "mio" 793 | version = "1.0.2" 794 | source = "registry+https://github.com/rust-lang/crates.io-index" 795 | checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" 796 | dependencies = [ 797 | "hermit-abi", 798 | "libc", 799 | "wasi", 800 | "windows-sys 0.52.0", 801 | ] 802 | 803 | [[package]] 804 | name = "multer" 805 | version = "3.1.0" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" 808 | dependencies = [ 809 | "bytes", 810 | "encoding_rs", 811 | "futures-util", 812 | "http", 813 | "httparse", 814 | "memchr", 815 | "mime", 816 | "spin", 817 | "version_check", 818 | ] 819 | 820 | [[package]] 821 | name = "nu-ansi-term" 822 | version = "0.46.0" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 825 | dependencies = [ 826 | "overload", 827 | "winapi", 828 | ] 829 | 830 | [[package]] 831 | name = "num-conv" 832 | version = "0.1.0" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" 835 | 836 | [[package]] 837 | name = "num-traits" 838 | version = "0.2.19" 839 | source = "registry+https://github.com/rust-lang/crates.io-index" 840 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 841 | dependencies = [ 842 | "autocfg", 843 | ] 844 | 845 | [[package]] 846 | name = "object" 847 | version = "0.36.5" 848 | source = "registry+https://github.com/rust-lang/crates.io-index" 849 | checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" 850 | dependencies = [ 851 | "memchr", 852 | ] 853 | 854 | [[package]] 855 | name = "once_cell" 856 | version = "1.20.2" 857 | source = "registry+https://github.com/rust-lang/crates.io-index" 858 | checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" 859 | 860 | [[package]] 861 | name = "onig" 862 | version = "6.4.0" 863 | source = "registry+https://github.com/rust-lang/crates.io-index" 864 | checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" 865 | dependencies = [ 866 | "bitflags 1.3.2", 867 | "libc", 868 | "once_cell", 869 | "onig_sys", 870 | ] 871 | 872 | [[package]] 873 | name = "onig_sys" 874 | version = "69.8.1" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" 877 | dependencies = [ 878 | "cc", 879 | "pkg-config", 880 | ] 881 | 882 | [[package]] 883 | name = "overload" 884 | version = "0.1.1" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 887 | 888 | [[package]] 889 | name = "parking_lot" 890 | version = "0.12.3" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" 893 | dependencies = [ 894 | "lock_api", 895 | "parking_lot_core", 896 | ] 897 | 898 | [[package]] 899 | name = "parking_lot_core" 900 | version = "0.9.10" 901 | source = "registry+https://github.com/rust-lang/crates.io-index" 902 | checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" 903 | dependencies = [ 904 | "cfg-if", 905 | "libc", 906 | "redox_syscall", 907 | "smallvec", 908 | "windows-targets", 909 | ] 910 | 911 | [[package]] 912 | name = "percent-encoding" 913 | version = "2.3.1" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 916 | 917 | [[package]] 918 | name = "pin-project-lite" 919 | version = "0.2.15" 920 | source = "registry+https://github.com/rust-lang/crates.io-index" 921 | checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" 922 | 923 | [[package]] 924 | name = "pin-utils" 925 | version = "0.1.0" 926 | source = "registry+https://github.com/rust-lang/crates.io-index" 927 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 928 | 929 | [[package]] 930 | name = "pkg-config" 931 | version = "0.3.31" 932 | source = "registry+https://github.com/rust-lang/crates.io-index" 933 | checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" 934 | 935 | [[package]] 936 | name = "plist" 937 | version = "1.7.0" 938 | source = "registry+https://github.com/rust-lang/crates.io-index" 939 | checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" 940 | dependencies = [ 941 | "base64", 942 | "indexmap", 943 | "quick-xml", 944 | "serde", 945 | "time", 946 | ] 947 | 948 | [[package]] 949 | name = "powerfmt" 950 | version = "0.2.0" 951 | source = "registry+https://github.com/rust-lang/crates.io-index" 952 | checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 953 | 954 | [[package]] 955 | name = "proc-macro2" 956 | version = "1.0.89" 957 | source = "registry+https://github.com/rust-lang/crates.io-index" 958 | checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" 959 | dependencies = [ 960 | "unicode-ident", 961 | ] 962 | 963 | [[package]] 964 | name = "quick-xml" 965 | version = "0.32.0" 966 | source = "registry+https://github.com/rust-lang/crates.io-index" 967 | checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" 968 | dependencies = [ 969 | "memchr", 970 | ] 971 | 972 | [[package]] 973 | name = "quote" 974 | version = "1.0.37" 975 | source = "registry+https://github.com/rust-lang/crates.io-index" 976 | checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" 977 | dependencies = [ 978 | "proc-macro2", 979 | ] 980 | 981 | [[package]] 982 | name = "redox_syscall" 983 | version = "0.5.7" 984 | source = "registry+https://github.com/rust-lang/crates.io-index" 985 | checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" 986 | dependencies = [ 987 | "bitflags 2.6.0", 988 | ] 989 | 990 | [[package]] 991 | name = "regex" 992 | version = "1.11.1" 993 | source = "registry+https://github.com/rust-lang/crates.io-index" 994 | checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" 995 | dependencies = [ 996 | "aho-corasick", 997 | "memchr", 998 | "regex-automata", 999 | "regex-syntax", 1000 | ] 1001 | 1002 | [[package]] 1003 | name = "regex-automata" 1004 | version = "0.4.9" 1005 | source = "registry+https://github.com/rust-lang/crates.io-index" 1006 | checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" 1007 | dependencies = [ 1008 | "aho-corasick", 1009 | "memchr", 1010 | "regex-syntax", 1011 | ] 1012 | 1013 | [[package]] 1014 | name = "regex-syntax" 1015 | version = "0.8.5" 1016 | source = "registry+https://github.com/rust-lang/crates.io-index" 1017 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 1018 | 1019 | [[package]] 1020 | name = "rustc-demangle" 1021 | version = "0.1.24" 1022 | source = "registry+https://github.com/rust-lang/crates.io-index" 1023 | checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 1024 | 1025 | [[package]] 1026 | name = "rustix" 1027 | version = "0.38.40" 1028 | source = "registry+https://github.com/rust-lang/crates.io-index" 1029 | checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" 1030 | dependencies = [ 1031 | "bitflags 2.6.0", 1032 | "errno", 1033 | "libc", 1034 | "linux-raw-sys", 1035 | "windows-sys 0.52.0", 1036 | ] 1037 | 1038 | [[package]] 1039 | name = "rustversion" 1040 | version = "1.0.18" 1041 | source = "registry+https://github.com/rust-lang/crates.io-index" 1042 | checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" 1043 | 1044 | [[package]] 1045 | name = "ryu" 1046 | version = "1.0.18" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 1049 | 1050 | [[package]] 1051 | name = "same-file" 1052 | version = "1.0.6" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1055 | dependencies = [ 1056 | "winapi-util", 1057 | ] 1058 | 1059 | [[package]] 1060 | name = "scopeguard" 1061 | version = "1.2.0" 1062 | source = "registry+https://github.com/rust-lang/crates.io-index" 1063 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1064 | 1065 | [[package]] 1066 | name = "serde" 1067 | version = "1.0.215" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" 1070 | dependencies = [ 1071 | "serde_derive", 1072 | ] 1073 | 1074 | [[package]] 1075 | name = "serde_derive" 1076 | version = "1.0.215" 1077 | source = "registry+https://github.com/rust-lang/crates.io-index" 1078 | checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" 1079 | dependencies = [ 1080 | "proc-macro2", 1081 | "quote", 1082 | "syn", 1083 | ] 1084 | 1085 | [[package]] 1086 | name = "serde_json" 1087 | version = "1.0.132" 1088 | source = "registry+https://github.com/rust-lang/crates.io-index" 1089 | checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" 1090 | dependencies = [ 1091 | "itoa", 1092 | "memchr", 1093 | "ryu", 1094 | "serde", 1095 | ] 1096 | 1097 | [[package]] 1098 | name = "serde_path_to_error" 1099 | version = "0.1.16" 1100 | source = "registry+https://github.com/rust-lang/crates.io-index" 1101 | checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" 1102 | dependencies = [ 1103 | "itoa", 1104 | "serde", 1105 | ] 1106 | 1107 | [[package]] 1108 | name = "serde_urlencoded" 1109 | version = "0.7.1" 1110 | source = "registry+https://github.com/rust-lang/crates.io-index" 1111 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1112 | dependencies = [ 1113 | "form_urlencoded", 1114 | "itoa", 1115 | "ryu", 1116 | "serde", 1117 | ] 1118 | 1119 | [[package]] 1120 | name = "sharded-slab" 1121 | version = "0.1.7" 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" 1123 | checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" 1124 | dependencies = [ 1125 | "lazy_static", 1126 | ] 1127 | 1128 | [[package]] 1129 | name = "shell-words" 1130 | version = "1.1.0" 1131 | source = "registry+https://github.com/rust-lang/crates.io-index" 1132 | checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" 1133 | 1134 | [[package]] 1135 | name = "shlex" 1136 | version = "1.3.0" 1137 | source = "registry+https://github.com/rust-lang/crates.io-index" 1138 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1139 | 1140 | [[package]] 1141 | name = "signal-hook-registry" 1142 | version = "1.4.2" 1143 | source = "registry+https://github.com/rust-lang/crates.io-index" 1144 | checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" 1145 | dependencies = [ 1146 | "libc", 1147 | ] 1148 | 1149 | [[package]] 1150 | name = "slug" 1151 | version = "0.1.6" 1152 | source = "registry+https://github.com/rust-lang/crates.io-index" 1153 | checksum = "882a80f72ee45de3cc9a5afeb2da0331d58df69e4e7d8eeb5d3c7784ae67e724" 1154 | dependencies = [ 1155 | "deunicode", 1156 | "wasm-bindgen", 1157 | ] 1158 | 1159 | [[package]] 1160 | name = "smallvec" 1161 | version = "1.13.2" 1162 | source = "registry+https://github.com/rust-lang/crates.io-index" 1163 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1164 | 1165 | [[package]] 1166 | name = "socket2" 1167 | version = "0.5.7" 1168 | source = "registry+https://github.com/rust-lang/crates.io-index" 1169 | checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" 1170 | dependencies = [ 1171 | "libc", 1172 | "windows-sys 0.52.0", 1173 | ] 1174 | 1175 | [[package]] 1176 | name = "spin" 1177 | version = "0.9.8" 1178 | source = "registry+https://github.com/rust-lang/crates.io-index" 1179 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 1180 | 1181 | [[package]] 1182 | name = "strsim" 1183 | version = "0.11.1" 1184 | source = "registry+https://github.com/rust-lang/crates.io-index" 1185 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 1186 | 1187 | [[package]] 1188 | name = "syn" 1189 | version = "2.0.87" 1190 | source = "registry+https://github.com/rust-lang/crates.io-index" 1191 | checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" 1192 | dependencies = [ 1193 | "proc-macro2", 1194 | "quote", 1195 | "unicode-ident", 1196 | ] 1197 | 1198 | [[package]] 1199 | name = "sync_wrapper" 1200 | version = "0.1.2" 1201 | source = "registry+https://github.com/rust-lang/crates.io-index" 1202 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 1203 | 1204 | [[package]] 1205 | name = "sync_wrapper" 1206 | version = "1.0.1" 1207 | source = "registry+https://github.com/rust-lang/crates.io-index" 1208 | checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" 1209 | 1210 | [[package]] 1211 | name = "syntect" 1212 | version = "5.2.0" 1213 | source = "registry+https://github.com/rust-lang/crates.io-index" 1214 | checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" 1215 | dependencies = [ 1216 | "bincode", 1217 | "bitflags 1.3.2", 1218 | "fancy-regex", 1219 | "flate2", 1220 | "fnv", 1221 | "once_cell", 1222 | "onig", 1223 | "plist", 1224 | "regex-syntax", 1225 | "serde", 1226 | "serde_derive", 1227 | "serde_json", 1228 | "thiserror", 1229 | "walkdir", 1230 | "yaml-rust", 1231 | ] 1232 | 1233 | [[package]] 1234 | name = "terminal_size" 1235 | version = "0.4.0" 1236 | source = "registry+https://github.com/rust-lang/crates.io-index" 1237 | checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" 1238 | dependencies = [ 1239 | "rustix", 1240 | "windows-sys 0.59.0", 1241 | ] 1242 | 1243 | [[package]] 1244 | name = "textpod" 1245 | version = "0.1.5" 1246 | dependencies = [ 1247 | "axum", 1248 | "base64", 1249 | "chrono", 1250 | "clap", 1251 | "comrak", 1252 | "serde", 1253 | "tokio", 1254 | "tower-http", 1255 | "tracing", 1256 | "tracing-subscriber", 1257 | ] 1258 | 1259 | [[package]] 1260 | name = "thiserror" 1261 | version = "1.0.69" 1262 | source = "registry+https://github.com/rust-lang/crates.io-index" 1263 | checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" 1264 | dependencies = [ 1265 | "thiserror-impl", 1266 | ] 1267 | 1268 | [[package]] 1269 | name = "thiserror-impl" 1270 | version = "1.0.69" 1271 | source = "registry+https://github.com/rust-lang/crates.io-index" 1272 | checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" 1273 | dependencies = [ 1274 | "proc-macro2", 1275 | "quote", 1276 | "syn", 1277 | ] 1278 | 1279 | [[package]] 1280 | name = "thread_local" 1281 | version = "1.1.8" 1282 | source = "registry+https://github.com/rust-lang/crates.io-index" 1283 | checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" 1284 | dependencies = [ 1285 | "cfg-if", 1286 | "once_cell", 1287 | ] 1288 | 1289 | [[package]] 1290 | name = "time" 1291 | version = "0.3.36" 1292 | source = "registry+https://github.com/rust-lang/crates.io-index" 1293 | checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" 1294 | dependencies = [ 1295 | "deranged", 1296 | "itoa", 1297 | "num-conv", 1298 | "powerfmt", 1299 | "serde", 1300 | "time-core", 1301 | "time-macros", 1302 | ] 1303 | 1304 | [[package]] 1305 | name = "time-core" 1306 | version = "0.1.2" 1307 | source = "registry+https://github.com/rust-lang/crates.io-index" 1308 | checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" 1309 | 1310 | [[package]] 1311 | name = "time-macros" 1312 | version = "0.2.18" 1313 | source = "registry+https://github.com/rust-lang/crates.io-index" 1314 | checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" 1315 | dependencies = [ 1316 | "num-conv", 1317 | "time-core", 1318 | ] 1319 | 1320 | [[package]] 1321 | name = "tinyvec" 1322 | version = "1.8.0" 1323 | source = "registry+https://github.com/rust-lang/crates.io-index" 1324 | checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" 1325 | dependencies = [ 1326 | "tinyvec_macros", 1327 | ] 1328 | 1329 | [[package]] 1330 | name = "tinyvec_macros" 1331 | version = "0.1.1" 1332 | source = "registry+https://github.com/rust-lang/crates.io-index" 1333 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1334 | 1335 | [[package]] 1336 | name = "tokio" 1337 | version = "1.41.1" 1338 | source = "registry+https://github.com/rust-lang/crates.io-index" 1339 | checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" 1340 | dependencies = [ 1341 | "backtrace", 1342 | "bytes", 1343 | "libc", 1344 | "mio", 1345 | "parking_lot", 1346 | "pin-project-lite", 1347 | "signal-hook-registry", 1348 | "socket2", 1349 | "tokio-macros", 1350 | "windows-sys 0.52.0", 1351 | ] 1352 | 1353 | [[package]] 1354 | name = "tokio-macros" 1355 | version = "2.4.0" 1356 | source = "registry+https://github.com/rust-lang/crates.io-index" 1357 | checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" 1358 | dependencies = [ 1359 | "proc-macro2", 1360 | "quote", 1361 | "syn", 1362 | ] 1363 | 1364 | [[package]] 1365 | name = "tokio-util" 1366 | version = "0.7.12" 1367 | source = "registry+https://github.com/rust-lang/crates.io-index" 1368 | checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" 1369 | dependencies = [ 1370 | "bytes", 1371 | "futures-core", 1372 | "futures-sink", 1373 | "pin-project-lite", 1374 | "tokio", 1375 | ] 1376 | 1377 | [[package]] 1378 | name = "tower" 1379 | version = "0.5.1" 1380 | source = "registry+https://github.com/rust-lang/crates.io-index" 1381 | checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" 1382 | dependencies = [ 1383 | "futures-core", 1384 | "futures-util", 1385 | "pin-project-lite", 1386 | "sync_wrapper 0.1.2", 1387 | "tokio", 1388 | "tower-layer", 1389 | "tower-service", 1390 | "tracing", 1391 | ] 1392 | 1393 | [[package]] 1394 | name = "tower-http" 1395 | version = "0.6.1" 1396 | source = "registry+https://github.com/rust-lang/crates.io-index" 1397 | checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" 1398 | dependencies = [ 1399 | "bitflags 2.6.0", 1400 | "bytes", 1401 | "futures-util", 1402 | "http", 1403 | "http-body", 1404 | "http-body-util", 1405 | "http-range-header", 1406 | "httpdate", 1407 | "mime", 1408 | "mime_guess", 1409 | "percent-encoding", 1410 | "pin-project-lite", 1411 | "tokio", 1412 | "tokio-util", 1413 | "tower-layer", 1414 | "tower-service", 1415 | "tracing", 1416 | ] 1417 | 1418 | [[package]] 1419 | name = "tower-layer" 1420 | version = "0.3.3" 1421 | source = "registry+https://github.com/rust-lang/crates.io-index" 1422 | checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" 1423 | 1424 | [[package]] 1425 | name = "tower-service" 1426 | version = "0.3.3" 1427 | source = "registry+https://github.com/rust-lang/crates.io-index" 1428 | checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 1429 | 1430 | [[package]] 1431 | name = "tracing" 1432 | version = "0.1.40" 1433 | source = "registry+https://github.com/rust-lang/crates.io-index" 1434 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1435 | dependencies = [ 1436 | "log", 1437 | "pin-project-lite", 1438 | "tracing-attributes", 1439 | "tracing-core", 1440 | ] 1441 | 1442 | [[package]] 1443 | name = "tracing-attributes" 1444 | version = "0.1.27" 1445 | source = "registry+https://github.com/rust-lang/crates.io-index" 1446 | checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 1447 | dependencies = [ 1448 | "proc-macro2", 1449 | "quote", 1450 | "syn", 1451 | ] 1452 | 1453 | [[package]] 1454 | name = "tracing-core" 1455 | version = "0.1.32" 1456 | source = "registry+https://github.com/rust-lang/crates.io-index" 1457 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1458 | dependencies = [ 1459 | "once_cell", 1460 | "valuable", 1461 | ] 1462 | 1463 | [[package]] 1464 | name = "tracing-log" 1465 | version = "0.2.0" 1466 | source = "registry+https://github.com/rust-lang/crates.io-index" 1467 | checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" 1468 | dependencies = [ 1469 | "log", 1470 | "once_cell", 1471 | "tracing-core", 1472 | ] 1473 | 1474 | [[package]] 1475 | name = "tracing-subscriber" 1476 | version = "0.3.18" 1477 | source = "registry+https://github.com/rust-lang/crates.io-index" 1478 | checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" 1479 | dependencies = [ 1480 | "nu-ansi-term", 1481 | "sharded-slab", 1482 | "smallvec", 1483 | "thread_local", 1484 | "tracing-core", 1485 | "tracing-log", 1486 | ] 1487 | 1488 | [[package]] 1489 | name = "typed-arena" 1490 | version = "2.0.2" 1491 | source = "registry+https://github.com/rust-lang/crates.io-index" 1492 | checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" 1493 | 1494 | [[package]] 1495 | name = "unicase" 1496 | version = "2.8.0" 1497 | source = "registry+https://github.com/rust-lang/crates.io-index" 1498 | checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" 1499 | 1500 | [[package]] 1501 | name = "unicode-ident" 1502 | version = "1.0.13" 1503 | source = "registry+https://github.com/rust-lang/crates.io-index" 1504 | checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" 1505 | 1506 | [[package]] 1507 | name = "unicode-normalization" 1508 | version = "0.1.24" 1509 | source = "registry+https://github.com/rust-lang/crates.io-index" 1510 | checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" 1511 | dependencies = [ 1512 | "tinyvec", 1513 | ] 1514 | 1515 | [[package]] 1516 | name = "unicode_categories" 1517 | version = "0.1.1" 1518 | source = "registry+https://github.com/rust-lang/crates.io-index" 1519 | checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" 1520 | 1521 | [[package]] 1522 | name = "utf8parse" 1523 | version = "0.2.2" 1524 | source = "registry+https://github.com/rust-lang/crates.io-index" 1525 | checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 1526 | 1527 | [[package]] 1528 | name = "valuable" 1529 | version = "0.1.0" 1530 | source = "registry+https://github.com/rust-lang/crates.io-index" 1531 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 1532 | 1533 | [[package]] 1534 | name = "version_check" 1535 | version = "0.9.5" 1536 | source = "registry+https://github.com/rust-lang/crates.io-index" 1537 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 1538 | 1539 | [[package]] 1540 | name = "walkdir" 1541 | version = "2.5.0" 1542 | source = "registry+https://github.com/rust-lang/crates.io-index" 1543 | checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" 1544 | dependencies = [ 1545 | "same-file", 1546 | "winapi-util", 1547 | ] 1548 | 1549 | [[package]] 1550 | name = "wasi" 1551 | version = "0.11.0+wasi-snapshot-preview1" 1552 | source = "registry+https://github.com/rust-lang/crates.io-index" 1553 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1554 | 1555 | [[package]] 1556 | name = "wasm-bindgen" 1557 | version = "0.2.95" 1558 | source = "registry+https://github.com/rust-lang/crates.io-index" 1559 | checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" 1560 | dependencies = [ 1561 | "cfg-if", 1562 | "once_cell", 1563 | "wasm-bindgen-macro", 1564 | ] 1565 | 1566 | [[package]] 1567 | name = "wasm-bindgen-backend" 1568 | version = "0.2.95" 1569 | source = "registry+https://github.com/rust-lang/crates.io-index" 1570 | checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" 1571 | dependencies = [ 1572 | "bumpalo", 1573 | "log", 1574 | "once_cell", 1575 | "proc-macro2", 1576 | "quote", 1577 | "syn", 1578 | "wasm-bindgen-shared", 1579 | ] 1580 | 1581 | [[package]] 1582 | name = "wasm-bindgen-macro" 1583 | version = "0.2.95" 1584 | source = "registry+https://github.com/rust-lang/crates.io-index" 1585 | checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" 1586 | dependencies = [ 1587 | "quote", 1588 | "wasm-bindgen-macro-support", 1589 | ] 1590 | 1591 | [[package]] 1592 | name = "wasm-bindgen-macro-support" 1593 | version = "0.2.95" 1594 | source = "registry+https://github.com/rust-lang/crates.io-index" 1595 | checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" 1596 | dependencies = [ 1597 | "proc-macro2", 1598 | "quote", 1599 | "syn", 1600 | "wasm-bindgen-backend", 1601 | "wasm-bindgen-shared", 1602 | ] 1603 | 1604 | [[package]] 1605 | name = "wasm-bindgen-shared" 1606 | version = "0.2.95" 1607 | source = "registry+https://github.com/rust-lang/crates.io-index" 1608 | checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" 1609 | 1610 | [[package]] 1611 | name = "winapi" 1612 | version = "0.3.9" 1613 | source = "registry+https://github.com/rust-lang/crates.io-index" 1614 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1615 | dependencies = [ 1616 | "winapi-i686-pc-windows-gnu", 1617 | "winapi-x86_64-pc-windows-gnu", 1618 | ] 1619 | 1620 | [[package]] 1621 | name = "winapi-i686-pc-windows-gnu" 1622 | version = "0.4.0" 1623 | source = "registry+https://github.com/rust-lang/crates.io-index" 1624 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1625 | 1626 | [[package]] 1627 | name = "winapi-util" 1628 | version = "0.1.9" 1629 | source = "registry+https://github.com/rust-lang/crates.io-index" 1630 | checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" 1631 | dependencies = [ 1632 | "windows-sys 0.59.0", 1633 | ] 1634 | 1635 | [[package]] 1636 | name = "winapi-x86_64-pc-windows-gnu" 1637 | version = "0.4.0" 1638 | source = "registry+https://github.com/rust-lang/crates.io-index" 1639 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1640 | 1641 | [[package]] 1642 | name = "windows-core" 1643 | version = "0.52.0" 1644 | source = "registry+https://github.com/rust-lang/crates.io-index" 1645 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 1646 | dependencies = [ 1647 | "windows-targets", 1648 | ] 1649 | 1650 | [[package]] 1651 | name = "windows-sys" 1652 | version = "0.52.0" 1653 | source = "registry+https://github.com/rust-lang/crates.io-index" 1654 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1655 | dependencies = [ 1656 | "windows-targets", 1657 | ] 1658 | 1659 | [[package]] 1660 | name = "windows-sys" 1661 | version = "0.59.0" 1662 | source = "registry+https://github.com/rust-lang/crates.io-index" 1663 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 1664 | dependencies = [ 1665 | "windows-targets", 1666 | ] 1667 | 1668 | [[package]] 1669 | name = "windows-targets" 1670 | version = "0.52.6" 1671 | source = "registry+https://github.com/rust-lang/crates.io-index" 1672 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1673 | dependencies = [ 1674 | "windows_aarch64_gnullvm", 1675 | "windows_aarch64_msvc", 1676 | "windows_i686_gnu", 1677 | "windows_i686_gnullvm", 1678 | "windows_i686_msvc", 1679 | "windows_x86_64_gnu", 1680 | "windows_x86_64_gnullvm", 1681 | "windows_x86_64_msvc", 1682 | ] 1683 | 1684 | [[package]] 1685 | name = "windows_aarch64_gnullvm" 1686 | version = "0.52.6" 1687 | source = "registry+https://github.com/rust-lang/crates.io-index" 1688 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1689 | 1690 | [[package]] 1691 | name = "windows_aarch64_msvc" 1692 | version = "0.52.6" 1693 | source = "registry+https://github.com/rust-lang/crates.io-index" 1694 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1695 | 1696 | [[package]] 1697 | name = "windows_i686_gnu" 1698 | version = "0.52.6" 1699 | source = "registry+https://github.com/rust-lang/crates.io-index" 1700 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1701 | 1702 | [[package]] 1703 | name = "windows_i686_gnullvm" 1704 | version = "0.52.6" 1705 | source = "registry+https://github.com/rust-lang/crates.io-index" 1706 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1707 | 1708 | [[package]] 1709 | name = "windows_i686_msvc" 1710 | version = "0.52.6" 1711 | source = "registry+https://github.com/rust-lang/crates.io-index" 1712 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1713 | 1714 | [[package]] 1715 | name = "windows_x86_64_gnu" 1716 | version = "0.52.6" 1717 | source = "registry+https://github.com/rust-lang/crates.io-index" 1718 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 1719 | 1720 | [[package]] 1721 | name = "windows_x86_64_gnullvm" 1722 | version = "0.52.6" 1723 | source = "registry+https://github.com/rust-lang/crates.io-index" 1724 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 1725 | 1726 | [[package]] 1727 | name = "windows_x86_64_msvc" 1728 | version = "0.52.6" 1729 | source = "registry+https://github.com/rust-lang/crates.io-index" 1730 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 1731 | 1732 | [[package]] 1733 | name = "xdg" 1734 | version = "2.5.2" 1735 | source = "registry+https://github.com/rust-lang/crates.io-index" 1736 | checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546" 1737 | 1738 | [[package]] 1739 | name = "yaml-rust" 1740 | version = "0.4.5" 1741 | source = "registry+https://github.com/rust-lang/crates.io-index" 1742 | checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" 1743 | dependencies = [ 1744 | "linked-hash-map", 1745 | ] 1746 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "textpod" 3 | version = "0.1.5" 4 | edition = "2021" 5 | license-file = "LICENSE" 6 | description = "Local, web-based notetaking app inspired by 'One Big Text File' idea." 7 | homepage = "https://github.com/freetonik/textpod" 8 | repository = "https://github.com/freetonik/textpod" 9 | readme = "README.md" 10 | 11 | [dependencies] 12 | axum = { version = "0.7.7", features = ["multipart"] } 13 | tokio = { version = "1.41.1", features = ["full"] } 14 | tower-http = { version = "0.6.1", features = ["fs"] } 15 | comrak = "0.29" 16 | serde = { version = "1.0.215", features = ["derive"] } 17 | chrono = "0.4.38" 18 | clap = { version = "4.4", features = ["derive"] } 19 | tracing = "0.1" 20 | tracing-subscriber = "0.3.18" 21 | base64 = "0.22.1" 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rust:alpine AS build 2 | 3 | RUN apk add musl-dev perl make 4 | RUN cargo install textpod 5 | RUN cargo install monolith 6 | 7 | FROM alpine 8 | COPY --from=build /usr/local/cargo/bin/textpod /usr/bin/textpod 9 | COPY --from=build /usr/local/cargo/bin/monolith /usr/bin/monolith 10 | 11 | RUN apk add --no-cache tzdata 12 | 13 | WORKDIR /app/notes 14 | 15 | HEALTHCHECK --interval=60s --retries=3 --timeout=1s \ 16 | CMD nc -z -w 1 localhost 3000 || exit 1 17 | 18 | ENTRYPOINT ["textpod"] 19 | CMD ["-p", "3000", "-l", "0.0.0.0"] 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 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 General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![textpod build status on GNU/Linux](https://github.com/freetonik/textpod/workflows/GNU%2FLinux/badge.svg)](https://github.com/freetonik/textpod/actions?query=workflow%3AGNU%2FLinux) 2 | [![textpod build status on macOS](https://github.com/freetonik/textpod/workflows/macOS/badge.svg)](https://github.com/freetonik/textpod/actions?query=workflow%3AmacOS) 3 | [![textpod build status on Windows](https://github.com/freetonik/textpod/workflows/Windows/badge.svg)](https://github.com/freetonik/textpod/actions?query=workflow%3AWindows) 4 | 5 | # Textpod 6 | 7 | Local, web-based note-taking app inspired by "One Big Text File" idea. Short demo: 8 | 9 | [![Textpod short demo video](https://img.youtube.com/vi/VAqJJxaJNVM/0.jpg)](https://www.youtube.com/watch?v=VAqJJxaJNVM) 10 | 11 | - Single page with all notes and a simple entry form (Markdown) 12 | - All notes are stored in a single `notes.md` file 13 | - Search/filtering when you start typing with `/` 14 | - Start a link with `+` and Textpod will save a local single-page copy 15 | - File and image attachments 16 | 17 | ## Installation 18 | 19 | #### Using [Cargo](https://crates.io/crates/textpod) (cross-platform) 20 | 21 | ```console 22 | cargo install textpod 23 | ``` 24 | 25 | #### Via [Homebrew](https://brew.sh/) (macOS and GNU/Linux) 26 | 27 | ```console 28 | brew tap freetonik/tap 29 | brew install textpod 30 | ``` 31 | 32 | In order to download webpages, you need to have `monolith` installed. `cargo install monolith` or `brew install monolith` (macOS). See [monolith](https://github.com/Y2Z/monolith) for more details. 33 | 34 | ## Usage 35 | 36 | Run `textpod` in any directory. It will create a `notes.md` file if it doesn't exist. It will create `attachments` directory for file and image attachments. 37 | Webpages are saved in `attachments/webpages`. You can specify the port with `-p` flag, e.g. `textpod -p 8080` and/or the address with `-l` flag, e.g. `textpod -l 0.0.0.0`. 38 | 39 | ## Docker 40 | 41 | Docker image is available at [Docker Hub](https://hub.docker.com/r/freetonik/textpod). 42 | E.g. run on port `8099`, mapping the `notes` directory (under current directory): 43 | 44 | ``` 45 | docker pull freetonik/textpod 46 | docker run --rm --name textpod -d -v $(pwd)/notes:/app -p 8099:3000 freetonik/textpod 47 | ``` 48 | 49 | Or check out `docker-compose.yml`. 50 | 51 | ## Contributing 52 | 53 | Feel free to open issues and pull requests. I want to keep the code very simple and accessible to beginners. The goal is not to create another feature-rich note-taking app, but to keep it simple and fast. 54 | A "one big text file" idea is very powerful and I just want to make it slightly enhanced. 55 | -------------------------------------------------------------------------------- /RELEASE_CHECKLIST.md: -------------------------------------------------------------------------------- 1 | - [ ] Update version in `Cargo.toml` 2 | - [ ] Create Github release 3 | - [ ] Update homebrew formula https://github.com/freetonik/homebrew-tap 4 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | textpod-docker: 3 | image: freetonik/textpod:latest 4 | build: . 5 | ports: 6 | - '8099:3000' 7 | volumes: 8 | - './notes:/app/notes' 9 | container_name: textpod 10 | restart: unless-stopped 11 | environment: 12 | - TZ=UTC 13 | -------------------------------------------------------------------------------- /src/favicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Textpod 6 | 7 | 8 | 111 | 112 | 113 | 114 | 115 | 117 |
118 |
119 | 120 | 265 | 266 | 267 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use axum::{ 2 | extract::{DefaultBodyLimit, Multipart, Path, State}, 3 | http::StatusCode, 4 | response::{Html, IntoResponse}, 5 | routing::{get, post}, 6 | Json, Router, 7 | }; 8 | use base64::{display::Base64Display, engine::general_purpose::STANDARD}; 9 | use chrono::Local; 10 | use clap::Parser; 11 | use comrak::{markdown_to_html, Options}; 12 | use serde::{Deserialize, Serialize}; 13 | use std::{ 14 | env, 15 | fs::{self}, 16 | io::Write, 17 | net::SocketAddr, 18 | path::PathBuf, 19 | process, 20 | sync::{Arc, Mutex}, 21 | }; 22 | use tokio::process::Command; 23 | use tokio::spawn; 24 | use tower_http::services::ServeDir; 25 | use tracing::{error, info}; 26 | use tracing_subscriber; 27 | 28 | const INDEX_HTML: &str = include_str!("index.html"); 29 | const FAVICON_SVG: &[u8] = include_bytes!("favicon.svg"); 30 | 31 | #[derive(Parser)] 32 | #[command(author, version, about, long_about = None)] 33 | struct Args { 34 | /// Change to DIR before doing anything 35 | #[arg(short = 'C', long, value_name = "DIR")] 36 | base_directory: Option, 37 | /// Port number for the server 38 | #[arg(short, long, default_value_t = 3000)] 39 | port: u16, 40 | /// Listen address for the server 41 | #[arg(short, long, default_value = "127.0.0.1")] 42 | listen: String, 43 | /// Save notes in FILE 44 | #[arg(short = 'f', long, value_name = "FILE", default_value = "notes.md")] 45 | notes_file: PathBuf, 46 | } 47 | 48 | #[derive(Clone, Debug, Serialize, Deserialize)] 49 | struct Note { 50 | timestamp: String, 51 | content: String, 52 | html: String, 53 | } 54 | 55 | #[derive(Clone)] 56 | struct AppState { 57 | html: String, 58 | notes: Arc>>, 59 | notes_file: PathBuf, 60 | } 61 | 62 | const CONTENT_LENGTH_LIMIT: usize = 500 * 1024 * 1024; // allow uploading up to 500mb files... overkill? 63 | 64 | #[tokio::main] 65 | async fn main() { 66 | tracing_subscriber::fmt::init(); 67 | 68 | let args = Args::parse(); 69 | 70 | if let Some(path) = args.base_directory { 71 | if let Err(e) = env::set_current_dir(&path) { 72 | error!("could not change directory to {}: {e}", path.display()); 73 | process::exit(1); 74 | } 75 | } 76 | 77 | if let Err(e) = fs::create_dir_all("attachments") { 78 | error!( 79 | "could not create attachments directory in {}: {e}", 80 | env::current_dir().unwrap().display() 81 | ); 82 | process::exit(1); 83 | } 84 | 85 | let favicon = Base64Display::new(FAVICON_SVG, &STANDARD); 86 | let html = INDEX_HTML.replace( 87 | "{{FAVICON}}", 88 | format!("data:image/svg+xml;base64,{favicon}").as_str(), 89 | ); 90 | 91 | let notes = Arc::new(Mutex::new(load_notes(&args.notes_file))); 92 | 93 | let state = AppState { 94 | html, 95 | notes, 96 | notes_file: args.notes_file, 97 | }; 98 | 99 | let app = Router::new() 100 | .route("/", get(index)) 101 | .route("/notes", get(get_notes).post(save_note)) 102 | .route( 103 | "/notes/:index", 104 | get(get_note_by_index).delete(delete_note_by_index), 105 | ) // TODO PUT/PATCH 106 | .route("/upload", post(upload_file)) 107 | .layer(DefaultBodyLimit::max(CONTENT_LENGTH_LIMIT)) 108 | .nest_service("/attachments", ServeDir::new("attachments")) 109 | .with_state(state); 110 | 111 | let server_details = format!("{}:{}", args.listen, args.port); 112 | let addr: SocketAddr = server_details 113 | .parse() 114 | .expect("Unable to parse socket address"); 115 | info!("Starting server on http://{}", addr); 116 | 117 | match tokio::net::TcpListener::bind(&addr).await { 118 | Ok(listener) => { 119 | if let Err(e) = axum::serve(listener, app).await { 120 | error!("Server error: {}", e); 121 | } 122 | } 123 | Err(e) => { 124 | error!("Failed to bind to address {}: {}", addr, e); 125 | } 126 | } 127 | } 128 | 129 | fn load_notes(file: &PathBuf) -> Vec { 130 | if let Ok(content) = fs::read_to_string(file) { 131 | content 132 | .split("\n\n---\n\n") 133 | .filter(|s| !s.trim().is_empty()) 134 | .map(|block| { 135 | let parts: Vec<&str> = block.splitn(2, '\n').collect(); 136 | let (timestamp, content) = match parts.as_slice() { 137 | [timestamp, content] => { 138 | (timestamp.trim().to_string(), content.trim().to_string()) 139 | } 140 | _ => ( 141 | Local::now().format("%Y-%m-%d %H:%M:%S").to_string(), 142 | block.to_string(), 143 | ), 144 | }; 145 | 146 | let html = md_to_html(&content); 147 | Note { 148 | timestamp, 149 | content: content.to_string(), 150 | html, 151 | } 152 | }) 153 | .collect() 154 | } else { 155 | Vec::new() 156 | } 157 | } 158 | 159 | // route / (root) 160 | async fn index(State(state): State) -> Html { 161 | Html(state.html) 162 | } 163 | 164 | // GET /notes 165 | async fn get_notes(State(state): State) -> Json> { 166 | let notes = state.notes.lock().unwrap(); 167 | Json(notes.iter().cloned().collect::>()) 168 | } 169 | 170 | // GET /notes/:index 171 | async fn get_note_by_index( 172 | State(state): State, 173 | Path(index): Path, 174 | ) -> Result { 175 | let notes = state.notes.lock().unwrap(); 176 | if index >= notes.len() { 177 | return Err(( 178 | StatusCode::BAD_REQUEST, 179 | format!("request for non-existent note #{index}"), 180 | )); 181 | } 182 | 183 | return Ok(Json(notes.iter().collect::>()[index].clone())); 184 | } 185 | 186 | // DELETE /notes/:index 187 | async fn delete_note_by_index( 188 | State(state): State, 189 | Path(index): Path, 190 | ) -> Result { 191 | let mut notes = state.notes.lock().unwrap(); 192 | if index >= notes.len() { 193 | return Err(( 194 | StatusCode::BAD_REQUEST, 195 | format!("request for non-existent note #{index}"), 196 | )); 197 | } 198 | 199 | notes.remove(index); 200 | 201 | // Update the notes file 202 | let content = notes 203 | .iter() 204 | .map(|note| format!("{}\n{}\n\n---\n\n", note.timestamp, note.content)) 205 | .collect::(); 206 | 207 | if let Err(e) = fs::write(&state.notes_file, content) { 208 | return Err((StatusCode::INTERNAL_SERVER_ERROR, e.to_string())); 209 | } 210 | 211 | info!("Note deleted: {}", index); 212 | 213 | // TODO return the deleted note, maybe? 214 | return Ok(StatusCode::NO_CONTENT); 215 | } 216 | 217 | // POST /notes 218 | async fn save_note( 219 | State(state): State, 220 | Json(content): Json, 221 | ) -> Result<(), StatusCode> { 222 | let mut content = content.clone(); 223 | 224 | // Replace "---" with "
" in the content 225 | content = content.replace("---", "
"); 226 | let links_to_download: Vec = content 227 | .split_whitespace() 228 | .filter(|word| word.starts_with("+http")) 229 | .map(|s| s.to_string()) 230 | .collect(); 231 | 232 | fs::create_dir_all("attachments/webpages").unwrap(); 233 | 234 | for link in &links_to_download { 235 | let url = &link[1..]; 236 | let escaped_filename = url_to_safe_filename(url); 237 | let filepath = format!("attachments/webpages/{}.html", escaped_filename); 238 | content = content.replace(link, &format!("{} ([local copy](/{}))", url, filepath)); 239 | } 240 | 241 | let timestamp = Local::now().format("%Y-%m-%d %H:%M:%S").to_string(); 242 | let html = md_to_html(&content); // Changed to pass a reference 243 | let note = Note { 244 | timestamp: timestamp.clone(), 245 | content: content.clone(), 246 | html, 247 | }; 248 | 249 | state.notes.lock().unwrap().push(note); 250 | 251 | let mut file = fs::OpenOptions::new() 252 | .create(true) 253 | .append(true) 254 | .open(&state.notes_file) 255 | .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; 256 | 257 | write!(file, "{}\n{}\n\n---\n\n", timestamp, content) 258 | .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; 259 | 260 | info!("Note created: {}", timestamp); 261 | 262 | if !links_to_download.is_empty() { 263 | let notes = state.notes.clone(); 264 | spawn(async move { 265 | for link in links_to_download { 266 | let url = &link[1..]; 267 | let escaped_filename = url_to_safe_filename(url); 268 | let filepath = format!("attachments/webpages/{}.html", escaped_filename); 269 | 270 | let result = Command::new("monolith") 271 | .args(&[url, "-o", &filepath]) 272 | .output() 273 | .await; 274 | 275 | info!("Downloading webpage: {}", url); 276 | 277 | if result.is_err() { 278 | error!("Failed to download webpage: {}", url); 279 | let mut notes_lock = notes.lock().unwrap(); 280 | if let Some(last_note) = notes_lock.last_mut() { 281 | let updated_content = last_note.content.replace( 282 | &format!("([local copy](/{}))", filepath), 283 | "(local copy failed)", 284 | ); 285 | last_note.content = updated_content.clone(); 286 | last_note.html = md_to_html(&updated_content); // Changed to pass a reference here too 287 | 288 | drop(notes_lock); 289 | 290 | if let Ok(file_content) = fs::read_to_string(&state.notes_file) { 291 | let notes_lock = notes.lock().unwrap(); 292 | let updated_content: Vec = file_content 293 | .split("\n---\n") 294 | .enumerate() 295 | .map(|(i, note_content)| { 296 | if i == notes_lock.len() - 1 { 297 | format!("{}\n{}", timestamp, updated_content) 298 | } else { 299 | note_content.to_string() 300 | } 301 | }) 302 | .collect(); 303 | drop(notes_lock); 304 | 305 | if let Ok(mut file) = fs::File::create(&state.notes_file) { 306 | for note_content in updated_content { 307 | writeln!(file, "{}\n---", note_content).ok(); 308 | } 309 | } 310 | } 311 | } 312 | } 313 | } 314 | }); 315 | } 316 | 317 | Ok(()) 318 | } 319 | 320 | // route POST /upload 321 | async fn upload_file(mut multipart: Multipart) -> Result, StatusCode> { 322 | while let Some(field) = multipart.next_field().await.unwrap() { 323 | let name = field.file_name().unwrap().to_string(); 324 | let data = field.bytes().await.unwrap(); 325 | 326 | info!("Uploading file: {}", name); 327 | 328 | let original_path = PathBuf::from("attachments").join(&name); 329 | let mut counter = 1; 330 | 331 | let original_stem = original_path 332 | .file_stem() 333 | .and_then(|s| s.to_str()) 334 | .unwrap_or(""); 335 | let original_ext = original_path 336 | .extension() 337 | .and_then(|s| s.to_str()) 338 | .unwrap_or(""); 339 | 340 | // Generate unique filename if already exists 341 | let mut path = original_path.clone(); 342 | while path.exists() { 343 | // e.g: file-1.txt 344 | let new_name = if original_ext.is_empty() { 345 | format!("{}-{}", original_stem, counter) 346 | } else { 347 | format!("{}-{}.{}", original_stem, counter, original_ext) 348 | }; 349 | 350 | path = original_path.parent().unwrap().join(new_name); 351 | counter += 1; 352 | } 353 | 354 | fs::write(&path, data).map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; 355 | 356 | info!("File saved as {}", path.display()); 357 | return Ok(Json(format!( 358 | "/attachments/{}", 359 | path.file_name().unwrap().to_str().unwrap() 360 | ))); 361 | } 362 | 363 | error!("Error uploading file"); 364 | Err(StatusCode::BAD_REQUEST) 365 | } 366 | 367 | // UTILS 368 | fn md_to_html(markdown: &str) -> String { 369 | let mut options = Options::default(); 370 | options.extension.strikethrough = true; 371 | options.extension.tagfilter = true; 372 | options.extension.table = true; 373 | options.extension.autolink = true; 374 | options.extension.tasklist = true; 375 | options.extension.superscript = true; 376 | options.render.unsafe_ = true; 377 | markdown_to_html(markdown, &options) 378 | } 379 | 380 | fn url_to_safe_filename(url: &str) -> String { 381 | let mut safe_name = String::with_capacity(url.len()); 382 | 383 | let stripped_url = url 384 | .trim() 385 | .strip_prefix("http://") 386 | .unwrap_or(url) 387 | .strip_prefix("https://") 388 | .unwrap_or(url); 389 | 390 | for c in stripped_url.chars() { 391 | match c { 392 | '/' | '\\' | ':' | '*' | '?' | '"' | '<' | '>' | '|' => safe_name.push('_'), 393 | c if c.is_alphanumeric() || c == '-' || c == '.' || c == '_' => safe_name.push(c), 394 | _ => safe_name.push('_'), 395 | } 396 | } 397 | 398 | safe_name.trim_matches(|c| c == '.' || c == ' ').to_string() 399 | } 400 | --------------------------------------------------------------------------------