diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 60b6e2fef..936a717d8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,7 +25,7 @@ jobs: - name: install wasm target run: rustup target add wasm32-unknown-unknown - name: install tauri-cli & tauri-build - run: cargo install tauri-cli --git https://github.com/tauri-apps/tauri --rev 23a049c593e5394b347b0abdf0f4f37f36a29873 + run: cargo install tauri-cli --version "^1.0.2" - name: install trunk run: cargo install --locked trunk - name: install dependencies (ubuntu only) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 06458d21c..e15b00142 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -44,7 +44,7 @@ jobs: libgtk-3-dev \ libayatana-appindicator3-dev \ librsvg2-dev - cargo install tauri-cli --git https://github.com/tauri-apps/tauri --rev 23a049c593e5394b347b0abdf0f4f37f36a29873 + cargo install tauri-cli --version "^1.0.2" cargo install --locked trunk - name: Build sidecar diff --git a/Cargo.lock b/Cargo.lock index 6a95873c5..c850568d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -448,9 +448,9 @@ checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" [[package]] name = "bytemuck" -version = "1.9.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc" +checksum = "c53dfa917ec274df8ed3c572698f381a24eef2efba9492d797301b72b6db408a" [[package]] name = "byteorder" @@ -801,9 +801,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +checksum = "5999502d32b9c48d492abe66392408144895020ec4709e549e840799f3bb74c0" dependencies = [ "generic-array", "typenum", @@ -1055,9 +1055,9 @@ checksum = "3a68a4904193147e0a8dec3314640e6db742afd5f6e634f428a6af230d9b3591" [[package]] name = "either" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" [[package]] name = "embed-resource" @@ -1157,14 +1157,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0408e2626025178a6a7f7ffc05a25bc47103229f19c113755de7bf63816290c" +checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" dependencies = [ "cfg-if", "libc", "redox_syscall", - "winapi", + "windows-sys", ] [[package]] @@ -1661,9 +1661,9 @@ dependencies = [ [[package]] name = "gloo-file" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa5d6084efa4a2b182ef3a8649cb6506cb4843f22cf907c6e0a799944248ae90" +checksum = "a8d5564e570a38b43d78bdc063374a0c3098c4f0d64005b12f9bbe87e869b6d7" dependencies = [ "futures-channel", "gloo-events", @@ -1690,9 +1690,9 @@ dependencies = [ [[package]] name = "gloo-net" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b3401b85ab9a73963832f5c0bc0e406f5e6e20a1e2d3ed09a7fdfe23ab254d8" +checksum = "351e6f94c76579cc9f9323a15f209086fc7bd428bff4288723d3a417851757b2" dependencies = [ "futures-channel", "futures-core", @@ -2463,6 +2463,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "line-wrap" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" +dependencies = [ + "safemem", +] + [[package]] name = "lock_api" version = "0.4.7" @@ -2900,9 +2909,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" +checksum = "ac8b1a9b2518dc799a2271eff1688707eb315f0d4697aa6b0871369ca4c4da55" [[package]] name = "oneshot" @@ -3267,18 +3276,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" dependencies = [ "proc-macro2", "quote", @@ -3303,6 +3312,20 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +[[package]] +name = "plist" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" +dependencies = [ + "base64", + "indexmap", + "line-wrap", + "serde", + "time 0.3.11", + "xml-rs", +] + [[package]] name = "png" version = "0.11.0" @@ -3424,9 +3447,9 @@ dependencies = [ [[package]] name = "psl" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "027244bd67547f5897fa12d991182bf3af92fcfd55860410fbb5ccbebd80b579" +checksum = "7e9c7d362659b525758d09e2a3ae965e371b347605e5fb2bc5bec5c2a1ecf41b" dependencies = [ "psl-types", ] @@ -3773,7 +3796,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.11", + "semver 1.0.12", ] [[package]] @@ -3801,6 +3824,12 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + [[package]] name = "same-file" version = "1.0.6" @@ -4067,9 +4096,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d92beeab217753479be2f74e54187a6aed4c125ff0703a866c3147a02f0c6dd" +checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" dependencies = [ "serde", ] @@ -4091,9 +4120,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47" dependencies = [ "serde_derive", ] @@ -4112,9 +4141,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" dependencies = [ "proc-macro2", "quote", @@ -4123,9 +4152,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" dependencies = [ "itoa 1.0.2", "ryu", @@ -4293,9 +4322,9 @@ checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "smallvec" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc88c725d61fc6c3132893370cac4a0200e3fedf5da8331c570664b1987f5ca2" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] name = "socket2" @@ -4811,9 +4840,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.11.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bfe4c782f0543f667ee3b732d026b2f1c64af39cd52e726dec1ea1f2d8f6b80" +checksum = "a71c32c2fa7bba46b01becf9cf470f6a781573af7e376c5e317a313ecce27545" dependencies = [ "bitflags", "cairo-rs", @@ -4822,6 +4851,7 @@ dependencies = [ "core-foundation", "core-graphics", "crossbeam-channel", + "dirs-next", "dispatch", "gdk", "gdk-pixbuf", @@ -4849,7 +4879,6 @@ dependencies = [ "raw-window-handle", "scopeguard", "serde", - "tao-core-video-sys", "unicode-segmentation", "uuid 0.8.2", "windows 0.37.0", @@ -4857,18 +4886,6 @@ dependencies = [ "x11-dl", ] -[[package]] -name = "tao-core-video-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271450eb289cb4d8d0720c6ce70c72c8c858c93dd61fc625881616752e6b98f6" -dependencies = [ - "cfg-if", - "core-foundation-sys", - "libc", - "objc", -] - [[package]] name = "tar" version = "0.4.38" @@ -4882,9 +4899,9 @@ dependencies = [ [[package]] name = "tauri" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1ebb60bb8f246d5351ff9b7728fdfa7a6eba72baa722ab6021d553981caba1" +checksum = "421641ec549d34935530886151a42ce5ecbbb57beb30e5eec1b22f8e08e10ee9" dependencies = [ "anyhow", "attohttpc", @@ -4913,7 +4930,7 @@ dependencies = [ "raw-window-handle", "regex", "rfd", - "semver 1.0.11", + "semver 1.0.12", "serde", "serde_json", "serde_repr", @@ -4939,14 +4956,14 @@ dependencies = [ [[package]] name = "tauri-build" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7b26eb3523e962b90012fedbfb744ca153d9be85e7981e00737e106d5323941" +checksum = "598bd36884ee15ac73dfca9921066fd87d13d9beea60384b99a66c3a5d800d70" dependencies = [ "anyhow", "cargo_toml", "heck 0.4.0", - "semver 1.0.11", + "semver 1.0.12", "serde_json", "tauri-utils", "winres", @@ -4954,32 +4971,34 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9468c5189188c820ef605dfe4937c768cb2918e9460c8093dc4ee2cbd717b262" +checksum = "048a7b404b92c86e7dc32458fd0963f042a76d520681e6f598d73a97c2feeeef" dependencies = [ "base64", "brotli", "ico", + "plist", "png 0.17.5", "proc-macro2", "quote", "regex", - "semver 1.0.11", + "semver 1.0.12", "serde", "serde_json", "sha2", "tauri-utils", "thiserror", + "time 0.3.11", "uuid 1.1.2", "walkdir", ] [[package]] name = "tauri-macros" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40e3ffddd7a274fc7baaa260888c971a0d95d2ef403aa16600c878b8b1c00ffe" +checksum = "aaf70098bfab21efde9b2c089008b319ba333f4ee6e55c38bdea188dea86497f" dependencies = [ "heck 0.4.0", "proc-macro2", @@ -4991,14 +5010,15 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7dc4db360bb40584187b6cb7834da736ce4ef2ab0914e2be98014444fa9920" +checksum = "82d34f58c61a6790ba3de5753daea61b5beb6926b2384d1ad03b9dfe622c72be" dependencies = [ "gtk", "http", "http-range", "infer", + "raw-window-handle", "serde", "serde_json", "tauri-utils", @@ -5010,14 +5030,15 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c876fb3a6e7c6fe2ac466b2a6ecd83658528844b4df0914558a9bc1501b31cf3" +checksum = "cd9a56e25146ff1f13f37bdb010ed0d692e7e81c824b9f977ae439f446f37ab4" dependencies = [ "cocoa", "gtk", "percent-encoding 2.1.0", "rand 0.8.5", + "raw-window-handle", "tauri-runtime", "tauri-utils", "uuid 1.1.2", @@ -5029,9 +5050,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727145cb55b8897fa9f2bcea4fad31dc39394703d037c9669b40f2d1c0c2d7f3" +checksum = "616f178da1e0466ca45963ed108a1567d4b8803662addaca313169d0dcd97715" dependencies = [ "brotli", "ctor", @@ -5044,13 +5065,14 @@ dependencies = [ "phf 0.10.1", "proc-macro2", "quote", - "semver 1.0.11", + "semver 1.0.12", "serde", "serde_json", "serde_with", "thiserror", "url 2.2.2", "walkdir", + "windows 0.37.0", ] [[package]] @@ -5341,9 +5363,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" +checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" dependencies = [ "proc-macro2", "quote", @@ -5373,13 +5395,13 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.11" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bc28f93baff38037f64e6f43d34cfa1605f27a49c34e8a04c5e78b0babf2596" +checksum = "3a713421342a5a666b7577783721d3117f1b69a393df803ee17bb73b1e122a59" dependencies = [ "ansi_term", - "lazy_static", "matchers", + "once_cell", "regex", "sharded-slab", "smallvec", @@ -5439,9 +5461,9 @@ checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" [[package]] name = "unicode-normalization" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dee68f85cab8cf68dec42158baf3a79a1cdc065a8b103025965d6ccb7f6cbd" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" dependencies = [ "tinyvec", ] @@ -6061,9 +6083,9 @@ dependencies = [ [[package]] name = "wry" -version = "0.18.3" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b1ba327c7dd4292f46bf8e6ba8e6ec2db4443b2973c9d304a359d95e0aa856" +checksum = "ce19dddbd3ce01dc8f14eb6d4c8f914123bf8379aaa838f6da4f981ff7104a3f" dependencies = [ "block", "cocoa", diff --git a/README.md b/README.md index fa876ef0c..8c141f78a 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@

Download now: - + macOS | - + Windows | - + Linux (AppImage)
@@ -44,10 +44,10 @@ Spyglass lives on your device crawling & indexing websites __you__ want with a basic set of rules. -Web pages when condensed down to text are surprisingly small with todays' incredibly -fast CPUs and tons of disk space. Its a no brainer that you should be able to create a -personal library of wikis, blog posts, etc. that can be referenced instanaeously. Cut -through the SEO spam of the internet by building your own index. +Web pages when condensed down to text are surprisingly small. With todays' incredibly +fast CPUs and ample amounts of of disk space, you can easily create a personal library of +wikis, blog posts, etc. that can be referenced instantaneously. Cut through the SEO spam of +the internet by building your own index. For users who have been frustrated with the current state of search and the internet, Spyglass offers a powerful solution to find _exactly_ what you want. diff --git a/VERSION.json b/VERSION.json index 53c94aa7c..74c1b9eaa 100644 --- a/VERSION.json +++ b/VERSION.json @@ -1,23 +1,23 @@ { - "version": "22.6.4", - "notes": "Thank you for using Spyglass! See full release notes here: https://github.com/a5huynh/spyglass/releases/tag/v2022.6.4", - "pub_date": "2022-06-25T23:13:46Z", + "version": "22.6.5", + "notes": "Thank you for using Spyglass! See full release notes here: https://github.com/a5huynh/spyglass/releases/tag/v2022.6.5", + "pub_date": "2022-06-29T19:33:14Z", "platforms": { "darwin-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnRRMGhmTXRLSUFCUG9WUTZmS3Bnb20wMjBCYjNRL2dncE5zZFNEa0ZXbzd5RU1JbDBhUVlWaDRkK2N2ODFZYnRLdVgwVDk3cVpsT1FzelFxWjdzWXdVPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjU2MTk2NjE0CWZpbGU6L1VzZXJzL3J1bm5lci93b3JrL3NweWdsYXNzL3NweWdsYXNzL3RhcmdldC9yZWxlYXNlL2J1bmRsZS9tYWNvcy9TcHlnbGFzcy5hcHAudGFyLmd6CitmQ1g0SW5tdlZ4UjI0VGxZUFpyNHdoUlZQNnA4d3Y0eFkwMWsrSEFOWlpTdEVpci9sbXpIeXA4M1VPV0EyRnVMSzlSZXdmTEl4YXJ6QmdaTlFNdUNnPT0K", - "url": "https://github.com/a5huynh/spyglass/releases/download/v2022.6.4/Spyglass.app.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYm9DWmR4dWx4Vy9tZGQ3VmxmekhRY0huYW0yeEUvYW9Qd3pUR01ZN0N3cEhpWDc5SElDUTI5eXRwVmVtVno4djZXNTlmeEhnRFdaM0d5K2pzR24wbGc0PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjU2NTMwOTM3CWZpbGU6L1VzZXJzL3J1bm5lci93b3JrL3NweWdsYXNzL3NweWdsYXNzL3RhcmdldC9yZWxlYXNlL2J1bmRsZS9tYWNvcy9TcHlnbGFzcy5hcHAudGFyLmd6CmtldkgzMnhRVjMxdGlUY1ZnSVBpQkppTUFGZ2lFOHVJWCt5L0czK0FwSGxnaU5VQVFjRnRWbmNTajlQTVRDUGhOdkl6NldqSVhTTUJCdWl0Q0RVd0FRPT0K", + "url": "https://github.com/a5huynh/spyglass/releases/download/v2022.6.5/Spyglass.app.tar.gz" }, "darwin-aarch64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnRRMGhmTXRLSUFCUG9WUTZmS3Bnb20wMjBCYjNRL2dncE5zZFNEa0ZXbzd5RU1JbDBhUVlWaDRkK2N2ODFZYnRLdVgwVDk3cVpsT1FzelFxWjdzWXdVPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjU2MTk2NjE0CWZpbGU6L1VzZXJzL3J1bm5lci93b3JrL3NweWdsYXNzL3NweWdsYXNzL3RhcmdldC9yZWxlYXNlL2J1bmRsZS9tYWNvcy9TcHlnbGFzcy5hcHAudGFyLmd6CitmQ1g0SW5tdlZ4UjI0VGxZUFpyNHdoUlZQNnA4d3Y0eFkwMWsrSEFOWlpTdEVpci9sbXpIeXA4M1VPV0EyRnVMSzlSZXdmTEl4YXJ6QmdaTlFNdUNnPT0K", - "url": "https://github.com/a5huynh/spyglass/releases/download/v2022.6.4/Spyglass.app.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYm9DWmR4dWx4Vy9tZGQ3VmxmekhRY0huYW0yeEUvYW9Qd3pUR01ZN0N3cEhpWDc5SElDUTI5eXRwVmVtVno4djZXNTlmeEhnRFdaM0d5K2pzR24wbGc0PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjU2NTMwOTM3CWZpbGU6L1VzZXJzL3J1bm5lci93b3JrL3NweWdsYXNzL3NweWdsYXNzL3RhcmdldC9yZWxlYXNlL2J1bmRsZS9tYWNvcy9TcHlnbGFzcy5hcHAudGFyLmd6CmtldkgzMnhRVjMxdGlUY1ZnSVBpQkppTUFGZ2lFOHVJWCt5L0czK0FwSGxnaU5VQVFjRnRWbmNTajlQTVRDUGhOdkl6NldqSVhTTUJCdWl0Q0RVd0FRPT0K", + "url": "https://github.com/a5huynh/spyglass/releases/download/v2022.6.5/Spyglass.app.tar.gz" }, "linux-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnFhU0lnaGNMU3dhTFJydjlmb2N6MnQ5Y1Z6d2QvMjhGVjBOeFdXdlVlcjhaOXA2Q3hqUk9QMG9SaDRDbFlndzFFRFRua3ErSGZabjErNFZkTXhUTkE0PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjU2MTk2MTMzCWZpbGU6L2hvbWUvcnVubmVyL3dvcmsvc3B5Z2xhc3Mvc3B5Z2xhc3MvdGFyZ2V0L3JlbGVhc2UvYnVuZGxlL2FwcGltYWdlL3NweWdsYXNzXzIyLjYuNF9hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKWmtzT3ljeE1KV3FWWWU0d2Y1K2t0Mkc0VjNaN0NBY3BOM0pZMGFBYkhsbisxeHZMWndSRlVhNUxJMlJmNXJvdDNSVVB6ZWFXM0hIS01OclI0TXJaQ3c9PQo=", - "url": "https://github.com/a5huynh/spyglass/releases/download/v2022.6.4/spyglass_22.6.4_amd64.AppImage.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYm1WcDl5ZmoyYXVHSmthZFNqSEhTMm9DUVBEcE9TNXgxeDNNTHprWUdLZWhxa1htOVFNM2NGQzVXOUVvNGQzcXg5UzE5TWRETVdSekcyRGh2dE9jOFFjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjU2NTI5OTIyCWZpbGU6L2hvbWUvcnVubmVyL3dvcmsvc3B5Z2xhc3Mvc3B5Z2xhc3MvdGFyZ2V0L3JlbGVhc2UvYnVuZGxlL2FwcGltYWdlL3NweWdsYXNzXzIyLjYuNV9hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKYWh3bmRVVng5TEpCSVZuOWM4aERDNnJIREVKYkhQSWtJcG1kOWFmckV6MmlKQXNLaUtaUHl4ajdMWkpvUEpneW9zZmp1SU5KSi9XUVc1NWE3TFdlRGc9PQo=", + "url": "https://github.com/a5huynh/spyglass/releases/download/v2022.6.5/spyglass_22.6.5_amd64.AppImage.tar.gz" }, "windows-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYmpvRkR2azdCQ3dhQlkxRERLOHM1aVFKaVJzdTJFdERWaCtSbmZGdWhnNlBCa0o1N1Y5YndVdVBUanNQaFlEdlVxNnhFNmIvcHBKVGtMNWNIUTU5bXdRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjU2MTk3NDA2CWZpbGU6RDpcYVxzcHlnbGFzc1xzcHlnbGFzc1x0YXJnZXRccmVsZWFzZVxidW5kbGUvbXNpL1NweWdsYXNzXzIyLjYuNF94NjRfZW4tVVMubXNpLnppcAp4RzhvQ3Q5YTQvN21XVW0wNTlSeUs4bUMwMnJ6SkhsYTRseHExb3JvZWdVL2dEbkxTalJkZUVkMVoxMElYRFRMVDliTlBjdzFFYnF4WnM5OWRjZjZBUT09Cg==", - "url": "https://github.com/a5huynh/spyglass/releases/download/v2022.6.4/Spyglass_22.6.4_x64_en-US.msi.zip" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnFjQ0VKQ0xuVUl1S3MxaE9PMGJMSE9yS3JQdG81eCtCYnVYN0pBNVNjL0haMjFTdkxERmx0azZPdURGK2F2emt1SHJiT0hSVlBlVHgzRGFlZXBXRkFJPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjU2NTMwODAzCWZpbGU6RDpcYVxzcHlnbGFzc1xzcHlnbGFzc1x0YXJnZXRccmVsZWFzZVxidW5kbGUvbXNpL1NweWdsYXNzXzIyLjYuNV94NjRfZW4tVVMubXNpLnppcAorVmZQay9Lek9YQ3B4OS9nUTBDRjR5TVErVTdqK00vdVIyRXNlSVZkSUJreVZVZFduRnEyenBuSmQyaUdmRFVuZXdGUHI2MGk0emdvWlE1b1drblNBdz09Cg==", + "url": "https://github.com/a5huynh/spyglass/releases/download/v2022.6.5/Spyglass_22.6.5_x64_en-US.msi.zip" } } } \ No newline at end of file diff --git a/crates/client/public/glue.js b/crates/client/public/glue.js index 59b3d90d9..9a782e7dc 100644 --- a/crates/client/public/glue.js +++ b/crates/client/public/glue.js @@ -49,6 +49,10 @@ export async function network_change(isOffline) { return await invoke('network_change', { isOffline }); } +export async function recrawl_domain(domain) { + return await invoke('recrawl_domain', { domain }); +} + export async function searchDocs(lenses, query) { return await invoke('search_docs', { lenses, query }); } diff --git a/crates/client/public/main.css b/crates/client/public/main.css index 5ae0652e5..a9d188950 100644 --- a/crates/client/public/main.css +++ b/crates/client/public/main.css @@ -606,6 +606,10 @@ Ensure the default browser behavior of the `hidden` attribute. flex: 1 1 0%; } +.flex-grow { + flex-grow: 1; +} + .grow { flex-grow: 1; } @@ -844,6 +848,10 @@ Ensure the default browser behavior of the `hidden` attribute. padding-right: 0px; } +.pl-1 { + padding-left: 0.25rem; +} + .pt-2 { padding-top: 0.5rem; } @@ -852,6 +860,10 @@ Ensure the default browser behavior of the `hidden` attribute. text-align: center; } +.text-right { + text-align: right; +} + .align-middle { vertical-align: middle; } diff --git a/crates/client/src/components/btn.rs b/crates/client/src/components/btn.rs index 714165845..32eb8c799 100644 --- a/crates/client/src/components/btn.rs +++ b/crates/client/src/components/btn.rs @@ -24,6 +24,7 @@ pub fn tooltip(props: &TooltipProps) -> Html { "text-center", "bg-neutral-900", "text-sm", + "text-right", ]; html! { @@ -38,19 +39,16 @@ pub struct DeleteButtonProps { pub doc_id: String, } -fn handle_delete(doc_id: String) { - spawn_local(async move { - let _ = crate::delete_doc(doc_id.clone()).await; - }); -} - #[function_component(DeleteButton)] pub fn delete_btn(props: &DeleteButtonProps) -> Html { let onclick = { let doc_id = props.doc_id.clone(); - move |_| { - handle_delete(doc_id.clone()); - } + Callback::from(move |_| { + let doc_id = doc_id.clone(); + spawn_local(async move { + let _ = crate::delete_doc(doc_id.clone()).await; + }); + }) }; html! { @@ -62,3 +60,39 @@ pub fn delete_btn(props: &DeleteButtonProps) -> Html { } } + +#[derive(Properties, PartialEq)] +pub struct RecrawlButtonProps { + pub domain: String, + pub onrecrawl: Option>, +} + +#[function_component(RecrawlButton)] +pub fn recrawl_button(props: &RecrawlButtonProps) -> Html { + let onclick = { + let domain = props.domain.clone(); + let callback = props.onrecrawl.clone(); + + Callback::from(move |me| { + let domain = domain.clone(); + let callback = callback.clone(); + + spawn_local(async move { + let _ = crate::recrawl_domain(domain.clone()).await; + }); + + if let Some(callback) = callback { + callback.emit(me); + } + }) + }; + + html! { + + } +} diff --git a/crates/client/src/main.rs b/crates/client/src/main.rs index f2216a442..5ae513295 100644 --- a/crates/client/src/main.rs +++ b/crates/client/src/main.rs @@ -60,6 +60,9 @@ extern "C" { #[wasm_bindgen] pub async fn network_change(is_offline: bool); + + #[wasm_bindgen(catch)] + pub async fn recrawl_domain(domain: String) -> Result<(), JsValue>; } #[derive(Clone, Routable, PartialEq)] diff --git a/crates/client/src/pages/stats.rs b/crates/client/src/pages/stats.rs index 9b2b13583..4052d4b69 100644 --- a/crates/client/src/pages/stats.rs +++ b/crates/client/src/pages/stats.rs @@ -2,7 +2,7 @@ use num_format::{Buffer, Locale}; use wasm_bindgen_futures::spawn_local; use yew::prelude::*; -use crate::components::icons; +use crate::components::{btn, icons}; use crate::crawl_stats; use shared::response::{CrawlStats, QueueStatus}; @@ -107,11 +107,11 @@ pub fn stats_page() -> Html { let onclick = { let request_finished = request_finished.clone(); let stats = stats.clone(); - move |_| { + Callback::from(move |_| { request_finished.set(false); stats.set(Vec::new()); fetch_crawl_stats(stats.clone(), request_finished.clone()); - } + }) }; let mut rendered = stats @@ -120,8 +120,9 @@ pub fn stats_page() -> Html { let total = stats.total() as f64; html! {
-
- {domain} +
+
{domain}
+
diff --git a/crates/shared/src/rpc.rs b/crates/shared/src/rpc.rs index e4d142e39..1860a7338 100644 --- a/crates/shared/src/rpc.rs +++ b/crates/shared/src/rpc.rs @@ -31,6 +31,9 @@ pub trait Rpc { #[rpc(name = "list_installed_lenses")] fn list_installed_lenses(&self) -> BoxFuture>>; + #[rpc(name = "recrawl_domain")] + fn recrawl_domain(&self, domain: String) -> BoxFuture>; + #[rpc(name = "search_docs")] fn search_docs(&self, query: SearchParam) -> BoxFuture>; diff --git a/crates/spyglass/src/api/mod.rs b/crates/spyglass/src/api/mod.rs index cac18a252..2a2ae2934 100644 --- a/crates/spyglass/src/api/mod.rs +++ b/crates/spyglass/src/api/mod.rs @@ -37,6 +37,10 @@ impl Rpc for SpyglassRPC { Box::pin(route::list_installed_lenses(self.state.clone())) } + fn recrawl_domain(&self, domain: String) -> BoxFuture> { + Box::pin(route::recrawl_domain(self.state.clone(), domain)) + } + fn search_docs(&self, query: SearchParam) -> BoxFuture> { Box::pin(route::search(self.state.clone(), query)) } diff --git a/crates/spyglass/src/api/route.rs b/crates/spyglass/src/api/route.rs index f1ef9b5e5..cf6ef18a0 100644 --- a/crates/spyglass/src/api/route.rs +++ b/crates/spyglass/src/api/route.rs @@ -1,19 +1,18 @@ use std::collections::HashMap; -use entities::sea_orm::prelude::*; -use entities::sea_orm::QueryOrder; -use entities::sea_orm::Set; +use entities::models::crawl_queue::CrawlStatus; use jsonrpc_core::{Error, ErrorCode, Result}; -use shared::response::LensResult; use tracing::instrument; use url::Url; use shared::request; use shared::response::{ - AppStatus, CrawlStats, QueueStatus, SearchLensesResp, SearchMeta, SearchResult, SearchResults, + AppStatus, CrawlStats, LensResult, QueueStatus, SearchLensesResp, SearchMeta, SearchResult, + SearchResults, }; use entities::models::{crawl_queue, indexed_document, lens}; +use entities::sea_orm::{prelude::*, sea_query, QueryOrder, Set}; use libspyglass::search::Searcher; use libspyglass::state::AppState; @@ -158,18 +157,27 @@ pub async fn list_queue(state: AppState) -> Result { } #[instrument(skip(state))] -pub async fn toggle_pause(state: AppState) -> jsonrpc_core::Result { - // Scope so that the app_state mutex is correctly released. - { - let app_state = &state.app_state; - let mut paused_status = app_state.get_mut("paused").unwrap(); +pub async fn recrawl_domain(state: AppState, domain: String) -> Result<()> { + log::info!("handling recrawl domain: {}", domain); + let db = &state.db; - let current_status = paused_status.to_string() == "true"; - let updated_status = !current_status; - *paused_status = updated_status.to_string(); + let res = crawl_queue::Entity::update_many() + .col_expr( + crawl_queue::Column::Status, + sea_query::Expr::value(sea_query::Value::String(Some(Box::new( + CrawlStatus::Queued.to_string(), + )))), + ) + .filter(crawl_queue::Column::Domain.eq(domain.clone())) + .exec(db) + .await; + + // Log out issues + if let Err(e) = res { + log::error!("Error recrawling domain {}: {}", domain, e); } - _get_current_status(state.clone()).await + Ok(()) } /// Search the user's indexed documents @@ -255,3 +263,18 @@ pub async fn search_lenses( Ok(SearchLensesResp { results }) } + +#[instrument(skip(state))] +pub async fn toggle_pause(state: AppState) -> jsonrpc_core::Result { + // Scope so that the app_state mutex is correctly released. + { + let app_state = &state.app_state; + let mut paused_status = app_state.get_mut("paused").unwrap(); + + let current_status = paused_status.to_string() == "true"; + let updated_status = !current_status; + *paused_status = updated_status.to_string(); + } + + _get_current_status(state.clone()).await +} diff --git a/crates/tauri/Cargo.toml b/crates/tauri/Cargo.toml index afc925c25..b6ba244bf 100644 --- a/crates/tauri/Cargo.toml +++ b/crates/tauri/Cargo.toml @@ -26,7 +26,7 @@ ron = "0.7" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" shared = { path = "../shared" } -tauri = { version = "1.0.0", features = ["api-all", "devtools", "notification", "system-tray", "updater"] } +tauri = { version = "1.0.2", features = ["api-all", "devtools", "notification", "system-tray", "updater"] } tokio = "1" tokio-retry = "0.3" tracing = "0.1" diff --git a/crates/tauri/src/cmd.rs b/crates/tauri/src/cmd.rs index 1d907e146..83ba7eae7 100644 --- a/crates/tauri/src/cmd.rs +++ b/crates/tauri/src/cmd.rs @@ -234,3 +234,26 @@ pub async fn network_change( Ok(()) } + +#[tauri::command] +pub async fn recrawl_domain( + _: tauri::Window, + rpc: State<'_, rpc::RpcMutex>, + domain: &str, +) -> Result<(), String> { + log::info!("recrawling {}", domain); + let mut rpc = rpc.lock().await; + + match rpc + .client + .call_method::<(String,), ()>("recrawl_domain", "", (domain.into(),)) + .await + { + Ok(_) => Ok(()), + Err(err) => { + log::error!("Error sending RPC: {}", err); + rpc.reconnect().await; + Ok(()) + } + } +} diff --git a/crates/tauri/src/constants.rs b/crates/tauri/src/constants.rs index d132111bc..bf07ab233 100644 --- a/crates/tauri/src/constants.rs +++ b/crates/tauri/src/constants.rs @@ -1,11 +1,13 @@ pub const INPUT_WIDTH: f64 = 640.0; pub const INPUT_Y: f64 = 128.0; +// Check for a new version every 6 hours. 60 seconds * 60 minutes * 6 hours +pub const VERSION_CHECK_INTERVAL_S: u64 = 60 * 60 * 6; + pub const APP_USER_AGENT: &str = "spyglass (github.com/a5huynh/spyglass)"; pub const DISCORD_JOIN_URL: &str = "https://discord.gg/663wPVBSTB"; pub const LENS_DIRECTORY_INDEX_URL: &str = "https://raw.githubusercontent.com/spyglass-search/lens-box/main/index.ron"; -pub const VERSION_CHECK_URL: &str = "https://api.github.com/repos/a5huynh/spyglass/releases"; pub const STATS_WIN_NAME: &str = "crawl_stats"; pub const LENS_MANAGER_WIN_NAME: &str = "lens_manager"; diff --git a/crates/tauri/src/main.rs b/crates/tauri/src/main.rs index d6d2bbbb5..0a0a5d837 100644 --- a/crates/tauri/src/main.rs +++ b/crates/tauri/src/main.rs @@ -6,15 +6,13 @@ use std::io; use std::path::PathBuf; use std::sync::Arc; -use std::time::Duration; use jsonrpc_core::Value; use num_format::{Locale, ToFormattedString}; use rpc::RpcMutex; -use serde::Deserialize; -use tauri::{AppHandle, GlobalShortcutManager, Manager, SystemTray, SystemTrayEvent}; +use tauri::{AppHandle, GlobalShortcutManager, Manager, SystemTray, SystemTrayEvent, Window}; use tokio::sync::Mutex; -use tokio::time; +use tokio::{time, time::Duration}; use tracing_log::LogTracer; use tracing_subscriber::{fmt, layer::SubscriberExt, EnvFilter}; @@ -51,7 +49,6 @@ fn main() -> Result<(), Box> { LogTracer::init()?; let ctx = tauri::generate_context!(); - let app_version = format!("v20{}", ctx.package_info().version); tauri::Builder::default() .invoke_handler(tauri::generate_handler![ @@ -64,12 +61,13 @@ fn main() -> Result<(), Box> { cmd::network_change, cmd::open_lens_folder, cmd::open_result, + cmd::recrawl_domain, cmd::resize_window, cmd::search_docs, cmd::search_lenses, ]) - .menu(menu::get_app_menu()) - .system_tray(SystemTray::new().with_menu(menu::get_tray_menu(&config))) + .menu(menu::get_app_menu(&ctx)) + .system_tray(SystemTray::new().with_menu(menu::get_tray_menu(&ctx, &config))) .setup(move |app| { // macOS: hide from dock (also hides menu bar) #[cfg(target_os = "macos")] @@ -91,21 +89,9 @@ fn main() -> Result<(), Box> { } } - // Check the release version against app version - match tauri::async_runtime::block_on(check_version()) { - Ok(release_ver) => { - if release_ver.tag_name > app_version { - // Update menu item - let tray = app.tray_handle(); - let version_item = tray.get_item(menu::VERSION_MENU_ITEM); - - let _ = version_item.set_enabled(true); - let _ = version_item.set_title("🎉 Update available!"); - app.manage(release_ver); - } - } - Err(e) => log::error!("Unable to check version: {}", e), - } + // Spawn a version checking background task. Check every couple hours + // for a new version. + tauri::async_runtime::spawn(check_version_interval(window.clone())); // Wait for the server to boot up let rpc = tauri::async_runtime::block_on(rpc::RpcClient::new()); @@ -176,11 +162,6 @@ fn main() -> Result<(), Box> { item_handle.set_title(new_label).unwrap(); } - menu::VERSION_MENU_ITEM => { - if let Some(version) = app.try_state::() { - let _ = open::that(&version.html_url); - } - } menu::OPEN_LENS_MANAGER => { show_lens_manager_window(app); } @@ -284,31 +265,12 @@ async fn update_tray_menu(app: &AppHandle) { } } -#[derive(Clone, Deserialize)] -pub struct ReleaseVersion { - html_url: String, - tag_name: String, -} - -async fn check_version() -> anyhow::Result { - let client = reqwest::Client::builder() - .user_agent(constants::APP_USER_AGENT) - .build()?; - - let res = client - .get(constants::VERSION_CHECK_URL) - .send() - .await? - .json::>() - .await?; - - if res.is_empty() { - return Err(anyhow::Error::msg("Empty version array")); +async fn check_version_interval(window: Window) { + let mut interval = + tokio::time::interval(Duration::from_secs(constants::VERSION_CHECK_INTERVAL_S)); + loop { + interval.tick().await; + log::info!("checking for update..."); + window.trigger_global("tauri://update", None); } - - let latest = res - .first() - .expect("Version array shouldn't be empty") - .to_owned(); - Ok(latest) } diff --git a/crates/tauri/src/menu.rs b/crates/tauri/src/menu.rs index 5d682386a..2ab181cfc 100644 --- a/crates/tauri/src/menu.rs +++ b/crates/tauri/src/menu.rs @@ -1,5 +1,8 @@ use shared::config::Config; -use tauri::{CustomMenuItem, Menu, MenuItem, Submenu, SystemTrayMenu, SystemTrayMenuItem}; +use tauri::{ + utils::assets::EmbeddedAssets, Context, CustomMenuItem, Menu, MenuItem, Submenu, + SystemTrayMenu, SystemTrayMenuItem, +}; pub const VERSION_MENU_ITEM: &str = "version"; pub const QUIT_MENU_ITEM: &str = "quit"; @@ -16,9 +19,7 @@ pub const JOIN_DISCORD: &str = "join_discord"; pub const DEV_SHOW_CONSOLE: &str = "dev_show_console"; -pub fn get_tray_menu(config: &Config) -> SystemTrayMenu { - let ctx = tauri::generate_context!(); - +pub fn get_tray_menu(ctx: &Context, config: &Config) -> SystemTrayMenu { let show = CustomMenuItem::new(SHOW_SEARCHBAR.to_string(), "Show search") .accelerator(config.user_settings.shortcut.clone()); @@ -65,13 +66,11 @@ pub fn get_tray_menu(config: &Config) -> SystemTrayMenu { .add_item(quit) } -pub fn get_app_menu() -> Menu { +pub fn get_app_menu(ctx: &Context) -> Menu { if cfg!(target_os = "linux") { return Menu::new(); } - let ctx = tauri::generate_context!(); - Menu::new().add_submenu(Submenu::new( &ctx.package_info().name, Menu::new() diff --git a/crates/tauri/tauri.conf.json b/crates/tauri/tauri.conf.json index f7f9c0aed..329facd7d 100644 --- a/crates/tauri/tauri.conf.json +++ b/crates/tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "package": { "productName": "Spyglass", - "version": "22.6.5" + "version": "22.7.1" }, "build": { "distDir": "../client/dist", @@ -48,6 +48,7 @@ "updater": { "active": true, "endpoints": [ + "https://spyglass-update-check.spyglass.workers.dev", "https://raw.githubusercontent.com/a5huynh/spyglass/main/VERSION.json" ], "dialog": true,