├── .github └── workflows │ ├── gh-pages.yml │ └── rust.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE.txt ├── README.md ├── book.toml ├── cli ├── Cargo.toml └── src │ └── main.rs ├── docs ├── SUMMARY.md ├── custom.css ├── development.md ├── installation.md ├── intro.md └── usage.md ├── libs └── standardfile │ ├── Cargo.toml │ └── src │ ├── crypto.rs │ ├── lib.rs │ └── remote.rs └── shell ├── Cargo.toml ├── build.rs ├── data ├── resources.gresource.xml └── resources │ ├── css │ └── base.css │ └── ui │ ├── about.ui │ ├── import.ui │ ├── shortcuts.ui │ └── window.ui └── src ├── config.rs ├── consts.rs ├── main.rs ├── secret.rs ├── storage.rs └── ui ├── application.rs ├── controller.rs ├── mod.rs └── utils.rs /.github/workflows/gh-pages.yml: -------------------------------------------------------------------------------- 1 | name: Github Pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths: 8 | - 'docs/*' 9 | 10 | jobs: 11 | deploy: 12 | runs-on: ubuntu-18.04 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Setup mdBook 17 | uses: peaceiris/actions-mdbook@v1 18 | with: 19 | mdbook-version: 'latest' 20 | 21 | - run: mdbook build 22 | 23 | - name: Deploy 24 | uses: peaceiris/actions-gh-pages@v3 25 | with: 26 | github_token: ${{ secrets.GITHUB_TOKEN }} 27 | publish_dir: ./docs 28 | -------------------------------------------------------------------------------- /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Install deps 20 | run: sudo apt install libpango1.0-dev libatk1.0-dev libgtk-3-dev 21 | - name: Build 22 | run: cargo build --verbose 23 | - name: Run tests 24 | run: cargo test --verbose 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /book 2 | /target 3 | /.cargo 4 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "adler32" 5 | version = "1.1.0" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "567b077b825e468cc974f0020d4082ee6e03132512f207ef1a02fd5d00d1f32d" 8 | 9 | [[package]] 10 | name = "aes" 11 | version = "0.3.2" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "54eb1d8fe354e5fc611daf4f2ea97dd45a765f4f1e4512306ec183ae2e8f20c9" 14 | dependencies = [ 15 | "aes-soft", 16 | "aesni", 17 | "block-cipher-trait", 18 | ] 19 | 20 | [[package]] 21 | name = "aes-soft" 22 | version = "0.3.3" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" 25 | dependencies = [ 26 | "block-cipher-trait", 27 | "byteorder", 28 | "opaque-debug", 29 | ] 30 | 31 | [[package]] 32 | name = "aesni" 33 | version = "0.6.0" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" 36 | dependencies = [ 37 | "block-cipher-trait", 38 | "opaque-debug", 39 | ] 40 | 41 | [[package]] 42 | name = "ansi_term" 43 | version = "0.11.0" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" 46 | dependencies = [ 47 | "winapi 0.3.9", 48 | ] 49 | 50 | [[package]] 51 | name = "anyhow" 52 | version = "1.0.31" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "85bb70cc08ec97ca5450e6eba421deeea5f172c0fc61f78b5357b2a8e8be195f" 55 | 56 | [[package]] 57 | name = "arrayref" 58 | version = "0.3.6" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" 61 | 62 | [[package]] 63 | name = "arrayvec" 64 | version = "0.5.1" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" 67 | 68 | [[package]] 69 | name = "async-compression" 70 | version = "0.3.5" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "9021768bcce77296b64648cc7a7460e3df99979b97ed5c925c38d1cc83778d98" 73 | dependencies = [ 74 | "bytes", 75 | "flate2", 76 | "futures-core", 77 | "memchr", 78 | "pin-project-lite", 79 | ] 80 | 81 | [[package]] 82 | name = "atk" 83 | version = "0.9.0" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "812b4911e210bd51b24596244523c856ca749e6223c50a7fbbba3f89ee37c426" 86 | dependencies = [ 87 | "atk-sys", 88 | "bitflags", 89 | "glib", 90 | "glib-sys", 91 | "gobject-sys", 92 | "libc", 93 | ] 94 | 95 | [[package]] 96 | name = "atk-sys" 97 | version = "0.10.0" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "f530e4af131d94cc4fa15c5c9d0348f0ef28bac64ba660b6b2a1cf2605dedfce" 100 | dependencies = [ 101 | "glib-sys", 102 | "gobject-sys", 103 | "libc", 104 | "system-deps", 105 | ] 106 | 107 | [[package]] 108 | name = "atty" 109 | version = "0.2.14" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 112 | dependencies = [ 113 | "hermit-abi", 114 | "libc", 115 | "winapi 0.3.9", 116 | ] 117 | 118 | [[package]] 119 | name = "autocfg" 120 | version = "0.1.7" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" 123 | 124 | [[package]] 125 | name = "autocfg" 126 | version = "1.0.0" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 129 | 130 | [[package]] 131 | name = "base64" 132 | version = "0.11.0" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" 135 | 136 | [[package]] 137 | name = "base64" 138 | version = "0.12.3" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 141 | 142 | [[package]] 143 | name = "bitflags" 144 | version = "1.2.1" 145 | source = "registry+https://github.com/rust-lang/crates.io-index" 146 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 147 | 148 | [[package]] 149 | name = "blake2b_simd" 150 | version = "0.5.10" 151 | source = "registry+https://github.com/rust-lang/crates.io-index" 152 | checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" 153 | dependencies = [ 154 | "arrayref", 155 | "arrayvec", 156 | "constant_time_eq", 157 | ] 158 | 159 | [[package]] 160 | name = "block-buffer" 161 | version = "0.7.3" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" 164 | dependencies = [ 165 | "block-padding", 166 | "byte-tools", 167 | "byteorder", 168 | "generic-array", 169 | ] 170 | 171 | [[package]] 172 | name = "block-cipher-trait" 173 | version = "0.6.2" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" 176 | dependencies = [ 177 | "generic-array", 178 | ] 179 | 180 | [[package]] 181 | name = "block-modes" 182 | version = "0.3.3" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "31aa8410095e39fdb732909fb5730a48d5bd7c2e3cd76bd1b07b3dbea130c529" 185 | dependencies = [ 186 | "block-cipher-trait", 187 | "block-padding", 188 | ] 189 | 190 | [[package]] 191 | name = "block-padding" 192 | version = "0.1.5" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" 195 | dependencies = [ 196 | "byte-tools", 197 | ] 198 | 199 | [[package]] 200 | name = "bumpalo" 201 | version = "3.4.0" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" 204 | 205 | [[package]] 206 | name = "byte-tools" 207 | version = "0.3.1" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" 210 | 211 | [[package]] 212 | name = "byteorder" 213 | version = "1.3.4" 214 | source = "registry+https://github.com/rust-lang/crates.io-index" 215 | checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 216 | 217 | [[package]] 218 | name = "bytes" 219 | version = "0.5.5" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "118cf036fbb97d0816e3c34b2d7a1e8cfc60f68fcf63d550ddbe9bd5f59c213b" 222 | dependencies = [ 223 | "loom", 224 | ] 225 | 226 | [[package]] 227 | name = "cairo-rs" 228 | version = "0.9.0" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | checksum = "20c39055f35fb3cf8cc2683e8e85097cc1b26f76ac1438626a50c503cc141e5c" 231 | dependencies = [ 232 | "bitflags", 233 | "cairo-sys-rs", 234 | "glib", 235 | "glib-sys", 236 | "gobject-sys", 237 | "libc", 238 | "thiserror", 239 | ] 240 | 241 | [[package]] 242 | name = "cairo-sys-rs" 243 | version = "0.10.0" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "2ed2639b9ad5f1d6efa76de95558e11339e7318426d84ac4890b86c03e828ca7" 246 | dependencies = [ 247 | "glib-sys", 248 | "libc", 249 | "system-deps", 250 | ] 251 | 252 | [[package]] 253 | name = "cc" 254 | version = "1.0.54" 255 | source = "registry+https://github.com/rust-lang/crates.io-index" 256 | checksum = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" 257 | 258 | [[package]] 259 | name = "cfg-if" 260 | version = "0.1.10" 261 | source = "registry+https://github.com/rust-lang/crates.io-index" 262 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 263 | 264 | [[package]] 265 | name = "chrono" 266 | version = "0.4.11" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" 269 | dependencies = [ 270 | "num-integer", 271 | "num-traits", 272 | "serde", 273 | "time", 274 | ] 275 | 276 | [[package]] 277 | name = "clap" 278 | version = "2.33.1" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" 281 | dependencies = [ 282 | "ansi_term", 283 | "atty", 284 | "bitflags", 285 | "strsim", 286 | "textwrap", 287 | "unicode-width", 288 | "vec_map", 289 | ] 290 | 291 | [[package]] 292 | name = "cloudabi" 293 | version = "0.0.3" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 296 | dependencies = [ 297 | "bitflags", 298 | ] 299 | 300 | [[package]] 301 | name = "constant_time_eq" 302 | version = "0.1.5" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" 305 | 306 | [[package]] 307 | name = "core-foundation" 308 | version = "0.7.0" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 311 | dependencies = [ 312 | "core-foundation-sys", 313 | "libc", 314 | ] 315 | 316 | [[package]] 317 | name = "core-foundation-sys" 318 | version = "0.7.0" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 321 | 322 | [[package]] 323 | name = "crc32fast" 324 | version = "1.2.0" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" 327 | dependencies = [ 328 | "cfg-if", 329 | ] 330 | 331 | [[package]] 332 | name = "crossbeam-utils" 333 | version = "0.7.2" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" 336 | dependencies = [ 337 | "autocfg 1.0.0", 338 | "cfg-if", 339 | "lazy_static", 340 | ] 341 | 342 | [[package]] 343 | name = "crypto-mac" 344 | version = "0.7.0" 345 | source = "registry+https://github.com/rust-lang/crates.io-index" 346 | checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" 347 | dependencies = [ 348 | "generic-array", 349 | "subtle", 350 | ] 351 | 352 | [[package]] 353 | name = "data-encoding" 354 | version = "2.2.1" 355 | source = "registry+https://github.com/rust-lang/crates.io-index" 356 | checksum = "72aa14c04dfae8dd7d8a2b1cb7ca2152618cd01336dbfe704b8dcbf8d41dbd69" 357 | 358 | [[package]] 359 | name = "dbus" 360 | version = "0.2.3" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "b4a0c10ea61042b7555729ab0608727bbbb06ce709c11e6047cfa4e10f6d052d" 363 | dependencies = [ 364 | "libc", 365 | ] 366 | 367 | [[package]] 368 | name = "digest" 369 | version = "0.8.1" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" 372 | dependencies = [ 373 | "generic-array", 374 | ] 375 | 376 | [[package]] 377 | name = "directories" 378 | version = "3.0.1" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" 381 | dependencies = [ 382 | "dirs-sys", 383 | ] 384 | 385 | [[package]] 386 | name = "dirs-sys" 387 | version = "0.3.5" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" 390 | dependencies = [ 391 | "libc", 392 | "redox_users", 393 | "winapi 0.3.9", 394 | ] 395 | 396 | [[package]] 397 | name = "dtoa" 398 | version = "0.4.6" 399 | source = "registry+https://github.com/rust-lang/crates.io-index" 400 | checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" 401 | 402 | [[package]] 403 | name = "either" 404 | version = "1.5.3" 405 | source = "registry+https://github.com/rust-lang/crates.io-index" 406 | checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" 407 | 408 | [[package]] 409 | name = "encoding_rs" 410 | version = "0.8.23" 411 | source = "registry+https://github.com/rust-lang/crates.io-index" 412 | checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" 413 | dependencies = [ 414 | "cfg-if", 415 | ] 416 | 417 | [[package]] 418 | name = "fake-simd" 419 | version = "0.1.2" 420 | source = "registry+https://github.com/rust-lang/crates.io-index" 421 | checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" 422 | 423 | [[package]] 424 | name = "flate2" 425 | version = "1.0.14" 426 | source = "registry+https://github.com/rust-lang/crates.io-index" 427 | checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" 428 | dependencies = [ 429 | "cfg-if", 430 | "crc32fast", 431 | "libc", 432 | "miniz_oxide", 433 | ] 434 | 435 | [[package]] 436 | name = "fnv" 437 | version = "1.0.7" 438 | source = "registry+https://github.com/rust-lang/crates.io-index" 439 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 440 | 441 | [[package]] 442 | name = "foreign-types" 443 | version = "0.3.2" 444 | source = "registry+https://github.com/rust-lang/crates.io-index" 445 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 446 | dependencies = [ 447 | "foreign-types-shared", 448 | ] 449 | 450 | [[package]] 451 | name = "foreign-types-shared" 452 | version = "0.1.1" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 455 | 456 | [[package]] 457 | name = "fuchsia-cprng" 458 | version = "0.1.1" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" 461 | 462 | [[package]] 463 | name = "fuchsia-zircon" 464 | version = "0.3.3" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 467 | dependencies = [ 468 | "bitflags", 469 | "fuchsia-zircon-sys", 470 | ] 471 | 472 | [[package]] 473 | name = "fuchsia-zircon-sys" 474 | version = "0.3.3" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 477 | 478 | [[package]] 479 | name = "futures" 480 | version = "0.3.5" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" 483 | dependencies = [ 484 | "futures-channel", 485 | "futures-core", 486 | "futures-executor", 487 | "futures-io", 488 | "futures-sink", 489 | "futures-task", 490 | "futures-util", 491 | ] 492 | 493 | [[package]] 494 | name = "futures-channel" 495 | version = "0.3.5" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" 498 | dependencies = [ 499 | "futures-core", 500 | "futures-sink", 501 | ] 502 | 503 | [[package]] 504 | name = "futures-core" 505 | version = "0.3.5" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" 508 | 509 | [[package]] 510 | name = "futures-executor" 511 | version = "0.3.5" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" 514 | dependencies = [ 515 | "futures-core", 516 | "futures-task", 517 | "futures-util", 518 | ] 519 | 520 | [[package]] 521 | name = "futures-io" 522 | version = "0.3.5" 523 | source = "registry+https://github.com/rust-lang/crates.io-index" 524 | checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" 525 | 526 | [[package]] 527 | name = "futures-macro" 528 | version = "0.3.5" 529 | source = "registry+https://github.com/rust-lang/crates.io-index" 530 | checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" 531 | dependencies = [ 532 | "proc-macro-hack", 533 | "proc-macro2", 534 | "quote", 535 | "syn", 536 | ] 537 | 538 | [[package]] 539 | name = "futures-sink" 540 | version = "0.3.5" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" 543 | 544 | [[package]] 545 | name = "futures-task" 546 | version = "0.3.5" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" 549 | dependencies = [ 550 | "once_cell", 551 | ] 552 | 553 | [[package]] 554 | name = "futures-util" 555 | version = "0.3.5" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" 558 | dependencies = [ 559 | "futures-channel", 560 | "futures-core", 561 | "futures-io", 562 | "futures-macro", 563 | "futures-sink", 564 | "futures-task", 565 | "memchr", 566 | "pin-project", 567 | "pin-utils", 568 | "proc-macro-hack", 569 | "proc-macro-nested", 570 | "slab", 571 | ] 572 | 573 | [[package]] 574 | name = "gdk" 575 | version = "0.13.0" 576 | source = "registry+https://github.com/rust-lang/crates.io-index" 577 | checksum = "7764140c1246a19ce9b5f7e8b760f7d11644651a8e18a64873e9980cd68ba558" 578 | dependencies = [ 579 | "bitflags", 580 | "cairo-rs", 581 | "cairo-sys-rs", 582 | "gdk-pixbuf", 583 | "gdk-sys", 584 | "gio", 585 | "gio-sys", 586 | "glib", 587 | "glib-sys", 588 | "gobject-sys", 589 | "libc", 590 | "pango", 591 | ] 592 | 593 | [[package]] 594 | name = "gdk-pixbuf" 595 | version = "0.9.0" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "8f6dae3cb99dd49b758b88f0132f8d401108e63ae8edd45f432d42cdff99998a" 598 | dependencies = [ 599 | "gdk-pixbuf-sys", 600 | "gio", 601 | "gio-sys", 602 | "glib", 603 | "glib-sys", 604 | "gobject-sys", 605 | "libc", 606 | ] 607 | 608 | [[package]] 609 | name = "gdk-pixbuf-sys" 610 | version = "0.10.0" 611 | source = "registry+https://github.com/rust-lang/crates.io-index" 612 | checksum = "3bfe468a7f43e97b8d193a762b6c5cf67a7d36cacbc0b9291dbcae24bfea1e8f" 613 | dependencies = [ 614 | "gio-sys", 615 | "glib-sys", 616 | "gobject-sys", 617 | "libc", 618 | "system-deps", 619 | ] 620 | 621 | [[package]] 622 | name = "gdk-sys" 623 | version = "0.10.0" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "0a9653cfc500fd268015b1ac055ddbc3df7a5c9ea3f4ccef147b3957bd140d69" 626 | dependencies = [ 627 | "cairo-sys-rs", 628 | "gdk-pixbuf-sys", 629 | "gio-sys", 630 | "glib-sys", 631 | "gobject-sys", 632 | "libc", 633 | "pango-sys", 634 | "pkg-config", 635 | "system-deps", 636 | ] 637 | 638 | [[package]] 639 | name = "generator" 640 | version = "0.6.21" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "add72f17bb81521258fcc8a7a3245b1e184e916bfbe34f0ea89558f440df5c68" 643 | dependencies = [ 644 | "cc", 645 | "libc", 646 | "log", 647 | "rustc_version", 648 | "winapi 0.3.9", 649 | ] 650 | 651 | [[package]] 652 | name = "generic-array" 653 | version = "0.12.3" 654 | source = "registry+https://github.com/rust-lang/crates.io-index" 655 | checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" 656 | dependencies = [ 657 | "typenum", 658 | ] 659 | 660 | [[package]] 661 | name = "getrandom" 662 | version = "0.1.14" 663 | source = "registry+https://github.com/rust-lang/crates.io-index" 664 | checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 665 | dependencies = [ 666 | "cfg-if", 667 | "libc", 668 | "wasi", 669 | ] 670 | 671 | [[package]] 672 | name = "gio" 673 | version = "0.9.0" 674 | source = "registry+https://github.com/rust-lang/crates.io-index" 675 | checksum = "3c5492e80b45e6c56214894a9a0cbe1340ab5066eb44a2dbe151393b6d7942c0" 676 | dependencies = [ 677 | "bitflags", 678 | "futures", 679 | "futures-channel", 680 | "futures-core", 681 | "futures-io", 682 | "futures-util", 683 | "gio-sys", 684 | "glib", 685 | "glib-sys", 686 | "gobject-sys", 687 | "libc", 688 | "once_cell", 689 | "thiserror", 690 | ] 691 | 692 | [[package]] 693 | name = "gio-sys" 694 | version = "0.10.0" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | checksum = "35993626299fbcaa73c0a19be8fdd01c950f9f3d3ac9cb4fb5532b924ab1a5d7" 697 | dependencies = [ 698 | "glib-sys", 699 | "gobject-sys", 700 | "libc", 701 | "system-deps", 702 | ] 703 | 704 | [[package]] 705 | name = "glib" 706 | version = "0.10.0" 707 | source = "registry+https://github.com/rust-lang/crates.io-index" 708 | checksum = "01a6c19f992a95e76c09391ee85be09b2e1360a87f792f1f461824aa74133587" 709 | dependencies = [ 710 | "bitflags", 711 | "futures-channel", 712 | "futures-core", 713 | "futures-executor", 714 | "futures-task", 715 | "futures-util", 716 | "glib-macros", 717 | "glib-sys", 718 | "gobject-sys", 719 | "libc", 720 | "once_cell", 721 | ] 722 | 723 | [[package]] 724 | name = "glib-macros" 725 | version = "0.10.0" 726 | source = "registry+https://github.com/rust-lang/crates.io-index" 727 | checksum = "4585654c573f43122004f1ceab20c1bcfa31353431c54062ababf61efe7b5755" 728 | dependencies = [ 729 | "anyhow", 730 | "heck", 731 | "itertools", 732 | "proc-macro-crate", 733 | "proc-macro-error", 734 | "proc-macro2", 735 | "quote", 736 | "syn", 737 | ] 738 | 739 | [[package]] 740 | name = "glib-sys" 741 | version = "0.10.0" 742 | source = "registry+https://github.com/rust-lang/crates.io-index" 743 | checksum = "b6cda4af5c2f4507b7a3535b798dca2135293f4bc3a17f399ce244ef15841c4c" 744 | dependencies = [ 745 | "libc", 746 | "system-deps", 747 | ] 748 | 749 | [[package]] 750 | name = "gobject-sys" 751 | version = "0.10.0" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "952133b60c318a62bf82ee75b93acc7e84028a093e06b9e27981c2b6fe68218c" 754 | dependencies = [ 755 | "glib-sys", 756 | "libc", 757 | "system-deps", 758 | ] 759 | 760 | [[package]] 761 | name = "gtk" 762 | version = "0.9.0" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | checksum = "3adf6adf7ba686d5e4f4dae32edfa12118af9469f67425f0afd075bf4a58ea9d" 765 | dependencies = [ 766 | "atk", 767 | "bitflags", 768 | "cairo-rs", 769 | "cairo-sys-rs", 770 | "cc", 771 | "gdk", 772 | "gdk-pixbuf", 773 | "gdk-pixbuf-sys", 774 | "gdk-sys", 775 | "gio", 776 | "gio-sys", 777 | "glib", 778 | "glib-sys", 779 | "gobject-sys", 780 | "gtk-sys", 781 | "libc", 782 | "once_cell", 783 | "pango", 784 | "pango-sys", 785 | "pkg-config", 786 | ] 787 | 788 | [[package]] 789 | name = "gtk-sys" 790 | version = "0.10.0" 791 | source = "registry+https://github.com/rust-lang/crates.io-index" 792 | checksum = "89acda6f084863307d948ba64a4b1ef674e8527dddab147ee4cdcc194c880457" 793 | dependencies = [ 794 | "atk-sys", 795 | "cairo-sys-rs", 796 | "gdk-pixbuf-sys", 797 | "gdk-sys", 798 | "gio-sys", 799 | "glib-sys", 800 | "gobject-sys", 801 | "libc", 802 | "pango-sys", 803 | "system-deps", 804 | ] 805 | 806 | [[package]] 807 | name = "h2" 808 | version = "0.2.5" 809 | source = "registry+https://github.com/rust-lang/crates.io-index" 810 | checksum = "79b7246d7e4b979c03fa093da39cfb3617a96bbeee6310af63991668d7e843ff" 811 | dependencies = [ 812 | "bytes", 813 | "fnv", 814 | "futures-core", 815 | "futures-sink", 816 | "futures-util", 817 | "http", 818 | "indexmap", 819 | "log", 820 | "slab", 821 | "tokio", 822 | "tokio-util", 823 | ] 824 | 825 | [[package]] 826 | name = "heck" 827 | version = "0.3.1" 828 | source = "registry+https://github.com/rust-lang/crates.io-index" 829 | checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" 830 | dependencies = [ 831 | "unicode-segmentation", 832 | ] 833 | 834 | [[package]] 835 | name = "hermit-abi" 836 | version = "0.1.14" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | checksum = "b9586eedd4ce6b3c498bc3b4dd92fc9f11166aa908a914071953768066c67909" 839 | dependencies = [ 840 | "libc", 841 | ] 842 | 843 | [[package]] 844 | name = "hkdf" 845 | version = "0.8.0" 846 | source = "registry+https://github.com/rust-lang/crates.io-index" 847 | checksum = "3fa08a006102488bd9cd5b8013aabe84955cf5ae22e304c2caf655b633aefae3" 848 | dependencies = [ 849 | "digest", 850 | "hmac", 851 | ] 852 | 853 | [[package]] 854 | name = "hmac" 855 | version = "0.7.1" 856 | source = "registry+https://github.com/rust-lang/crates.io-index" 857 | checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" 858 | dependencies = [ 859 | "crypto-mac", 860 | "digest", 861 | ] 862 | 863 | [[package]] 864 | name = "http" 865 | version = "0.2.1" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" 868 | dependencies = [ 869 | "bytes", 870 | "fnv", 871 | "itoa", 872 | ] 873 | 874 | [[package]] 875 | name = "http-body" 876 | version = "0.3.1" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" 879 | dependencies = [ 880 | "bytes", 881 | "http", 882 | ] 883 | 884 | [[package]] 885 | name = "httparse" 886 | version = "1.3.4" 887 | source = "registry+https://github.com/rust-lang/crates.io-index" 888 | checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" 889 | 890 | [[package]] 891 | name = "hyper" 892 | version = "0.13.6" 893 | source = "registry+https://github.com/rust-lang/crates.io-index" 894 | checksum = "a6e7655b9594024ad0ee439f3b5a7299369dc2a3f459b47c696f9ff676f9aa1f" 895 | dependencies = [ 896 | "bytes", 897 | "futures-channel", 898 | "futures-core", 899 | "futures-util", 900 | "h2", 901 | "http", 902 | "http-body", 903 | "httparse", 904 | "itoa", 905 | "log", 906 | "pin-project", 907 | "socket2", 908 | "time", 909 | "tokio", 910 | "tower-service", 911 | "want", 912 | ] 913 | 914 | [[package]] 915 | name = "hyper-tls" 916 | version = "0.4.1" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "3adcd308402b9553630734e9c36b77a7e48b3821251ca2493e8cd596763aafaa" 919 | dependencies = [ 920 | "bytes", 921 | "hyper", 922 | "native-tls", 923 | "tokio", 924 | "tokio-tls", 925 | ] 926 | 927 | [[package]] 928 | name = "idna" 929 | version = "0.2.0" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 932 | dependencies = [ 933 | "matches", 934 | "unicode-bidi", 935 | "unicode-normalization", 936 | ] 937 | 938 | [[package]] 939 | name = "indexmap" 940 | version = "1.4.0" 941 | source = "registry+https://github.com/rust-lang/crates.io-index" 942 | checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe" 943 | dependencies = [ 944 | "autocfg 1.0.0", 945 | ] 946 | 947 | [[package]] 948 | name = "iovec" 949 | version = "0.1.4" 950 | source = "registry+https://github.com/rust-lang/crates.io-index" 951 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 952 | dependencies = [ 953 | "libc", 954 | ] 955 | 956 | [[package]] 957 | name = "iridium" 958 | version = "0.2.0" 959 | dependencies = [ 960 | "anyhow", 961 | "chrono", 962 | "data-encoding", 963 | "directories", 964 | "gdk", 965 | "gio", 966 | "glib", 967 | "gtk", 968 | "ring", 969 | "secret-service", 970 | "serde", 971 | "standardfile", 972 | "toml", 973 | "uuid", 974 | ] 975 | 976 | [[package]] 977 | name = "iridium-cli" 978 | version = "0.2.0" 979 | dependencies = [ 980 | "anyhow", 981 | "standardfile", 982 | "structopt", 983 | ] 984 | 985 | [[package]] 986 | name = "itertools" 987 | version = "0.9.0" 988 | source = "registry+https://github.com/rust-lang/crates.io-index" 989 | checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" 990 | dependencies = [ 991 | "either", 992 | ] 993 | 994 | [[package]] 995 | name = "itoa" 996 | version = "0.4.6" 997 | source = "registry+https://github.com/rust-lang/crates.io-index" 998 | checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" 999 | 1000 | [[package]] 1001 | name = "js-sys" 1002 | version = "0.3.40" 1003 | source = "registry+https://github.com/rust-lang/crates.io-index" 1004 | checksum = "ce10c23ad2ea25ceca0093bd3192229da4c5b3c0f2de499c1ecac0d98d452177" 1005 | dependencies = [ 1006 | "wasm-bindgen", 1007 | ] 1008 | 1009 | [[package]] 1010 | name = "kernel32-sys" 1011 | version = "0.2.2" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 1014 | dependencies = [ 1015 | "winapi 0.2.8", 1016 | "winapi-build", 1017 | ] 1018 | 1019 | [[package]] 1020 | name = "lazy_static" 1021 | version = "1.4.0" 1022 | source = "registry+https://github.com/rust-lang/crates.io-index" 1023 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 1024 | 1025 | [[package]] 1026 | name = "libc" 1027 | version = "0.2.71" 1028 | source = "registry+https://github.com/rust-lang/crates.io-index" 1029 | checksum = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" 1030 | 1031 | [[package]] 1032 | name = "log" 1033 | version = "0.4.8" 1034 | source = "registry+https://github.com/rust-lang/crates.io-index" 1035 | checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 1036 | dependencies = [ 1037 | "cfg-if", 1038 | ] 1039 | 1040 | [[package]] 1041 | name = "loom" 1042 | version = "0.3.4" 1043 | source = "registry+https://github.com/rust-lang/crates.io-index" 1044 | checksum = "4ecc775857611e1df29abba5c41355cdf540e7e9d4acfdf0f355eefee82330b7" 1045 | dependencies = [ 1046 | "cfg-if", 1047 | "generator", 1048 | "scoped-tls", 1049 | ] 1050 | 1051 | [[package]] 1052 | name = "matches" 1053 | version = "0.1.8" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 1056 | 1057 | [[package]] 1058 | name = "memchr" 1059 | version = "2.3.3" 1060 | source = "registry+https://github.com/rust-lang/crates.io-index" 1061 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 1062 | 1063 | [[package]] 1064 | name = "mime" 1065 | version = "0.3.16" 1066 | source = "registry+https://github.com/rust-lang/crates.io-index" 1067 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 1068 | 1069 | [[package]] 1070 | name = "mime_guess" 1071 | version = "2.0.3" 1072 | source = "registry+https://github.com/rust-lang/crates.io-index" 1073 | checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" 1074 | dependencies = [ 1075 | "mime", 1076 | "unicase", 1077 | ] 1078 | 1079 | [[package]] 1080 | name = "miniz_oxide" 1081 | version = "0.3.7" 1082 | source = "registry+https://github.com/rust-lang/crates.io-index" 1083 | checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" 1084 | dependencies = [ 1085 | "adler32", 1086 | ] 1087 | 1088 | [[package]] 1089 | name = "mio" 1090 | version = "0.6.22" 1091 | source = "registry+https://github.com/rust-lang/crates.io-index" 1092 | checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" 1093 | dependencies = [ 1094 | "cfg-if", 1095 | "fuchsia-zircon", 1096 | "fuchsia-zircon-sys", 1097 | "iovec", 1098 | "kernel32-sys", 1099 | "libc", 1100 | "log", 1101 | "miow", 1102 | "net2", 1103 | "slab", 1104 | "winapi 0.2.8", 1105 | ] 1106 | 1107 | [[package]] 1108 | name = "miow" 1109 | version = "0.2.1" 1110 | source = "registry+https://github.com/rust-lang/crates.io-index" 1111 | checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 1112 | dependencies = [ 1113 | "kernel32-sys", 1114 | "net2", 1115 | "winapi 0.2.8", 1116 | "ws2_32-sys", 1117 | ] 1118 | 1119 | [[package]] 1120 | name = "native-tls" 1121 | version = "0.2.4" 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" 1123 | checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" 1124 | dependencies = [ 1125 | "lazy_static", 1126 | "libc", 1127 | "log", 1128 | "openssl", 1129 | "openssl-probe", 1130 | "openssl-sys", 1131 | "schannel", 1132 | "security-framework", 1133 | "security-framework-sys", 1134 | "tempfile", 1135 | ] 1136 | 1137 | [[package]] 1138 | name = "net2" 1139 | version = "0.2.34" 1140 | source = "registry+https://github.com/rust-lang/crates.io-index" 1141 | checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" 1142 | dependencies = [ 1143 | "cfg-if", 1144 | "libc", 1145 | "winapi 0.3.9", 1146 | ] 1147 | 1148 | [[package]] 1149 | name = "num" 1150 | version = "0.2.1" 1151 | source = "registry+https://github.com/rust-lang/crates.io-index" 1152 | checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" 1153 | dependencies = [ 1154 | "num-bigint", 1155 | "num-complex", 1156 | "num-integer", 1157 | "num-iter", 1158 | "num-rational", 1159 | "num-traits", 1160 | ] 1161 | 1162 | [[package]] 1163 | name = "num-bigint" 1164 | version = "0.2.6" 1165 | source = "registry+https://github.com/rust-lang/crates.io-index" 1166 | checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" 1167 | dependencies = [ 1168 | "autocfg 1.0.0", 1169 | "num-integer", 1170 | "num-traits", 1171 | ] 1172 | 1173 | [[package]] 1174 | name = "num-complex" 1175 | version = "0.2.4" 1176 | source = "registry+https://github.com/rust-lang/crates.io-index" 1177 | checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" 1178 | dependencies = [ 1179 | "autocfg 1.0.0", 1180 | "num-traits", 1181 | ] 1182 | 1183 | [[package]] 1184 | name = "num-integer" 1185 | version = "0.1.43" 1186 | source = "registry+https://github.com/rust-lang/crates.io-index" 1187 | checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" 1188 | dependencies = [ 1189 | "autocfg 1.0.0", 1190 | "num-traits", 1191 | ] 1192 | 1193 | [[package]] 1194 | name = "num-iter" 1195 | version = "0.1.41" 1196 | source = "registry+https://github.com/rust-lang/crates.io-index" 1197 | checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f" 1198 | dependencies = [ 1199 | "autocfg 1.0.0", 1200 | "num-integer", 1201 | "num-traits", 1202 | ] 1203 | 1204 | [[package]] 1205 | name = "num-rational" 1206 | version = "0.2.4" 1207 | source = "registry+https://github.com/rust-lang/crates.io-index" 1208 | checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" 1209 | dependencies = [ 1210 | "autocfg 1.0.0", 1211 | "num-bigint", 1212 | "num-integer", 1213 | "num-traits", 1214 | ] 1215 | 1216 | [[package]] 1217 | name = "num-traits" 1218 | version = "0.2.12" 1219 | source = "registry+https://github.com/rust-lang/crates.io-index" 1220 | checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" 1221 | dependencies = [ 1222 | "autocfg 1.0.0", 1223 | ] 1224 | 1225 | [[package]] 1226 | name = "num_cpus" 1227 | version = "1.13.0" 1228 | source = "registry+https://github.com/rust-lang/crates.io-index" 1229 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 1230 | dependencies = [ 1231 | "hermit-abi", 1232 | "libc", 1233 | ] 1234 | 1235 | [[package]] 1236 | name = "once_cell" 1237 | version = "1.4.0" 1238 | source = "registry+https://github.com/rust-lang/crates.io-index" 1239 | checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" 1240 | 1241 | [[package]] 1242 | name = "opaque-debug" 1243 | version = "0.2.3" 1244 | source = "registry+https://github.com/rust-lang/crates.io-index" 1245 | checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" 1246 | 1247 | [[package]] 1248 | name = "openssl" 1249 | version = "0.10.30" 1250 | source = "registry+https://github.com/rust-lang/crates.io-index" 1251 | checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" 1252 | dependencies = [ 1253 | "bitflags", 1254 | "cfg-if", 1255 | "foreign-types", 1256 | "lazy_static", 1257 | "libc", 1258 | "openssl-sys", 1259 | ] 1260 | 1261 | [[package]] 1262 | name = "openssl-probe" 1263 | version = "0.1.2" 1264 | source = "registry+https://github.com/rust-lang/crates.io-index" 1265 | checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 1266 | 1267 | [[package]] 1268 | name = "openssl-sys" 1269 | version = "0.9.58" 1270 | source = "registry+https://github.com/rust-lang/crates.io-index" 1271 | checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" 1272 | dependencies = [ 1273 | "autocfg 1.0.0", 1274 | "cc", 1275 | "libc", 1276 | "pkg-config", 1277 | "vcpkg", 1278 | ] 1279 | 1280 | [[package]] 1281 | name = "pango" 1282 | version = "0.9.0" 1283 | source = "registry+https://github.com/rust-lang/crates.io-index" 1284 | checksum = "460dbe5ad850c46780ba61f142e966beacf5eebb09822830f796c91d7d4fec31" 1285 | dependencies = [ 1286 | "bitflags", 1287 | "glib", 1288 | "glib-sys", 1289 | "gobject-sys", 1290 | "libc", 1291 | "once_cell", 1292 | "pango-sys", 1293 | ] 1294 | 1295 | [[package]] 1296 | name = "pango-sys" 1297 | version = "0.10.0" 1298 | source = "registry+https://github.com/rust-lang/crates.io-index" 1299 | checksum = "24d2650c8b62d116c020abd0cea26a4ed96526afda89b1c4ea567131fdefc890" 1300 | dependencies = [ 1301 | "glib-sys", 1302 | "gobject-sys", 1303 | "libc", 1304 | "system-deps", 1305 | ] 1306 | 1307 | [[package]] 1308 | name = "percent-encoding" 1309 | version = "2.1.0" 1310 | source = "registry+https://github.com/rust-lang/crates.io-index" 1311 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 1312 | 1313 | [[package]] 1314 | name = "pin-project" 1315 | version = "0.4.22" 1316 | source = "registry+https://github.com/rust-lang/crates.io-index" 1317 | checksum = "12e3a6cdbfe94a5e4572812a0201f8c0ed98c1c452c7b8563ce2276988ef9c17" 1318 | dependencies = [ 1319 | "pin-project-internal", 1320 | ] 1321 | 1322 | [[package]] 1323 | name = "pin-project-internal" 1324 | version = "0.4.22" 1325 | source = "registry+https://github.com/rust-lang/crates.io-index" 1326 | checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7" 1327 | dependencies = [ 1328 | "proc-macro2", 1329 | "quote", 1330 | "syn", 1331 | ] 1332 | 1333 | [[package]] 1334 | name = "pin-project-lite" 1335 | version = "0.1.7" 1336 | source = "registry+https://github.com/rust-lang/crates.io-index" 1337 | checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" 1338 | 1339 | [[package]] 1340 | name = "pin-utils" 1341 | version = "0.1.0" 1342 | source = "registry+https://github.com/rust-lang/crates.io-index" 1343 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1344 | 1345 | [[package]] 1346 | name = "pkg-config" 1347 | version = "0.3.17" 1348 | source = "registry+https://github.com/rust-lang/crates.io-index" 1349 | checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" 1350 | 1351 | [[package]] 1352 | name = "ppv-lite86" 1353 | version = "0.2.8" 1354 | source = "registry+https://github.com/rust-lang/crates.io-index" 1355 | checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" 1356 | 1357 | [[package]] 1358 | name = "proc-macro-crate" 1359 | version = "0.1.4" 1360 | source = "registry+https://github.com/rust-lang/crates.io-index" 1361 | checksum = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e" 1362 | dependencies = [ 1363 | "toml", 1364 | ] 1365 | 1366 | [[package]] 1367 | name = "proc-macro-error" 1368 | version = "1.0.3" 1369 | source = "registry+https://github.com/rust-lang/crates.io-index" 1370 | checksum = "fc175e9777c3116627248584e8f8b3e2987405cabe1c0adf7d1dd28f09dc7880" 1371 | dependencies = [ 1372 | "proc-macro-error-attr", 1373 | "proc-macro2", 1374 | "quote", 1375 | "syn", 1376 | "version_check", 1377 | ] 1378 | 1379 | [[package]] 1380 | name = "proc-macro-error-attr" 1381 | version = "1.0.3" 1382 | source = "registry+https://github.com/rust-lang/crates.io-index" 1383 | checksum = "3cc9795ca17eb581285ec44936da7fc2335a3f34f2ddd13118b6f4d515435c50" 1384 | dependencies = [ 1385 | "proc-macro2", 1386 | "quote", 1387 | "syn", 1388 | "syn-mid", 1389 | "version_check", 1390 | ] 1391 | 1392 | [[package]] 1393 | name = "proc-macro-hack" 1394 | version = "0.5.16" 1395 | source = "registry+https://github.com/rust-lang/crates.io-index" 1396 | checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4" 1397 | 1398 | [[package]] 1399 | name = "proc-macro-nested" 1400 | version = "0.1.6" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" 1403 | 1404 | [[package]] 1405 | name = "proc-macro2" 1406 | version = "1.0.18" 1407 | source = "registry+https://github.com/rust-lang/crates.io-index" 1408 | checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" 1409 | dependencies = [ 1410 | "unicode-xid", 1411 | ] 1412 | 1413 | [[package]] 1414 | name = "quote" 1415 | version = "1.0.7" 1416 | source = "registry+https://github.com/rust-lang/crates.io-index" 1417 | checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" 1418 | dependencies = [ 1419 | "proc-macro2", 1420 | ] 1421 | 1422 | [[package]] 1423 | name = "rand" 1424 | version = "0.6.5" 1425 | source = "registry+https://github.com/rust-lang/crates.io-index" 1426 | checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" 1427 | dependencies = [ 1428 | "autocfg 0.1.7", 1429 | "libc", 1430 | "rand_chacha 0.1.1", 1431 | "rand_core 0.4.2", 1432 | "rand_hc 0.1.0", 1433 | "rand_isaac", 1434 | "rand_jitter", 1435 | "rand_os", 1436 | "rand_pcg", 1437 | "rand_xorshift", 1438 | "winapi 0.3.9", 1439 | ] 1440 | 1441 | [[package]] 1442 | name = "rand" 1443 | version = "0.7.3" 1444 | source = "registry+https://github.com/rust-lang/crates.io-index" 1445 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1446 | dependencies = [ 1447 | "getrandom", 1448 | "libc", 1449 | "rand_chacha 0.2.2", 1450 | "rand_core 0.5.1", 1451 | "rand_hc 0.2.0", 1452 | ] 1453 | 1454 | [[package]] 1455 | name = "rand_chacha" 1456 | version = "0.1.1" 1457 | source = "registry+https://github.com/rust-lang/crates.io-index" 1458 | checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" 1459 | dependencies = [ 1460 | "autocfg 0.1.7", 1461 | "rand_core 0.3.1", 1462 | ] 1463 | 1464 | [[package]] 1465 | name = "rand_chacha" 1466 | version = "0.2.2" 1467 | source = "registry+https://github.com/rust-lang/crates.io-index" 1468 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1469 | dependencies = [ 1470 | "ppv-lite86", 1471 | "rand_core 0.5.1", 1472 | ] 1473 | 1474 | [[package]] 1475 | name = "rand_core" 1476 | version = "0.3.1" 1477 | source = "registry+https://github.com/rust-lang/crates.io-index" 1478 | checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 1479 | dependencies = [ 1480 | "rand_core 0.4.2", 1481 | ] 1482 | 1483 | [[package]] 1484 | name = "rand_core" 1485 | version = "0.4.2" 1486 | source = "registry+https://github.com/rust-lang/crates.io-index" 1487 | checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" 1488 | 1489 | [[package]] 1490 | name = "rand_core" 1491 | version = "0.5.1" 1492 | source = "registry+https://github.com/rust-lang/crates.io-index" 1493 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1494 | dependencies = [ 1495 | "getrandom", 1496 | ] 1497 | 1498 | [[package]] 1499 | name = "rand_hc" 1500 | version = "0.1.0" 1501 | source = "registry+https://github.com/rust-lang/crates.io-index" 1502 | checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" 1503 | dependencies = [ 1504 | "rand_core 0.3.1", 1505 | ] 1506 | 1507 | [[package]] 1508 | name = "rand_hc" 1509 | version = "0.2.0" 1510 | source = "registry+https://github.com/rust-lang/crates.io-index" 1511 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1512 | dependencies = [ 1513 | "rand_core 0.5.1", 1514 | ] 1515 | 1516 | [[package]] 1517 | name = "rand_isaac" 1518 | version = "0.1.1" 1519 | source = "registry+https://github.com/rust-lang/crates.io-index" 1520 | checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" 1521 | dependencies = [ 1522 | "rand_core 0.3.1", 1523 | ] 1524 | 1525 | [[package]] 1526 | name = "rand_jitter" 1527 | version = "0.1.4" 1528 | source = "registry+https://github.com/rust-lang/crates.io-index" 1529 | checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" 1530 | dependencies = [ 1531 | "libc", 1532 | "rand_core 0.4.2", 1533 | "winapi 0.3.9", 1534 | ] 1535 | 1536 | [[package]] 1537 | name = "rand_os" 1538 | version = "0.1.3" 1539 | source = "registry+https://github.com/rust-lang/crates.io-index" 1540 | checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" 1541 | dependencies = [ 1542 | "cloudabi", 1543 | "fuchsia-cprng", 1544 | "libc", 1545 | "rand_core 0.4.2", 1546 | "rdrand", 1547 | "winapi 0.3.9", 1548 | ] 1549 | 1550 | [[package]] 1551 | name = "rand_pcg" 1552 | version = "0.1.2" 1553 | source = "registry+https://github.com/rust-lang/crates.io-index" 1554 | checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" 1555 | dependencies = [ 1556 | "autocfg 0.1.7", 1557 | "rand_core 0.4.2", 1558 | ] 1559 | 1560 | [[package]] 1561 | name = "rand_xorshift" 1562 | version = "0.1.1" 1563 | source = "registry+https://github.com/rust-lang/crates.io-index" 1564 | checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" 1565 | dependencies = [ 1566 | "rand_core 0.3.1", 1567 | ] 1568 | 1569 | [[package]] 1570 | name = "rdrand" 1571 | version = "0.4.0" 1572 | source = "registry+https://github.com/rust-lang/crates.io-index" 1573 | checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" 1574 | dependencies = [ 1575 | "rand_core 0.3.1", 1576 | ] 1577 | 1578 | [[package]] 1579 | name = "redox_syscall" 1580 | version = "0.1.56" 1581 | source = "registry+https://github.com/rust-lang/crates.io-index" 1582 | checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 1583 | 1584 | [[package]] 1585 | name = "redox_users" 1586 | version = "0.3.4" 1587 | source = "registry+https://github.com/rust-lang/crates.io-index" 1588 | checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" 1589 | dependencies = [ 1590 | "getrandom", 1591 | "redox_syscall", 1592 | "rust-argon2", 1593 | ] 1594 | 1595 | [[package]] 1596 | name = "remove_dir_all" 1597 | version = "0.5.3" 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" 1599 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 1600 | dependencies = [ 1601 | "winapi 0.3.9", 1602 | ] 1603 | 1604 | [[package]] 1605 | name = "reqwest" 1606 | version = "0.10.6" 1607 | source = "registry+https://github.com/rust-lang/crates.io-index" 1608 | checksum = "3b82c9238b305f26f53443e3a4bc8528d64b8d0bee408ec949eb7bf5635ec680" 1609 | dependencies = [ 1610 | "async-compression", 1611 | "base64 0.12.3", 1612 | "bytes", 1613 | "encoding_rs", 1614 | "futures-core", 1615 | "futures-util", 1616 | "http", 1617 | "http-body", 1618 | "hyper", 1619 | "hyper-tls", 1620 | "js-sys", 1621 | "lazy_static", 1622 | "log", 1623 | "mime", 1624 | "mime_guess", 1625 | "native-tls", 1626 | "percent-encoding", 1627 | "pin-project-lite", 1628 | "serde", 1629 | "serde_json", 1630 | "serde_urlencoded", 1631 | "tokio", 1632 | "tokio-tls", 1633 | "url", 1634 | "wasm-bindgen", 1635 | "wasm-bindgen-futures", 1636 | "web-sys", 1637 | "winreg", 1638 | ] 1639 | 1640 | [[package]] 1641 | name = "ring" 1642 | version = "0.16.15" 1643 | source = "registry+https://github.com/rust-lang/crates.io-index" 1644 | checksum = "952cd6b98c85bbc30efa1ba5783b8abf12fec8b3287ffa52605b9432313e34e4" 1645 | dependencies = [ 1646 | "cc", 1647 | "libc", 1648 | "once_cell", 1649 | "spin", 1650 | "untrusted", 1651 | "web-sys", 1652 | "winapi 0.3.9", 1653 | ] 1654 | 1655 | [[package]] 1656 | name = "rust-argon2" 1657 | version = "0.7.0" 1658 | source = "registry+https://github.com/rust-lang/crates.io-index" 1659 | checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" 1660 | dependencies = [ 1661 | "base64 0.11.0", 1662 | "blake2b_simd", 1663 | "constant_time_eq", 1664 | "crossbeam-utils", 1665 | ] 1666 | 1667 | [[package]] 1668 | name = "rustc_version" 1669 | version = "0.2.3" 1670 | source = "registry+https://github.com/rust-lang/crates.io-index" 1671 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 1672 | dependencies = [ 1673 | "semver", 1674 | ] 1675 | 1676 | [[package]] 1677 | name = "ryu" 1678 | version = "1.0.5" 1679 | source = "registry+https://github.com/rust-lang/crates.io-index" 1680 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 1681 | 1682 | [[package]] 1683 | name = "schannel" 1684 | version = "0.1.19" 1685 | source = "registry+https://github.com/rust-lang/crates.io-index" 1686 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 1687 | dependencies = [ 1688 | "lazy_static", 1689 | "winapi 0.3.9", 1690 | ] 1691 | 1692 | [[package]] 1693 | name = "scoped-tls" 1694 | version = "0.1.2" 1695 | source = "registry+https://github.com/rust-lang/crates.io-index" 1696 | checksum = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" 1697 | 1698 | [[package]] 1699 | name = "secret-service" 1700 | version = "1.1.0" 1701 | source = "registry+https://github.com/rust-lang/crates.io-index" 1702 | checksum = "f8a87c87544bc8762765b5aab5cead10229ff190f1a7f1cb5c341a486cc91f7c" 1703 | dependencies = [ 1704 | "aes", 1705 | "block-modes", 1706 | "dbus", 1707 | "hkdf", 1708 | "lazy_static", 1709 | "num", 1710 | "rand 0.6.5", 1711 | "sha2", 1712 | ] 1713 | 1714 | [[package]] 1715 | name = "security-framework" 1716 | version = "0.4.4" 1717 | source = "registry+https://github.com/rust-lang/crates.io-index" 1718 | checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" 1719 | dependencies = [ 1720 | "bitflags", 1721 | "core-foundation", 1722 | "core-foundation-sys", 1723 | "libc", 1724 | "security-framework-sys", 1725 | ] 1726 | 1727 | [[package]] 1728 | name = "security-framework-sys" 1729 | version = "0.4.3" 1730 | source = "registry+https://github.com/rust-lang/crates.io-index" 1731 | checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" 1732 | dependencies = [ 1733 | "core-foundation-sys", 1734 | "libc", 1735 | ] 1736 | 1737 | [[package]] 1738 | name = "semver" 1739 | version = "0.9.0" 1740 | source = "registry+https://github.com/rust-lang/crates.io-index" 1741 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 1742 | dependencies = [ 1743 | "semver-parser", 1744 | ] 1745 | 1746 | [[package]] 1747 | name = "semver-parser" 1748 | version = "0.7.0" 1749 | source = "registry+https://github.com/rust-lang/crates.io-index" 1750 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 1751 | 1752 | [[package]] 1753 | name = "serde" 1754 | version = "1.0.114" 1755 | source = "registry+https://github.com/rust-lang/crates.io-index" 1756 | checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" 1757 | dependencies = [ 1758 | "serde_derive", 1759 | ] 1760 | 1761 | [[package]] 1762 | name = "serde_derive" 1763 | version = "1.0.114" 1764 | source = "registry+https://github.com/rust-lang/crates.io-index" 1765 | checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" 1766 | dependencies = [ 1767 | "proc-macro2", 1768 | "quote", 1769 | "syn", 1770 | ] 1771 | 1772 | [[package]] 1773 | name = "serde_json" 1774 | version = "1.0.55" 1775 | source = "registry+https://github.com/rust-lang/crates.io-index" 1776 | checksum = "ec2c5d7e739bc07a3e73381a39d61fdb5f671c60c1df26a130690665803d8226" 1777 | dependencies = [ 1778 | "itoa", 1779 | "ryu", 1780 | "serde", 1781 | ] 1782 | 1783 | [[package]] 1784 | name = "serde_urlencoded" 1785 | version = "0.6.1" 1786 | source = "registry+https://github.com/rust-lang/crates.io-index" 1787 | checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" 1788 | dependencies = [ 1789 | "dtoa", 1790 | "itoa", 1791 | "serde", 1792 | "url", 1793 | ] 1794 | 1795 | [[package]] 1796 | name = "sha2" 1797 | version = "0.8.2" 1798 | source = "registry+https://github.com/rust-lang/crates.io-index" 1799 | checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" 1800 | dependencies = [ 1801 | "block-buffer", 1802 | "digest", 1803 | "fake-simd", 1804 | "opaque-debug", 1805 | ] 1806 | 1807 | [[package]] 1808 | name = "slab" 1809 | version = "0.4.2" 1810 | source = "registry+https://github.com/rust-lang/crates.io-index" 1811 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 1812 | 1813 | [[package]] 1814 | name = "socket2" 1815 | version = "0.3.12" 1816 | source = "registry+https://github.com/rust-lang/crates.io-index" 1817 | checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" 1818 | dependencies = [ 1819 | "cfg-if", 1820 | "libc", 1821 | "redox_syscall", 1822 | "winapi 0.3.9", 1823 | ] 1824 | 1825 | [[package]] 1826 | name = "spin" 1827 | version = "0.5.2" 1828 | source = "registry+https://github.com/rust-lang/crates.io-index" 1829 | checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 1830 | 1831 | [[package]] 1832 | name = "standardfile" 1833 | version = "0.2.0" 1834 | dependencies = [ 1835 | "aes", 1836 | "anyhow", 1837 | "block-modes", 1838 | "chrono", 1839 | "data-encoding", 1840 | "rand 0.7.3", 1841 | "rand_chacha 0.2.2", 1842 | "reqwest", 1843 | "ring", 1844 | "serde", 1845 | "serde_json", 1846 | "thiserror", 1847 | "uuid", 1848 | ] 1849 | 1850 | [[package]] 1851 | name = "strsim" 1852 | version = "0.8.0" 1853 | source = "registry+https://github.com/rust-lang/crates.io-index" 1854 | checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" 1855 | 1856 | [[package]] 1857 | name = "structopt" 1858 | version = "0.3.15" 1859 | source = "registry+https://github.com/rust-lang/crates.io-index" 1860 | checksum = "de2f5e239ee807089b62adce73e48c625e0ed80df02c7ab3f068f5db5281065c" 1861 | dependencies = [ 1862 | "clap", 1863 | "lazy_static", 1864 | "structopt-derive", 1865 | ] 1866 | 1867 | [[package]] 1868 | name = "structopt-derive" 1869 | version = "0.4.8" 1870 | source = "registry+https://github.com/rust-lang/crates.io-index" 1871 | checksum = "510413f9de616762a4fbeab62509bf15c729603b72d7cd71280fbca431b1c118" 1872 | dependencies = [ 1873 | "heck", 1874 | "proc-macro-error", 1875 | "proc-macro2", 1876 | "quote", 1877 | "syn", 1878 | ] 1879 | 1880 | [[package]] 1881 | name = "strum" 1882 | version = "0.18.0" 1883 | source = "registry+https://github.com/rust-lang/crates.io-index" 1884 | checksum = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b" 1885 | 1886 | [[package]] 1887 | name = "strum_macros" 1888 | version = "0.18.0" 1889 | source = "registry+https://github.com/rust-lang/crates.io-index" 1890 | checksum = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c" 1891 | dependencies = [ 1892 | "heck", 1893 | "proc-macro2", 1894 | "quote", 1895 | "syn", 1896 | ] 1897 | 1898 | [[package]] 1899 | name = "subtle" 1900 | version = "1.0.0" 1901 | source = "registry+https://github.com/rust-lang/crates.io-index" 1902 | checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" 1903 | 1904 | [[package]] 1905 | name = "syn" 1906 | version = "1.0.33" 1907 | source = "registry+https://github.com/rust-lang/crates.io-index" 1908 | checksum = "e8d5d96e8cbb005d6959f119f773bfaebb5684296108fb32600c00cde305b2cd" 1909 | dependencies = [ 1910 | "proc-macro2", 1911 | "quote", 1912 | "unicode-xid", 1913 | ] 1914 | 1915 | [[package]] 1916 | name = "syn-mid" 1917 | version = "0.5.0" 1918 | source = "registry+https://github.com/rust-lang/crates.io-index" 1919 | checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" 1920 | dependencies = [ 1921 | "proc-macro2", 1922 | "quote", 1923 | "syn", 1924 | ] 1925 | 1926 | [[package]] 1927 | name = "system-deps" 1928 | version = "1.3.1" 1929 | source = "registry+https://github.com/rust-lang/crates.io-index" 1930 | checksum = "80e452a47a990cc127ae1cbb7b687774b1bf5a497351a9f8ff488209e76295ed" 1931 | dependencies = [ 1932 | "heck", 1933 | "pkg-config", 1934 | "strum", 1935 | "strum_macros", 1936 | "thiserror", 1937 | "toml", 1938 | "version-compare", 1939 | ] 1940 | 1941 | [[package]] 1942 | name = "tempfile" 1943 | version = "3.1.0" 1944 | source = "registry+https://github.com/rust-lang/crates.io-index" 1945 | checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" 1946 | dependencies = [ 1947 | "cfg-if", 1948 | "libc", 1949 | "rand 0.7.3", 1950 | "redox_syscall", 1951 | "remove_dir_all", 1952 | "winapi 0.3.9", 1953 | ] 1954 | 1955 | [[package]] 1956 | name = "textwrap" 1957 | version = "0.11.0" 1958 | source = "registry+https://github.com/rust-lang/crates.io-index" 1959 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 1960 | dependencies = [ 1961 | "unicode-width", 1962 | ] 1963 | 1964 | [[package]] 1965 | name = "thiserror" 1966 | version = "1.0.20" 1967 | source = "registry+https://github.com/rust-lang/crates.io-index" 1968 | checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" 1969 | dependencies = [ 1970 | "thiserror-impl", 1971 | ] 1972 | 1973 | [[package]] 1974 | name = "thiserror-impl" 1975 | version = "1.0.20" 1976 | source = "registry+https://github.com/rust-lang/crates.io-index" 1977 | checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" 1978 | dependencies = [ 1979 | "proc-macro2", 1980 | "quote", 1981 | "syn", 1982 | ] 1983 | 1984 | [[package]] 1985 | name = "time" 1986 | version = "0.1.43" 1987 | source = "registry+https://github.com/rust-lang/crates.io-index" 1988 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 1989 | dependencies = [ 1990 | "libc", 1991 | "winapi 0.3.9", 1992 | ] 1993 | 1994 | [[package]] 1995 | name = "tinyvec" 1996 | version = "0.3.3" 1997 | source = "registry+https://github.com/rust-lang/crates.io-index" 1998 | checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" 1999 | 2000 | [[package]] 2001 | name = "tokio" 2002 | version = "0.2.21" 2003 | source = "registry+https://github.com/rust-lang/crates.io-index" 2004 | checksum = "d099fa27b9702bed751524694adbe393e18b36b204da91eb1cbbbbb4a5ee2d58" 2005 | dependencies = [ 2006 | "bytes", 2007 | "fnv", 2008 | "futures-core", 2009 | "iovec", 2010 | "lazy_static", 2011 | "memchr", 2012 | "mio", 2013 | "num_cpus", 2014 | "pin-project-lite", 2015 | "slab", 2016 | ] 2017 | 2018 | [[package]] 2019 | name = "tokio-tls" 2020 | version = "0.3.1" 2021 | source = "registry+https://github.com/rust-lang/crates.io-index" 2022 | checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" 2023 | dependencies = [ 2024 | "native-tls", 2025 | "tokio", 2026 | ] 2027 | 2028 | [[package]] 2029 | name = "tokio-util" 2030 | version = "0.3.1" 2031 | source = "registry+https://github.com/rust-lang/crates.io-index" 2032 | checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" 2033 | dependencies = [ 2034 | "bytes", 2035 | "futures-core", 2036 | "futures-sink", 2037 | "log", 2038 | "pin-project-lite", 2039 | "tokio", 2040 | ] 2041 | 2042 | [[package]] 2043 | name = "toml" 2044 | version = "0.5.6" 2045 | source = "registry+https://github.com/rust-lang/crates.io-index" 2046 | checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" 2047 | dependencies = [ 2048 | "serde", 2049 | ] 2050 | 2051 | [[package]] 2052 | name = "tower-service" 2053 | version = "0.3.0" 2054 | source = "registry+https://github.com/rust-lang/crates.io-index" 2055 | checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" 2056 | 2057 | [[package]] 2058 | name = "try-lock" 2059 | version = "0.2.2" 2060 | source = "registry+https://github.com/rust-lang/crates.io-index" 2061 | checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" 2062 | 2063 | [[package]] 2064 | name = "typenum" 2065 | version = "1.12.0" 2066 | source = "registry+https://github.com/rust-lang/crates.io-index" 2067 | checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" 2068 | 2069 | [[package]] 2070 | name = "unicase" 2071 | version = "2.6.0" 2072 | source = "registry+https://github.com/rust-lang/crates.io-index" 2073 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 2074 | dependencies = [ 2075 | "version_check", 2076 | ] 2077 | 2078 | [[package]] 2079 | name = "unicode-bidi" 2080 | version = "0.3.4" 2081 | source = "registry+https://github.com/rust-lang/crates.io-index" 2082 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 2083 | dependencies = [ 2084 | "matches", 2085 | ] 2086 | 2087 | [[package]] 2088 | name = "unicode-normalization" 2089 | version = "0.1.13" 2090 | source = "registry+https://github.com/rust-lang/crates.io-index" 2091 | checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" 2092 | dependencies = [ 2093 | "tinyvec", 2094 | ] 2095 | 2096 | [[package]] 2097 | name = "unicode-segmentation" 2098 | version = "1.6.0" 2099 | source = "registry+https://github.com/rust-lang/crates.io-index" 2100 | checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" 2101 | 2102 | [[package]] 2103 | name = "unicode-width" 2104 | version = "0.1.8" 2105 | source = "registry+https://github.com/rust-lang/crates.io-index" 2106 | checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" 2107 | 2108 | [[package]] 2109 | name = "unicode-xid" 2110 | version = "0.2.0" 2111 | source = "registry+https://github.com/rust-lang/crates.io-index" 2112 | checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 2113 | 2114 | [[package]] 2115 | name = "untrusted" 2116 | version = "0.7.1" 2117 | source = "registry+https://github.com/rust-lang/crates.io-index" 2118 | checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" 2119 | 2120 | [[package]] 2121 | name = "url" 2122 | version = "2.1.1" 2123 | source = "registry+https://github.com/rust-lang/crates.io-index" 2124 | checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" 2125 | dependencies = [ 2126 | "idna", 2127 | "matches", 2128 | "percent-encoding", 2129 | ] 2130 | 2131 | [[package]] 2132 | name = "uuid" 2133 | version = "0.8.1" 2134 | source = "registry+https://github.com/rust-lang/crates.io-index" 2135 | checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" 2136 | dependencies = [ 2137 | "rand 0.7.3", 2138 | "serde", 2139 | ] 2140 | 2141 | [[package]] 2142 | name = "vcpkg" 2143 | version = "0.2.10" 2144 | source = "registry+https://github.com/rust-lang/crates.io-index" 2145 | checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" 2146 | 2147 | [[package]] 2148 | name = "vec_map" 2149 | version = "0.8.2" 2150 | source = "registry+https://github.com/rust-lang/crates.io-index" 2151 | checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" 2152 | 2153 | [[package]] 2154 | name = "version-compare" 2155 | version = "0.0.10" 2156 | source = "registry+https://github.com/rust-lang/crates.io-index" 2157 | checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" 2158 | 2159 | [[package]] 2160 | name = "version_check" 2161 | version = "0.9.2" 2162 | source = "registry+https://github.com/rust-lang/crates.io-index" 2163 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 2164 | 2165 | [[package]] 2166 | name = "want" 2167 | version = "0.3.0" 2168 | source = "registry+https://github.com/rust-lang/crates.io-index" 2169 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 2170 | dependencies = [ 2171 | "log", 2172 | "try-lock", 2173 | ] 2174 | 2175 | [[package]] 2176 | name = "wasi" 2177 | version = "0.9.0+wasi-snapshot-preview1" 2178 | source = "registry+https://github.com/rust-lang/crates.io-index" 2179 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 2180 | 2181 | [[package]] 2182 | name = "wasm-bindgen" 2183 | version = "0.2.63" 2184 | source = "registry+https://github.com/rust-lang/crates.io-index" 2185 | checksum = "4c2dc4aa152834bc334f506c1a06b866416a8b6697d5c9f75b9a689c8486def0" 2186 | dependencies = [ 2187 | "cfg-if", 2188 | "serde", 2189 | "serde_json", 2190 | "wasm-bindgen-macro", 2191 | ] 2192 | 2193 | [[package]] 2194 | name = "wasm-bindgen-backend" 2195 | version = "0.2.63" 2196 | source = "registry+https://github.com/rust-lang/crates.io-index" 2197 | checksum = "ded84f06e0ed21499f6184df0e0cb3494727b0c5da89534e0fcc55c51d812101" 2198 | dependencies = [ 2199 | "bumpalo", 2200 | "lazy_static", 2201 | "log", 2202 | "proc-macro2", 2203 | "quote", 2204 | "syn", 2205 | "wasm-bindgen-shared", 2206 | ] 2207 | 2208 | [[package]] 2209 | name = "wasm-bindgen-futures" 2210 | version = "0.4.13" 2211 | source = "registry+https://github.com/rust-lang/crates.io-index" 2212 | checksum = "64487204d863f109eb77e8462189d111f27cb5712cc9fdb3461297a76963a2f6" 2213 | dependencies = [ 2214 | "cfg-if", 2215 | "js-sys", 2216 | "wasm-bindgen", 2217 | "web-sys", 2218 | ] 2219 | 2220 | [[package]] 2221 | name = "wasm-bindgen-macro" 2222 | version = "0.2.63" 2223 | source = "registry+https://github.com/rust-lang/crates.io-index" 2224 | checksum = "838e423688dac18d73e31edce74ddfac468e37b1506ad163ffaf0a46f703ffe3" 2225 | dependencies = [ 2226 | "quote", 2227 | "wasm-bindgen-macro-support", 2228 | ] 2229 | 2230 | [[package]] 2231 | name = "wasm-bindgen-macro-support" 2232 | version = "0.2.63" 2233 | source = "registry+https://github.com/rust-lang/crates.io-index" 2234 | checksum = "3156052d8ec77142051a533cdd686cba889537b213f948cd1d20869926e68e92" 2235 | dependencies = [ 2236 | "proc-macro2", 2237 | "quote", 2238 | "syn", 2239 | "wasm-bindgen-backend", 2240 | "wasm-bindgen-shared", 2241 | ] 2242 | 2243 | [[package]] 2244 | name = "wasm-bindgen-shared" 2245 | version = "0.2.63" 2246 | source = "registry+https://github.com/rust-lang/crates.io-index" 2247 | checksum = "c9ba19973a58daf4db6f352eda73dc0e289493cd29fb2632eb172085b6521acd" 2248 | 2249 | [[package]] 2250 | name = "web-sys" 2251 | version = "0.3.40" 2252 | source = "registry+https://github.com/rust-lang/crates.io-index" 2253 | checksum = "7b72fe77fd39e4bd3eaa4412fd299a0be6b3dfe9d2597e2f1c20beb968f41d17" 2254 | dependencies = [ 2255 | "js-sys", 2256 | "wasm-bindgen", 2257 | ] 2258 | 2259 | [[package]] 2260 | name = "winapi" 2261 | version = "0.2.8" 2262 | source = "registry+https://github.com/rust-lang/crates.io-index" 2263 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 2264 | 2265 | [[package]] 2266 | name = "winapi" 2267 | version = "0.3.9" 2268 | source = "registry+https://github.com/rust-lang/crates.io-index" 2269 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2270 | dependencies = [ 2271 | "winapi-i686-pc-windows-gnu", 2272 | "winapi-x86_64-pc-windows-gnu", 2273 | ] 2274 | 2275 | [[package]] 2276 | name = "winapi-build" 2277 | version = "0.1.1" 2278 | source = "registry+https://github.com/rust-lang/crates.io-index" 2279 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 2280 | 2281 | [[package]] 2282 | name = "winapi-i686-pc-windows-gnu" 2283 | version = "0.4.0" 2284 | source = "registry+https://github.com/rust-lang/crates.io-index" 2285 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2286 | 2287 | [[package]] 2288 | name = "winapi-x86_64-pc-windows-gnu" 2289 | version = "0.4.0" 2290 | source = "registry+https://github.com/rust-lang/crates.io-index" 2291 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2292 | 2293 | [[package]] 2294 | name = "winreg" 2295 | version = "0.7.0" 2296 | source = "registry+https://github.com/rust-lang/crates.io-index" 2297 | checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 2298 | dependencies = [ 2299 | "winapi 0.3.9", 2300 | ] 2301 | 2302 | [[package]] 2303 | name = "ws2_32-sys" 2304 | version = "0.2.1" 2305 | source = "registry+https://github.com/rust-lang/crates.io-index" 2306 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 2307 | dependencies = [ 2308 | "winapi 0.2.8", 2309 | "winapi-build", 2310 | ] 2311 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "libs/standardfile", 4 | "cli", 5 | "shell", 6 | ] 7 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 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 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 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 | {project} Copyright (C) {year} {fullname} 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 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Iridium 2 | 3 | Iridium is a [Standard Notes](https://standardnotes.org), local-first client 4 | written in Rust and GTK. It synchronizes with any compliant Standard Notes 5 | server but can work entirely offline as well. 6 | 7 | ![main window](https://i.imgur.com/F2E8KFs.png) 8 | 9 | ## Building from source 10 | 11 | Iridium is written in Rust, so you will need the Rust toolchain. You could use 12 | [rustup](https://rustup.rs) to install update Rust and Cargo. You also need a 13 | few system dependencies, besides the obvious development libraries of GTK you 14 | will need OpenSSL and the `glib-compile-resources` binary. Then build, test and 15 | run with 16 | 17 | $ cargo build --release 18 | $ cargo test --release 19 | $ cargo run --release 20 | 21 | To display logs during execution set the `G_MESSAGES_DEBUG` environment variable 22 | to either `iridium` for application logs or `all` for everything: 23 | 24 | $ G_MESSAGES_DEBUG=iridium cargo run 25 | 26 | ## License 27 | 28 | Iridium is licensed under the GPL, see [LICENSE.txt](LICENSE.txt) for more 29 | information. 30 | -------------------------------------------------------------------------------- /book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | authors = ["Matthias Vogelgesang"] 3 | language = "en" 4 | multilingual = false 5 | src = "docs" 6 | title = "Iridium Documentation" 7 | 8 | [output.html] 9 | additional-css = ["docs/custom.css"] 10 | default-theme = "Rust" 11 | -------------------------------------------------------------------------------- /cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "iridium-cli" 3 | version = "0.2.0" 4 | authors = ["Matthias Vogelgesang"] 5 | edition = "2018" 6 | license = "GPL-3.0-or-later" 7 | 8 | [dependencies] 9 | anyhow = "1.0" 10 | standardfile = { path = "../libs/standardfile" } 11 | structopt = "0" 12 | -------------------------------------------------------------------------------- /cli/src/main.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use standardfile::crypto::Crypto; 3 | use standardfile::remote::Client; 4 | use standardfile::{Credentials, Exported}; 5 | use std::fs::read_to_string; 6 | use std::path::{Path, PathBuf}; 7 | use structopt::StructOpt; 8 | 9 | #[derive(StructOpt)] 10 | enum Command { 11 | Decrypt { 12 | #[structopt(long, parse(from_os_str))] 13 | input: PathBuf, 14 | #[structopt(long)] 15 | password: String, 16 | }, 17 | Signin { 18 | #[structopt(long)] 19 | host: Option, 20 | #[structopt(long)] 21 | identifier: String, 22 | #[structopt(long)] 23 | password: String, 24 | }, 25 | } 26 | 27 | fn decrypt(input: &Path, password: &str) -> Result<()> { 28 | let exported = Exported::from_str(&read_to_string(input)?)?; 29 | let credentials = Credentials::from_exported(&exported, &password); 30 | let crypto = Crypto::new(&credentials)?; 31 | 32 | for item in exported.items { 33 | let decrypted = crypto.decrypt(&item)?; 34 | println!("{}: {}\n{}\n", item.uuid, item.content_type, decrypted); 35 | } 36 | Ok(()) 37 | } 38 | 39 | fn signin(host: Option, identifier: &str, password: &str) -> Result<()> { 40 | let credentials = Credentials::from_defaults(&identifier, &password); 41 | let host = host.unwrap_or(String::from("https://sync.standardnotes.org")); 42 | let _ = Client::new_sign_in(&host, &credentials)?; 43 | Ok(()) 44 | } 45 | 46 | fn main() -> Result<()> { 47 | match Command::from_args() { 48 | Command::Decrypt { input, password } => { 49 | decrypt(&input, &password)?; 50 | } 51 | Command::Signin { 52 | host, 53 | identifier, 54 | password, 55 | } => { 56 | signin(host, &identifier, &password)?; 57 | } 58 | }; 59 | 60 | Ok(()) 61 | } 62 | -------------------------------------------------------------------------------- /docs/SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | [Introduction](./intro.md) 4 | 5 | - [Installation](./installation.md) 6 | - [Usage](./usage.md) 7 | - [Development](./development.md) 8 | -------------------------------------------------------------------------------- /docs/custom.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-family: "Source Sans Pro", "Open Sans", sans-serif; 3 | } 4 | 5 | body { 6 | font-size: 2.2rem; 7 | } 8 | 9 | kbd { 10 | padding: 0.0em 0.4em; 11 | border: 1px solid #ccc; 12 | font-size: 0.9em; 13 | background-color: #f7f7f7; 14 | -moz-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2); 15 | -webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2); 16 | box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2); 17 | -moz-border-radius: 4px; 18 | -webkit-border-radius: 4px; 19 | border-radius: 4px; 20 | display: inline-block; 21 | line-height: 1.4; 22 | } 23 | -------------------------------------------------------------------------------- /docs/development.md: -------------------------------------------------------------------------------- 1 | # Development 2 | -------------------------------------------------------------------------------- /docs/installation.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | -------------------------------------------------------------------------------- /docs/intro.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Iridium is a [Standard Notes](https://standardnotes.org) client written in Rust 4 | and GTK. It synchronizes with any compliant Standard Notes server but can work 5 | entirely offline as well. 6 | -------------------------------------------------------------------------------- /docs/usage.md: -------------------------------------------------------------------------------- 1 | # Usage 2 | 3 | The main application is split into two panes: a list of notes on the left hand 4 | side and the title and content of the currently selected note on the right hand 5 | side. The right pane is empty if there are is no note to select. 6 | 7 | ## Adding a note 8 | 9 | To add a new note press the + button in the upper left corner. Your 10 | cursor focus will switch to the title entry box which you might want to fill out 11 | first, so you can identify the note in the list box. 12 | 13 | ## Deleting a note 14 | 15 | To delete a note, first select it in the list with a left mouse click, press 16 | right click to open the popup menu and choose delete. Once a note has been 17 | delete it cannot be recovered. 18 | -------------------------------------------------------------------------------- /libs/standardfile/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "standardfile" 3 | version = "0.2.0" 4 | authors = ["Matthias Vogelgesang"] 5 | edition = "2018" 6 | license = "LGPL-3.0" 7 | 8 | [dependencies] 9 | anyhow = "1.0" 10 | aes = "0.3.2" 11 | block-modes = "0.3.3" 12 | chrono = { version = "0.4", features = ["serde"] } 13 | data-encoding = "2.2.0" 14 | uuid = { version = "0.8", features = ["serde", "v4"] } 15 | rand = "0.7" 16 | rand_chacha = "0.2" 17 | ring = "0.16" 18 | reqwest = { version = "0.10", features = ["json", "blocking", "gzip"] } 19 | serde = { version = "1.0", features = ["derive"] } 20 | serde_json = "1.0" 21 | thiserror = "1.0" 22 | -------------------------------------------------------------------------------- /libs/standardfile/src/crypto.rs: -------------------------------------------------------------------------------- 1 | use crate::{Envelope, Credentials, CryptoError}; 2 | use aes::Aes256; 3 | use block_modes::block_padding::Pkcs7; 4 | use block_modes::{BlockMode, Cbc}; 5 | use data_encoding::{BASE64, HEXLOWER}; 6 | use rand::prelude::*; 7 | use ring::{digest, hmac, error}; 8 | use std::str; 9 | use std::num::NonZeroU32; 10 | use uuid::Uuid; 11 | 12 | pub type Key = [u8; 768 / 8 / 3]; 13 | 14 | pub struct Crypto { 15 | pw: Key, 16 | mk: Key, 17 | ak: Key, 18 | } 19 | 20 | pub struct Encrypted { 21 | pub content: String, 22 | pub enc_item_key: String, 23 | } 24 | 25 | type Aes256Cbc = Cbc; 26 | 27 | fn decrypt(s: &str, ek: &Key, ak: &Key, check_uuid: &Uuid) -> Result { 28 | let s: Vec<&str> = s.split(':').collect(); 29 | let version = s[0]; 30 | let auth_hash = s[1]; 31 | let uuid = Uuid::parse_str(s[2])?; 32 | let iv = s[3]; 33 | let ciphertext = s[4]; 34 | 35 | if version != "003" { 36 | return Err(CryptoError::UnsupportedScheme(version.to_string())); 37 | } 38 | 39 | if &uuid != check_uuid { 40 | return Err(CryptoError::UuidMismatch); 41 | } 42 | 43 | let to_auth = std::format!("003:{}:{}:{}", uuid, iv, ciphertext); 44 | let auth_hash_bytes = HEXLOWER.decode(&auth_hash.as_bytes())?; 45 | let key = hmac::Key::new(hmac::HMAC_SHA256, ak); 46 | 47 | if let Err(error::Unspecified) = hmac::verify(&key, to_auth.as_bytes(), &auth_hash_bytes) { 48 | return Err(CryptoError::Verification); 49 | }; 50 | 51 | let iv_bytes = HEXLOWER.decode(iv.as_bytes())?; 52 | let cipher = Aes256Cbc::new_var(ek, &iv_bytes)?; 53 | let ciphertext_bytes = BASE64.decode(ciphertext.as_bytes())?; 54 | let decrypted = cipher.decrypt_vec(ciphertext_bytes.as_ref())?; 55 | Ok(str::from_utf8(decrypted.as_ref())?.to_string()) 56 | } 57 | 58 | fn encrypt(s: &str, ek: &Key, ak: &Key, uuid: &Uuid) -> Result { 59 | let mut rng = rand_chacha::ChaCha20Rng::from_entropy(); 60 | let mut iv_bytes = [0u8; 16]; 61 | rng.fill_bytes(&mut iv_bytes); 62 | 63 | let uuid_encoded = uuid.to_hyphenated_ref(); 64 | let cipher = Aes256Cbc::new_var(ek, &iv_bytes)?; 65 | let encrypted = cipher.encrypt_vec(s.as_ref()); 66 | let encrypted_encoded = BASE64.encode(encrypted.as_slice()); 67 | let iv_encoded = HEXLOWER.encode(iv_bytes.as_ref()); 68 | let to_auth = std::format!("003:{}:{}:{}", uuid_encoded, iv_encoded, encrypted_encoded); 69 | let key = hmac::Key::new(hmac::HMAC_SHA256, ak.as_ref()); 70 | let to_auth_bytes = to_auth.as_bytes(); 71 | let auth_hash_bytes = hmac::sign(&key, to_auth_bytes); 72 | let auth_hash = HEXLOWER.encode(auth_hash_bytes.as_ref()); 73 | 74 | Ok(std::format!( 75 | "003:{}:{}:{}:{}", 76 | auth_hash, 77 | uuid_encoded, 78 | iv_encoded, 79 | encrypted_encoded 80 | )) 81 | } 82 | 83 | /// Create random nonce. 84 | pub fn make_nonce() -> String { 85 | let mut rng = rand_chacha::ChaCha20Rng::from_entropy(); 86 | let mut nonce = [0u8; 32]; 87 | rng.fill_bytes(&mut nonce); 88 | HEXLOWER.encode(nonce.as_ref()) 89 | } 90 | 91 | impl Crypto { 92 | pub fn new(credentials: &Credentials) -> Result { 93 | let cost = NonZeroU32::new(credentials.cost).ok_or(CryptoError::InvalidCost)?; 94 | let salt_input = std::format!("{}:SF:003:{}:{}", credentials.identifier, credentials.cost, credentials.nonce); 95 | let salt = digest::digest(&digest::SHA256, salt_input.as_bytes()); 96 | let hex_salt = HEXLOWER.encode(salt.as_ref()); 97 | let mut hashed = [0u8; 768 / 8]; 98 | 99 | ring::pbkdf2::derive( 100 | ring::pbkdf2::PBKDF2_HMAC_SHA512, 101 | cost, 102 | &hex_salt.as_bytes(), 103 | credentials.password.as_bytes(), 104 | &mut hashed, 105 | ); 106 | 107 | let mut pw: Key = [0u8; 32]; 108 | let mut mk: Key = [0u8; 32]; 109 | let mut ak: Key = [0u8; 32]; 110 | 111 | pw.clone_from_slice(&hashed[0..32]); 112 | mk.clone_from_slice(&hashed[32..64]); 113 | ak.clone_from_slice(&hashed[64..]); 114 | 115 | Ok(Crypto { pw: pw, mk: mk, ak: ak }) 116 | } 117 | 118 | pub fn password(&self) -> String { 119 | HEXLOWER.encode(&self.pw) 120 | } 121 | 122 | pub fn decrypt(&self, item: &Envelope) -> Result { 123 | if item.enc_item_key.is_none() || item.content.is_none() { 124 | return Err(CryptoError::NoKey); 125 | } 126 | 127 | let enc_item_key = item.enc_item_key.as_ref().ok_or(CryptoError::NoKey)?; 128 | let content = item.content.as_ref().ok_or(CryptoError::NoContent)?; 129 | let item_key = decrypt(&enc_item_key, &self.mk, &self.ak, &item.uuid)?; 130 | let mut item_ek: Key = [0; 32]; 131 | let mut item_ak: Key = [0; 32]; 132 | 133 | HEXLOWER 134 | .decode_mut(item_key[..64].as_bytes(), &mut item_ek) 135 | .expect("foo"); 136 | HEXLOWER 137 | .decode_mut(item_key[64..].as_bytes(), &mut item_ak) 138 | .expect("foo"); 139 | 140 | Ok(decrypt(&content, &item_ek, &item_ak, &item.uuid)?) 141 | } 142 | 143 | pub fn encrypt(&self, content: &str, uuid: &Uuid) -> Result { 144 | let mut rng = rand_chacha::ChaCha20Rng::from_entropy(); 145 | let mut item_key = [0u8; 64]; 146 | rng.fill_bytes(&mut item_key); 147 | 148 | let mut item_ek: Key = [0; 32]; 149 | let mut item_ak: Key = [0; 32]; 150 | 151 | item_ek.clone_from_slice(&item_key[..32]); 152 | item_ak.clone_from_slice(&item_key[32..]); 153 | 154 | let mut iv_bytes = [0u8; 16]; 155 | rng.fill_bytes(&mut iv_bytes); 156 | 157 | let item_key_encoded = HEXLOWER.encode(item_key.as_ref()); 158 | 159 | Ok(Encrypted { 160 | content: encrypt(content, &item_ek, &item_ak, &uuid)?, 161 | enc_item_key: encrypt(item_key_encoded.as_ref(), &self.mk, &self.ak, &uuid)?, 162 | }) 163 | } 164 | } 165 | 166 | #[cfg(test)] 167 | mod tests { 168 | use super::*; 169 | use crate::{Note, Item}; 170 | use chrono::Utc; 171 | 172 | #[test] 173 | fn test_encrypt_decrypt() { 174 | let now = Utc::now(); 175 | let uuid = Uuid::new_v4(); 176 | 177 | let note = Note { 178 | title: "Title".to_owned(), 179 | text: "Text".to_owned(), 180 | created_at: now, 181 | updated_at: now, 182 | uuid: uuid, 183 | }; 184 | 185 | let nonce = "3f8ea1ffd8067c1550ca3ad78de71c9b6e68b5cb540e370c12065eca15d9a049"; 186 | let credentials = Credentials { 187 | identifier: "foo@bar.com".to_string(), 188 | cost: 110000, 189 | nonce: nonce.to_string(), 190 | password: "secret".to_string(), 191 | }; 192 | let crypto = Crypto::new(&credentials).unwrap(); 193 | 194 | let item = Item::Note(note); 195 | let encrypted = item.encrypt(&crypto).unwrap(); 196 | let decrypted = encrypted.decrypt(&crypto).unwrap(); 197 | 198 | assert!(matches!(decrypted, Item::Note { .. })); 199 | 200 | match decrypted { 201 | Item::Note(decrypted) => { 202 | assert_eq!(decrypted.title, "Title"); 203 | assert_eq!(decrypted.text, "Text"); 204 | }, 205 | _ => {} 206 | }; 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /libs/standardfile/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![forbid(unsafe_code)] 2 | 3 | use anyhow::Result; 4 | use block_modes::{BlockModeError, InvalidKeyIvLength}; 5 | use chrono::{DateTime, Utc}; 6 | use data_encoding::DecodeError; 7 | use uuid::Uuid; 8 | use serde::{Serialize, Deserialize}; 9 | use thiserror::Error; 10 | use std::str::Utf8Error; 11 | 12 | pub mod crypto; 13 | pub mod remote; 14 | 15 | #[derive(Serialize, Deserialize, Debug)] 16 | pub struct Envelope { 17 | pub uuid: Uuid, 18 | pub content: Option, 19 | pub content_type: String, 20 | pub enc_item_key: Option, 21 | pub created_at: DateTime, 22 | pub updated_at: DateTime, 23 | pub deleted: Option, 24 | } 25 | 26 | #[derive(Serialize, Deserialize)] 27 | pub struct AuthParams { 28 | pub identifier: String, 29 | pub pw_cost: u32, 30 | pub pw_nonce: String, 31 | pub version: String, 32 | } 33 | 34 | #[derive(Serialize, Deserialize)] 35 | pub struct Exported { 36 | #[serde(rename = "keyParams")] 37 | pub auth_params: AuthParams, 38 | pub items: Vec, 39 | } 40 | 41 | #[derive(Serialize, Deserialize)] 42 | struct NoteContent { 43 | pub title: Option, 44 | pub text: String, 45 | } 46 | 47 | #[derive(Serialize, Deserialize)] 48 | pub struct Reference { 49 | pub uuid: Uuid, 50 | pub content_type: String, 51 | } 52 | 53 | #[derive(Serialize, Deserialize)] 54 | struct TagContent { 55 | pub title: String, 56 | pub references: Vec, 57 | } 58 | 59 | pub struct Note { 60 | pub title: String, 61 | pub text: String, 62 | pub created_at: DateTime, 63 | pub updated_at: DateTime, 64 | pub uuid: Uuid, 65 | } 66 | 67 | pub struct Tag { 68 | pub title: String, 69 | pub references: Vec, 70 | pub created_at: DateTime, 71 | pub updated_at: DateTime, 72 | pub uuid: Uuid, 73 | } 74 | 75 | pub enum Item { 76 | Note(Note), 77 | Tag(Tag), 78 | } 79 | 80 | #[derive(Error, Debug)] 81 | pub enum CryptoError { 82 | #[error("cost must be more than zero")] 83 | InvalidCost, 84 | #[error("no key given")] 85 | NoKey, 86 | #[error("no encrypted content given")] 87 | NoContent, 88 | #[error("unknown item content type `{0}'")] 89 | UnknownContentType(String), 90 | #[error("unsupported encryption scheme {0}")] 91 | UnsupportedScheme(String), 92 | #[error("uuid mismatch")] 93 | UuidMismatch, 94 | #[error("uuid decode error")] 95 | UuidDecode(#[from] uuid::Error), 96 | #[error("verification issue")] 97 | Verification, 98 | #[error("block mode error")] 99 | BlockMode(#[from] BlockModeError), 100 | #[error("iv length error")] 101 | IvLength(#[from] InvalidKeyIvLength), 102 | #[error("decode error")] 103 | Decode(#[from] DecodeError), 104 | #[error(transparent)] 105 | Other(#[from] anyhow::Error), 106 | #[error("utf8 decode error")] 107 | Utf8Decode(#[from] Utf8Error), 108 | } 109 | 110 | /// Authentication parameters constructed locally, from a remote server or an imported file and 111 | /// passed to construct the crypto used in the storage. 112 | #[derive(Clone)] 113 | pub struct Credentials { 114 | pub identifier: String, 115 | pub cost: u32, 116 | pub nonce: String, 117 | pub password: String, 118 | } 119 | 120 | impl AuthParams { 121 | pub fn from_credentials(credentials: &Credentials) -> Self { 122 | Self { 123 | identifier: credentials.identifier.clone(), 124 | pw_cost: credentials.cost, 125 | pw_nonce: credentials.nonce.clone(), 126 | version: "003".to_string(), 127 | } 128 | } 129 | } 130 | 131 | impl Envelope { 132 | /// Deserialize Envelope from JSON string. 133 | pub fn from_str(s: &str) -> Result { 134 | Ok(serde_json::from_str(s)?) 135 | } 136 | 137 | /// Serialize Envelope as JSON string. 138 | pub fn to_string(&self) -> Result { 139 | Ok(serde_json::to_string(&self)?) 140 | } 141 | 142 | /// Decrypt Envelope to an Item. 143 | pub fn decrypt(&self, crypto: &crypto::Crypto) -> Result { 144 | if self.content_type == "Note" { 145 | Ok(Note::decrypt(crypto, &self)?) 146 | } 147 | else if self.content_type == "Tag" { 148 | Ok(Tag::decrypt(crypto, &self)?) 149 | } 150 | else { 151 | Err(CryptoError::UnknownContentType(self.content_type.clone())) 152 | } 153 | } 154 | } 155 | 156 | impl Item { 157 | /// Encrypt Item to an Envelope. 158 | pub fn encrypt(&self, crypto: &crypto::Crypto) -> Result { 159 | match self { 160 | Item::Note(note) => note.encrypt(crypto), 161 | Item::Tag(tag) => tag.encrypt(crypto), 162 | } 163 | } 164 | 165 | /// Get uuid. 166 | pub fn uuid(&self) -> Uuid { 167 | match self { 168 | Item::Note(note) => note.uuid, 169 | Item::Tag(tag) => tag.uuid, 170 | } 171 | } 172 | } 173 | 174 | impl Exported { 175 | /// Deserialize Exported from JSON string. 176 | pub fn from_str(s: &str) -> Result { 177 | Ok(serde_json::from_str(s)?) 178 | } 179 | 180 | pub fn to_str(&self) -> Result { 181 | Ok(serde_json::to_string(&self)?) 182 | } 183 | } 184 | 185 | impl Credentials { 186 | pub fn from_exported(exported: &Exported, password: &str) -> Self { 187 | Self { 188 | identifier: exported.auth_params.identifier.clone(), 189 | cost: exported.auth_params.pw_cost, 190 | nonce: exported.auth_params.pw_nonce.clone(), 191 | password: password.to_string(), 192 | } 193 | } 194 | 195 | pub fn from_defaults(identifier: &str, password: &str) -> Self { 196 | Self { 197 | identifier: identifier.to_string(), 198 | cost: 110000, 199 | nonce: crypto::make_nonce(), 200 | password: password.to_string(), 201 | } 202 | } 203 | } 204 | 205 | impl Note { 206 | fn encrypt(&self, crypto: &crypto::Crypto) -> Result { 207 | let content = NoteContent { 208 | title: Some(self.title.clone()), 209 | text: self.text.clone(), 210 | }; 211 | 212 | let to_encrypt = serde_json::to_string(&content)?; 213 | let encrypted = crypto.encrypt(&to_encrypt, &self.uuid)?; 214 | 215 | Ok(Envelope { 216 | uuid: self.uuid, 217 | content: Some(encrypted.content), 218 | content_type: "Note".to_owned(), 219 | enc_item_key: Some(encrypted.enc_item_key), 220 | created_at: self.created_at, 221 | updated_at: self.updated_at, 222 | deleted: Some(false), 223 | }) 224 | } 225 | 226 | fn decrypt(crypto: &crypto::Crypto, item: &Envelope) -> Result { 227 | let decrypted = crypto.decrypt(item)?; 228 | let content = serde_json::from_str::(&decrypted)?; 229 | 230 | Ok(Item::Note(Note { 231 | title: content.title.unwrap_or("".to_string()), 232 | text: content.text, 233 | created_at: item.created_at, 234 | updated_at: item.updated_at, 235 | uuid: item.uuid, 236 | })) 237 | } 238 | } 239 | 240 | impl Tag { 241 | fn encrypt(&self, crypto: &crypto::Crypto) -> Result { 242 | let content = TagContent { 243 | title: self.title.clone(), 244 | references: self.references 245 | .iter() 246 | .map(|uuid| Reference { 247 | uuid: uuid.clone(), 248 | content_type: "Note".to_string(), 249 | }) 250 | .collect::<_>() 251 | }; 252 | 253 | let to_encrypt = serde_json::to_string(&content)?; 254 | let encrypted = crypto.encrypt(&to_encrypt, &self.uuid)?; 255 | 256 | Ok(Envelope { 257 | uuid: self.uuid, 258 | content: Some(encrypted.content), 259 | content_type: "Note".to_owned(), 260 | enc_item_key: Some(encrypted.enc_item_key), 261 | created_at: self.created_at, 262 | updated_at: self.updated_at, 263 | deleted: Some(false), 264 | }) 265 | } 266 | 267 | fn decrypt(crypto: &crypto::Crypto, item: &Envelope) -> Result { 268 | let decrypted = crypto.decrypt(item)?; 269 | let content = serde_json::from_str::(&decrypted)?; 270 | let references = content.references 271 | .iter() 272 | .map(|reference| reference.uuid) 273 | .collect::<_>(); 274 | 275 | Ok(Item::Tag(Tag { 276 | title: content.title, 277 | references: references, 278 | created_at: item.created_at, 279 | updated_at: item.updated_at, 280 | uuid: item.uuid, 281 | })) 282 | } 283 | } 284 | -------------------------------------------------------------------------------- /libs/standardfile/src/remote.rs: -------------------------------------------------------------------------------- 1 | use super::{Credentials, Envelope, crypto::Crypto}; 2 | use anyhow::{anyhow, Result}; 3 | use reqwest::{StatusCode, blocking::Response, header::{HeaderMap, HeaderValue, CONTENT_TYPE}}; 4 | use serde::{Serialize, Deserialize}; 5 | use uuid::Uuid; 6 | 7 | #[derive(Deserialize)] 8 | pub struct AuthParamsResponse { 9 | pub pw_cost: u32, 10 | pub pw_nonce: String, 11 | pub version: String, 12 | } 13 | 14 | #[derive(Deserialize)] 15 | struct User { 16 | pub uuid: Uuid, 17 | pub email: String, 18 | } 19 | 20 | #[derive(Deserialize)] 21 | struct ErrorResponse { 22 | pub errors: Vec, 23 | } 24 | 25 | #[derive(Serialize)] 26 | struct RegistrationRequest { 27 | pub email: String, 28 | pub password: String, 29 | pub pw_cost: u32, 30 | pub pw_nonce: String, 31 | pub version: String, 32 | } 33 | 34 | #[derive(Serialize)] 35 | struct SignInRequest { 36 | pub email: String, 37 | pub password: String, 38 | } 39 | 40 | #[derive(Deserialize)] 41 | struct SignInResponse { 42 | pub user: User, 43 | pub token: String, 44 | } 45 | 46 | #[derive(Serialize)] 47 | struct SyncRequest { 48 | pub items: Vec, 49 | pub sync_token: Option, 50 | pub cursor_token: Option, 51 | } 52 | 53 | #[derive(Deserialize, Debug)] 54 | struct SyncResponse { 55 | pub retrieved_items: Vec, 56 | pub saved_items: Vec, 57 | pub unsaved: Option>, 58 | pub sync_token: Option, 59 | pub cursor_token: Option, 60 | } 61 | 62 | pub struct Client { 63 | host: String, 64 | pub credentials: Credentials, 65 | client: reqwest::blocking::Client, 66 | auth_token: String, 67 | sync_token: Option, 68 | } 69 | 70 | fn get_token_from_signin_response(response: Response) -> Result { 71 | match response.status() { 72 | StatusCode::OK => { 73 | let response = response.json::()?; 74 | Ok(response.token) 75 | } 76 | _ => { 77 | let response = response.json::()?; 78 | Err(anyhow!("{}", response.errors[0])) 79 | } 80 | } 81 | } 82 | 83 | impl Client { 84 | /// Create client by registering a new user 85 | pub fn new_register(host: &str, credentials: Credentials) -> Result { 86 | let crypto = Crypto::new(&credentials)?; 87 | let encoded_pw = crypto.password(); 88 | 89 | let request = RegistrationRequest { 90 | email: credentials.identifier.to_string(), 91 | password: encoded_pw, 92 | pw_cost: credentials.cost, 93 | pw_nonce: credentials.nonce.clone(), 94 | version: "003".to_string(), 95 | }; 96 | 97 | let url = format!("{}/auth", host); 98 | let client = reqwest::blocking::Client::new(); 99 | let response = client.post(&url).json(&request).send()?; 100 | 101 | Ok(Self { 102 | host: host.to_string(), 103 | credentials: credentials, 104 | client: client, 105 | auth_token: get_token_from_signin_response(response)?, 106 | sync_token: None, 107 | }) 108 | } 109 | 110 | /// Create client by signing in. 111 | pub fn new_sign_in(host: &str, credentials: &Credentials) -> Result { 112 | let client = reqwest::blocking::Client::new(); 113 | 114 | let url = format!("{}/auth/params?email={}", host, credentials.identifier); 115 | let response = client.get(&url).send()?.json::()?; 116 | 117 | let mut credentials = credentials.clone(); 118 | credentials.cost = response.pw_cost; 119 | credentials.nonce = response.pw_nonce; 120 | 121 | let crypto = Crypto::new(&credentials)?; 122 | let encoded_pw = crypto.password(); 123 | 124 | let request = SignInRequest { 125 | email: credentials.identifier.clone(), 126 | password: encoded_pw, 127 | }; 128 | 129 | let url = format!("{}/auth/sign_in", host); 130 | let response = client.post(&url).json(&request).send()?; 131 | 132 | Ok(Self { 133 | host: host.to_string(), 134 | credentials: credentials, 135 | client: client, 136 | auth_token: get_token_from_signin_response(response)?, 137 | sync_token: None, 138 | }) 139 | } 140 | 141 | pub fn sync(&mut self, items: Vec) -> Result> { 142 | let url = format!("{}/items/sync", &self.host); 143 | let mut headers = HeaderMap::new(); 144 | headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); 145 | 146 | let sync_request = SyncRequest { 147 | items: items, 148 | sync_token: self.sync_token.clone(), 149 | cursor_token: None, 150 | }; 151 | 152 | let response = self.client 153 | .post(&url) 154 | .headers(headers) 155 | .bearer_auth(&self.auth_token) 156 | .body(serde_json::to_string(&sync_request)?) 157 | .send()? 158 | .json::()?; 159 | 160 | self.sync_token = response.sync_token; 161 | Ok(response.retrieved_items) 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /shell/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "iridium" 3 | version = "0.2.0" 4 | authors = ["Matthias Vogelgesang"] 5 | edition = "2018" 6 | license = "GPL-3.0-or-later" 7 | 8 | [dependencies] 9 | anyhow = "1.0" 10 | chrono = { version = "0.4" } 11 | data-encoding = "2.2.0" 12 | directories = "3" 13 | gtk = { version = "0.9", features = ["v3_22"] } 14 | glib = "0.10" 15 | gio = { version = "0.9", features = ["v2_46"] } 16 | gdk = "0.13" 17 | ring = "0.16" 18 | secret-service = "1.0" 19 | serde = { version = "1.0", features = ["derive"] } 20 | standardfile = { path = "../libs/standardfile" } 21 | toml = "0.5" 22 | uuid = { version = "0.8", features = ["serde", "v4"] } 23 | -------------------------------------------------------------------------------- /shell/build.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use std::path::Path; 3 | use std::process::Command; 4 | 5 | fn main() { 6 | let out_dir = env::var_os("OUT_DIR").unwrap(); 7 | let out_path = Path::new(&out_dir).join("resources.gresource"); 8 | 9 | let args = [ 10 | format!("--target={}", out_path.display()), 11 | "data/resources.gresource.xml".to_string(), 12 | ]; 13 | 14 | Command::new("glib-compile-resources") 15 | .args(&args) 16 | .output() 17 | .unwrap(); 18 | 19 | println!("cargo:rerun-if-changed=build.rs"); 20 | println!("cargo:rerun-if-changed=data/resources.gresource.xml"); 21 | println!("cargo:rerun-if-changed=data/resources/css/base.css"); 22 | println!("cargo:rerun-if-changed=data/resources/ui/about.ui"); 23 | println!("cargo:rerun-if-changed=data/resources/ui/import.ui"); 24 | println!("cargo:rerun-if-changed=data/resources/ui/shortcuts.ui"); 25 | println!("cargo:rerun-if-changed=data/resources/ui/window.ui"); 26 | } 27 | -------------------------------------------------------------------------------- /shell/data/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | data/resources/css/base.css 5 | data/resources/ui/about.ui 6 | data/resources/ui/import.ui 7 | data/resources/ui/shortcuts.ui 8 | data/resources/ui/window.ui 9 | 10 | 11 | -------------------------------------------------------------------------------- /shell/data/resources/css/base.css: -------------------------------------------------------------------------------- 1 | #iridium-entry-box { 2 | background-color: white; 3 | } 4 | 5 | #iridium-title-entry { 6 | border: none; 7 | font-family: 'JetBrains Mono', 'Fira Mono', monospace; 8 | font-weight: bold; 9 | } 10 | 11 | #iridium-tag-entry { 12 | border: none; 13 | font-family: 'JetBrains Mono', 'Fira Mono', monospace; 14 | } 15 | 16 | #iridium-text-view { 17 | background-color: transparent; 18 | font-family: 'JetBrains Mono', 'Fira Mono', monospace; 19 | } 20 | 21 | #iridium-note-row { 22 | border-bottom: 1px solid #ddd; /* non-theme-dependent? */ 23 | } 24 | 25 | #iridium-note-row-label { 26 | font-weight: 600; 27 | } 28 | -------------------------------------------------------------------------------- /shell/data/resources/ui/about.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | False 6 | True 7 | dialog 8 | Iridium 9 | https://github.com/matze/iridium 10 | Matthias Vogelgesang 11 | translator-credits 12 | gpl-3-0 13 | 14 | 15 | 16 | 17 | 18 | False 19 | vertical 20 | 2 21 | 22 | 23 | False 24 | end 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | False 34 | False 35 | 0 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /shell/data/resources/ui/import.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Import 6 | 1 7 | 8 | 9 | GTK_ALIGN_CENTER 10 | GTK_ALIGN_CENTER 11 | 12 | 13 | True 14 | 48 15 | 12 16 | 17 | 18 | True 19 | True 20 | 21 | 22 | 0 23 | 0 24 | 2 25 | 26 | 27 | 28 | 29 | True 30 | False 31 | Password 32 | dialog-password-symbolic 33 | True 34 | 35 | 36 | 0 37 | 1 38 | 2 39 | 40 | 41 | 42 | 43 | True 44 | True 45 | True 46 | 47 | https://sync.standardnotes.org 48 | 49 | 50 | 51 | 0 52 | 2 53 | 54 | 55 | 56 | 57 | True 58 | False 59 | GTK_ALIGN_START 60 | GTK_ALIGN_CENTER 61 | 12 62 | 63 | 64 | 1 65 | 2 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | True 75 | Cancel 76 | 77 | 78 | 79 | 80 | True 81 | True 82 | Import 83 | 84 | 85 | 86 | import-button-cancel 87 | import-button-okay 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /shell/data/resources/ui/shortcuts.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | 6 | 7 | True 8 | shortcuts 9 | 10 10 | 11 | 12 | True 13 | General 14 | 15 | 16 | True 17 | Show Shortcuts 18 | <Primary>question 19 | 20 | 21 | 22 | 23 | True 24 | Search 25 | <Primary>F 26 | 27 | 28 | 29 | 30 | True 31 | Quit 32 | <Primary>Q 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /shell/data/resources/ui/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | False 7 | appmenu-button 8 | 9 | 10 | True 11 | False 12 | 10 13 | vertical 14 | 15 | 16 | True 17 | True 18 | False 19 | profiles 20 | Profiles 21 | 22 | 23 | False 24 | True 25 | 4 26 | 27 | 28 | 29 | 30 | True 31 | False 32 | 33 | 34 | False 35 | True 36 | 5 37 | 38 | 39 | 40 | 41 | True 42 | True 43 | False 44 | win.show-help-overlay 45 | Keyboard Shortcuts 46 | 47 | 48 | False 49 | True 50 | 6 51 | 52 | 53 | 54 | 55 | True 56 | True 57 | False 58 | app.about 59 | About Iridium 60 | 61 | 62 | False 63 | True 64 | 7 65 | 66 | 67 | 68 | 69 | main 70 | 71 | 72 | 73 | 74 | True 75 | False 76 | 10 77 | vertical 78 | 79 | 80 | True 81 | True 82 | False 83 | True 84 | True 85 | main 86 | Profiles 87 | 88 | 89 | False 90 | True 91 | 1 92 | 93 | 94 | 95 | 96 | True 97 | True 98 | False 99 | app.setup 100 | New … 101 | 102 | 103 | False 104 | True 105 | 2 106 | 107 | 108 | 109 | 110 | True 111 | True 112 | False 113 | app.import 114 | Import … 115 | 116 | 117 | False 118 | True 119 | 3 120 | 121 | 122 | 123 | 124 | True 125 | True 126 | False 127 | app.export 128 | Export … 129 | 130 | 131 | False 132 | True 133 | 4 134 | 135 | 136 | 137 | 138 | True 139 | False 140 | 141 | 142 | False 143 | True 144 | 5 145 | 146 | 147 | 148 | 149 | profiles 150 | 151 | 152 | 153 | 154 | False 155 | 156 | 157 | True 158 | False 159 | 10 160 | vertical 161 | 162 | 163 | True 164 | True 165 | False 166 | app.delete 167 | Delete 168 | 169 | 170 | 171 | 172 | main 173 | 174 | 175 | 176 | 177 | True 178 | False 179 | list-add-symbolic 180 | 181 | 182 | False 183 | 800 184 | 400 185 | 186 | 187 | True 188 | False 189 | Iridium 190 | True 191 | 192 | 193 | False 194 | True 195 | app.add 196 | add-note-icon 197 | 198 | 199 | start 200 | 201 | 202 | 203 | 204 | False 205 | True 206 | True 207 | app_menu 208 | 209 | 210 | True 211 | False 212 | open-menu-symbolic 213 | 214 | 215 | 216 | 217 | end 218 | 219 | 220 | 221 | 222 | 223 | 224 | True 225 | 226 | 227 | True 228 | start 229 | center 230 | 231 | 232 | True 233 | 236 | 237 | 238 | True 239 | 240 | 241 | True 242 | 243 | 244 | 245 | 246 | 247 | 248 | False 249 | True 250 | 251 | 252 | 253 | 254 | True 255 | none 256 | 6 257 | 258 | 259 | True 260 | window-close-symbolic 261 | 264 | 265 | 266 | 267 | 268 | end 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | True 280 | GTK_STACK_TRANSITION_TYPE_SLIDE_UP 281 | 282 | 283 | 284 | True 285 | GTK_ALIGN_CENTER 286 | GTK_ALIGN_CENTER 287 | GTK_ORIENTATION_VERTICAL 288 | 48 289 | 280 290 | 12 291 | 292 | 293 | True 294 | Identification 295 | GTK_ALIGN_START 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | True 304 | GTK_ALIGN_START 305 | 6 306 | True 307 | 50 308 | 0 309 | Keep your password somewhere safe. If you lose it, there is no way to recover notes encrypted with it. 310 | 311 | 312 | 313 | 314 | True 315 | Identifier 316 | avatar-default-symbolic 317 | True 318 | 319 | 320 | 321 | 322 | True 323 | False 324 | Password 325 | dialog-password-symbolic 326 | True 327 | 328 | 329 | 330 | 331 | True 332 | Create 333 | GTK_ALIGN_START 334 | 6 335 | 336 | 337 | 338 | 339 | True 340 | Synchronization 341 | GTK_ALIGN_START 342 | 24 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | True 351 | GTK_ALIGN_START 352 | 6 353 | True 354 | 50 355 | 0 356 | Log in to or sign up with a Standard Notes server. Use the dropdown menu to choose one of the public servers. 357 | 358 | 359 | 360 | 361 | True 362 | True 363 | True 364 | 365 | https://sync.standardnotes.org 366 | 367 | 368 | 369 | 370 | 371 | True 372 | 6 373 | 6 374 | GTK_ORIENTATION_HORIZONTAL 375 | 376 | 377 | True 378 | Sign up 379 | GTK_ALIGN_END 380 | 381 | 382 | 383 | 384 | True 385 | Log in 386 | GTK_ALIGN_END 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | True 398 | GTK_ORIENTATION_VERTICAL 399 | 400 | 401 | True 402 | 403 | 404 | True 405 | GTK_ORIENTATION_VERTICAL 406 | 407 | 408 | True 409 | 410 | 411 | True 412 | 6 413 | 414 | 415 | True 416 | True 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | True 426 | True 427 | 428 | 429 | True 430 | iridium-note-list 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | True 441 | GTK_STACK_TRANSITION_TYPE_SLIDE_UP 442 | 443 | 444 | 445 | iridium-entry-info 446 | True 447 | True 448 | Press + to add a new note. 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | iridium-entry-box 460 | True 461 | GTK_ORIENTATION_VERTICAL 462 | 463 | 464 | iridium-title-entry 465 | True 466 | Add title … 467 | 12 468 | 10 469 | 6 470 | GTK_ALIGN_FILL 471 | TRUE 472 | 473 | 474 | 475 | 476 | iridium-tag-entry 477 | False 478 | Add tag … 479 | 12 480 | 10 481 | 6 482 | 12 483 | GTK_ALIGN_FILL 484 | TRUE 485 | 486 | 487 | 488 | 489 | True 490 | 491 | 492 | True 493 | 12 494 | 18 495 | 496 | 497 | iridium-text-view 498 | True 499 | True 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | -------------------------------------------------------------------------------- /shell/src/config.rs: -------------------------------------------------------------------------------- 1 | use anyhow::{anyhow, Result}; 2 | use crate::secret; 3 | use directories::BaseDirs; 4 | use serde::{Deserialize, Serialize}; 5 | use standardfile::Credentials; 6 | use std::path::PathBuf; 7 | use std::fs; 8 | use std::collections::HashMap; 9 | use std::fs::{create_dir_all, read_to_string}; 10 | 11 | #[derive(Serialize, Deserialize, Debug)] 12 | pub struct Geometry { 13 | pub width: u32, 14 | pub height: u32, 15 | pub x: i32, 16 | pub y: i32, 17 | pub maximized: bool, 18 | } 19 | 20 | #[derive(Serialize, Deserialize, Clone)] 21 | struct Identity { 22 | pub identifier: String, 23 | pub nonce: String, 24 | pub cost: u32, 25 | pub server: Option, 26 | } 27 | 28 | #[derive(Serialize, Deserialize)] 29 | struct Root { 30 | pub current: String, 31 | pub identities: Vec, 32 | pub geometry: Option, 33 | } 34 | 35 | pub struct Config { 36 | identifier: Option, 37 | identities: HashMap, 38 | pub geometry: Option, 39 | } 40 | 41 | fn get_path() -> Result { 42 | let dirs = BaseDirs::new().ok_or(anyhow!("Could not get XDG config dir"))?; 43 | let mut path = PathBuf::from(dirs.config_dir()); 44 | path.push("iridium"); 45 | path.push("config.toml"); 46 | Ok(path) 47 | } 48 | 49 | impl Config { 50 | /// Create a new Config and load from filesystem if possible. 51 | pub fn new() -> Result { 52 | let path = get_path()?; 53 | 54 | if path.exists() { 55 | let contents = read_to_string(path)?; 56 | let root: Root = toml::from_str(&contents)?; 57 | 58 | let mut config = Self { 59 | identifier: Some(root.current.clone()), 60 | identities: HashMap::new(), 61 | geometry: root.geometry, 62 | }; 63 | 64 | for identity in root.identities { 65 | config.identities.insert(identity.identifier.clone(), identity); 66 | } 67 | 68 | Ok(config) 69 | } 70 | else { 71 | Ok(Self { 72 | identifier: None, 73 | identities: HashMap::new(), 74 | geometry: None, 75 | }) 76 | } 77 | } 78 | 79 | /// Add a new identity and switch to it. 80 | fn add_identity(&mut self, identity: Identity) { 81 | self.identifier = Some(identity.identifier.clone()); 82 | self.identities.insert(identity.identifier.clone(), identity); 83 | } 84 | 85 | /// Add a new identity from credentials and switch to it. 86 | pub fn add(&mut self, credentials: &Credentials, server: Option) { 87 | let identity = Identity { 88 | identifier: credentials.identifier.clone(), 89 | nonce: credentials.nonce.clone(), 90 | cost: credentials.cost, 91 | server: server, 92 | }; 93 | 94 | self.add_identity(identity); 95 | } 96 | 97 | /// Switch identities and return an error if it does not exist. 98 | pub fn switch(&mut self, identifier: &str) -> Result<()> { 99 | if !self.identities.contains_key(identifier) { 100 | Err(anyhow!("Identifier does not exist")) 101 | } 102 | else { 103 | self.identifier = Some(identifier.to_string()); 104 | Ok(()) 105 | } 106 | } 107 | 108 | /// Return credentials for current identity. 109 | pub fn credentials(&self) -> Result { 110 | let identifier = self.identifier.as_ref().ok_or(anyhow!("No identifier set"))?; 111 | let identity = self.identities.get(identifier).ok_or(anyhow!("No identity found for current identifier"))?; 112 | 113 | Ok(Credentials { 114 | password: secret::load(&identity.identifier, &None)?, 115 | identifier: identity.identifier.clone(), 116 | cost: identity.cost, 117 | nonce: identity.nonce.clone(), 118 | }) 119 | } 120 | 121 | /// Get server for current identity. 122 | pub fn server(&self) -> Option { 123 | let identifier = self.identifier.as_ref().unwrap(); 124 | 125 | self.identities 126 | .get(identifier) 127 | .map_or(None, |identity| identity.server.as_ref()) 128 | .map_or(None, |server| Some(server.clone())) 129 | } 130 | 131 | /// Get existing identifiers. 132 | pub fn identifiers(&self) -> Vec { 133 | self.identities.keys().map(|s| s.clone()).collect() 134 | } 135 | 136 | pub fn identifier(&self) -> Option<&String> { 137 | self.identifier.as_ref() 138 | } 139 | 140 | /// Write configuration to disk. 141 | pub fn write(&self) -> Result<()> { 142 | let identifier = self.identifier.as_ref().ok_or(anyhow!("No identifier set"))?; 143 | let identity = self.identities.get(identifier).ok_or(anyhow!("No identity found for current identifier"))?; 144 | let path = get_path()?; 145 | 146 | if !path.exists() { 147 | create_dir_all(path.parent().unwrap())?; 148 | } 149 | 150 | let geometry = match &self.geometry { 151 | Some(geometry) => Some(Geometry { 152 | width: geometry.width, 153 | height: geometry.height, 154 | x: geometry.x, 155 | y: geometry.y, 156 | maximized: geometry.maximized, 157 | }), 158 | None => None, 159 | }; 160 | 161 | let identities = self.identities 162 | .values() 163 | .map(|identity| identity.clone()) 164 | .collect(); 165 | 166 | let root = Root { 167 | current: identity.identifier.clone(), 168 | identities: identities, 169 | geometry: geometry, 170 | }; 171 | 172 | fs::write(path, toml::to_string(&root)?)?; 173 | Ok(()) 174 | } 175 | } 176 | -------------------------------------------------------------------------------- /shell/src/consts.rs: -------------------------------------------------------------------------------- 1 | pub static APP_DOMAIN: &str = "iridium"; 2 | pub static APP_ID: &str = "net.bloerg.Iridium"; 3 | pub static APP_VERSION: &str = env!("CARGO_PKG_VERSION"); 4 | 5 | pub static ABOUT_UI: &str = "/net/bloerg/Iridium/data/resources/ui/about.ui"; 6 | pub static IMPORT_UI: &str = "/net/bloerg/Iridium/data/resources/ui/import.ui"; 7 | pub static SHORTCUTS_UI: &str = "/net/bloerg/Iridium/data/resources/ui/shortcuts.ui"; 8 | pub static WINDOW_UI: &str = "/net/bloerg/Iridium/data/resources/ui/window.ui"; 9 | pub static BASE_CSS: &str = "/net/bloerg/Iridium/data/resources/css/base.css"; 10 | -------------------------------------------------------------------------------- /shell/src/main.rs: -------------------------------------------------------------------------------- 1 | #![forbid(unsafe_code)] 2 | 3 | #[macro_use] 4 | extern crate glib; 5 | extern crate secret_service; 6 | 7 | mod config; 8 | mod consts; 9 | mod secret; 10 | mod storage; 11 | mod ui; 12 | 13 | use anyhow::Result; 14 | use gio::{resources_register, Resource}; 15 | use glib::Bytes; 16 | use ui::application::Application; 17 | 18 | fn init_resources() -> Result<()> { 19 | let data: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/resources.gresource")); 20 | let gbytes = Bytes::from_static(data.as_ref()); 21 | let resource = Resource::from_data(&gbytes)?; 22 | resources_register(&resource); 23 | 24 | Ok(()) 25 | } 26 | 27 | fn main() -> Result<()> { 28 | gtk::init()?; 29 | init_resources()?; 30 | let app = Application::new()?; 31 | app.run(); 32 | 33 | Ok(()) 34 | } 35 | -------------------------------------------------------------------------------- /shell/src/secret.rs: -------------------------------------------------------------------------------- 1 | use anyhow::{anyhow, Result}; 2 | use secret_service::{EncryptionType, SecretService}; 3 | use standardfile::Credentials; 4 | 5 | /// Store password in the keyring. 6 | pub fn store(credentials: &Credentials, server: Option<&str>) -> Result<()> { 7 | let service = SecretService::new(EncryptionType::Dh) 8 | .map_err(|err| anyhow!("Could not instantiate SecretService: {}", err))?; 9 | 10 | let collection = service 11 | .get_any_collection() 12 | .map_err(|err| anyhow!("Could not get any collection: {}", err))?; 13 | 14 | let mut props = vec![ 15 | ("service", "iridium"), 16 | ("identifier", &credentials.identifier), 17 | ("type", "password"), 18 | ]; 19 | 20 | if let Some(server) = server { 21 | props.push(("server", server)); 22 | } 23 | 24 | collection 25 | .create_item( 26 | &format!("Iridium password for {}", credentials.identifier), 27 | props, 28 | credentials.password.as_bytes(), 29 | true, 30 | "text/plain", 31 | ) 32 | .map_err(|err| anyhow!("Could not create password item: {}", err))?; 33 | 34 | Ok(()) 35 | } 36 | 37 | /// Load password for a given identifier. 38 | pub fn load(identifier: &str, server: &Option) -> Result { 39 | let service = SecretService::new(EncryptionType::Dh).unwrap(); 40 | let mut query = vec![ 41 | ("service", "iridium"), 42 | ("identifier", identifier), 43 | ("type", "password"), 44 | ]; 45 | 46 | if let Some(server) = server { 47 | query.push(("server", server)); 48 | } 49 | 50 | let items = service 51 | .search_items(query) 52 | .map_err(|err| anyhow!("Service query failed: {}", err))?; 53 | 54 | Ok(String::from_utf8( 55 | items 56 | .get(0) 57 | .ok_or(anyhow!("Password not found"))? 58 | .get_secret() 59 | .map_err(|err| anyhow!("Could not get secret for password: {}", err))?, 60 | )?) 61 | } 62 | -------------------------------------------------------------------------------- /shell/src/storage.rs: -------------------------------------------------------------------------------- 1 | use anyhow::{anyhow, Result}; 2 | use chrono::Utc; 3 | use crate::consts::APP_DOMAIN; 4 | use standardfile::{AuthParams, remote, CryptoError, Envelope, Exported, Item, Note, Credentials, crypto::Crypto}; 5 | use data_encoding::HEXLOWER; 6 | use directories::BaseDirs; 7 | use ring::digest; 8 | use std::collections::{HashSet, HashMap}; 9 | use std::fs::{create_dir_all, write, read_dir, read_to_string, remove_file}; 10 | use std::path::PathBuf; 11 | use uuid::Uuid; 12 | 13 | pub struct Storage { 14 | path: PathBuf, 15 | pub items: HashMap, 16 | credentials: Credentials, 17 | crypto: Crypto, 18 | pub current: Option, 19 | 20 | /// Contains uuids of notes that have not been flushed yet 21 | dirty: HashSet, 22 | 23 | /// The storage automatically syncs with the client if it exists. 24 | pub client: Option, 25 | } 26 | 27 | fn data_path_from_identifier(identifier: &str) -> Result { 28 | let name = HEXLOWER.encode(digest::digest(&digest::SHA256, identifier.as_bytes()).as_ref()); 29 | 30 | if let Some(dirs) = BaseDirs::new() { 31 | let mut path = PathBuf::from(dirs.data_dir()); 32 | path.push("iridium"); 33 | path.push(name); 34 | Ok(path) 35 | } 36 | else { 37 | Err(anyhow!("Could not determine XDG data dir")) 38 | } 39 | } 40 | 41 | impl Storage { 42 | pub fn new(credentials: &Credentials, client: Option) -> Result { 43 | let mut storage = Self { 44 | path: data_path_from_identifier(&credentials.identifier)?, 45 | items: HashMap::new(), 46 | credentials: credentials.clone(), 47 | crypto: Crypto::new(&credentials)?, 48 | current: None, 49 | dirty: HashSet::new(), 50 | client: client, 51 | }; 52 | 53 | let mut items: Vec = Vec::new(); 54 | 55 | if storage.path.exists() { 56 | g_info!(APP_DOMAIN, "Loading {:?}", storage.path); 57 | 58 | for entry in read_dir(&storage.path)? { 59 | let file_path = entry?.path(); 60 | 61 | if let Some(file_name) = file_path.file_name() { 62 | let uuid = Uuid::parse_str(file_name.to_string_lossy().as_ref())?; 63 | let contents = read_to_string(file_path)?; 64 | let item = Envelope::from_str(&contents)?; 65 | 66 | if uuid != item.uuid { 67 | return Err(anyhow!("File is corrupted")); 68 | } 69 | 70 | storage.items.insert(uuid, item.decrypt(&storage.crypto)?); 71 | items.push(item); 72 | } 73 | } 74 | } 75 | 76 | if let Some(client) = &mut storage.client { 77 | g_info!(APP_DOMAIN, "Syncing with remote"); 78 | 79 | // Use all items we haven't synced yet. For now pretend we have never synced an item. 80 | // Decrypt, flush and show notes we have retrieved from the initial sync. 81 | let items = client.sync(items)?; 82 | storage.insert_encrypted_items(&items)?; 83 | } 84 | 85 | Ok(storage) 86 | } 87 | 88 | /// Create storage from vector of encrypted items. 89 | pub fn new_from_items(credentials: &Credentials, items: &Vec) -> Result { 90 | let mut storage = Storage::new(credentials, None)?; 91 | storage.insert_encrypted_items(items)?; 92 | Ok(storage) 93 | } 94 | 95 | pub fn export(&self) -> Result { 96 | Ok(Exported { 97 | auth_params: AuthParams::from_credentials(&self.credentials), 98 | items: self.items.values().map(|item| item.encrypt(&self.crypto)).collect::, _>>()?, 99 | }) 100 | } 101 | 102 | /// Set the currently note to update. 103 | pub fn set_current_uuid(&mut self, uuid: &Uuid) -> Result<()> { 104 | if !self.items.contains_key(&uuid) { 105 | return Err(anyhow!(format!("{} does not exist", uuid))); 106 | } 107 | 108 | self.current = Some(*uuid); 109 | Ok(()) 110 | } 111 | 112 | fn insert_encrypted_items(&mut self, items: &Vec) -> Result<()> { 113 | for item in items { 114 | let result = item.decrypt(&self.crypto); 115 | 116 | match result { 117 | Ok(decrypted) => { 118 | self.items.insert(item.uuid, decrypted); 119 | self.flush(&item)?; 120 | } 121 | Err(err) => { 122 | match err { 123 | CryptoError::Other(e) => return Err(e), 124 | CryptoError::UnknownContentType(_) => { /* ignore this one */ } 125 | e => return Err(anyhow!("{}", e)), 126 | } 127 | } 128 | } 129 | } 130 | 131 | Ok(()) 132 | } 133 | 134 | fn get_uuid(&self) -> Result { 135 | Ok(self.current.ok_or(anyhow!("No current uuid set"))?) 136 | } 137 | 138 | fn get_note(&self) -> Result<&Note> { 139 | let uuid = self.get_uuid()?; 140 | let item = self.items.get(&uuid).ok_or(anyhow!("uuid mapping not found"))?; 141 | 142 | match item { 143 | Item::Note(note) => Ok(note), 144 | Item::Tag(_) => panic!("Current uuid is a tag"), 145 | } 146 | } 147 | 148 | fn get_note_mut(&mut self) -> Result<&mut Note> { 149 | let uuid = self.get_uuid()?; 150 | let item = self.items.get_mut(&uuid).ok_or(anyhow!("uuid mapping not found"))?; 151 | 152 | match item { 153 | Item::Note(note) => Ok(note), 154 | Item::Tag(_) => panic!("Current uuid is a tag"), 155 | } 156 | } 157 | 158 | /// Update the contents of the currently selected item. 159 | pub fn set_text(&mut self, text: &str) -> Result<()> { 160 | let note = self.get_note_mut()?; 161 | note.updated_at = Utc::now(); 162 | note.text = text.to_owned(); 163 | 164 | self.dirty.insert(self.get_uuid()?); 165 | Ok(()) 166 | } 167 | 168 | /// Get text of the currently selected item. 169 | pub fn get_text(&self) -> Result { 170 | Ok(self.get_note()?.text.clone()) 171 | } 172 | 173 | /// Update the title of the currently selected item. 174 | pub fn set_title(&mut self, title: &str) -> Result<()> { 175 | let note = self.get_note_mut()?; 176 | note.updated_at = Utc::now(); 177 | note.title = title.to_owned(); 178 | 179 | self.dirty.insert(self.get_uuid()?); 180 | Ok(()) 181 | } 182 | 183 | /// Get title of the currently selected item. 184 | pub fn get_title(&self) -> Result { 185 | Ok(self.get_note()?.title.clone()) 186 | } 187 | 188 | fn flush_to_disk(&self, uuid: &Uuid, item: &Envelope) -> Result<()> { 189 | let path = self.path_from_uuid(&uuid); 190 | 191 | if let Some(parent) = path.parent() { 192 | if !parent.exists() { 193 | create_dir_all(&parent)?; 194 | } 195 | } 196 | 197 | write(&path, item.to_string()?)?; 198 | 199 | Ok(()) 200 | } 201 | 202 | /// Write encrypted item to disk and sync with remote. 203 | fn flush(&mut self, item: &Envelope) -> Result<()> { 204 | self.flush_to_disk(&item.uuid, &item)?; 205 | 206 | if let Some(client) = &mut self.client { 207 | g_info!(APP_DOMAIN, "Syncing {}", item.uuid); 208 | 209 | let copy = Envelope { 210 | uuid: item.uuid, 211 | content: item.content.clone(), 212 | content_type: item.content_type.clone(), 213 | enc_item_key: item.enc_item_key.clone(), 214 | created_at: item.created_at, 215 | updated_at: item.updated_at, 216 | deleted: item.deleted, 217 | }; 218 | 219 | client.sync(vec![copy])?; 220 | } 221 | 222 | Ok(()) 223 | } 224 | 225 | /// Encrypt all dirty items, write them to disk and sync with remote. 226 | pub fn flush_dirty(&mut self) -> Result<()> { 227 | let mut items: Vec = Vec::new(); 228 | 229 | for uuid in &self.dirty { 230 | let item = self.items.get(uuid).ok_or(anyhow!("uuid dirty but not found"))?; 231 | let envelope = item.encrypt(&self.crypto)?; 232 | 233 | self.flush_to_disk(&uuid, &envelope)?; 234 | items.push(envelope); 235 | } 236 | 237 | if let Some(client) = &mut self.client { 238 | g_info!(APP_DOMAIN, "Syncing dirty items"); 239 | client.sync(items)?; 240 | } 241 | 242 | self.dirty.clear(); 243 | 244 | Ok(()) 245 | } 246 | 247 | /// Delete note from storage. 248 | pub fn delete(&mut self, uuid: &Uuid) -> Result<()> { 249 | if self.dirty.contains(uuid) { 250 | self.dirty.remove(&uuid); 251 | } 252 | 253 | if let Some(client) = &mut self.client { 254 | if let Some(item) = self.items.get(&uuid) { 255 | let mut envelope = item.encrypt(&self.crypto)?; 256 | envelope.deleted = Some(true); 257 | 258 | // Apparently, we do not receive the item back as marked deleted 259 | // but on subsequent syncs only. 260 | client.sync(vec![envelope])?; 261 | } 262 | } 263 | 264 | let path = self.path_from_uuid(&uuid); 265 | g_info!(APP_DOMAIN, "Deleting {:?}", path); 266 | remove_file(path)?; 267 | self.items.remove(&uuid); 268 | 269 | Ok(()) 270 | } 271 | 272 | fn path_from_uuid(&self, uuid: &Uuid) -> PathBuf { 273 | let mut path = PathBuf::from(&self.path); 274 | path.push(uuid.to_hyphenated().to_string()); 275 | path 276 | } 277 | 278 | /// Create a new note and return its new uuid. 279 | pub fn create_note(&mut self) -> Uuid { 280 | let now = Utc::now(); 281 | let uuid = Uuid::new_v4(); 282 | 283 | let note = Note { 284 | title: "".to_owned(), 285 | text: "".to_owned(), 286 | created_at: now, 287 | updated_at: now, 288 | uuid: uuid, 289 | }; 290 | 291 | self.items.insert(uuid, Item::Note(note)); 292 | 293 | uuid 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /shell/src/ui/application.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use gio::prelude::*; 3 | use gtk::prelude::*; 4 | use glib::translate::{ToGlib, from_glib}; 5 | use std::env; 6 | use std::path::PathBuf; 7 | use crate::config::{Config, Geometry}; 8 | use crate::consts::{APP_DOMAIN, APP_ID, APP_VERSION, ABOUT_UI, BASE_CSS, IMPORT_UI, SHORTCUTS_UI, WINDOW_UI}; 9 | use crate::secret; 10 | use crate::storage::Storage; 11 | use crate::ui::controller::Controller; 12 | use standardfile::{remote, Exported, Credentials}; 13 | 14 | pub struct Application { 15 | app: gtk::Application, 16 | window: gtk::ApplicationWindow, 17 | sender: glib::Sender, 18 | builder: gtk::Builder, 19 | search_bar: gtk::SearchBar, 20 | tag_entry: gtk::Entry, 21 | setup_create_button: gtk::Button, 22 | setup_signup_button: gtk::Button, 23 | setup_login_button: gtk::Button, 24 | note_list_box: gtk::ListBox, 25 | note_popover: gtk::PopoverMenu, 26 | } 27 | 28 | enum AppEvent { 29 | AddNote, 30 | DeleteNote, 31 | SelectNote, 32 | Register(String, Credentials), 33 | SignIn(String, Credentials), 34 | Import(PathBuf, String, Option), 35 | Export(PathBuf), 36 | Update(Option, Option), 37 | UpdateFilter(Option), 38 | UpdateGeometry(Geometry), 39 | CreateStorage(Credentials), 40 | Switch(String), 41 | FlushDirty, 42 | Quit, 43 | } 44 | 45 | fn setup_server_dialog(builder: >k::Builder) { 46 | let server_box = get_widget!(builder, gtk::ComboBoxText, "server-box"); 47 | let server_entry = server_box.get_child().unwrap().downcast::().unwrap(); 48 | let sync_button = get_widget!(builder, gtk::Switch, "sync-switch"); 49 | 50 | server_entry.set_input_purpose(gtk::InputPurpose::Url); 51 | server_entry.set_icon_from_icon_name(gtk::EntryIconPosition::Primary, Some("network-server-symbolic")); 52 | server_entry.set_placeholder_text(Some("Server address")); 53 | sync_button.bind_property("active", &server_box, "sensitive").flags(glib::BindingFlags::SYNC_CREATE).build(); 54 | sync_button.bind_property("active", &server_entry, "sensitive").flags(glib::BindingFlags::SYNC_CREATE).build(); 55 | } 56 | 57 | fn get_user_details(builder: >k::Builder) -> Credentials { 58 | let identifier_entry = get_widget!(builder, gtk::Entry, "identifier-entry"); 59 | let password_entry = get_widget!(builder, gtk::Entry, "password-entry"); 60 | 61 | Credentials::from_defaults(&identifier_entry.get_text(), &password_entry.get_text()) 62 | } 63 | 64 | fn get_auth_details(builder: >k::Builder) -> (String, Credentials) { 65 | let server_combo_box = get_widget!(builder, gtk::ComboBoxText, "server-combo"); 66 | 67 | (server_combo_box.get_active_text().unwrap().to_string(), get_user_details(&builder)) 68 | } 69 | 70 | fn show_header_buttons(builder: >k::Builder, visible: bool) { 71 | let menu_button = get_widget!(builder, gtk::MenuButton, "appmenu-button"); 72 | let add_button = get_widget!(builder, gtk::Button, "add-button"); 73 | menu_button.set_visible(visible); 74 | add_button.set_visible(visible); 75 | } 76 | 77 | fn show_setup_content(builder: >k::Builder) { 78 | let stack = get_widget!(builder, gtk::Stack, "main-stack"); 79 | let setup_box = get_widget!(builder, gtk::Box, "main-setup"); 80 | show_header_buttons(builder, false); 81 | stack.set_visible_child(&setup_box); 82 | } 83 | 84 | fn show_main_content(builder: >k::Builder) { 85 | let stack = get_widget!(builder, gtk::Stack, "main-stack"); 86 | let main_box = get_widget!(builder, gtk::Box, "main-content"); 87 | show_header_buttons(builder, true); 88 | stack.set_visible_child(&main_box); 89 | } 90 | 91 | fn show_notification(builder: >k::Builder, message: &str) { 92 | let revealer = get_widget!(builder, gtk::Revealer, "notification-revealer"); 93 | let label = get_widget!(builder, gtk::Label, "notification-label"); 94 | let close_button = get_widget!(builder, gtk::Button, "notification-button"); 95 | 96 | label.set_text(&message); 97 | revealer.set_reveal_child(true); 98 | 99 | close_button.connect_clicked(move |_| { 100 | revealer.set_reveal_child(false); 101 | }); 102 | } 103 | 104 | impl Application { 105 | fn setup_overlay_help(&self) { 106 | let builder = gtk::Builder::from_resource(SHORTCUTS_UI); 107 | let shortcuts_window = get_widget!(builder, gtk::ShortcutsWindow, "shortcuts"); 108 | self.window.set_help_overlay(Some(&shortcuts_window)); 109 | } 110 | 111 | fn setup_style_provider(&self) { 112 | let style_provider = gtk::CssProvider::new(); 113 | style_provider.load_from_resource(BASE_CSS); 114 | 115 | gtk::StyleContext::add_provider_for_screen( 116 | &self.window.get_screen().unwrap(), 117 | &style_provider, 118 | gtk::STYLE_PROVIDER_PRIORITY_APPLICATION, 119 | ); 120 | } 121 | 122 | fn setup_actions(&self) { 123 | action!(self.app, "quit", 124 | clone!(@strong self.sender as sender => move |_, _| { 125 | sender.send(AppEvent::Quit).unwrap(); 126 | }) 127 | ); 128 | 129 | action!(self.app, "about", 130 | clone!(@weak self.window as window => move |_, _| { 131 | let builder = gtk::Builder::from_resource(ABOUT_UI); 132 | let dialog = get_widget!(builder, gtk::AboutDialog, "about-dialog"); 133 | dialog.set_version(Some(APP_VERSION)); 134 | dialog.set_logo_icon_name(Some(APP_ID)); 135 | dialog.set_transient_for(Some(&window)); 136 | dialog.connect_response(|dialog, _| dialog.close()); 137 | dialog.show(); 138 | }) 139 | ); 140 | 141 | action!(self.app, "add", 142 | clone!(@strong self.sender as sender => move |_, _| { 143 | sender.send(AppEvent::AddNote).unwrap(); 144 | }) 145 | ); 146 | 147 | action!(self.app, "delete", 148 | clone!(@strong self.sender as sender => move |_, _| { 149 | sender.send(AppEvent::DeleteNote).unwrap(); 150 | }) 151 | ); 152 | 153 | action!(self.app, "setup", 154 | clone!(@weak self.builder as builder => move |_, _| { 155 | show_setup_content(&builder); 156 | }) 157 | ); 158 | 159 | action!(self.app, "search", 160 | clone!(@strong self.search_bar as search_bar => move |_, _| { 161 | search_bar.set_search_mode(!search_bar.get_search_mode()); 162 | }) 163 | ); 164 | 165 | action!(self.app, "tags", 166 | clone!(@strong self.tag_entry as tag_entry => move |_, _| { 167 | // Replace with tag_entry.set_action_name et al. 168 | tag_entry.set_visible(!tag_entry.get_visible()); 169 | }) 170 | ); 171 | 172 | action!(self.app, "import", 173 | clone!(@weak self.window as window, @strong self.sender as sender => move |_, _| { 174 | let builder = gtk::Builder::from_resource(IMPORT_UI); 175 | let dialog = get_widget!(builder, gtk::Dialog, "import-dialog"); 176 | 177 | setup_server_dialog(&builder); 178 | dialog.set_transient_for(Some(&window)); 179 | dialog.set_modal(true); 180 | 181 | match dialog.run() { 182 | gtk::ResponseType::Ok => { 183 | let file_chooser = get_widget!(builder, gtk::FileChooserButton, "import-file-button"); 184 | 185 | if let Some(filename) = file_chooser.get_filename() { 186 | let password_entry = get_widget!(builder, gtk::Entry, "import-password"); 187 | let server_box = get_widget!(builder, gtk::ComboBoxText, "server-box"); 188 | let server_entry = server_box.get_child().unwrap().downcast::().unwrap(); 189 | let server = server_entry.get_text().to_string(); 190 | let server = if server != "" { Some(server) } else { None }; 191 | 192 | sender.send(AppEvent::Import(filename, password_entry.get_text().to_string(), server)).unwrap(); 193 | } 194 | } 195 | _ => {} 196 | } 197 | 198 | dialog.close(); 199 | }) 200 | ); 201 | 202 | action!(self.app, "export", 203 | clone!(@weak self.window as window, @strong self.sender as sender => move |_, _| { 204 | let dialog = gtk::FileChooserDialog::with_buttons::( 205 | Some("Export JSON"), 206 | Some(&window), 207 | gtk::FileChooserAction::Save, 208 | &[("_Cancel", gtk::ResponseType::Cancel), ("_Save", gtk::ResponseType::Accept)] 209 | ); 210 | 211 | match dialog.run() { 212 | gtk::ResponseType::Accept => { 213 | if let Some(filename) = dialog.get_filename() { 214 | sender.send(AppEvent::Export(filename)).unwrap(); 215 | } 216 | }, 217 | _ => {} 218 | } 219 | 220 | dialog.close(); 221 | }) 222 | ); 223 | 224 | self.app.set_accels_for_action("app.quit", &["q"]); 225 | self.app.set_accels_for_action("app.search", &["f"]); 226 | self.app.set_accels_for_action("app.tags", &["t"]); 227 | } 228 | 229 | fn setup_signals(&self) { 230 | let search_entry = get_widget!(self.builder, gtk::SearchEntry, "search-entry"); 231 | 232 | search_entry.connect_search_changed( 233 | clone!(@strong self.sender as sender => move |entry| { 234 | let text = entry.get_text(); 235 | 236 | if text.len() > 2 { 237 | sender.send(AppEvent::UpdateFilter(Some(text.as_str().to_string()))).unwrap(); 238 | } 239 | else { 240 | sender.send(AppEvent::UpdateFilter(None)).unwrap(); 241 | } 242 | }) 243 | ); 244 | 245 | self.search_bar.connect_entry(&search_entry); 246 | 247 | self.app.connect_activate( 248 | clone!(@weak self.window as window => move |app| { 249 | window.set_application(Some(app)); 250 | app.add_window(&window); 251 | window.present(); 252 | }) 253 | ); 254 | 255 | self.window.connect_destroy( 256 | clone!(@strong self.sender as sender => move |_| { 257 | sender.send(AppEvent::Quit).unwrap(); 258 | }) 259 | ); 260 | 261 | self.window.connect_configure_event( 262 | clone!(@strong self.sender as sender => move |window, event| { 263 | let (width, height) = event.get_size(); 264 | let (x, y) = window.get_position(); 265 | 266 | sender.send(AppEvent::UpdateGeometry(Geometry { 267 | x: x, 268 | y: y, 269 | width: width, 270 | height: height, 271 | maximized: false, 272 | })).unwrap(); 273 | 274 | false 275 | }) 276 | ); 277 | 278 | self.setup_create_button.connect_clicked( 279 | clone!(@strong self.builder as builder, @strong self.sender as sender => move |_| { 280 | let user = get_user_details(&builder); 281 | sender.send(AppEvent::CreateStorage(user)).unwrap(); 282 | }) 283 | ); 284 | 285 | self.setup_signup_button.connect_clicked( 286 | clone!(@strong self.builder as builder, @strong self.sender as sender => move |_| { 287 | let (server, credentials) = get_auth_details(&builder); 288 | sender.send(AppEvent::Register(server, credentials)).unwrap(); 289 | }) 290 | ); 291 | 292 | self.setup_login_button.connect_clicked( 293 | clone!(@strong self.builder as builder, @strong self.sender as sender => move |_| { 294 | let (server, credentials) = get_auth_details(&builder); 295 | sender.send(AppEvent::SignIn(server, credentials)).unwrap(); 296 | }) 297 | ); 298 | 299 | self.note_list_box.connect_row_selected( 300 | clone!(@strong self.sender as sender, @strong self.note_popover as popover => move |_, row| { 301 | if let Some(row) = row { 302 | popover.set_relative_to(Some(row)); 303 | sender.send(AppEvent::SelectNote).unwrap(); 304 | } 305 | }) 306 | ); 307 | 308 | self.note_list_box.connect_button_press_event( 309 | clone!(@strong self.note_popover as popover => move |_, event_button| { 310 | if event_button.get_button() == 3 { 311 | popover.popup(); 312 | } 313 | glib::signal::Inhibit(false) 314 | }) 315 | ); 316 | } 317 | 318 | fn setup_binds(&self) { 319 | let setup_identifier_entry = get_widget!(self.builder, gtk::Entry, "identifier-entry"); 320 | 321 | setup_identifier_entry.bind_property("text-length", &self.setup_create_button, "sensitive") 322 | .flags(glib::BindingFlags::SYNC_CREATE) 323 | .build(); 324 | 325 | setup_identifier_entry.bind_property("text-length", &self.setup_login_button, "sensitive") 326 | .flags(glib::BindingFlags::SYNC_CREATE) 327 | .build(); 328 | 329 | setup_identifier_entry.bind_property("text-length", &self.setup_signup_button, "sensitive") 330 | .flags(glib::BindingFlags::SYNC_CREATE) 331 | .build(); 332 | } 333 | 334 | fn restore_geometry(&self, geometry: &Geometry) { 335 | self.window.move_(geometry.x, geometry.y); 336 | self.window.resize(geometry.width as i32, geometry.height as i32); 337 | } 338 | 339 | pub fn new() -> Result { 340 | let app = gtk::Application::new(Some(APP_ID), gio::ApplicationFlags::FLAGS_NONE)?; 341 | let builder = gtk::Builder::from_resource(WINDOW_UI); 342 | 343 | let (sender, receiver) = glib::MainContext::channel::(glib::PRIORITY_DEFAULT); 344 | 345 | let window = get_widget!(builder, gtk::ApplicationWindow, "window"); 346 | let note_list_box = get_widget!(builder, gtk::ListBox, "note-list"); 347 | let note_popover = get_widget!(builder, gtk::PopoverMenu, "note-menu"); 348 | let profile_menu = get_widget!(builder, gtk::Box, "profile-menu"); 349 | let title_entry = get_widget!(builder, gtk::Entry, "title-entry"); 350 | let text_view = get_widget!(builder, gtk::TextView, "text-view"); 351 | let text_buffer = text_view.get_buffer().unwrap(); 352 | 353 | let application = Self { 354 | app: app.clone(), 355 | window: window.clone(), 356 | sender: sender.clone(), 357 | builder: builder.clone(), 358 | tag_entry: get_widget!(builder, gtk::Entry, "tag-entry"), 359 | search_bar: get_widget!(builder, gtk::SearchBar, "search-bar"), 360 | setup_create_button: get_widget!(builder, gtk::Button, "create-local-button"), 361 | setup_signup_button: get_widget!(builder, gtk::Button, "signup-button"), 362 | setup_login_button: get_widget!(builder, gtk::Button, "login-button"), 363 | note_list_box: note_list_box.clone(), 364 | note_popover: note_popover.clone(), 365 | }; 366 | 367 | let mut controller = Controller::new(&builder); 368 | let mut config = Config::new()?; 369 | 370 | for identifier in config.identifiers() { 371 | let button = gtk::ModelButton::new(); 372 | button.set_property_text(Some(&identifier)); 373 | button.show(); 374 | profile_menu.pack_end(&button, false, true, 0); 375 | 376 | button.connect_clicked( 377 | clone!(@strong sender => move |button| { 378 | let identifier = button.get_property_text().unwrap().to_string(); 379 | sender.send(AppEvent::Switch(identifier)).unwrap(); 380 | }) 381 | ); 382 | } 383 | 384 | let mut storage = match &config.identifier() { 385 | Some(identifier) => { 386 | if let Some(geometry) = &config.geometry { 387 | application.restore_geometry(&geometry); 388 | } 389 | 390 | let server = config.server(); 391 | let password = secret::load(&identifier, &server)?; 392 | let credentials = Credentials::from_defaults(&identifier, &password); 393 | 394 | if let Some(server) = server { 395 | sender.send(AppEvent::SignIn(server.to_string(), credentials)).unwrap(); 396 | } 397 | 398 | show_main_content(&builder); 399 | 400 | let credentials = config.credentials()?; 401 | let storage = Storage::new(&credentials, None)?; 402 | 403 | for item in storage.items.values() { 404 | controller.insert(&item); 405 | } 406 | 407 | controller.select_first(); 408 | 409 | Some(storage) 410 | } 411 | None => None 412 | }; 413 | 414 | application.setup_overlay_help(); 415 | application.setup_style_provider(); 416 | application.setup_actions(); 417 | application.setup_signals(); 418 | application.setup_binds(); 419 | 420 | let mut flush_timer_running = false; 421 | let mut title_entry_handler: Option = None; 422 | let mut text_buffer_handler: Option = None; 423 | 424 | receiver.attach(None, 425 | clone!(@strong sender, @strong app, @strong window => move |event| { 426 | match event { 427 | AppEvent::Quit => { 428 | if let Some(storage) = &mut storage { 429 | if let Err(err) = storage.flush_dirty() { 430 | g_error!(APP_DOMAIN, "Could not flush: {}", err); 431 | } 432 | } 433 | 434 | if let Err(err) = config.write() { 435 | g_warning!(APP_DOMAIN, "Could not write config: {}", err); 436 | } 437 | 438 | app.quit(); 439 | } 440 | AppEvent::UpdateGeometry(geometry) => { 441 | config.geometry = Some(geometry); 442 | } 443 | AppEvent::CreateStorage(user) => { 444 | let credentials = Credentials::from_defaults(&user.identifier, &user.password); 445 | 446 | match Storage::new(&credentials, None) { 447 | Ok(s) => { 448 | storage = Some(s); 449 | config.add(&credentials, None); 450 | if let Err(err) = secret::store(&credentials, None) { 451 | show_notification(&builder, &format!("{}", err)); 452 | } 453 | else { 454 | controller.clear(); 455 | show_main_content(&builder); 456 | } 457 | } 458 | Err(message) => { 459 | show_notification(&builder, &format!("Error: {}.", message)); 460 | } 461 | }; 462 | } 463 | AppEvent::Register(server, credentials) => { 464 | g_info!(APP_DOMAIN, "Registering with {}", server); 465 | let client = remote::Client::new_register(&server, credentials); 466 | 467 | match client { 468 | Ok(client) => { 469 | let credentials = client.credentials.clone(); 470 | storage = Some(Storage::new(&credentials, Some(client)).unwrap()); 471 | 472 | if let Err(err) = secret::store(&credentials, Some(&server)) { 473 | show_notification(&builder, &format!("{}", err)); 474 | } 475 | else { 476 | config.add(&credentials, Some(server)); 477 | show_main_content(&builder); 478 | } 479 | } 480 | Err(message) => { 481 | let message = format!("Registration failed: {}.", message); 482 | show_notification(&builder, &message); 483 | } 484 | }; 485 | } 486 | AppEvent::SignIn(server, credentials) => { 487 | g_info!(APP_DOMAIN, "Signing in to {}", server); 488 | let client = remote::Client::new_sign_in(&server, &credentials); 489 | 490 | match client { 491 | Ok(client) => { 492 | // We have to use the clients credentials because encryption 493 | // parameters such as nonce and number of iterations might have 494 | // changed. 495 | let credentials = client.credentials.clone(); 496 | 497 | // Switch storage, read local files and show them in the UI. 498 | storage = Some(Storage::new(&credentials, Some(client)).unwrap()); 499 | 500 | for item in storage.as_ref().unwrap().items.values() { 501 | controller.insert(&item); 502 | } 503 | 504 | // Store the encryption password and auth token in the keyring. 505 | if let Err(err) = secret::store(&credentials, Some(&server)) { 506 | show_notification(&builder, &format!("{}", err)); 507 | } 508 | else { 509 | config.add(&credentials, Some(server)); 510 | show_main_content(&builder); 511 | } 512 | } 513 | Err(message) => { 514 | let message = format!("Login failed: {}.", message); 515 | show_notification(&builder, &message); 516 | } 517 | } 518 | } 519 | AppEvent::Import(path, password, server) => { 520 | let filename = path.file_name().unwrap().to_string_lossy(); 521 | 522 | if let Ok(contents) = std::fs::read_to_string(&path) { 523 | if let Ok(exported) = Exported::from_str(&contents) { 524 | let credentials = Credentials::from_exported(&exported, &password); 525 | 526 | if let Err(err) = secret::store(&credentials, server.as_deref()) { 527 | show_notification(&builder, &format!("{}", err)); 528 | } 529 | 530 | config.add(&credentials, server); 531 | let new_storage = Storage::new_from_items(&credentials, &exported.items); 532 | 533 | match new_storage { 534 | Err(err) => { 535 | let message = format!("Could not decrypt: {}", err); 536 | show_notification(&builder, &message); 537 | } 538 | Ok(s) => { 539 | for item in s.items.values() { 540 | controller.insert(&item); 541 | } 542 | 543 | storage = Some(s); 544 | } 545 | } 546 | 547 | } 548 | else { 549 | let message = format!("{} is not exported JSON.", filename); 550 | show_notification(&builder, &message); 551 | } 552 | } 553 | else { 554 | let message = format!("{} does not contain UTF-8 data.", filename); 555 | show_notification(&builder, &message); 556 | } 557 | } 558 | AppEvent::Export(path) => { 559 | if let Some(storage) = &storage { 560 | let exported = storage.export().unwrap(); 561 | std::fs::write(path, exported.to_str().unwrap()).unwrap(); 562 | } 563 | } 564 | AppEvent::Switch(identifier) => { 565 | controller.clear(); 566 | config.switch(&identifier).unwrap(); 567 | 568 | // FIXME: do something about the unwraps 569 | let credentials = config.credentials().unwrap(); 570 | let new_storage = Storage::new(&credentials, None).unwrap(); 571 | 572 | for item in new_storage.items.values() { 573 | controller.insert(&item); 574 | } 575 | 576 | storage = Some(new_storage); 577 | } 578 | AppEvent::AddNote => { 579 | if let Some(storage) = &mut storage { 580 | let uuid = storage.create_note(); 581 | let item = storage.items.get(&uuid).unwrap(); 582 | 583 | controller.insert(&item); 584 | } 585 | } 586 | AppEvent::DeleteNote => { 587 | if let Some(storage) = &mut storage { 588 | if let Some(uuid) = storage.current { 589 | g_info!(APP_DOMAIN, "Deleting {}", uuid); 590 | controller.delete(&uuid); 591 | storage.delete(&uuid).unwrap(); 592 | } 593 | } 594 | } 595 | AppEvent::SelectNote => { 596 | let row = note_list_box.get_selected_row().unwrap(); 597 | 598 | if let Some(uuid) = controller.select(&row) { 599 | if let Some(storage) = &mut storage { 600 | storage.set_current_uuid(&uuid).unwrap(); 601 | 602 | // We first disconnect the change handlers before setting the text 603 | // and content to avoid updating the storage and controller which would 604 | // unnecessarily cause row movement and a server sync. 605 | 606 | if let Some(handler) = title_entry_handler { 607 | title_entry.disconnect(from_glib(handler)); 608 | } 609 | 610 | if let Some(handler) = text_buffer_handler { 611 | text_buffer.disconnect(from_glib(handler)); 612 | } 613 | 614 | let title = storage.get_title().unwrap(); 615 | let text = storage.get_text().unwrap(); 616 | 617 | title_entry.set_text(&title); 618 | text_buffer.set_text(&text); 619 | 620 | title_entry_handler = Some(title_entry.connect_changed( 621 | clone!(@strong sender => move |entry| { 622 | sender.send(AppEvent::Update(Some(entry.get_text().to_string()), None)).unwrap(); 623 | }) 624 | ).to_glib()); 625 | 626 | text_buffer_handler = Some(text_buffer.connect_changed( 627 | clone!(@strong sender => move |text_buffer| { 628 | let start = text_buffer.get_start_iter(); 629 | let end = text_buffer.get_end_iter(); 630 | let text = text_buffer.get_text(&start, &end, false).unwrap(); 631 | let text = text.as_str().to_string(); 632 | 633 | sender.send(AppEvent::Update(None, Some(text))).unwrap(); 634 | }) 635 | ).to_glib()); 636 | } 637 | } 638 | } 639 | AppEvent::Update(title, text) => { 640 | if let Some(storage) = &mut storage { 641 | if let Some(title) = title { 642 | storage.set_title(&title).unwrap(); 643 | } 644 | 645 | if let Some(text) = text { 646 | storage.set_text(&text).unwrap(); 647 | } 648 | 649 | if let Some(uuid) = storage.current { 650 | controller.updated(&uuid); 651 | } 652 | 653 | if !flush_timer_running { 654 | glib::source::timeout_add_seconds(5, 655 | clone!(@strong sender => move || { 656 | sender.send(AppEvent::FlushDirty).unwrap(); 657 | glib::Continue(false) 658 | }) 659 | ); 660 | 661 | flush_timer_running = true; 662 | } 663 | } 664 | } 665 | AppEvent::UpdateFilter(term) => { 666 | controller.filter_rows(term); 667 | } 668 | AppEvent::FlushDirty => { 669 | if let Some(storage) = &mut storage { 670 | if let Err(err) = storage.flush_dirty() { 671 | g_error!(APP_DOMAIN, "Could not flush: {}", err); 672 | } 673 | else { 674 | flush_timer_running = false; 675 | } 676 | } 677 | } 678 | } 679 | 680 | glib::Continue(true) 681 | }) 682 | ); 683 | 684 | Ok(application) 685 | } 686 | 687 | pub fn run(&self) { 688 | let args: Vec = env::args().collect(); 689 | self.app.run(&args); 690 | } 691 | } 692 | -------------------------------------------------------------------------------- /shell/src/ui/controller.rs: -------------------------------------------------------------------------------- 1 | use chrono::{DateTime, Utc}; 2 | use gio::prelude::*; 3 | use gtk::prelude::*; 4 | use standardfile::{Item as StandardItem, Note}; 5 | use std::{cell::RefCell, cmp, cmp::{Ord, Ordering}, collections::HashMap, rc::Rc}; 6 | use uuid::Uuid; 7 | 8 | struct Item { 9 | uuid: Uuid, 10 | label: gtk::Label, 11 | last_updated: DateTime, 12 | } 13 | 14 | pub struct Controller { 15 | items: Rc>>, 16 | list_box: gtk::ListBox, 17 | title_entry: gtk::Entry, 18 | note_stack: gtk::Stack, 19 | note_info: gtk::Label, 20 | note_content: gtk::Box, 21 | binding: Option, 22 | } 23 | 24 | impl Ord for Item { 25 | fn cmp(&self, other: &Self) -> Ordering { 26 | self.last_updated.cmp(&other.last_updated) 27 | } 28 | } 29 | 30 | impl PartialOrd for Item { 31 | fn partial_cmp(&self, other: &Self) -> Option { 32 | Some(self.cmp(other)) 33 | } 34 | } 35 | 36 | impl PartialEq for Item { 37 | fn eq(&self, other: &Self) -> bool { 38 | self.last_updated == other.last_updated 39 | } 40 | } 41 | 42 | impl Eq for Item {} 43 | 44 | impl Controller { 45 | pub fn new(builder: >k::Builder) -> Self { 46 | let controller = Self { 47 | items: Rc::new(RefCell::new(HashMap::new())), 48 | list_box: get_widget!(builder, gtk::ListBox, "note-list"), 49 | title_entry: get_widget!(builder, gtk::Entry, "title-entry"), 50 | note_stack: get_widget!(builder, gtk::Stack, "right-hand-stack"), 51 | note_info: get_widget!(builder, gtk::Label, "right-hand-info-label"), 52 | note_content: get_widget!(builder, gtk::Box, "entry-box"), 53 | binding: None, 54 | }; 55 | 56 | controller.list_box.set_sort_func(Some(Box::new( 57 | clone!(@strong controller.items as items => move |row_a, row_b| { 58 | let items = items.borrow(); 59 | let item_a = &items[row_a]; 60 | let item_b = &items[row_b]; 61 | (item_a < item_b) as i32 62 | }) 63 | ))); 64 | 65 | controller 66 | } 67 | 68 | fn insert_note(&mut self, note: &Note) { 69 | let label = gtk::Label::new(None); 70 | label.set_halign(gtk::Align::Start); 71 | label.set_margin_start(9); 72 | label.set_margin_end(9); 73 | label.set_margin_top(9); 74 | label.set_margin_bottom(9); 75 | label.set_widget_name("iridium-note-row-label"); 76 | label.set_text(¬e.title); 77 | 78 | let row = gtk::ListBoxRow::new(); 79 | row.add(&label); 80 | row.set_widget_name("iridium-note-row"); 81 | row.show_all(); 82 | 83 | { 84 | let mut items = self.items.borrow_mut(); 85 | 86 | items.insert(row.clone(), Item { 87 | uuid: note.uuid, 88 | label: label.clone(), 89 | last_updated: note.updated_at, 90 | }); 91 | 92 | if items.len() == 1 { 93 | self.note_stack.set_visible_child(&self.note_content); 94 | } 95 | } 96 | 97 | self.list_box.insert(&row, 0); 98 | self.list_box.select_row(Some(&row)); 99 | } 100 | 101 | pub fn insert(&mut self, item: &StandardItem) { 102 | if self.have(&item.uuid()) { 103 | return; 104 | } 105 | 106 | if let StandardItem::Note(note) = item { 107 | self.insert_note(¬e); 108 | } 109 | } 110 | 111 | pub fn delete(&mut self, uuid: &Uuid) { 112 | let mut index = 0; 113 | let mut items = self.items.borrow_mut(); 114 | 115 | for (row, _) in items.iter().filter(|&(_, item)| item.uuid == *uuid) { 116 | index = cmp::max(0, row.get_index() - 1); 117 | self.list_box.remove(row); 118 | } 119 | 120 | items.retain(|_, item| item.uuid != *uuid); 121 | 122 | if items.len() > 0 { 123 | let new_selected_row = self.list_box.get_row_at_index(index).unwrap(); 124 | self.list_box.select_row(Some(&new_selected_row)); 125 | } 126 | else { 127 | self.note_stack.set_visible_child(&self.note_info); 128 | } 129 | } 130 | 131 | pub fn clear(&mut self) { 132 | if let Some(binding) = &self.binding { 133 | binding.unbind(); 134 | } 135 | 136 | let mut items = self.items.borrow_mut(); 137 | 138 | for row in items.keys() { 139 | self.list_box.remove(row); 140 | } 141 | 142 | items.clear(); 143 | self.note_stack.set_visible_child(&self.note_info); 144 | } 145 | 146 | pub fn select_first(&self) { 147 | let items = self.items.borrow(); 148 | let most_recent = items.iter().max_by(|(_, x), (_, y)| x.cmp(y)); 149 | 150 | if let Some((row, _)) = most_recent { 151 | self.list_box.select_row(Some(row)); 152 | } 153 | } 154 | 155 | pub fn select(&mut self, selected_row: >k::ListBoxRow) -> Option { 156 | if let Some(binding) = &self.binding { 157 | binding.unbind(); 158 | } 159 | 160 | if let Some(item) = self.items.borrow().get(selected_row) { 161 | self.binding = Some(self.title_entry.bind_property("text", &item.label, "label").build().unwrap()); 162 | return Some(item.uuid); 163 | } 164 | 165 | None 166 | } 167 | 168 | pub fn updated(&mut self, uuid: &Uuid) { 169 | for item in self.items.borrow_mut() 170 | .iter_mut() 171 | .filter(|(_, item)| item.uuid == *uuid) 172 | .map(|(_, item)| item) { 173 | item.last_updated = Utc::now(); 174 | } 175 | 176 | for row in self.items.borrow() 177 | .iter() 178 | .filter(|(row, item)| item.uuid == *uuid && row.get_index() > 0) 179 | .map(|(row, _)| row) { 180 | self.list_box.remove(row); 181 | self.list_box.insert(row, 0); 182 | } 183 | } 184 | 185 | pub fn filter_rows(&self, term: Option) { 186 | if let Some(term) = term { 187 | self.list_box.set_filter_func(Some(Box::new( 188 | clone!(@strong self.items as items => move |row| { 189 | let items = items.borrow(); 190 | let label_text = items[row].label.get_text().to_string().to_lowercase(); 191 | label_text.contains(&term) 192 | }) 193 | ))); 194 | } 195 | else { 196 | self.list_box.set_filter_func(None); 197 | } 198 | } 199 | 200 | fn have(&self, uuid: &Uuid) -> bool { 201 | self.items.borrow().iter().any(|(_, item)| item.uuid == *uuid) 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /shell/src/ui/mod.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | pub mod utils; 3 | pub mod application; 4 | pub mod controller; 5 | -------------------------------------------------------------------------------- /shell/src/ui/utils.rs: -------------------------------------------------------------------------------- 1 | macro_rules! action { 2 | ($actions_group:expr, $name:expr, $callback:expr) => { 3 | let simple_action = gio::SimpleAction::new($name, None); 4 | simple_action.connect_activate($callback); 5 | $actions_group.add_action(&simple_action); 6 | }; 7 | } 8 | 9 | macro_rules! get_widget { 10 | ($builder:expr, $widget_type:ty, $name:expr) => {{ 11 | $builder.get_object::<$widget_type>($name).unwrap() 12 | }}; 13 | } 14 | --------------------------------------------------------------------------------